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

Function NewSubPlot

plot/plotcore/ploteditor.go:78–88  ·  view source on GitHub ↗

NewSubPlot returns a [PlotEditor] with its own separate [core.Toolbar], suitable for a tab or other element that is not the main plot.

(parent ...tree.Node)

Source from the content-addressed store, hash-verified

76// NewSubPlot returns a [PlotEditor] with its own separate [core.Toolbar],
77// suitable for a tab or other element that is not the main plot.
78func NewSubPlot(parent ...tree.Node) *PlotEditor {
79 fr := core.NewFrame(parent...)
80 tb := core.NewToolbar(fr)
81 pl := NewPlotEditor(fr)
82 fr.Styler(func(s *styles.Style) {
83 s.Direction = styles.Column
84 s.Grow.Set(1, 1)
85 })
86 tb.Maker(pl.MakeToolbar)
87 return pl
88}
89
90func (pl *PlotEditor) Init() {
91 pl.Frame.Init()

Callers

nothing calls this directly

Calls 6

NewFrameFunction · 0.92
NewToolbarFunction · 0.92
NewPlotEditorFunction · 0.85
StylerMethod · 0.80
MakerMethod · 0.80
SetMethod · 0.65

Tested by

no test coverage detected