gui

package
v0.0.0-...-f7c34fe Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BarPlot

type BarPlot struct {
	*tview.Box
	// contains filtered or unexported fields
}

func NewBarPlot

func NewBarPlot() *BarPlot

func (*BarPlot) Blur

func (plot *BarPlot) Blur()

Blur is called by the application when the primitive loses focus.

func (*BarPlot) Draw

func (plot *BarPlot) Draw(screen tcell.Screen)

func (*BarPlot) Focus

func (plot *BarPlot) Focus(delegate func(p tview.Primitive))

Focus is called by the application when the primitive receives focus. Implementers may call delegate() to pass the focus on to another primitive.

func (*BarPlot) HasFocus

func (plot *BarPlot) HasFocus() bool

HasFocus determines if the primitive has focus. This function must return true also if one of this primitive's child elements has focus.

func (*BarPlot) InputHandler

func (plot *BarPlot) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler returns a handler which receives key events when it has focus. It is called by the Application class.

A value of nil may also be returned, in which case this primitive cannot receive focus and will not process any key events.

The handler will receive the key event and a function that allows it to set the focus to a different primitive, so that future key events are sent to that primitive.

The Application's Draw() function will be called automatically after the handler returns.

The Box class provides functionality to intercept keyboard input. If you subclass from Box, it is recommended that you wrap your handler using Box.WrapInputHandler() so you inherit that functionality.

func (*BarPlot) MouseHandler

func (plot *BarPlot) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)

MouseHandler returns a handler which receives mouse events. It is called by the Application class.

A value of nil may also be returned to stop the downward propagation of mouse events.

The Box class provides functionality to intercept mouse events. If you subclass from Box, it is recommended that you wrap your handler using Box.WrapMouseHandler() so you inherit that functionality.

func (*BarPlot) SetAxis2String

func (plot *BarPlot) SetAxis2String(Xaxis2String func(value float64) string, Yaxis2String func(value float64) string)

func (*BarPlot) SetData

func (plot *BarPlot) SetData(Data [][]float64) error

func (*BarPlot) SetNoDataText

func (plot *BarPlot) SetNoDataText(text string)

func (*BarPlot) SetPlotBorder

func (b *BarPlot) SetPlotBorder(border bool) *BarPlot

func (*BarPlot) SetPlotTite

func (b *BarPlot) SetPlotTite(title string) *BarPlot

func (*BarPlot) SetStyleForPointFunc

func (plot *BarPlot) SetStyleForPointFunc(style4point func(point []float64) tcell.Style)

func (*BarPlot) SetXAxisText

func (plot *BarPlot) SetXAxisText(text string, aligment int)

func (*BarPlot) SetYAxisText

func (plot *BarPlot) SetYAxisText(text string, aligment int)

type DotPlot

type DotPlot struct {
	*tview.Box
	// contains filtered or unexported fields
}

func NewDotPlot

func NewDotPlot() *DotPlot

func (*DotPlot) Blur

func (plot *DotPlot) Blur()

Blur is called by the application when the primitive loses focus.

func (*DotPlot) Draw

func (plot *DotPlot) Draw(screen tcell.Screen)

func (*DotPlot) Focus

func (plot *DotPlot) Focus(delegate func(p tview.Primitive))

Focus is called by the application when the primitive receives focus. Implementers may call delegate() to pass the focus on to another primitive.

func (*DotPlot) HasFocus

func (plot *DotPlot) HasFocus() bool

HasFocus determines if the primitive has focus. This function must return true also if one of this primitive's child elements has focus.

func (*DotPlot) InputHandler

func (plot *DotPlot) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler returns a handler which receives key events when it has focus. It is called by the Application class.

A value of nil may also be returned, in which case this primitive cannot receive focus and will not process any key events.

The handler will receive the key event and a function that allows it to set the focus to a different primitive, so that future key events are sent to that primitive.

The Application's Draw() function will be called automatically after the handler returns.

