etview

package
v1.1.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2023 License: BSD-3-Clause Imports: 27 Imported by: 177

README

etview

Docs: GoDoc

etview provides GUI Views of etable.Table and etensor.Tensor structures using the GoGi View framework, as GoGi Widgets.

Add this to import to get these views to be registered with the GoGi ValueView system:

	_ "github.com/emer/etable/etview" // include to get gui views
  • 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.

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

View Source
const LabelSpace = float32(8)

Variables

View Source
var KiT_SimMatGrid = kit.Types.AddType(&SimMatGrid{}, nil)
View Source
var KiT_SimMatValueView = kit.Types.AddType(&SimMatValueView{}, nil)
View Source
var KiT_TableValueView = kit.Types.AddType(&TableValueView{}, nil)
View Source
var KiT_TableView = kit.Types.AddType(&TableView{}, TableViewProps)
View Source
var KiT_TensorDisp = kit.Types.AddType(&TensorDisp{}, TensorDispProps)
View Source
var KiT_TensorGrid = kit.Types.AddType(&TensorGrid{}, nil)
View Source
var KiT_TensorGridValueView = kit.Types.AddType(&TensorGridValueView{}, nil)
View Source
var KiT_TensorValueView = kit.Types.AddType(&TensorValueView{}, nil)
View Source
var KiT_TensorView = kit.Types.AddType(&TensorView{}, TensorViewProps)
View Source
var TableViewProps = ki.Props{
	"EnumType:Flag":    gi.KiT_NodeFlags,
	"background-color": &gi.Prefs.Colors.Background,
	"color":            &gi.Prefs.Colors.Font,
	"max-width":        -1,
	"max-height":       -1,
}
View Source
var TensorDispProps = ki.Props{
	"ToolBar": ki.PropSlice{
		{"Update", ki.Props{
			"label": "Update Grid",
			"icon":  "update",
		}},
	},
}
View Source
var TensorViewProps = ki.Props{
	"background-color": &gi.Prefs.Colors.Background,
	"color":            &gi.Prefs.Colors.Font,
	"max-width":        -1,
	"max-height":       -1,
}

Functions

func SimMatGridDialog added in v1.0.0

func SimMatGridDialog(avp *gi.Viewport2D, smat *simat.SimMat, opts giv.DlgOpts, recv ki.Ki, dlgFunc ki.RecvFunc) *gi.Dialog

SimMatGridDialog is for viewing a etensor.Tensor using a SimMatGrid -- optionally connects to given signal receiving object and function for dialog signals (nil to ignore) gopy:interface=handle

func TableViewDialog

func TableViewDialog(avp *gi.Viewport2D, et *etable.Table, opts giv.DlgOpts, recv ki.Ki, dlgFunc ki.RecvFunc) *gi.Dialog

TableViewDialog is for editing an etable.Table using a TableView -- optionally connects to given signal receiving object and function for dialog signals (nil to ignore) gopy:interface=handle

func TensorGridDialog added in v1.0.0

func TensorGridDialog(avp *gi.Viewport2D, tsr etensor.Tensor, opts giv.DlgOpts, recv ki.Ki, dlgFunc ki.RecvFunc) *gi.Dialog

TensorGridDialog is for viewing a etensor.Tensor using a TensorGrid -- optionally connects to given signal receiving object and function for dialog signals (nil to ignore) gopy:interface=handle

func TensorViewDialog

func TensorViewDialog(avp *gi.Viewport2D, tsr etensor.Tensor, opts giv.DlgOpts, recv ki.Ki, dlgFunc ki.RecvFunc) *gi.Dialog

TensorViewDialog is for editing an etensor.Tensor using a TensorView -- optionally connects to given signal receiving object and function for dialog signals (nil to ignore) gopy:interface=handle

Types

type SimMatGrid added in v1.0.0

