MCPcopy Create free account
hub / github.com/cogentcore/core / Init

Method Init

plot/plotcore/ploteditor.go:90–129  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

88}
89
90func (pl *PlotEditor) Init() {
91 pl.Frame.Init()
92
93 pl.Options.defaults()
94 pl.Styler(func(s *styles.Style) {
95 s.Grow.Set(1, 1)
96 if pl.SizeClass() == core.SizeCompact {
97 s.Direction = styles.Column
98 }
99 })
100
101 pl.OnShow(func(e events.Event) {
102 pl.UpdatePlot()
103 })
104
105 pl.Updater(func() {
106 pl.Options.fromMeta(pl.table.Table)
107 })
108 tree.AddChildAt(pl, "columns", func(w *core.Frame) {
109 pl.columnsFrame = w
110 w.Styler(func(s *styles.Style) {
111 s.Direction = styles.Column
112 s.Background = colors.Scheme.SurfaceContainerLow
113 if w.SizeClass() == core.SizeCompact {
114 s.Grow.Set(1, 0)
115 } else {
116 s.Grow.Set(0, 1)
117 s.Overflow.Y = styles.OverflowAuto
118 }
119 })
120 w.Maker(pl.makeColumns)
121 })
122 tree.AddChildAt(pl, "plot", func(w *Plot) {
123 pl.plotWidget = w
124 w.Plot = pl.plot
125 w.Styler(func(s *styles.Style) {
126 s.Grow.Set(1, 1)
127 })
128 })
129}
130
131// setIndexView sets the table to view and does Update
132// to update the Column list, which will also trigger a Layout

Callers

nothing calls this directly

Calls 11

UpdatePlotMethod · 0.95
AddChildAtFunction · 0.92
StylerMethod · 0.80
SizeClassMethod · 0.80
OnShowMethod · 0.80
UpdaterMethod · 0.80
fromMetaMethod · 0.80
MakerMethod · 0.80
InitMethod · 0.65
SetMethod · 0.65
defaultsMethod · 0.45

Tested by

no test coverage detected