Documentation
¶
Overview ¶
Package plotcore provides Cogent Core widgets for viewing and editing plots.
Index ¶
- type Editor
- func (pl *Editor) CopyFieldsFrom(frm tree.Node)
- func (pl *Editor) GoUpdatePlot()
- func (pl *Editor) Init()
- func (pl *Editor) MakeToolbar(p *tree.Plan)
- func (pl *Editor) OpenCSV(filename core.Filename, delim tensor.Delims)
- func (pl *Editor) OpenFS(fsys fs.FS, filename core.Filename, delim tensor.Delims)
- func (pl *Editor) SaveAll(fname core.Filename)
- func (pl *Editor) SaveCSV(fname core.Filename, delim tensor.Delims)
- func (pl *Editor) SavePNG(fname core.Filename)
- func (pl *Editor) SaveSVG(fname core.Filename)
- func (t *Editor) SetPlotStyle(v plot.PlotStyle) *Editor
- func (pl *Editor) SetSlice(sl any, stylers ...func(s *plot.Style)) *Editor
- func (pl *Editor) SetTable(tab *table.Table) *Editor
- func (pt *Editor) SizeFinal()
- func (pl *Editor) UpdatePlot()
- type Plot
- type PlotterChooser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Editor ¶
type Editor struct { core.Frame // PlotStyle has the overall plot style parameters. PlotStyle plot.PlotStyle // contains filtered or unexported fields }
Editor is a widget that provides an interactive 2D plot of selected columns of tabular data, represented by a table.Table into a table.Table. Other types of tabular data can be converted into this format. The user can change various options for the plot and also modify the underlying data.
func NewEditor ¶
NewEditor returns a new Editor with the given optional parent: Editor is a widget that provides an interactive 2D plot of selected columns of tabular data, represented by a table.Table into a table.Table. Other types of tabular data can be converted into this format. The user can change various options for the plot and also modify the underlying data.
func NewSubPlot ¶
NewSubPlot returns a Editor with its own separate core.Toolbar, suitable for a tab or other element that is not the main plot.
func (*Editor) CopyFieldsFrom ¶
func (*Editor) GoUpdatePlot ¶
func (pl *Editor) GoUpdatePlot()
GoUpdatePlot updates the display based on current Indexed view into table. This version can be called from goroutines. It does Sequential() on the table.Table, under the assumption that it is used for tracking a the latest updates of a running process.
func (*Editor) MakeToolbar ¶
func (*Editor) OpenCSV ¶
OpenCSV opens the Table data from a csv (comma-separated values) file (or any delim)
func (*Editor) OpenFS ¶
OpenFS opens the Table data from a csv (comma-separated values) file (or any delim) from the given filesystem.
func (*Editor) SaveAll ¶
SaveAll saves the current plot to a png, svg, and the data to a tsv -- full save Any extension is removed and appropriate extensions are added
func (*Editor) SaveCSV ¶
SaveCSV saves the Table data to a csv (comma-separated values) file with headers (any delim)
func (*Editor) SaveSVG ¶
SaveSVG saves the plot to an svg -- first updates to ensure that plot is current
func (*Editor) SetPlotStyle ¶
SetPlotStyle sets the [Editor.PlotStyle]: PlotStyle has the overall plot style parameters.
func (*Editor) SetSlice ¶
SetSlice sets the table to a table.NewSliceTable from the given slice. Optional styler functions are used for each struct field in sequence, and any can contain global plot style.
func (*Editor) SetTable ¶
SetTable sets the table to a new view of given table, and does UpdatePlot.
func (*Editor) UpdatePlot ¶
func (pl *Editor) UpdatePlot()
UpdatePlot updates the display based on current Indexed view into table. It does not automatically update the table.Table unless it is nil or out date.
type Plot ¶
type Plot struct { core.WidgetBase // Plot is the Plot to display in this widget Plot *plot.Plot `set:"-"` // SetRangesFunc, if set, is called to adjust the data ranges // after the point when these ranges are updated based on the plot data. SetRangesFunc func() }
Plot is a widget that renders a plot.Plot object. If it is not states.ReadOnly, the user can pan and zoom the graph. See Editor for an interactive interface for selecting columns to view.
func NewPlot ¶
NewPlot returns a new Plot with the given optional parent: Plot is a widget that renders a plot.Plot object. If it is not states.ReadOnly, the user can pan and zoom the graph. See Editor for an interactive interface for selecting columns to view.
func (*Plot) SetPlot ¶
SetPlot sets the plot to the given plot.Plot. You must still call core.WidgetBase.Update to trigger a redrawing of the plot.
func (*Plot) SetSetRangesFunc ¶
SetSetRangesFunc sets the [Plot.SetRangesFunc]: SetRangesFunc, if set, is called to adjust the data ranges after the point when these ranges are updated based on the plot data.
type PlotterChooser ¶
PlotterChooser represents a [Plottername] value with a core.Chooser for selecting a plotter.
func NewPlotterChooser ¶
func NewPlotterChooser(parent ...tree.Node) *PlotterChooser
NewPlotterChooser returns a new PlotterChooser with the given optional parent: PlotterChooser represents a [Plottername] value with a core.Chooser for selecting a plotter.
func (*PlotterChooser) Init ¶
func (fc *PlotterChooser) Init()