type SimMatGrid struct {
	TensorGrid

	// the similarity / distance matrix
	SimMat *simat.SimMat `desc:"the similarity / distance matrix"`
	// 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 AddNewSimMatGrid added in v1.0.0

func AddNewSimMatGrid(parent ki.Ki, name string, smat *simat.SimMat) *SimMatGrid

AddNewSimMatGrid adds a new tensor grid to given parent node, with given name.

func (*SimMatGrid) ConnectEvents2D added in v1.0.0

func (tg *SimMatGrid) ConnectEvents2D()

func (*SimMatGrid) Defaults added in v1.0.0

func (tg *SimMatGrid) Defaults()

Defaults sets defaults for values that are at nonsensical initial values

func (*SimMatGrid) MouseEvent added in v1.0.0

func (tg *SimMatGrid) MouseEvent()

MouseEvent handles button MouseEvent

func (*SimMatGrid) Render2D added in v1.0.0

func (tg *SimMatGrid) Render2D()

func (*SimMatGrid) RenderSimMat added in v1.0.0

func (tg *SimMatGrid) RenderSimMat()

func (*SimMatGrid) SetSimMat added in v1.0.0

func (tg *SimMatGrid) SetSimMat(smat *simat.SimMat)

SetSimMat sets the similarity matrix and triggers a display update

func (*SimMatGrid) Size2D added in v1.0.0

func (tg *SimMatGrid) Size2D(iter int)

func (*SimMatGrid) Size2DLabel added in v1.0.0

func (tg *SimMatGrid) Size2DLabel(lbs []string, col bool) (minBlank, ngps int, sz mat32.Vec2)

func (*SimMatGrid) Style2D added in v1.0.0

func (tg *SimMatGrid) Style2D()

type SimMatValueView added in v1.0.0

type SimMatValueView struct {
	giv.ValueViewBase
}

SimMatValueView presents a button that pulls up the SimMatGridView viewer for an etable.Table

func (*SimMatValueView) Activate added in v1.0.0

func (vv *SimMatValueView) Activate(vp *gi.Viewport2D, recv ki.Ki, dlgFunc ki.RecvFunc)

func (*SimMatValueView) ConfigWidget added in v1.0.0

func (vv *SimMatValueView) ConfigWidget(widg gi.Node2D)

func (*SimMatValueView) HasAction added in v1.0.0

func (vv *SimMatValueView) HasAction() bool

func (*SimMatValueView) UpdateWidget added in v1.0.0

func (vv *SimMatValueView) UpdateWidget()

func (*SimMatValueView) WidgetType added in v1.0.0

func (vv *SimMatValueView) WidgetType() reflect.Type

type TableValueView

type TableValueView struct {
	giv.ValueViewBase
}

TableValueView presents a button that pulls up the TableView viewer for an etable.Table

func (*TableValueView) Activate

func (vv *TableValueView) Activate(vp *gi.Viewport2D, recv ki.Ki, dlgFunc ki.RecvFunc)

func (*TableValueView) ConfigWidget

func (vv *TableValueView) ConfigWidget(widg gi.Node2D)

func (*TableValueView) HasAction

func (vv *TableValueView) HasAction() bool

func (*TableValueView) UpdateWidget

func (vv *TableValueView) UpdateWidget()

func (*TableValueView) WidgetType

func (vv *TableValueView) WidgetType() reflect.Type

type TableView

type TableView struct {
	giv.SliceViewBase

	// the idx view of the table that we're a view of
	Table *etable.IdxView `desc:"the idx view of the table that we're a view of"`

	// overall display options for tensor display
	TsrDisp TensorDisp `desc:"overall display options for tensor display"`

	// per column tensor display
	ColTsrDisp map[int]*TensorDisp `desc:"per column tensor display"`

	// number of columns in table (as of last update)
	NCols int `inactive:"+" desc:"number of columns in table (as of last update)"`

	// current sort index
	SortIdx int `desc:"current sort index"`

	// whether current sort order is descending
	SortDesc bool `desc:"whether current sort order is descending"`
}

etview.TableView provides a GUI interface for etable.Table's

func AddNewTableView

func AddNewTableView(parent ki.Ki, name string) *TableView

AddNewTableView adds a new tableview to given parent node, with given name.

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) Config

func (tv *TableView) Config()

Config configures the view

func (*TableView) ConfigSliceGrid

func (tv *TableView) ConfigSliceGrid()

ConfigSliceGrid configures the SliceGrid for the current slice this is only called by global Config and updates are guarded by that

