Documentation ¶
Overview ¶
Package netview provides the NetView interactive 3D network viewer, implemented in the GoGi 3D framework.
Index ¶
- Variables
- type LayMesh
- type NetView
- func (nv *NetView) Config()
- func (nv *NetView) Counters() *gi.Label
- func (nv *NetView) Defaults()
- func (nv *NetView) GoUpdate(counters string)
- func (nv *NetView) HasLayers() bool
- func (nv *NetView) IsConfiged() bool
- func (nv *NetView) NetLay() *gi.Layout
- func (nv *NetView) OpenWeights(filename gi.FileName)
- func (nv *NetView) SaveWeights(filename gi.FileName)
- func (nv *NetView) Scene() *gi3d.Scene
- func (nv *NetView) SetCounters(ctrs string)
- func (nv *NetView) SetNet(net emer.Network)
- func (nv *NetView) SetVar(vr string)
- func (nv *NetView) ShowAllParams() string
- func (nv *NetView) ShowNonDefaultParams() string
- func (nv *NetView) Toolbar() *gi.ToolBar
- func (nv *NetView) ToolbarConfig()
- func (nv *NetView) UnitVal(lay emer.Layer, idx []int) (raw, scaled float32, clr gi.Color)
- func (nv *NetView) Update(counters string)
- func (nv *NetView) UpdateImpl(counters string)
- func (nv *NetView) VarScaleUpdate(varNm string) bool
- func (nv *NetView) VarsConfig()
- func (nv *NetView) VarsLay() *gi.Frame
- func (nv *NetView) VarsListUpdate()
- func (nv *NetView) VarsUpdate()
- func (nv *NetView) ViewConfig()
- func (nv *NetView) ViewDefaults()
- func (nv *NetView) Viewbar() *gi.ToolBar
- func (nv *NetView) ViewbarConfig()
- type Params
- type VarParams
Constants ¶
This section is empty.
Variables ¶
var KiT_LayMesh = kit.Types.AddType(&LayMesh{}, nil)
var KiT_NetView = kit.Types.AddType(&NetView{}, NetViewProps)
var MinUnitHeight = float32(1.0e-6)
MinUnitHeight ensures that there is always at least some dimensionality to the unit cubes -- affects transparency rendering etc
var NetViewProps = ki.Props{ "max-width": -1, "max-height": -1, "CallMethods": ki.PropSlice{ {"SaveWeights", ki.Props{ "desc": "save network weights to file", "icon": "file-save", "Args": ki.PropSlice{ {"File Name", ki.Props{ "ext": ".wts", }}, }, }}, {"OpenWeights", ki.Props{ "desc": "open network weights from file", "icon": "file-open", "Args": ki.PropSlice{ {"File Name", ki.Props{ "ext": ".wts", }}, }, }}, }, }
Functions ¶
This section is empty.
Types ¶
type LayMesh ¶
type LayMesh struct { gi3d.MeshBase Lay emer.Layer `desc:"layer that we render"` Shape etensor.Shape `desc:"current shape that has been constructed -- if same, just update"` View *NetView `desc:"netview that we're in"` }
LayMesh is a gi3d.Mesh that represents a layer -- it is dynamically updated using the Update method which only resets the essential Vertex elements. The geometry is literal in the layer size: 0,0,0 lower-left corner and increasing X,Z for the width and height of the layer, in unit (1) increments per unit.. NetView applies an overall scaling to make it fit within the larger view.
func AddNewLayMesh ¶
AddNewLayMesh adds LayMesh mesh to given scene for given layer
type NetView ¶
type NetView struct { gi.Layout Net emer.Network `desc:"the network that we're viewing"` Var string `desc:"current variable that we're viewing"` Vars []string `desc:"the list of variables to view, along with view-specific params"` VarParams map[string]*VarParams `desc:"parameters for the list of variables to view"` CurVarParams *VarParams `json:"-" xml:"-" view:"-" desc:"current var params -- only valid during Update of display"` Params Params `desc:"parameters controlling how the view is rendered"` ColorMap *giv.ColorMap `desc:"color map for mapping values to colors -- set by name in Params"` }
NetView is a GoGi Widget that provides a 3D network view using the GoGi gi3d 3D framework.
func AddNewNetView ¶
AddNewNetView adds a new NetView to given parent node, with given name.
func (*NetView) GoUpdate ¶
GoUpdate is the update call to make from another go routine it does the proper blocking to coordinate with GUI updates generated on the main GUI thread.
func (*NetView) IsConfiged ¶
IsConfiged returns true if widget is fully configured
func (*NetView) OpenWeights ¶
OpenWeights opens the network weights -- when called with giv.CallMethod it will auto-prompt for filename
func (*NetView) SaveWeights ¶
SaveWeights saves the network weights -- when called with giv.CallMethod it will auto-prompt for filename
func (*NetView) SetCounters ¶
func (*NetView) ShowAllParams ¶
ShowAllParams shows a dialog of all the parameters in the network.
func (*NetView) ShowNonDefaultParams ¶
ShowNonDefaultParams shows a dialog of all the parameters that are not at their default values in the network. Useful for setting params.
func (*NetView) ToolbarConfig ¶
func (nv *NetView) ToolbarConfig()
func (*NetView) UnitVal ¶
UnitVal returns the raw value, scaled value, and color representation for given unit of given layer scaled is in range -1..1 todo: incorporate history etc..
func (*NetView) Update ¶
Update updates the display based on current state of network counters string, if non-empty, will be displayed at bottom of view, showing current counter state This version is for calling within main window eventloop goroutine use GoUpdate version for calling outside of main goroutine.
func (*NetView) UpdateImpl ¶
func (*NetView) VarScaleUpdate ¶
VarScaleUpdate updates display of the scaling params for given variable (use nv.Var for current) returns true if any setting changed (update always triggered)
func (*NetView) VarsListUpdate ¶
func (nv *NetView) VarsListUpdate()
VarsListUpdate updates the list of network variables
func (*NetView) VarsUpdate ¶
func (nv *NetView) VarsUpdate()
VarsUpdate updates the selection status of the variables and the view range state too
func (*NetView) ViewDefaults ¶
func (nv *NetView) ViewDefaults()
ViewDefaults are the default 3D view params
func (*NetView) ViewbarConfig ¶
func (nv *NetView) ViewbarConfig()
type Params ¶
type Params struct { UnitSize float32 `min:"0.1" max:"1" step:"0.1" def:"0.9" desc:"size of a single unit, where 1 = full width and no space.. .9 default"` LayNmSize float32 `min:"0.01" max:".1" step:"0.01" def:"0.05" desc:"size of the layer name labels -- entire network view is unit sized"` ColorMap giv.ColorMapName `desc:"name of color map to use"` ZeroAlpha float32 `` /* 158-byte string literal not displayed */ NetView *NetView `copy:"-" json:"-" xml:"-" view:"-" desc:"our netview, for update method"` }
Params holds parameters controlling how the view is rendered
type VarParams ¶
type VarParams struct { Var string `desc:"name of the variable"` ZeroCtr bool `` /* 139-byte string literal not displayed */ Range minmax.Range32 `view:"inline" desc:"range to display"` MinMax minmax.F32 `view:"inline" desc:"if not using fixed range, this is the actual range of data"` }
VarParams holds parameters for display of each variable