Documentation
¶
Overview ¶
Package tensorcore provides GUI Views of table Table and Tensor structures using the Cogent Core views framework.
* Table provides a row-and-column tabular GUI interface, similar to a spreadsheet, for viewing and editing Table data. Any higher-dimensional tensor columns are shown as TensorGrid elements that can be clicked to open a TensorView editor with actual numeric values in a similar spreadsheet- like GUI.
* TensorView provides a spreadsheet-like GUI for viewing and editing tensor data.
* TensorGrid provides a 2D colored grid display of tensor data, collapsing any higher dimensions down to 2D. Different core.ColorMaps can be used to translate values into colors.
Package tensorcore provides GUI Cogent Core widgets for tensor types.
Package tensorcore provides GUI Cogent Core widgets for tensor types.
Index ¶
- Constants
- func AddGridStylerTo(obj any, f func(s *GridStyle))
- func RepeatsToBlank(str []string) []string
- func SetGridStylersTo(obj any, st GridStylers)
- type GridStyle
- func (gs *GridStyle) ApplyStylersFrom(obj any)
- func (gs *GridStyle) Defaults()
- func (t *GridStyle) SetColorMap(v core.ColorMapName) *GridStyle
- func (t *GridStyle) SetColumnRotation(v float32) *GridStyle
- func (t *GridStyle) SetDimExtra(v float32) *GridStyle
- func (t *GridStyle) SetFontSize(v float32) *GridStyle
- func (t *GridStyle) SetGridFill(v float32) *GridStyle
- func (t *GridStyle) SetMinMax(v minmax.F64) *GridStyle
- func (t *GridStyle) SetRange(v minmax.Range64) *GridStyle
- func (t *GridStyle) SetSize(v minmax.F32) *GridStyle
- func (t *GridStyle) SetTotalSize(v float32) *GridStyle
- type GridStylers
- type Layout
- type Table
- func (tb *Table) AsyncUpdateTable()
- func (tb *Table) CopySelectToMime() mimedata.Mimes
- func (tb *Table) DeleteAt(idx int)
- func (tb *Table) EditGlobalGridStyle()
- func (tb *Table) EditGridStyle(col int)
- func (tb *Table) FromMimeData(md mimedata.Mimes) [][]string
- func (tb *Table) GetColumnGridStyle(col int) *GridStyle
- func (tb *Table) HasStyler() bool
- func (tb *Table) Init()
- func (tb *Table) MakeHeader(p *tree.Plan)
- func (tb *Table) MakeRow(p *tree.Plan, i int)
- func (tb *Table) MakeToolbar(p *tree.Plan)
- func (tb *Table) MimeDataType() string
- func (tb *Table) NewAt(idx int)
- func (tb *Table) PasteAssign(md mimedata.Mimes, idx int)
- func (tb *Table) PasteAtIndex(md mimedata.Mimes, idx int)
- func (tb *Table) RowFirstVisWidget(row int) (*core.WidgetBase, bool)
- func (tb *Table) RowGrabFocus(row int) *core.WidgetBase
- func (tb *Table) RowWidgetNs() (nWidgPerRow, idxOff int)
- func (tb *Table) SelectedColumnStrings(colName string) []string
- func (tb *Table) SetSlice(sl any) *Table
- func (t *Table) SetSortDescending(v bool) *Table
- func (tb *Table) SetSortFieldName(nm string)
- func (t *Table) SetSortIndex(v int) *Table
- func (tb *Table) SetTable(dt *table.Table) *Table
- func (tb *Table) SizeFinal()
- func (tb *Table) SliceHeader() *core.Frame
- func (tb *Table) SliceIndex(i int) (si, vi int, invis bool)
- func (tb *Table) SortColumn(fldIndex int)
- func (tb *Table) SortFieldName() string
- func (tb *Table) StyleRow(w core.Widget, idx, fidx int)
- func (tb *Table) StyleValue(w core.Widget, s *styles.Style, row, col int)
- func (tb *Table) UpdateMaxWidths()
- func (tb *Table) UpdateSliceSize() int
- type TableButton
- type TensorButton
- type TensorEditor
- func (tb *TensorEditor) ColumnHeader(col int) string
- func (tb *TensorEditor) CopySelectToMime() mimedata.Mimes
- func (tb *TensorEditor) FromMimeData(md mimedata.Mimes) [][]string
- func (tb *TensorEditor) HasStyler() bool
- func (tb *TensorEditor) Init()
- func (tb *TensorEditor) MakeHeader(p *tree.Plan)
- func (tb *TensorEditor) MakeRow(p *tree.Plan, i int)
- func (tb *TensorEditor) MakeToolbar(p *tree.Plan)
- func (tb *TensorEditor) MimeDataType() string
- func (tb *TensorEditor) OpenCSV(filename core.Filename) error
- func (tb *TensorEditor) PasteAssign(md mimedata.Mimes, idx int)
- func (tb *TensorEditor) PasteAtIndex(md mimedata.Mimes, idx int)
- func (tb *TensorEditor) RowFirstVisWidget(row int) (*core.WidgetBase, bool)
- func (tb *TensorEditor) RowGrabFocus(row int) *core.WidgetBase
- func (tb *TensorEditor) RowWidgetNs() (nWidgPerRow, idxOff int)
- func (tb *TensorEditor) SaveCSV(filename core.Filename) error
- func (t *TensorEditor) SetBlankFloat(v float64) *TensorEditor
- func (t *TensorEditor) SetBlankString(v string) *TensorEditor
- func (t *TensorEditor) SetNCols(v int) *TensorEditor
- func (tb *TensorEditor) SetTensor(et tensor.Tensor) *TensorEditor
- func (tb *TensorEditor) SizeFinal()
- func (tb *TensorEditor) SliceHeader() *core.Frame
- func (tb *TensorEditor) SliceIndex(i int) (si, vi int, invis bool)
- func (tb *TensorEditor) StyleRow(w core.Widget, idx, fidx int)
- func (tb *TensorEditor) StyleValue(w core.Widget, s *styles.Style, row, col int)
- func (tb *TensorEditor) UpdateMaxWidths()
- func (tb *TensorEditor) UpdateSliceSize() int
- type TensorGrid
- func (tg *TensorGrid) Color(val float64) (norm float64, clr color.Color)
- func (tg *TensorGrid) EditStyle()
- func (tg *TensorGrid) EnsureColorMap()
- func (tg *TensorGrid) Init()
- func (tg *TensorGrid) MakeToolbar(p *tree.Plan)
- func (tg *TensorGrid) MinSize() math32.Vector2
- func (tg *TensorGrid) Render()
- func (t *TensorGrid) SetColorMap(v *colormap.Map) *TensorGrid
- func (t *TensorGrid) SetColumnLabels(v ...string) *TensorGrid
- func (t *TensorGrid) SetGridStyle(v GridStyle) *TensorGrid
- func (t *TensorGrid) SetRowLabels(v ...string) *TensorGrid
- func (tg *TensorGrid) SetTensor(tsr tensor.Tensor) *TensorGrid
- func (tg *TensorGrid) SetWidgetValue(value any) error
- func (tg *TensorGrid) SizeLabel(lbs []string, col bool) (minBlank, ngps int, sz math32.Vector2)
- func (tg *TensorGrid) TensorEditor()
- func (tg *TensorGrid) UpdateRange()
- func (tg *TensorGrid) WidgetValue() any
Constants ¶
const LabelSpace = 8
LabelSpace is space after label in dot pixels.
Variables ¶
This section is empty.
Functions ¶
func AddGridStylerTo ¶
AddGridStylerTo adds the given [GridStyler] function into given object's metadata.
func RepeatsToBlank ¶ added in v0.1.2
RepeatsToBlank returns string slice with any sequentially repeated strings set to blank (empty string), which drives grouping in the TensorGrid labels.
func SetGridStylersTo ¶
func SetGridStylersTo(obj any, st GridStylers)
SetGridStylersTo sets the GridStylers into given object's metadata.
Types ¶
type GridStyle ¶
type GridStyle struct {
Layout
// Range to plot
Range minmax.Range64 `display:"inline"`
// MinMax has the actual range of data, if not using fixed Range.
MinMax minmax.F64 `display:"inline"`
// ColorMap is the name of the color map to use in translating values to colors.
ColorMap core.ColorMapName
// GridFill sets proportion of grid square filled by the color block:
// 1 = all, .5 = half, etc.
GridFill float32 `min:"0.1" max:"1" step:"0.1" default:"0.9,1"`
// DimExtra is the amount of extra space to add at dimension boundaries,
// as a proportion of total grid size.
DimExtra float32 `min:"0" max:"1" step:"0.02" default:"0.1,0.3"`
// Size sets the minimum and maximum size for grid squares.
Size minmax.F32 `display:"inline"`
// TotalSize sets the total preferred display size along largest dimension.
// Grid squares will be sized to fit within this size,
// subject to the Size.Min / Max constraints, which have precedence.
TotalSize float32
// FontSize is the font size in standard Dp units for labels.
FontSize float32
// ColumnRotation is the rotation angle in degrees for column labels
ColumnRotation float32 `default:"90"`
}
GridStyle are options for displaying tensors
func NewGridStyle ¶
func NewGridStyle() *GridStyle
NewGridStyle returns a new GridStyle with defaults.
func (*GridStyle) ApplyStylersFrom ¶
func (*GridStyle) Defaults ¶
func (gs *GridStyle) Defaults()
Defaults sets defaults for values that are at nonsensical initial values
func (*GridStyle) SetColorMap ¶
func (t *GridStyle) SetColorMap(v core.ColorMapName) *GridStyle
SetColorMap sets the [GridStyle.ColorMap]: ColorMap is the name of the color map to use in translating values to colors.
func (*GridStyle) SetColumnRotation ¶ added in v0.1.2
SetColumnRotation sets the [GridStyle.ColumnRotation]: ColumnRotation is the rotation angle in degrees for column labels
func (*GridStyle) SetDimExtra ¶
SetDimExtra sets the [GridStyle.DimExtra]: DimExtra is the amount of extra space to add at dimension boundaries, as a proportion of total grid size.
func (*GridStyle) SetFontSize ¶
SetFontSize sets the [GridStyle.FontSize]: FontSize is the font size in standard Dp units for labels.
func (*GridStyle) SetGridFill ¶
SetGridFill sets the [GridStyle.GridFill]: GridFill sets proportion of grid square filled by the color block: 1 = all, .5 = half, etc.
func (*GridStyle) SetMinMax ¶
SetMinMax sets the [GridStyle.MinMax]: MinMax has the actual range of data, if not using fixed Range.
func (*GridStyle) SetSize ¶
SetSize sets the [GridStyle.Size]: Size sets the minimum and maximum size for grid squares.
func (*GridStyle) SetTotalSize ¶
SetTotalSize sets the [GridStyle.TotalSize]: TotalSize sets the total preferred display size along largest dimension. Grid squares will be sized to fit within this size, subject to the Size.Min / Max constraints, which have precedence.
type GridStylers ¶
type GridStylers []func(s *GridStyle)
GridStylers is a list of styling functions that set GridStyle properties. These are called in the order added.
func GetGridStylersFrom ¶
func GetGridStylersFrom(obj any) GridStylers
GetGridStylersFrom returns GridStylers from given object's metadata. Returns nil if none or no metadata.
func (*GridStylers) Add ¶
func (st *GridStylers) Add(f func(s *GridStyle))
Add Adds a styling function to the list.
func (*GridStylers) Run ¶
func (st *GridStylers) Run(s *GridStyle)
Run runs the list of styling functions on given GridStyle object.
type Layout ¶
type Layout struct {
// OddRow means that even-numbered dimensions are displayed as Y*X rectangles.
// This determines along which dimension to display any remaining
// odd dimension: OddRow = true = organize vertically along row
// dimension, false = organize horizontally across column dimension.
OddRow bool
// TopZero means that the Y=0 coordinate is displayed from the top-down;
// otherwise the Y=0 coordinate is displayed from the bottom up,
// which is typical for emergent network patterns.
TopZero bool
// Image will display the data as a bitmap image. If a 2D tensor, then it will
// be a greyscale image. If a 3D tensor with size of either the first
// or last dim = either 3 or 4, then it is a RGB(A) color image.
Image bool
}
Layout are layout options for displaying tensors.
func (*Layout) SetImage ¶
SetImage sets the [Layout.Image]: Image will display the data as a bitmap image. If a 2D tensor, then it will be a greyscale image. If a 3D tensor with size of either the first or last dim = either 3 or 4, then it is a RGB(A) color image.
func (*Layout) SetOddRow ¶
SetOddRow sets the [Layout.OddRow]: OddRow means that even-numbered dimensions are displayed as Y*X rectangles. This determines along which dimension to display any remaining odd dimension: OddRow = true = organize vertically along row dimension, false = organize horizontally across column dimension.
func (*Layout) SetTopZero ¶
SetTopZero sets the [Layout.TopZero]: TopZero means that the Y=0 coordinate is displayed from the top-down; otherwise the Y=0 coordinate is displayed from the bottom up, which is typical for emergent network patterns.
type Table ¶
type Table struct {
core.ListBase
// Table is the table that we're a view of.
Table *table.Table `set:"-"`
// GridStyle has global grid display styles. GridStylers on the Table
// are applied to this on top of defaults.
GridStyle GridStyle `set:"-"`
// ColumnGridStyle has per column grid display styles.
ColumnGridStyle map[int]*GridStyle `set:"-"`
// current sort index.
SortIndex int
// whether current sort order is descending.
SortDescending bool
// contains filtered or unexported fields
}
Table provides a GUI widget for representing table.Table values.
func NewTable ¶
NewTable returns a new Table with the given optional parent: Table provides a GUI widget for representing table.Table values.
func (*Table) AsyncUpdateTable ¶
func (tb *Table) AsyncUpdateTable()
AsyncUpdateTable updates the display for asynchronous updating from other goroutines. Also updates indexview (calling Sequential).
func (*Table) CopySelectToMime ¶
CopySelectToMime copies selected rows to mime data
func (*Table) EditGlobalGridStyle ¶
func (tb *Table) EditGlobalGridStyle()
EditGlobalGridStyle shows an editor dialog for global grid styles.
func (*Table) EditGridStyle ¶
EditGridStyle shows an editor dialog for grid style for given column index.
func (*Table) FromMimeData ¶
FromMimeData returns records from csv of mime data
func (*Table) GetColumnGridStyle ¶
GetColumnGridStyle gets grid style for given column.
func (*Table) MakeHeader ¶
func (*Table) MakeToolbar ¶
func (*Table) MimeDataType ¶
func (*Table) NewAt ¶
NewAt inserts a new blank element at given index in the slice -- -1 means the end
func (*Table) PasteAssign ¶
PasteAssign assigns mime data (only the first one!) to this idx
func (*Table) PasteAtIndex ¶
PasteAtIndex inserts object(s) from mime data at (before) given slice index adds to end of table
func (*Table) RowFirstVisWidget ¶
func (tb *Table) RowFirstVisWidget(row int) (*core.WidgetBase, bool)
RowFirstVisWidget returns the first visible widget for given row (could be index or not) -- false if out of range
func (*Table) RowGrabFocus ¶
func (tb *Table) RowGrabFocus(row int) *core.WidgetBase
RowGrabFocus grabs the focus for the first focusable widget in given row -- returns that element or nil if not successful -- note: grid must have already rendered for focus to be grabbed!
func (*Table) RowWidgetNs ¶
RowWidgetNs returns number of widgets per row and offset for index label
func (*Table) SelectedColumnStrings ¶
SelectedColumnStrings returns the string values of given column name.
func (*Table) SetSlice ¶
SetSlice sets the source table to a table.NewSliceTable from the given slice.
func (*Table) SetSortDescending ¶
SetSortDescending sets the [Table.SortDescending]: whether current sort order is descending.
func (*Table) SetSortFieldName ¶
SetSortField sets sorting to happen on given field and direction -- see SortFieldName for details
func (*Table) SetSortIndex ¶
SetSortIndex sets the [Table.SortIndex]: current sort index.
func (*Table) SetTable ¶
SetTable sets the source table that we are viewing, using a sequential view, and then configures the display
func (*Table) SliceHeader ¶
SliceHeader returns the Frame header for slice grid
func (*Table) SortColumn ¶
SortColumn sorts the slice for given column index. Toggles ascending vs. descending if already sorting on this dimension.
func (*Table) SortFieldName ¶
SortFieldName returns the name of the field being sorted, along with :up or :down depending on descending
func (*Table) StyleValue ¶
StyleValue performs additional value widget styling
func (*Table) UpdateMaxWidths ¶
func (tb *Table) UpdateMaxWidths()
func (*Table) UpdateSliceSize ¶
type TableButton ¶
TableButton presents a button that pulls up the Table viewer for a table.Table.
func NewTableButton ¶
func NewTableButton(parent ...tree.Node) *TableButton
NewTableButton returns a new TableButton with the given optional parent: TableButton presents a button that pulls up the Table viewer for a table.Table.
func (*TableButton) Init ¶
func (tb *TableButton) Init()
func (*TableButton) SetTable ¶
func (t *TableButton) SetTable(v *table.Table) *TableButton
SetTable sets the [TableButton.Table]
func (*TableButton) WidgetValue ¶
func (tb *TableButton) WidgetValue() any
type TensorButton ¶
TensorButton represents a Tensor with a button for making a TensorGrid viewer for an tensor.Tensor.
func NewTensorButton ¶
func NewTensorButton(parent ...tree.Node) *TensorButton
NewTensorButton returns a new TensorButton with the given optional parent: TensorButton represents a Tensor with a button for making a TensorGrid viewer for an tensor.Tensor.
func (*TensorButton) Init ¶
func (tb *TensorButton) Init()
func (*TensorButton) SetTensor ¶
func (t *TensorButton) SetTensor(v tensor.Tensor) *TensorButton
SetTensor sets the [TensorButton.Tensor]
func (*TensorButton) WidgetValue ¶
func (tb *TensorButton) WidgetValue() any
type TensorEditor ¶
type TensorEditor struct {
core.ListBase
// the tensor that we're a view of
Tensor tensor.Tensor `set:"-"`
// overall layout options for tensor display
Layout Layout `set:"-"`
// number of columns in table (as of last update)
NCols int `edit:"-"`
// blank values for out-of-range rows
BlankString string
BlankFloat float64
// contains filtered or unexported fields
}
TensorEditor provides a GUI widget for representing tensor.Tensor values.
func NewTensorEditor ¶
func NewTensorEditor(parent ...tree.Node) *TensorEditor
NewTensorEditor returns a new TensorEditor with the given optional parent: TensorEditor provides a GUI widget for representing tensor.Tensor values.
func (*TensorEditor) ColumnHeader ¶
func (tb *TensorEditor) ColumnHeader(col int) string
func (*TensorEditor) CopySelectToMime ¶
func (tb *TensorEditor) CopySelectToMime() mimedata.Mimes
CopySelectToMime copies selected rows to mime data
func (*TensorEditor) FromMimeData ¶
func (tb *TensorEditor) FromMimeData(md mimedata.Mimes) [][]string
FromMimeData returns records from csv of mime data
func (*TensorEditor) HasStyler ¶
func (tb *TensorEditor) HasStyler() bool
func (*TensorEditor) Init ¶
func (tb *TensorEditor) Init()
func (*TensorEditor) MakeHeader ¶
func (tb *TensorEditor) MakeHeader(p *tree.Plan)
func (*TensorEditor) MakeToolbar ¶
func (tb *TensorEditor) MakeToolbar(p *tree.Plan)
func (*TensorEditor) MimeDataType ¶
func (tb *TensorEditor) MimeDataType() string
func (*TensorEditor) OpenCSV ¶
func (tb *TensorEditor) OpenCSV(filename core.Filename) error
OpenTSV reads a tensor from a tab-separated-values (TSV) file. using the Go standard encoding/csv reader conforming to the official CSV standard. Reads all values and assigns as many as fit.
func (*TensorEditor) PasteAssign ¶
func (tb *TensorEditor) PasteAssign(md mimedata.Mimes, idx int)
PasteAssign assigns mime data (only the first one!) to this idx
func (*TensorEditor) PasteAtIndex ¶
func (tb *TensorEditor) PasteAtIndex(md mimedata.Mimes, idx int)
PasteAtIndex inserts object(s) from mime data at (before) given slice index adds to end of table
func (*TensorEditor) RowFirstVisWidget ¶
func (tb *TensorEditor) RowFirstVisWidget(row int) (*core.WidgetBase, bool)
RowFirstVisWidget returns the first visible widget for given row (could be index or not) -- false if out of range
func (*TensorEditor) RowGrabFocus ¶
func (tb *TensorEditor) RowGrabFocus(row int) *core.WidgetBase
RowGrabFocus grabs the focus for the first focusable widget in given row -- returns that element or nil if not successful -- note: grid must have already rendered for focus to be grabbed!
func (*TensorEditor) RowWidgetNs ¶
func (tb *TensorEditor) RowWidgetNs() (nWidgPerRow, idxOff int)
RowWidgetNs returns number of widgets per row and offset for index label
func (*TensorEditor) SaveCSV ¶
func (tb *TensorEditor) SaveCSV(filename core.Filename) error
SaveTSV writes a tensor to a tab-separated-values (TSV) file. Outer-most dims are rows in the file, and inner-most is column -- Reading just grabs all values and doesn't care about shape.
func (*TensorEditor) SetBlankFloat ¶
func (t *TensorEditor) SetBlankFloat(v float64) *TensorEditor
SetBlankFloat sets the [TensorEditor.BlankFloat]
func (*TensorEditor) SetBlankString ¶
func (t *TensorEditor) SetBlankString(v string) *TensorEditor
SetBlankString sets the [TensorEditor.BlankString]: blank values for out-of-range rows
func (*TensorEditor) SetNCols ¶
func (t *TensorEditor) SetNCols(v int) *TensorEditor
SetNCols sets the [TensorEditor.NCols]: number of columns in table (as of last update)
func (*TensorEditor) SetTensor ¶
func (tb *TensorEditor) SetTensor(et tensor.Tensor) *TensorEditor
SetTensor sets the source tensor that we are viewing, and then configures the display.
func (*TensorEditor) SizeFinal ¶
func (tb *TensorEditor) SizeFinal()
func (*TensorEditor) SliceHeader ¶
func (tb *TensorEditor) SliceHeader() *core.Frame
SliceHeader returns the Frame header for slice grid
func (*TensorEditor) SliceIndex ¶
func (tb *TensorEditor) SliceIndex(i int) (si, vi int, invis bool)
func (*TensorEditor) StyleValue ¶
StyleValue performs additional value widget styling
func (*TensorEditor) UpdateMaxWidths ¶
func (tb *TensorEditor) UpdateMaxWidths()
func (*TensorEditor) UpdateSliceSize ¶
func (tb *TensorEditor) UpdateSliceSize() int
type TensorGrid ¶
type TensorGrid struct {
core.WidgetBase
// Tensor is the tensor that we view.
Tensor tensor.Tensor `set:"-"`
// GridStyle has grid display style properties.
GridStyle GridStyle
// ColorMap is the colormap displayed (based on)
ColorMap *colormap.Map
// RowLabels are optional labels for each row of the 2D shape.
// Empty strings cause grouping with rendered lines.
RowLabels []string
// ColumnLabels are optional labels for each column of the 2D shape.
// Empty strings cause grouping with rendered lines.
ColumnLabels []string
// contains filtered or unexported fields
}
TensorGrid is a widget that displays tensor values as a grid of colored squares. Higher-dimensional data is projected into 2D using tensor.Projection2DShape and related functions.
func NewTensorGrid ¶
func NewTensorGrid(parent ...tree.Node) *TensorGrid
NewTensorGrid returns a new TensorGrid with the given optional parent: TensorGrid is a widget that displays tensor values as a grid of colored squares. Higher-dimensional data is projected into 2D using tensor.Projection2DShape and related functions.
func (*TensorGrid) EditStyle ¶
func (tg *TensorGrid) EditStyle()
func (*TensorGrid) EnsureColorMap ¶
func (tg *TensorGrid) EnsureColorMap()
EnsureColorMap makes sure there is a valid color map that matches specified name
func (*TensorGrid) Init ¶
func (tg *TensorGrid) Init()
func (*TensorGrid) MakeToolbar ¶ added in v0.1.2
func (tg *TensorGrid) MakeToolbar(p *tree.Plan)
func (*TensorGrid) MinSize ¶
func (tg *TensorGrid) MinSize() math32.Vector2
MinSize returns minimum size based on tensor and display settings
func (*TensorGrid) Render ¶
func (tg *TensorGrid) Render()
func (*TensorGrid) SetColorMap ¶
func (t *TensorGrid) SetColorMap(v *colormap.Map) *TensorGrid
SetColorMap sets the [TensorGrid.ColorMap]: ColorMap is the colormap displayed (based on)
func (*TensorGrid) SetColumnLabels ¶ added in v0.1.2
func (t *TensorGrid) SetColumnLabels(v ...string) *TensorGrid
SetColumnLabels sets the [TensorGrid.ColumnLabels]: ColumnLabels are optional labels for each column of the 2D shape. Empty strings cause grouping with rendered lines.
func (*TensorGrid) SetGridStyle ¶
func (t *TensorGrid) SetGridStyle(v GridStyle) *TensorGrid
SetGridStyle sets the [TensorGrid.GridStyle]: GridStyle has grid display style properties.
func (*TensorGrid) SetRowLabels ¶ added in v0.1.2
func (t *TensorGrid) SetRowLabels(v ...string) *TensorGrid
SetRowLabels sets the [TensorGrid.RowLabels]: RowLabels are optional labels for each row of the 2D shape. Empty strings cause grouping with rendered lines.
func (*TensorGrid) SetTensor ¶
func (tg *TensorGrid) SetTensor(tsr tensor.Tensor) *TensorGrid
SetTensor sets the tensor. Must call Update after this.
func (*TensorGrid) SetWidgetValue ¶
func (tg *TensorGrid) SetWidgetValue(value any) error
func (*TensorGrid) TensorEditor ¶
func (tg *TensorGrid) TensorEditor()
TensorEditor pulls up a TensorEditor of our tensor
func (*TensorGrid) UpdateRange ¶
func (tg *TensorGrid) UpdateRange()
func (*TensorGrid) WidgetValue ¶
func (tg *TensorGrid) WidgetValue() any