func (*TableView) ConfigToolbar

func (tv *TableView) ConfigToolbar()

ConfigToolbar configures the toolbar actions

func (*TableView) CopySelToMime

func (tv *TableView) CopySelToMime() mimedata.Mimes

CopySelToMime copies selected rows to mime data

func (*TableView) FromMimeData added in v1.0.0

func (tv *TableView) FromMimeData(md mimedata.Mimes) [][]string

FromMimeData returns records from csv of mime data

func (*TableView) GridLayout

func (tv *TableView) GridLayout() *gi.Layout

GridLayout returns the SliceGrid grid-layout widget, with grid and scrollbar

func (*TableView) IsConfiged

func (tv *TableView) IsConfiged() bool

IsConfiged returns true if the widget is fully configured

func (*TableView) ItemCtxtMenu

func (tv *TableView) ItemCtxtMenu(idx int)

func (*TableView) Layout2D

func (tv *TableView) Layout2D(parBBox image.Rectangle, iter int) bool

func (*TableView) LayoutHeader

func (tv *TableView) LayoutHeader()

LayoutHeader updates the header layout based on field widths

func (*TableView) LayoutSliceGrid

func (tv *TableView) LayoutSliceGrid() bool

LayoutSliceGrid does the proper layout of slice grid depending on allocated size returns true if UpdateSliceGrid should be called after this

func (*TableView) MimeDataType added in v1.0.0

func (tv *TableView) MimeDataType() string

func (*TableView) NeedsDoubleReRender added in v1.1.23

func (tv *TableView) NeedsDoubleReRender() bool

func (*TableView) PasteAssign

func (tv *TableView) PasteAssign(md mimedata.Mimes, idx int)

PasteAssign assigns mime data (only the first one!) to this idx

func (*TableView) PasteAtIdx

func (tv *TableView) PasteAtIdx(md mimedata.Mimes, idx int)

PasteAtIdx inserts object(s) from mime data at (before) given slice index adds to end of table

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

func (tv *TableView) RowWidgetNs() (nWidgPerRow, idxOff int)

RowWidgetNs returns number of widgets per row and offset for index label

func (*TableView) ScrollBar

func (tv *TableView) ScrollBar() *gi.ScrollBar

ScrollBar returns the SliceGrid scrollbar

func (*TableView) SelectRowWidgets

func (tv *TableView) SelectRowWidgets(row int, sel bool)

SelectRowWidgets sets the selection state of given row of widgets

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) SetSortFieldName

func (tv *TableView) SetSortFieldName(nm string)

SetSortField sets sorting to happen on given field and direction -- see SortFieldName for details

func (*TableView) SetTable

func (tv *TableView) SetTable(et *etable.Table, tmpSave giv.ValueView)

SetTable sets the source table that we are viewing, using a sequential IdxView and then configures the display

func (*TableView) SetTableView added in v1.0.0

func (tv *TableView) SetTableView(ix *etable.IdxView, tmpSave giv.ValueView)

SetTableView sets the source IdxView of a table (using a copy so original is not modified) and then configures the display

func (*TableView) SliceDeleteAt

func (tv *TableView) SliceDeleteAt(idx int, doUpdt bool)

SliceDeleteAt deletes element at given index from slice -- doUpdt means call UpdateSliceGrid to update display

func (*TableView) SliceFrame

func (tv *TableView) SliceFrame() *gi.Frame

SliceFrame returns the outer frame widget, which contains all the header, fields and values

func (*TableView) SliceGrid

func (tv *TableView) SliceGrid() *gi.Frame

SliceGrid returns the SliceGrid grid frame widget, which contains all the fields and values, within SliceFrame

func (*TableView) SliceHeader

func (tv *TableView) SliceHeader() *gi.ToolBar

SliceHeader returns the Toolbar header for slice grid

func (*TableView) SliceNewAt

func (tv *TableView) SliceNewAt(idx int)

SliceNewAt inserts a new blank element at given index in the slice -- -1 means the end

func (*TableView) SortFieldName

func (tv *TableView) SortFieldName() string

SortFieldName returns the name of the field being sorted, along with :up or :down depending on descending

