Documentation
¶
Overview ¶
Package etview provides GUI Views of etable Table and Tensor structures using the GoGi View framework: https://github.com/goki/gi
* TableView 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 giv.ColorMaps can be used to translate values into colors.
Index ¶
- Constants
- Variables
- type SimMatGrid
- func (t *SimMatGrid) KiType() *gti.Type
- func (tg *SimMatGrid) MinSize() mat32.Vec2
- func (t *SimMatGrid) New() ki.Ki
- func (tg *SimMatGrid) OnInit()
- func (tg *SimMatGrid) Render()
- func (tg *SimMatGrid) RenderSimMat()
- func (t *SimMatGrid) SetColMaxSz(v mat32.Vec2) *SimMatGrid
- func (t *SimMatGrid) SetColMinBlank(v int) *SimMatGrid
- func (t *SimMatGrid) SetColNgps(v int) *SimMatGrid
- func (t *SimMatGrid) SetColorMap(v *colormap.Map) *SimMatGrid
- func (t *SimMatGrid) SetDisp(v TensorDisp) *SimMatGrid
- func (t *SimMatGrid) SetRowMaxSz(v mat32.Vec2) *SimMatGrid
- func (t *SimMatGrid) SetRowMinBlank(v int) *SimMatGrid
- func (t *SimMatGrid) SetRowNgps(v int) *SimMatGrid
- func (tg *SimMatGrid) SetSimMat(smat *simat.SimMat) *SimMatGrid
- func (t *SimMatGrid) SetTooltip(v string) *SimMatGrid
- func (tg *SimMatGrid) SizeLabel(lbs []string, col bool) (minBlank, ngps int, sz mat32.Vec2)
- type SimMatValue
- type TableValue
- type TableView
- func (tv *TableView) ColTensorBlank(cidx int, col etensor.Tensor) *etensor.Float64
- func (tv *TableView) ColTensorDisp(col int) *TensorDisp
- func (tv *TableView) ConfigFrame()
- func (tv *TableView) ConfigHeader()
- func (tv *TableView) ConfigRows()
- func (tv *TableView) ConfigTableView()
- func (tv *TableView) ConfigToolbar(tb *gi.Toolbar)
- func (tv *TableView) ConfigWidget()
- func (tv *TableView) EditIdx(idx int)
- func (tv *TableView) GoUpdateView()
- func (t *TableView) KiType() *gti.Type
- func (t *TableView) New() ki.Ki
- func (tv *TableView) OnInit()
- func (tv *TableView) RowFirstVisWidget(row int) (*gi.WidgetBase, bool)
- func (tv *TableView) RowGrabFocus(row int) *gi.WidgetBase
- func (tv *TableView) RowWidgetNs() (nWidgPerRow, idxOff int)
- func (tv *TableView) SelectRowWidgets(row int, sel bool)
- func (t *TableView) SetBlankFloat(v float64) *TableView
- func (t *TableView) SetBlankString(v string) *TableView
- func (tv *TableView) SetColTensorDisp(col int) *TensorDisp
- func (t *TableView) SetColTsrBlank(v map[int]*etensor.Float64) *TableView
- func (t *TableView) SetColTsrDisp(v map[int]*TensorDisp) *TableView
- func (t *TableView) SetConfigIter(v int) *TableView
- func (t *TableView) SetDraggedIdxs(v []int) *TableView
- func (t *TableView) SetElVal(v reflect.Value) *TableView
- func (t *TableView) SetHeaderWidths(v []int) *TableView
- func (t *TableView) SetInitSelIdx(v int) *TableView
- func (t *TableView) SetMinRows(v int) *TableView
- func (t *TableView) SetNcols(v int) *TableView
- func (t *TableView) SetSelIdx(v int) *TableView
- func (t *TableView) SetSelIdxs(v map[int]struct{}) *TableView
- func (t *TableView) SetSelVal(v any) *TableView
- func (t *TableView) SetSliceNpval(v reflect.Value) *TableView
- func (t *TableView) SetSliceSize(v int) *TableView
- func (t *TableView) SetSliceValView(v giv.Value) *TableView
- func (t *TableView) SetSortDesc(v bool) *TableView
- func (tv *TableView) SetSortFieldName(nm string)
- func (t *TableView) SetSortIdx(v int) *TableView
- func (t *TableView) SetStackTop(v int) *TableView
- func (t *TableView) SetStartIdx(v int) *TableView
- func (t *TableView) SetStripes(v gi.Stripes) *TableView
- func (tv *TableView) SetStyles()
- func (tv *TableView) SetTable(et *etable.Table) *TableView
- func (tv *TableView) SetTableView(ix *etable.IdxView) *TableView
- func (t *TableView) SetTmpIdx(v int) *TableView
- func (t *TableView) SetTmpSave(v giv.Value) *TableView
- func (t *TableView) SetTooltip(v string) *TableView
- func (t *TableView) SetTsrDisp(v TensorDisp) *TableView
- func (t *TableView) SetValues(v []giv.Value) *TableView
- func (t *TableView) SetViewMu(v *sync.Mutex) *TableView
- func (t *TableView) SetViewPath(v string) *TableView
- func (t *TableView) SetVisRows(v int) *TableView
- func (tv *TableView) SizeFinal()
- func (tv *TableView) SliceDeleteAt(idx int)
- func (tv *TableView) SliceGrid() *giv.SliceViewGrid
- func (tv *TableView) SliceHeader() *gi.Frame
- func (tv *TableView) SliceNewAt(idx int)
- func (tv *TableView) SortFieldName() string
- func (tv *TableView) SortSliceAction(fldIdx int)
- func (tv *TableView) StyleRow(w gi.Widget, idx, fidx int)
- func (tv *TableView) TensorDispAction(fldIdx int)
- func (tv *TableView) UpdateWidgets()
- func (tv *TableView) UpdtSliceSize() int
- type TensorDisp
- type TensorGrid
- func (tg *TensorGrid) Color(val float64) (norm float64, clr color.Color)
- func (tg *TensorGrid) EnsureColorMap()
- func (tg *TensorGrid) HandleEvents()
- func (t *TensorGrid) KiType() *gti.Type
- func (tg *TensorGrid) MinSize() mat32.Vec2
- func (t *TensorGrid) New() ki.Ki
- func (tg *TensorGrid) OnInit()
- func (tg *TensorGrid) OpenTensorView()
- func (tg *TensorGrid) Render()
- func (tg *TensorGrid) RenderTensor()
- func (t *TensorGrid) SetColorMap(v *colormap.Map) *TensorGrid
- func (t *TensorGrid) SetDisp(v TensorDisp) *TensorGrid
- func (tg *TensorGrid) SetStyles()
- func (tg *TensorGrid) SetTensor(tsr etensor.Tensor) *TensorGrid
- func (t *TensorGrid) SetTooltip(v string) *TensorGrid
- func (tg *TensorGrid) UpdateRange()
- type TensorGridValue
- type TensorLayout
- type TensorValue
- type TensorView
Constants ¶
const LabelSpace = float32(8)
Variables ¶
var SimMatGridType = gti.AddType(>i.Type{ Name: "github.com/emer/etable/v2/etview.SimMatGrid", ShortName: "etview.SimMatGrid", IDName: "sim-mat-grid", Doc: "SimMatGrid is a widget that displays a similarity / distance matrix\nwith tensor values as a grid of colored squares, and labels for rows, cols", Directives: gti.Directives{ >i.Directive{Tool: "gti", Directive: "add", Args: []string{}}, }, Fields: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"SimMat", >i.Field{Name: "SimMat", Type: "*github.com/emer/etable/v2/simat.SimMat", LocalType: "*simat.SimMat", Doc: "the similarity / distance matrix", Directives: gti.Directives{}, Tag: "set:\"-\""}}, {"rowMaxSz", >i.Field{Name: "rowMaxSz", Type: "goki.dev/mat32.Vec2", LocalType: "mat32.Vec2", Doc: "", Directives: gti.Directives{}, Tag: ""}}, {"rowMinBlank", >i.Field{Name: "rowMinBlank", Type: "int", LocalType: "int", Doc: "", Directives: gti.Directives{}, Tag: ""}}, {"rowNGps", >i.Field{Name: "rowNGps", Type: "int", LocalType: "int", Doc: "", Directives: gti.Directives{}, Tag: ""}}, {"colMaxSz", >i.Field{Name: "colMaxSz", Type: "goki.dev/mat32.Vec2", LocalType: "mat32.Vec2", Doc: "", Directives: gti.Directives{}, Tag: ""}}, {"colMinBlank", >i.Field{Name: "colMinBlank", Type: "int", LocalType: "int", Doc: "", Directives: gti.Directives{}, Tag: ""}}, {"colNGps", >i.Field{Name: "colNGps", Type: "int", LocalType: "int", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Embeds: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"TensorGrid", >i.Field{Name: "TensorGrid", Type: "github.com/emer/etable/v2/etview.TensorGrid", LocalType: "TensorGrid", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Methods: ordmap.Make([]ordmap.KeyVal[string, *gti.Method]{}), Instance: &SimMatGrid{}, })
SimMatGridType is the gti.Type for SimMatGrid
var TableViewType = gti.AddType(>i.Type{ Name: "github.com/emer/etable/v2/etview.TableView", ShortName: "etview.TableView", IDName: "table-view", Doc: "etview.TableView provides a GUI interface for etable.Table's", Directives: gti.Directives{}, Fields: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Table", >i.Field{Name: "Table", Type: "*github.com/emer/etable/v2/etable.IdxView", LocalType: "*etable.IdxView", Doc: "the idx view of the table that we're a view of", Directives: gti.Directives{}, Tag: "set:\"-\""}}, {"TsrDisp", >i.Field{Name: "TsrDisp", Type: "github.com/emer/etable/v2/etview.TensorDisp", LocalType: "TensorDisp", Doc: "overall display options for tensor display", Directives: gti.Directives{}, Tag: ""}}, {"ColTsrDisp", >i.Field{Name: "ColTsrDisp", Type: "map[int]*github.com/emer/etable/v2/etview.TensorDisp", LocalType: "map[int]*TensorDisp", Doc: "per column tensor display params", Directives: gti.Directives{}, Tag: ""}}, {"ColTsrBlank", >i.Field{Name: "ColTsrBlank", Type: "map[int]*github.com/emer/etable/v2/etensor.Float64", LocalType: "map[int]*etensor.Float64", Doc: "per column blank tensor values", Directives: gti.Directives{}, Tag: ""}}, {"NCols", >i.Field{Name: "NCols", Type: "int", LocalType: "int", Doc: "number of columns in table (as of last update)", Directives: gti.Directives{}, Tag: "edit:\"-\""}}, {"SortIdx", >i.Field{Name: "SortIdx", Type: "int", LocalType: "int", Doc: "current sort index", Directives: gti.Directives{}, Tag: ""}}, {"SortDesc", >i.Field{Name: "SortDesc", Type: "bool", LocalType: "bool", Doc: "whether current sort order is descending", Directives: gti.Directives{}, Tag: ""}}, {"HeaderWidths", >i.Field{Name: "HeaderWidths", Type: "[]int", LocalType: "[]int", Doc: "HeaderWidths has number of characters in each header, per visfields", Directives: gti.Directives{}, Tag: "copy:\"-\" view:\"-\" json:\"-\" xml:\"-\""}}, {"BlankString", >i.Field{Name: "BlankString", Type: "string", LocalType: "string", Doc: "\tblank values for out-of-range rows", Directives: gti.Directives{}, Tag: ""}}, {"BlankFloat", >i.Field{Name: "BlankFloat", Type: "float64", LocalType: "float64", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Embeds: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"SliceViewBase", >i.Field{Name: "SliceViewBase", Type: "goki.dev/giv.SliceViewBase", LocalType: "giv.SliceViewBase", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Methods: ordmap.Make([]ordmap.KeyVal[string, *gti.Method]{}), Instance: &TableView{}, })
TableViewType is the gti.Type for TableView
var TensorGridType = gti.AddType(>i.Type{ Name: "github.com/emer/etable/v2/etview.TensorGrid", ShortName: "etview.TensorGrid", IDName: "tensor-grid", Doc: "TensorGrid is a widget that displays tensor values as a grid of colored squares.", Directives: gti.Directives{}, Fields: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"Tensor", >i.Field{Name: "Tensor", Type: "github.com/emer/etable/v2/etensor.Tensor", LocalType: "etensor.Tensor", Doc: "the tensor that we view", Directives: gti.Directives{}, Tag: "set:\"-\""}}, {"Disp", >i.Field{Name: "Disp", Type: "github.com/emer/etable/v2/etview.TensorDisp", LocalType: "TensorDisp", Doc: "display options", Directives: gti.Directives{}, Tag: ""}}, {"ColorMap", >i.Field{Name: "ColorMap", Type: "*goki.dev/colors/colormap.Map", LocalType: "*colormap.Map", Doc: "the actual colormap", Directives: gti.Directives{}, Tag: ""}}, }), Embeds: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"WidgetBase", >i.Field{Name: "WidgetBase", Type: "goki.dev/gi.WidgetBase", LocalType: "gi.WidgetBase", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Methods: ordmap.Make([]ordmap.KeyVal[string, *gti.Method]{}), Instance: &TensorGrid{}, })
TensorGridType is the gti.Type for TensorGrid
var TensorViewType = gti.AddType(>i.Type{ Name: "github.com/emer/etable/v2/etview.TensorView", ShortName: "etview.TensorView", IDName: "tensor-view", Doc: "etview.TensorView provides a GUI interface for etable.Tensor's\nusing a tabular rows-and-columns interface using textfields for editing.\nThis provides an editable complement to the TensorGrid graphical display.", Directives: gti.Directives{}, Fields: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{}), Embeds: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{ {"WidgetBase", >i.Field{Name: "WidgetBase", Type: "goki.dev/gi.WidgetBase", LocalType: "gi.WidgetBase", Doc: "", Directives: gti.Directives{}, Tag: ""}}, }), Methods: ordmap.Make([]ordmap.KeyVal[string, *gti.Method]{}), Instance: &TensorView{}, })
TensorViewType is the gti.Type for TensorView
Functions ¶
This section is empty.
Types ¶
type SimMatGrid ¶
type SimMatGrid struct {
TensorGrid
// the similarity / distance matrix
SimMat *simat.SimMat `set:"-"`
// contains filtered or unexported fields
}
SimMatGrid is a widget that displays a similarity / distance matrix with tensor values as a grid of colored squares, and labels for rows, cols
func NewSimMatGrid ¶
func NewSimMatGrid(par ki.Ki, name ...string) *SimMatGrid
NewSimMatGrid adds a new SimMatGrid with the given name to the given parent. If the name is unspecified, it defaults to the ID (kebab-case) name of the type, plus the ki.Ki.NumLifetimeChildren of the given parent.
func (*SimMatGrid) KiType ¶
func (t *SimMatGrid) KiType() *gti.Type
KiType returns the *gti.Type of SimMatGrid
func (*SimMatGrid) MinSize ¶
func (tg *SimMatGrid) MinSize() mat32.Vec2
func (*SimMatGrid) OnInit ¶
func (tg *SimMatGrid) OnInit()
Defaults sets defaults for values that are at nonsensical initial values
func (*SimMatGrid) Render ¶
func (tg *SimMatGrid) Render()
func (*SimMatGrid) RenderSimMat ¶
func (tg *SimMatGrid) RenderSimMat()
func (*SimMatGrid) SetColMaxSz ¶
func (t *SimMatGrid) SetColMaxSz(v mat32.Vec2) *SimMatGrid
SetColMaxSz sets the [SimMatGrid.colMaxSz]
func (*SimMatGrid) SetColMinBlank ¶
func (t *SimMatGrid) SetColMinBlank(v int) *SimMatGrid
SetColMinBlank sets the [SimMatGrid.colMinBlank]
func (*SimMatGrid) SetColNgps ¶
func (t *SimMatGrid) SetColNgps(v int) *SimMatGrid
SetColNgps sets the [SimMatGrid.colNGps]
func (*SimMatGrid) SetColorMap ¶
func (t *SimMatGrid) SetColorMap(v *colormap.Map) *SimMatGrid
SetColorMap sets the [SimMatGrid.ColorMap]
func (*SimMatGrid) SetDisp ¶
func (t *SimMatGrid) SetDisp(v TensorDisp) *SimMatGrid
SetDisp sets the [SimMatGrid.Disp]
func (*SimMatGrid) SetRowMaxSz ¶
func (t *SimMatGrid) SetRowMaxSz(v mat32.Vec2) *SimMatGrid
SetRowMaxSz sets the [SimMatGrid.rowMaxSz]
func (*SimMatGrid) SetRowMinBlank ¶
func (t *SimMatGrid) SetRowMinBlank(v int) *SimMatGrid
SetRowMinBlank sets the [SimMatGrid.rowMinBlank]
func (*SimMatGrid) SetRowNgps ¶
func (t *SimMatGrid) SetRowNgps(v int) *SimMatGrid
SetRowNgps sets the [SimMatGrid.rowNGps]
func (*SimMatGrid) SetSimMat ¶
func (tg *SimMatGrid) SetSimMat(smat *simat.SimMat) *SimMatGrid
SetSimMat sets the similarity matrix and triggers a display update
func (*SimMatGrid) SetTooltip ¶
func (t *SimMatGrid) SetTooltip(v string) *SimMatGrid
SetTooltip sets the [SimMatGrid.Tooltip]
type SimMatValue ¶
SimMatValue presents a button that pulls up the SimMatGridView viewer for an etable.Table
func (*SimMatValue) ConfigDialog ¶
func (vv *SimMatValue) ConfigDialog(d *gi.Body) (bool, func())
func (*SimMatValue) ConfigWidget ¶
func (vv *SimMatValue) ConfigWidget(w gi.Widget)
func (*SimMatValue) HasDialog ¶
func (vv *SimMatValue) HasDialog() bool
func (*SimMatValue) OpenDialog ¶
func (vv *SimMatValue) OpenDialog(ctx gi.Widget, fun func())
func (*SimMatValue) UpdateWidget ¶
func (vv *SimMatValue) UpdateWidget()
func (*SimMatValue) WidgetType ¶
func (vv *SimMatValue) WidgetType() *gti.Type
type TableValue ¶
TableValue presents a button that pulls up the TableView viewer for an etable.Table
func (*TableValue) ConfigDialog ¶
func (vv *TableValue) ConfigDialog(d *gi.Body) (bool, func())
func (*TableValue) ConfigWidget ¶
func (vv *TableValue) ConfigWidget(w gi.Widget)
func (*TableValue) HasDialog ¶
func (vv *TableValue) HasDialog() bool
func (*TableValue) OpenDialog ¶
func (vv *TableValue) OpenDialog(ctx gi.Widget, fun func())
func (*TableValue) UpdateWidget ¶
func (vv *TableValue) UpdateWidget()
func (*TableValue) WidgetType ¶
func (vv *TableValue) WidgetType() *gti.Type
type TableView ¶
type TableView struct {
giv.SliceViewBase
// the idx view of the table that we're a view of
Table *etable.IdxView `set:"-"`
// overall display options for tensor display
TsrDisp TensorDisp
// per column tensor display params
ColTsrDisp map[int]*TensorDisp
// per column blank tensor values
ColTsrBlank map[int]*etensor.Float64
// number of columns in table (as of last update)
NCols int `edit:"-"`
// current sort index
SortIdx int
// whether current sort order is descending
SortDesc bool
// HeaderWidths has number of characters in each header, per visfields
HeaderWidths []int `copy:"-" view:"-" json:"-" xml:"-"`
// blank values for out-of-range rows
BlankString string
BlankFloat float64
}
etview.TableView provides a GUI interface for etable.Table's
func NewTableView ¶
NewTableView adds a new TableView with the given name to the given parent. If the name is unspecified, it defaults to the ID (kebab-case) name of the type, plus the ki.Ki.NumLifetimeChildren of the given parent.
func (*TableView) ColTensorBlank ¶
ColTensorBlank returns tensor blanks for given tensor col
func (*TableView) ColTensorDisp ¶
func (tv *TableView) ColTensorDisp(col int) *TensorDisp
ColTensorDisp returns tensor display parameters for this column either the overall defaults or the per-column if set
func (*TableView) ConfigFrame ¶
func (tv *TableView) ConfigFrame()
func (*TableView) ConfigHeader ¶
func (tv *TableView) ConfigHeader()
func (*TableView) ConfigRows ¶
func (tv *TableView) ConfigRows()
ConfigRows configures VisRows worth of widgets to display slice data. It should only be called when NeedsConfigRows is true: when VisRows changes.
func (*TableView) ConfigTableView ¶
func (tv *TableView) ConfigTableView()
func (*TableView) ConfigToolbar ¶
func (*TableView) GoUpdateView ¶
func (tv *TableView) GoUpdateView()
GoUpdateView updates the display for asynchronous updating from other goroutines. Also updates indexview (calling Sequential).
func (*TableView) RowFirstVisWidget ¶
func (tv *TableView) RowFirstVisWidget(row int) (*gi.WidgetBase, bool)
RowFirstVisWidget returns the first visible widget for given row (could be index or not) -- false if out of range
func (*TableView) RowGrabFocus ¶
func (tv *TableView) RowGrabFocus(row int) *gi.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 (*TableView) RowWidgetNs ¶
RowWidgetNs returns number of widgets per row and offset for index label
func (*TableView) SelectRowWidgets ¶
SelectRowWidgets sets the selection state of given row of widgets
func (*TableView) SetBlankFloat ¶
SetBlankFloat sets the [TableView.BlankFloat]
func (*TableView) SetBlankString ¶
SetBlankString sets the [TableView.BlankString]:
blank values for out-of-range rows
func (*TableView) SetColTensorDisp ¶
func (tv *TableView) SetColTensorDisp(col int) *TensorDisp
SetColTensorDisp sets per-column tensor display params and returns them if already set, just returns them
func (*TableView) SetColTsrBlank ¶
SetColTsrBlank sets the [TableView.ColTsrBlank]: per column blank tensor values
func (*TableView) SetColTsrDisp ¶
func (t *TableView) SetColTsrDisp(v map[int]*TensorDisp) *TableView
SetColTsrDisp sets the [TableView.ColTsrDisp]: per column tensor display params
func (*TableView) SetConfigIter ¶
SetConfigIter sets the [TableView.ConfigIter]
func (*TableView) SetDraggedIdxs ¶
SetDraggedIdxs sets the [TableView.DraggedIdxs]
func (*TableView) SetHeaderWidths ¶
SetHeaderWidths sets the [TableView.HeaderWidths]: HeaderWidths has number of characters in each header, per visfields
func (*TableView) SetInitSelIdx ¶
SetInitSelIdx sets the [TableView.InitSelIdx]
func (*TableView) SetMinRows ¶
SetMinRows sets the [TableView.MinRows]
func (*TableView) SetNcols ¶
SetNcols sets the [TableView.NCols]: number of columns in table (as of last update)
func (*TableView) SetSelIdxs ¶
SetSelIdxs sets the [TableView.SelIdxs]
func (*TableView) SetSliceNpval ¶
SetSliceNpval sets the [TableView.SliceNPVal]
func (*TableView) SetSliceSize ¶
SetSliceSize sets the [TableView.SliceSize]
func (*TableView) SetSliceValView ¶
SetSliceValView sets the [TableView.SliceValView]
func (*TableView) SetSortDesc ¶
SetSortDesc sets the [TableView.SortDesc]: whether current sort order is descending
func (*TableView) SetSortFieldName ¶
SetSortField sets sorting to happen on given field and direction -- see SortFieldName for details
func (*TableView) SetSortIdx ¶
SetSortIdx sets the [TableView.SortIdx]: current sort index
func (*TableView) SetStackTop ¶
SetStackTop sets the [TableView.StackTop]
func (*TableView) SetStartIdx ¶
SetStartIdx sets the [TableView.StartIdx]
func (*TableView) SetStripes ¶
SetStripes sets the [TableView.Stripes]
func (*TableView) SetTable ¶
SetTable sets the source table that we are viewing, using a sequential IdxView and then configures the display
func (*TableView) SetTableView ¶
SetTableView sets the source IdxView of a table (using a copy so original is not modified) and then configures the display
func (*TableView) SetTmpSave ¶
SetTmpSave sets the [TableView.TmpSave]
func (*TableView) SetTooltip ¶
SetTooltip sets the [TableView.Tooltip]
func (*TableView) SetTsrDisp ¶
func (t *TableView) SetTsrDisp(v TensorDisp) *TableView
SetTsrDisp sets the [TableView.TsrDisp]: overall display options for tensor display
func (*TableView) SetViewPath ¶
SetViewPath sets the [TableView.ViewPath]
func (*TableView) SetVisRows ¶
SetVisRows sets the [TableView.VisRows]
func (*TableView) SliceDeleteAt ¶
SliceDeleteAt deletes element at given index from slice -- doUpdt means call UpdateSliceGrid to update display
func (*TableView) SliceGrid ¶
func (tv *TableView) SliceGrid() *giv.SliceViewGrid
SliceGrid returns the SliceGrid grid frame widget, which contains all the fields and values, within SliceFrame
func (*TableView) SliceHeader ¶
SliceHeader returns the Frame header for slice grid
func (*TableView) SliceNewAt ¶
SliceNewAt inserts a new blank element at given index in the slice -- -1 means the end
func (*TableView) SortFieldName ¶
SortFieldName returns the name of the field being sorted, along with :up or :down depending on descending
func (*TableView) SortSliceAction ¶
SortSliceAction sorts the slice for given field index -- toggles ascending vs. descending if already sorting on this dimension
func (*TableView) TensorDispAction ¶
TensorDispAction allows user to select tensor display options for column pass -1 for global params for the entire table
func (*TableView) UpdateWidgets ¶
func (tv *TableView) UpdateWidgets()
UpdateWidgets updates the row widget display to represent the current state of the slice data, including which range of data is being displayed. This is called for scrolling, navigation etc.
func (*TableView) UpdtSliceSize ¶
type TensorDisp ¶
type TensorDisp struct {
TensorLayout
// range to plot
Range minmax.Range64 `view:"inline"`
// if not using fixed range, this is the actual range of data
MinMax minmax.F64 `view:"inline"`
// the name of the color map to use in translating values to colors
ColorMap giv.ColorMapName
// what proportion of grid square should be filled by color block -- 1 = all, .5 = half, etc
GridFill float32 `min:"0.1" max:"1" step:"0.1" def:"0.9,1"`
// 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" def:"0.1,0.3"`
// minimum size for grid squares -- they will never be smaller than this
GridMinSize float32
// maximum size for grid squares -- they will never be larger than this
GridMaxSize float32
// total preferred display size along largest dimension.
// grid squares will be sized to fit within this size,
// subject to harder GridMin / Max size constraints
TotPrefSize float32
// font size in standard point units for labels (e.g., SimMat)
FontSize float32
// our gridview, for update method
GridView *TensorGrid `copy:"-" json:"-" xml:"-" view:"-"`
}
TensorDisp are options for displaying tensors
func (*TensorDisp) Defaults ¶
func (td *TensorDisp) Defaults()
Defaults sets defaults for values that are at nonsensical initial values
func (*TensorDisp) FmMeta ¶
func (td *TensorDisp) FmMeta(tsr etensor.Tensor)
FmMeta sets display options from Tensor meta-data
type TensorGrid ¶
type TensorGrid struct {
gi.WidgetBase
// the tensor that we view
Tensor etensor.Tensor `set:"-"`
// display options
Disp TensorDisp
// the actual colormap
ColorMap *colormap.Map
}
TensorGrid is a widget that displays tensor values as a grid of colored squares.
func NewTensorGrid ¶
func NewTensorGrid(par ki.Ki, name ...string) *TensorGrid
NewTensorGrid adds a new TensorGrid with the given name to the given parent. If the name is unspecified, it defaults to the ID (kebab-case) name of the type, plus the ki.Ki.NumLifetimeChildren of the given parent.
func (*TensorGrid) EnsureColorMap ¶
func (tg *TensorGrid) EnsureColorMap()
EnsureColorMap makes sure there is a valid color map that matches specified name
func (*TensorGrid) HandleEvents ¶
func (tg *TensorGrid) HandleEvents()
func (*TensorGrid) KiType ¶
func (t *TensorGrid) KiType() *gti.Type
KiType returns the *gti.Type of TensorGrid
func (*TensorGrid) MinSize ¶
func (tg *TensorGrid) MinSize() mat32.Vec2
MinSize returns minimum size based on tensor and display settings
func (*TensorGrid) OnInit ¶
func (tg *TensorGrid) OnInit()
func (*TensorGrid) OpenTensorView ¶
func (tg *TensorGrid) OpenTensorView()
OpenTensorView pulls up a TensorView of our tensor
func (*TensorGrid) Render ¶
func (tg *TensorGrid) Render()
func (*TensorGrid) RenderTensor ¶
func (tg *TensorGrid) RenderTensor()
func (*TensorGrid) SetColorMap ¶
func (t *TensorGrid) SetColorMap(v *colormap.Map) *TensorGrid
SetColorMap sets the [TensorGrid.ColorMap]: the actual colormap
func (*TensorGrid) SetDisp ¶
func (t *TensorGrid) SetDisp(v TensorDisp) *TensorGrid
SetDisp sets the [TensorGrid.Disp]: display options
func (*TensorGrid) SetStyles ¶
func (tg *TensorGrid) SetStyles()
func (*TensorGrid) SetTensor ¶
func (tg *TensorGrid) SetTensor(tsr etensor.Tensor) *TensorGrid
SetTensor sets the tensor and triggers a display update
func (*TensorGrid) SetTooltip ¶
func (t *TensorGrid) SetTooltip(v string) *TensorGrid
SetTooltip sets the [TensorGrid.Tooltip]
func (*TensorGrid) UpdateRange ¶
func (tg *TensorGrid) UpdateRange()
type TensorGridValue ¶
TensorGridValue manages a TensorGrid view of an etensor.Tensor
func (*TensorGridValue) ConfigWidget ¶
func (vv *TensorGridValue) ConfigWidget(w gi.Widget)
func (*TensorGridValue) HasDialog ¶
func (vv *TensorGridValue) HasDialog() bool
func (*TensorGridValue) UpdateWidget ¶
func (vv *TensorGridValue) UpdateWidget()
func (*TensorGridValue) WidgetType ¶
func (vv *TensorGridValue) WidgetType() *gti.Type
type TensorLayout ¶
type TensorLayout struct {
// 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
// if true, then 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
// 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
}
TensorLayout are layout options for displaying tensors
type TensorValue ¶
TensorValue presents a button that pulls up the TensorView viewer for an etensor.Tensor
func (*TensorValue) ConfigDialog ¶
func (vv *TensorValue) ConfigDialog(d *gi.Body) (bool, func())
func (*TensorValue) ConfigWidget ¶
func (vv *TensorValue) ConfigWidget(w gi.Widget)
func (*TensorValue) HasDialog ¶
func (vv *TensorValue) HasDialog() bool
func (*TensorValue) OpenDialog ¶
func (vv *TensorValue) OpenDialog(ctx gi.Widget, fun func())
func (*TensorValue) UpdateWidget ¶
func (vv *TensorValue) UpdateWidget()
func (*TensorValue) WidgetType ¶
func (vv *TensorValue) WidgetType() *gti.Type
type TensorView ¶
type TensorView struct {
gi.WidgetBase
}
etview.TensorView provides a GUI interface for etable.Tensor's using a tabular rows-and-columns interface using textfields for editing. This provides an editable complement to the TensorGrid graphical display.
func NewTensorView ¶
func NewTensorView(par ki.Ki, name ...string) *TensorView
NewTensorView adds a new TensorView with the given name to the given parent. If the name is unspecified, it defaults to the ID (kebab-case) name of the type, plus the ki.Ki.NumLifetimeChildren of the given parent.
func (*TensorView) KiType ¶
func (t *TensorView) KiType() *gti.Type
KiType returns the *gti.Type of TensorView
func (*TensorView) SetTooltip ¶
func (t *TensorView) SetTooltip(v string) *TensorView
SetTooltip sets the [TensorView.Tooltip]