databrowser

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataFS

func DataFS(fn *filetree.Node) *datafs.Data

DataFS returns the datafs representation of this item. returns nil if not a dataFS item.

func IsTableFile

func IsTableFile(fname string) bool

func NewDiffBrowserDirs

func NewDiffBrowserDirs(pathA, pathB string)

NewDiffBrowserDirs returns a new diff browser for files that differ within the two given directories. Excludes Job and .tsv data files.

func NewTab

func NewTab[T any](br *Browser, label string, mkfun func(tab *core.Frame) T) T

NewTab creates a tab with given label, or returns the existing one with given type of widget within it. mkfun function is called to create and configure a new widget if not already existing.

Types

type Browser

type Browser struct {
	core.Frame

	// FS is the filesystem, if browsing an FS
	FS fs.FS

	// DataRoot is the path to the root of the data to browse
	DataRoot string
	// contains filtered or unexported fields
}

Browser is a data browser, for browsing data either on an os filesystem or as a datafs virtual data filesystem.

func NewBrowser

func NewBrowser(parent ...tree.Node) *Browser

NewBrowser returns a new Browser with the given optional parent: Browser is a data browser, for browsing data either on an os filesystem or as a datafs virtual data filesystem.

func NewBrowserWindow

func NewBrowserWindow(fsys fs.FS, dataDir string) *Browser

NewBrowserWindow opens a new data Browser for given file system (nil for os files) and data directory.

func ParentBrowser

func ParentBrowser(tn tree.Node) *Browser

ParentBrowser returns the Browser parent of given node

func (*Browser) Init

func (br *Browser) Init()

Init initializes with the data and script directories

func (*Browser) MakeToolbar

func (br *Browser) MakeToolbar(p *tree.Plan)

func (*Browser) NewTabEditor

func (br *Browser) NewTabEditor(label, content string) *texteditor.Editor

NewTabEditor opens a texteditor.Editor tab, displaying given string.

func (*Browser) NewTabEditorFile

func (br *Browser) NewTabEditorFile(label, filename string) *texteditor.Editor

NewTabEditorFile opens an editor tab for given file

func (*Browser) NewTabPlot

func (br *Browser) NewTabPlot(label string, dt *table.Table) *plotcore.PlotEditor

NewTabPlot creates a tab with a Plot of given table.Table.

func (*Browser) NewTabSliceTable

func (br *Browser) NewTabSliceTable(label string, slc any) *core.Table

NewTabSliceTable creates a tab with a core.Table widget to view the given slice of structs.

func (*Browser) NewTabTensorEditor

func (br *Browser) NewTabTensorEditor(label string, tsr tensor.Tensor) *tensorcore.TensorEditor

NewTabTensorEditor creates a tab with a tensorcore.TensorEditor widget to view given Tensor.

func (*Browser) NewTabTensorGrid

func (br *Browser) NewTabTensorGrid(label string, tsr tensor.Tensor) *tensorcore.TensorGrid

NewTabTensorGrid creates a tab with a tensorcore.TensorGrid widget to view given Tensor.

func (*Browser) NewTabTensorTable

func (br *Browser) NewTabTensorTable(label string, dt *table.Table) *tensorcore.Table

NewTabTensorTable creates a tab with a tensorcore.Table widget to view given table.Table, using its own table.IndexView as tv.Table. Use tv.Table.Table to get the underlying *table.Table Use tv.Table.Sequential to update the IndexView to view all of the rows when done updating the Table, and then call br.Update()

func (*Browser) SetDataRoot

func (t *Browser) SetDataRoot(v string) *Browser

SetDataRoot sets the [Browser.DataRoot]: DataRoot is the path to the root of the data to browse

func (*Browser) SetFS

func (t *Browser) SetFS(v fs.FS) *Browser

SetFS sets the [Browser.FS]: Filesystem, if browsing an FS

func (*Browser) UpdateFiles

func (br *Browser) UpdateFiles()

UpdateFiles Updates the files list.

type FileNode

type FileNode struct {
	filetree.Node
}

FileNode is databrowser version of FileNode for FileTree

func NewFileNode

func NewFileNode(parent ...tree.Node) *FileNode

NewFileNode returns a new FileNode with the given optional parent: FileNode is databrowser version of FileNode for FileTree

func (*FileNode) ContextMenu

func (fn *FileNode) ContextMenu(m *core.Scene)

func (*FileNode) DiffDirs

func (fn *FileNode) DiffDirs()

DiffDirs displays a browser with differences between two selected directories

func (*FileNode) EditFile

func (fn *FileNode) EditFile()

EditFile pulls up this file in a texteditor

func (*FileNode) EditFiles

func (fn *FileNode) EditFiles()

EditFiles calls EditFile on selected files

func (*FileNode) GetFileInfo

func (fn *FileNode) GetFileInfo() error

func (*FileNode) Init

func (fn *FileNode) Init()

func (*FileNode) OpenFile

func (fn *FileNode) OpenFile() error

func (*FileNode) PlotFile

func (fn *FileNode) PlotFile()

PlotFile pulls up this file in a texteditor.

func (*FileNode) PlotFiles

func (fn *FileNode) PlotFiles()

PlotFiles calls PlotFile on selected files

func (*FileNode) WidgetTooltip

func (fn *FileNode) WidgetTooltip(pos image.Point) (string, image.Point)

Jump to

Keyboard shortcuts

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