func (*TableView) SortIfNeeded added in v1.0.31

func (tv *TableView) SortIfNeeded()

SortIfNeeded sort table if sorting set

func (*TableView) SortSliceAction

func (tv *TableView) SortSliceAction(fldIdx int)

SortSliceAction sorts the slice for given field index -- toggles ascending vs. descending if already sorting on this dimension

func (*TableView) Style2D added in v1.0.0

func (tv *TableView) Style2D()

func (*TableView) StyleRow

func (tv *TableView) StyleRow(svnp reflect.Value, widg gi.Node2D, idx, fidx int, vv giv.ValueView)

func (*TableView) TableConfig added in v1.0.0

func (tv *TableView) TableConfig()

TableConfig does all the configuration for a new Table view

func (*TableView) TensorDispAction

func (tv *TableView) TensorDispAction(fldIdx int)

TensorDispAction allows user to select tensor display options for column pass -1 for global params for the entire table

func (*TableView) ToolBar

func (tv *TableView) ToolBar() *gi.ToolBar

ToolBar returns the toolbar widget

func (*TableView) TsrDispToDots added in v1.0.0

func (tv *TableView) TsrDispToDots()

func (*TableView) UpdateSliceGrid

func (tv *TableView) UpdateSliceGrid()

UpdateSliceGrid updates grid display -- robust to any time calling

func (*TableView) UpdateTable added in v1.0.9

func (tv *TableView) UpdateTable()

UpdateTable updates view of Table -- regenerates indexes and calls Update

func (*TableView) UpdtSliceSize

func (tv *TableView) UpdtSliceSize() int

type TensorDisp

type TensorDisp struct {
	TensorLayout

	// [view: inline] range to plot
	Range minmax.Range64 `view:"inline" desc:"range to plot"`

	// [view: inline] if not using fixed range, this is the actual range of data
	MinMax minmax.F64 `view:"inline" desc:"if not using fixed range, this is the actual range of data"`

	// the name of the color map to use in translating values to colors
	ColorMap giv.ColorMapName `desc:"the name of the color map to use in translating values to colors"`

	// background color
	Background gist.Color `desc:"background color"`

	// [def: 0.9,1] [min: 0.1] [max: 1] [step: 0.1] what proportion of grid square should be filled by color block -- 1 = all, .5 = half, etc
	GridFill float32 `` /* 137-byte string literal not displayed */

	// [def: 0.1,0.3] [min: 0] [max: 1] [step: 0.02] amount of extra space to add at dimension boundaries, as a proportion of total grid size
	DimExtra float32 `` /* 137-byte string literal not displayed */

	// extra space to add at bottom of grid -- needed when included in TableView for example
	BotRtSpace units.Value `desc:"extra space to add at bottom of grid -- needed when included in TableView for example"`

	// minimum size for grid squares -- they will never be smaller than this
	GridMinSize units.Value `desc:"minimum size for grid squares -- they will never be smaller than this"`

	// maximum size for grid squares -- they will never be larger than this
	GridMaxSize units.Value `desc:"maximum size for grid squares -- they will never be larger than this"`

	// 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 units.Value `` /* 163-byte string literal not displayed */

	// font size in standard point units for labels (e.g., SimMat)
	FontSize float32 `desc:"font size in standard point units for labels (e.g., SimMat)"`

	// [view: -] our gridview, for update method
	GridView *TensorGrid `copy:"-" json:"-" xml:"-" view:"-" desc:"our gridview, for update method"`
}

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 added in v1.0.0

func (td *TensorDisp) FmMeta(tsr etensor.Tensor)

FmMeta sets display options from Tensor meta-data

func (*TensorDisp) ToDots

func (td *TensorDisp) ToDots(uc *units.Context)

func (*TensorDisp) Update added in v1.0.0

func (td *TensorDisp) Update()

Update satisfies the gi.Updater interface and will trigger display update on edits

type TensorGrid

type TensorGrid struct {
	gi.WidgetBase

	// the tensor that we view
	Tensor etensor.Tensor `desc:"the tensor that we view"`

	// display options
	Disp TensorDisp `desc:"display options"`

	// the actual colormap
	ColorMap *colormap.Map `desc:"the actual colormap"`
}