The Box class provides functionality to intercept keyboard input. If you subclass from Box, it is recommended that you wrap your handler using Box.WrapInputHandler() so you inherit that functionality.

func (*DotPlot) MouseHandler

func (plot *DotPlot) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)

MouseHandler returns a handler which receives mouse events. It is called by the Application class.

A value of nil may also be returned to stop the downward propagation of mouse events.

The Box class provides functionality to intercept mouse events. If you subclass from Box, it is recommended that you wrap your handler using Box.WrapMouseHandler() so you inherit that functionality.

func (*DotPlot) SetAxis2String

func (plot *DotPlot) SetAxis2String(Xaxis2String func(value float64) string, Yaxis2String func(value float64) string)

func (*DotPlot) SetData

func (plot *DotPlot) SetData(Data [][]float64) error

func (*DotPlot) SetNoDataText

func (plot *DotPlot) SetNoDataText(text string)

func (*DotPlot) SetPlotBorder

func (b *DotPlot) SetPlotBorder(border bool) *DotPlot

func (*DotPlot) SetPlotTite

func (b *DotPlot) SetPlotTite(title string) *DotPlot

func (*DotPlot) SetStyleForPointFunc

func (plot *DotPlot) SetStyleForPointFunc(style4point func(point []float64) tcell.Style)

func (*DotPlot) SetXAxisText

func (plot *DotPlot) SetXAxisText(text string, aligment int)

func (*DotPlot) SetYAxisText

func (plot *DotPlot) SetYAxisText(text string, aligment int)

type Plot

type Plot struct {
	*tview.Box

	PointRune rune
	// contains filtered or unexported fields
}

func NewPlot

func NewPlot() *Plot

func (*Plot) Blur

func (plot *Plot) Blur()

Blur is called by the application when the primitive loses focus.

func (*Plot) Draw

func (plot *Plot) Draw(screen tcell.Screen)

func (*Plot) Focus

func (plot *Plot) Focus(delegate func(p tview.Primitive))

Focus is called by the application when the primitive receives focus. Implementers may call delegate() to pass the focus on to another primitive.

func (*Plot) HasFocus

func (plot *Plot) HasFocus() bool

HasFocus determines if the primitive has focus. This function must return true also if one of this primitive's child elements has focus.

func (*Plot) InputHandler

func (plot *Plot) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler returns a handler which receives key events when it has focus. It is called by the Application class.

A value of nil may also be returned, in which case this primitive cannot receive focus and will not process any key events.

The handler will receive the key event and a function that allows it to set the focus to a different primitive, so that future key events are sent to that primitive.

The Application's Draw() function will be called automatically after the handler returns.

The Box class provides functionality to intercept keyboard input. If you subclass from Box, it is recommended that you wrap your handler using Box.WrapInputHandler() so you inherit that functionality.

func (*Plot) MouseHandler

func (plot *Plot) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)

MouseHandler returns a handler which receives mouse events. It is called by the Application class.

A value of nil may also be returned to stop the downward propagation of mouse events.

The Box class provides functionality to intercept mouse events. If you subclass from Box, it is recommended that you wrap your handler using Box.WrapMouseHandler() so you inherit that functionality.

func (*Plot) SetAxis2String

func (plot *Plot) SetAxis2String(Xaxis2String func(value float64) string, Yaxis2String func(value float64) string)

func (*Plot) SetData

func (plot *Plot) SetData(Data [][]float64) error

func (*Plot) SetNoDataText

func (plot *Plot) SetNoDataText(text string)

func (*Plot) SetPlotBorder

func (b *Plot) SetPlotBorder(border bool) *Plot

func (*Plot) SetPlotTite

func (b *Plot) SetPlotTite(title string) *Plot

func (*Plot) SetStyleForPointFunc

func (plot *Plot) SetStyleForPointFunc(style4point func(point []float64) tcell.Style)

func (*Plot) SetXAxisText

func (plot *Plot) SetXAxisText(text string, aligment int)

func (*Plot) SetYAxisText

func (plot *Plot) SetYAxisText(text string, aligment int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