TensorGrid is a widget that displays tensor values as a grid of colored squares.

func AddNewTensorGrid

func AddNewTensorGrid(parent ki.Ki, name string, tsr etensor.Tensor) *TensorGrid

AddNewTensorGrid adds a new tensor grid to given parent node, with given name.

func (*TensorGrid) Color

func (tg *TensorGrid) Color(val float64) (norm float64, clr gist.Color)

func (*TensorGrid) ConnectEvents2D

func (tg *TensorGrid) ConnectEvents2D()

func (*TensorGrid) Defaults

func (tg *TensorGrid) Defaults()

Defaults sets defaults for values that are at nonsensical initial values

func (*TensorGrid) EnsureColorMap

func (tg *TensorGrid) EnsureColorMap()

EnsureColorMap makes sure there is a valid color map that matches specified name

func (*TensorGrid) MouseEvent

func (tg *TensorGrid) MouseEvent()

MouseEvent handles button MouseEvent

func (*TensorGrid) OpenTensorView

func (tg *TensorGrid) OpenTensorView()

OpenTensorView pulls up a TensorView of our tensor

func (*TensorGrid) Render2D

func (tg *TensorGrid) Render2D()

func (*TensorGrid) RenderTensor

func (tg *TensorGrid) RenderTensor()

func (*TensorGrid) SetTensor

func (tg *TensorGrid) SetTensor(tsr etensor.Tensor)

SetTensor sets the tensor and triggers a display update

func (*TensorGrid) Size2D

func (tg *TensorGrid) Size2D(iter int)

func (*TensorGrid) Style2D

func (tg *TensorGrid) Style2D()

func (*TensorGrid) UpdateRange

func (tg *TensorGrid) UpdateRange()

type TensorGridValueView

type TensorGridValueView struct {
	giv.ValueViewBase
}

TensorGridValueView manages a TensorGrid view of an etensor.Tensor

func (*TensorGridValueView) ConfigWidget

func (vv *TensorGridValueView) ConfigWidget(widg gi.Node2D)

func (*TensorGridValueView) HasAction

func (vv *TensorGridValueView) HasAction() bool

func (*TensorGridValueView) UpdateWidget

func (vv *TensorGridValueView) UpdateWidget()

func (*TensorGridValueView) WidgetType

func (vv *TensorGridValueView) WidgetType() reflect.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 `` /* 255-byte string literal not displayed */

	// 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 `` /* 181-byte string literal not displayed */

	// 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 `` /* 201-byte string literal not displayed */
}

TensorLayout are layout options for displaying tensors

type TensorValueView

type TensorValueView struct {
	giv.ValueViewBase
}

TensorValueView presents a button that pulls up the TensorView viewer for an etensor.Tensor

func (*TensorValueView) Activate

func (vv *TensorValueView) Activate(vp *gi.Viewport2D, recv ki.Ki, dlgFunc ki.RecvFunc)

func (*TensorValueView) ConfigWidget

func (vv *TensorValueView) ConfigWidget(widg gi.Node2D)

func (*TensorValueView) HasAction

func (vv *TensorValueView) HasAction() bool

func (*TensorValueView) UpdateWidget

func (vv *TensorValueView) UpdateWidget()

func (*TensorValueView) WidgetType

func (vv *TensorValueView) WidgetType() reflect.Type

type TensorView

type TensorView struct {
	giv.SliceViewBase

	// the tensor that we're a view of
	Tensor etensor.Tensor `desc:"the tensor that we're a view of"`

	// layout config of the tensor
	TsrLay TensorLayout `desc:"layout config of the tensor"`

	// number of columns in table (as of last update)
	NCols int `inactive:"+" desc:"number of columns in table (as of last update)"`
}

etview.TensorView provides a GUI interface for etable.Tensor's using a tabular rows-and-columns interface

func AddNewTensorView

func AddNewTensorView(parent ki.Ki, name string) *TensorView

AddNewTensorView adds a new tableview to given parent node, with given name.

func (*TensorView) Config

func (tv *TensorView) Config()

Config configures the view

func (*TensorView) ConfigSliceGrid

func (tv *TensorView) ConfigSliceGrid()

ConfigSliceGrid configures the SliceGrid for the current slice this is only called by global Config and updates are guarded by that

func (*TensorView) ConfigToolbar

func (tv *TensorView) ConfigToolbar()

ConfigToolbar configures the toolbar actions

func (*TensorView) CopySelToMime

func (tv *TensorView) CopySelToMime() mimedata.Mimes

CopySelToMime copies selected rows to mime data

func (*TensorView) GridLayout

func (tv *TensorView) GridLayout() *gi.Layout

GridLayout returns the SliceGrid grid-layout widget, with grid and scrollbar

func (*TensorView) IsConfiged

func (tv *TensorView) IsConfiged() bool

IsConfiged returns true if the widget is fully configured

func (*TensorView) ItemCtxtMenu

func (tv *TensorView) ItemCtxtMenu(idx int)

func (*TensorView) Layout2D

func (tv *TensorView) Layout2D(parBBox image.Rectangle, iter int) bool

func (*TensorView) LayoutHeader

func (tv *TensorView) LayoutHeader()

LayoutHeader updates the header layout based on field widths

func (*TensorView) LayoutSliceGrid

func (tv *TensorView) LayoutSliceGrid() bool

LayoutSliceGrid does the proper layout of slice grid depending on allocated size returns true if UpdateSliceGrid should be called after this

func (*TensorView) PasteAssign

func (tv *TensorView) PasteAssign(md mimedata.Mimes, idx int)

PasteAssign assigns mime data (only the first one!) to this idx

func (*TensorView) PasteAtIdx

func (tv *TensorView) PasteAtIdx(md mimedata.Mimes, idx int)

PasteAtIdx inserts object(s) from mime data at (before) given slice index

func (*TensorView) RowFirstVisWidget

func (tv *TensorView) 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 (*TensorView) RowGrabFocus

func (tv *TensorView) 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 (*TensorView) RowWidgetNs

func (tv *TensorView) RowWidgetNs() (nWidgPerRow, idxOff int)

RowWidgetNs returns number of widgets per row and offset for index label

func (*TensorView) ScrollBar

func (tv *TensorView) ScrollBar() *gi.ScrollBar

ScrollBar returns the SliceGrid scrollbar

func (*TensorView) SelectRowWidgets

func (tv *TensorView) SelectRowWidgets(row int, sel bool)

SelectRowWidgets sets the selection state of given row of widgets

func (*TensorView) SetTensor

func (tv *TensorView) SetTensor(tsr etensor.Tensor, tmpSave giv.ValueView)

SetTensor sets the source tensor that we are viewing

func (*TensorView) SliceDeleteAt

func (tv *TensorView) SliceDeleteAt(idx int, doupdt bool)

SliceDeleteAt deletes element at given index from slice -- doupdt means call UpdateSliceGrid to update display

func (*TensorView) SliceFrame

func (tv *TensorView) SliceFrame() *gi.Frame

SliceFrame returns the outer frame widget, which contains all the header, fields and values

func (*TensorView) SliceGrid

func (tv *TensorView) SliceGrid() *gi.Frame

SliceGrid returns the SliceGrid grid frame widget, which contains all the fields and values, within SliceFrame

func (*TensorView) SliceHeader

func (tv *TensorView) SliceHeader() *gi.ToolBar

SliceHeader returns the Toolbar header for slice grid

func (*TensorView) SliceNewAt

func (tv *TensorView) SliceNewAt(idx int)

SliceNewAt inserts a new blank element at given index in the slice -- -1 means the end

func (*TensorView) StyleRow

func (tv *TensorView) StyleRow(svnp reflect.Value, widg gi.Node2D, idx, fidx int, vv giv.ValueView)

func (*TensorView) ToolBar

func (tv *TensorView) ToolBar() *gi.ToolBar

ToolBar returns the toolbar widget

func (*TensorView) UpdateSliceGrid

func (tv *TensorView) UpdateSliceGrid()

UpdateSliceGrid updates grid display -- robust to any time calling

func (*TensorView) UpdtSliceSize

func (tv *TensorView) UpdtSliceSize() int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL