Documentation
¶
Index ¶
- Constants
- type ActivityModeGauge
- func (g *ActivityModeGauge) Draw(screen tcell.Screen)
- func (g *ActivityModeGauge) Focus(delegate func(p tview.Primitive))
- func (g *ActivityModeGauge) GetRect() (int, int, int, int)
- func (g *ActivityModeGauge) HasFocus() bool
- func (g *ActivityModeGauge) Pulse()
- func (g *ActivityModeGauge) Reset()
- func (g *ActivityModeGauge) SetPgBgColor(color tcell.Color)
- func (g *ActivityModeGauge) SetRect(x, y, width, height int)
- type BarChart
- func (c *BarChart) AddBar(label string, value int, color tcell.Color)
- func (c *BarChart) Draw(screen tcell.Screen)
- func (c *BarChart) Focus(delegate func(p tview.Primitive))
- func (c *BarChart) GetRect() (int, int, int, int)
- func (c *BarChart) HasFocus() bool
- func (c *BarChart) RemoveBar(label string)
- func (c *BarChart) SetAxesColor(color tcell.Color)
- func (c *BarChart) SetAxesLabelColor(color tcell.Color)
- func (c *BarChart) SetBarValue(name string, value int)
- func (c *BarChart) SetBorder(status bool)
- func (c *BarChart) SetMaxValue(maxValue int)
- func (c *BarChart) SetRect(x, y, width, height int)
- type BarChartItem
- type Marker
- type MessageDialog
- func (d *MessageDialog) Draw(screen tcell.Screen)
- func (d *MessageDialog) Focus(delegate func(p tview.Primitive))
- func (d *MessageDialog) GetBackgroundColor() tcell.Color
- func (d *MessageDialog) HasFocus() bool
- func (d *MessageDialog) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- func (d *MessageDialog) MouseHandler() ...
- func (d *MessageDialog) SetBackgroundColor(color tcell.Color)
- func (d *MessageDialog) SetDoneFunc(handler func()) *MessageDialog
- func (d *MessageDialog) SetMessage(message string)
- func (d *MessageDialog) SetRect(x, y, width, height int)
- func (d *MessageDialog) SetTextColor(color tcell.Color)
- func (d *MessageDialog) SetTitle(title string)
- func (d *MessageDialog) SetType(dtype int)
- type PercentageModeGauge
- func (g *PercentageModeGauge) Draw(screen tcell.Screen)
- func (g *PercentageModeGauge) Focus(delegate func(p tview.Primitive))
- func (g *PercentageModeGauge) GetMaxValue() int
- func (g *PercentageModeGauge) GetRect() (int, int, int, int)
- func (g *PercentageModeGauge) GetValue() int
- func (g *PercentageModeGauge) HasFocus() bool
- func (g *PercentageModeGauge) Reset()
- func (g *PercentageModeGauge) SetMaxValue(value int)
- func (g *PercentageModeGauge) SetPgBgColor(color tcell.Color)
- func (g *PercentageModeGauge) SetRect(x, y, width, height int)
- func (g *PercentageModeGauge) SetValue(value int)
- type Plot
- func (plot *Plot) Draw(screen tcell.Screen)
- func (plot *Plot) GetPlotRect() (int, int, int, int)
- func (plot *Plot) SetAxesColor(color tcell.Color)
- func (plot *Plot) SetAxesLabelColor(color tcell.Color)
- func (plot *Plot) SetData(data [][]float64)
- func (plot *Plot) SetDotMarkerRune(r rune)
- func (plot *Plot) SetDrawAxes(draw bool)
- func (plot *Plot) SetDrawXAxisLabel(draw bool)
- func (plot *Plot) SetDrawYAxisLabel(draw bool)
- func (plot *Plot) SetLineColor(color []tcell.Color)
- func (plot *Plot) SetMarker(marker Marker)
- func (plot *Plot) SetMaxVal(maxVal float64)
- func (plot *Plot) SetMinVal(minVal float64)
- func (plot *Plot) SetPlotType(ptype PlotType)
- func (plot *Plot) SetRect(x, y, width, height int)
- func (plot *Plot) SetXAxisLabelFunc(f func(int) string)
- func (plot *Plot) SetYAxisAutoScaleMax(autoScale bool)
- func (plot *Plot) SetYAxisAutoScaleMin(autoScale bool)
- func (plot *Plot) SetYAxisLabelDataType(dataType PlotYAxisLabelDataType)
- func (plot *Plot) SetYRange(minVal float64, maxVal float64)
- type PlotType
- type PlotYAxisLabelDataType
- type Sparkline
- func (sl *Sparkline) Draw(screen tcell.Screen)
- func (sl *Sparkline) GetRect() (int, int, int, int)
- func (sl *Sparkline) HasFocus() bool
- func (sl *Sparkline) SetData(data []float64)
- func (sl *Sparkline) SetDataTitle(title string)
- func (sl *Sparkline) SetDataTitleColor(color tcell.Color)
- func (sl *Sparkline) SetLineColor(color tcell.Color)
- func (sl *Sparkline) SetRect(x, y, width, height int)
- type Spinner
- type SpinnerStyle
- type UtilModeGauge
- func (g *UtilModeGauge) Draw(screen tcell.Screen)
- func (g *UtilModeGauge) Focus(delegate func(p tview.Primitive))
- func (g *UtilModeGauge) GetRect() (int, int, int, int)
- func (g *UtilModeGauge) GetValue() float64
- func (g *UtilModeGauge) HasFocus() bool
- func (g *UtilModeGauge) SetCritPercentage(percentage float64)
- func (g *UtilModeGauge) SetEmptyColor(color tcell.Color)
- func (g *UtilModeGauge) SetLabel(label string)
- func (g *UtilModeGauge) SetLabelColor(color tcell.Color)
- func (g *UtilModeGauge) SetRect(x, y, width, height int)
- func (g *UtilModeGauge) SetValue(value float64)
- func (g *UtilModeGauge) SetWarnPercentage(percentage float64)
Constants ¶
const ( InfoDialog = 0 + iota ErrorDailog )
represents dialog type.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivityModeGauge ¶
ActivityModeGauge represents activity mode gauge permitive.
func NewActivityModeGauge ¶
func NewActivityModeGauge() *ActivityModeGauge
NewActivityModeGauge returns new activity mode gauge permitive.
func (*ActivityModeGauge) Draw ¶
func (g *ActivityModeGauge) Draw(screen tcell.Screen)
Draw draws this primitive onto the screen.
func (*ActivityModeGauge) Focus ¶
func (g *ActivityModeGauge) Focus(delegate func(p tview.Primitive))
Focus is called when this primitive receives focus.
func (*ActivityModeGauge) GetRect ¶
func (g *ActivityModeGauge) GetRect() (int, int, int, int)
GetRect return primitive current rect.
func (*ActivityModeGauge) HasFocus ¶
func (g *ActivityModeGauge) HasFocus() bool
HasFocus returns whether or not this primitive has focus.
func (*ActivityModeGauge) Pulse ¶
func (g *ActivityModeGauge) Pulse()
Pulse pulse update the gauge progress bar.
func (*ActivityModeGauge) Reset ¶
func (g *ActivityModeGauge) Reset()
Reset resets the gauge counter (set to 0).
func (*ActivityModeGauge) SetPgBgColor ¶
func (g *ActivityModeGauge) SetPgBgColor(color tcell.Color)
SetPgBgColor sets progress block background color.
func (*ActivityModeGauge) SetRect ¶
func (g *ActivityModeGauge) SetRect(x, y, width, height int)
SetRect sets rect for this primitive.
type BarChart ¶
BarChart represents bar chart primitive.
func (*BarChart) Draw ¶
func (c *BarChart) Draw(screen tcell.Screen)
Draw draws this primitive onto the screen.
func (*BarChart) SetAxesColor ¶ added in v0.4.0
func (c *BarChart) SetAxesColor(color tcell.Color)
SetAxesColor sets axes x and y lines color.
func (*BarChart) SetAxesLabelColor ¶ added in v0.4.0
func (c *BarChart) SetAxesLabelColor(color tcell.Color)
SetAxesLabelColor sets axes x and y label color.
func (*BarChart) SetBarValue ¶
SetBarValue sets bar values.
func (*BarChart) SetMaxValue ¶
SetMaxValue sets maximum value of bars.
type BarChartItem ¶
type BarChartItem struct {
// contains filtered or unexported fields
}
BarChartItem represents a single bar in bar chart.
type Marker ¶ added in v0.3.0
type Marker uint
Marker represents plot drawing marker (braille or dot).
type MessageDialog ¶
MessageDialog represents message dialog primitive.
func NewMessageDialog ¶
func NewMessageDialog(dtype int) *MessageDialog
NewMessageDialog returns a new message dialog primitive.
func (*MessageDialog) Draw ¶
func (d *MessageDialog) Draw(screen tcell.Screen)
Draw draws this primitive onto the screen.
func (*MessageDialog) Focus ¶
func (d *MessageDialog) Focus(delegate func(p tview.Primitive))
Focus is called when this primitive receives focus.
func (*MessageDialog) GetBackgroundColor ¶ added in v0.5.0
func (d *MessageDialog) GetBackgroundColor() tcell.Color
GetBackgroundColor returns dialog background color.
func (*MessageDialog) HasFocus ¶
func (d *MessageDialog) HasFocus() bool
HasFocus returns whether or not this primitive has focus.
func (*MessageDialog) InputHandler ¶
func (d *MessageDialog) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
InputHandler returns input handler function for this primitive.
func (*MessageDialog) MouseHandler ¶
func (d *MessageDialog) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)
MouseHandler returns the mouse handler for this primitive.
func (*MessageDialog) SetBackgroundColor ¶
func (d *MessageDialog) SetBackgroundColor(color tcell.Color)
SetBackgroundColor sets dialog background color.
func (*MessageDialog) SetDoneFunc ¶
func (d *MessageDialog) SetDoneFunc(handler func()) *MessageDialog
SetDoneFunc sets callback function for when user clicked on the button or presses "enter" or "esc".
func (*MessageDialog) SetMessage ¶
func (d *MessageDialog) SetMessage(message string)
SetMessage sets the dialog message to display.
func (*MessageDialog) SetRect ¶
func (d *MessageDialog) SetRect(x, y, width, height int)
SetRect sets rect for this primitive.
func (*MessageDialog) SetTextColor ¶
func (d *MessageDialog) SetTextColor(color tcell.Color)
SetTextColor sets dialog's message text color.
func (*MessageDialog) SetTitle ¶
func (d *MessageDialog) SetTitle(title string)
SetTitle sets dialog title.
func (*MessageDialog) SetType ¶
func (d *MessageDialog) SetType(dtype int)
SetType sets dialog type to info or error.
type PercentageModeGauge ¶
PercentageModeGauge represents percentage mode gauge permitive.
func NewPercentageModeGauge ¶
func NewPercentageModeGauge() *PercentageModeGauge
NewPercentageModeGauge returns new percentage mode gauge permitive.
func (*PercentageModeGauge) Draw ¶
func (g *PercentageModeGauge) Draw(screen tcell.Screen)
Draw draws this primitive onto the screen.
func (*PercentageModeGauge) Focus ¶
func (g *PercentageModeGauge) Focus(delegate func(p tview.Primitive))
Focus is called when this primitive receives focus.
func (*PercentageModeGauge) GetMaxValue ¶
func (g *PercentageModeGauge) GetMaxValue() int
GetMaxValue returns maximum allows value for the gauge.
func (*PercentageModeGauge) GetRect ¶
func (g *PercentageModeGauge) GetRect() (int, int, int, int)
GetRect return primitive current rect.
func (*PercentageModeGauge) GetValue ¶
func (g *PercentageModeGauge) GetValue() int
GetValue returns current gauge value.
func (*PercentageModeGauge) HasFocus ¶
func (g *PercentageModeGauge) HasFocus() bool
HasFocus returns whether or not this primitive has focus.
func (*PercentageModeGauge) Reset ¶
func (g *PercentageModeGauge) Reset()
Reset resets the gauge counter (set to 0).
func (*PercentageModeGauge) SetMaxValue ¶
func (g *PercentageModeGauge) SetMaxValue(value int)
SetMaxValue set maximum allows value for the gauge.
func (*PercentageModeGauge) SetPgBgColor ¶
func (g *PercentageModeGauge) SetPgBgColor(color tcell.Color)
SetPgBgColor sets progress block background color.
func (*PercentageModeGauge) SetRect ¶
func (g *PercentageModeGauge) SetRect(x, y, width, height int)
SetRect sets rect for this primitive.
func (*PercentageModeGauge) SetValue ¶
func (g *PercentageModeGauge) SetValue(value int)
SetValue update the gauge progress.
type Plot ¶ added in v0.3.0
Plot represents a plot primitive used for different charts.
func (*Plot) Draw ¶ added in v0.3.0
func (plot *Plot) Draw(screen tcell.Screen)
Draw draws this primitive onto the screen.
func (*Plot) GetPlotRect ¶ added in v0.7.0
GetPlotRect returns the rect for the inner part of the plot, ie not including axes.
func (*Plot) SetAxesColor ¶ added in v0.3.0
func (plot *Plot) SetAxesColor(color tcell.Color)
SetAxesColor sets axes x and y lines color.
func (*Plot) SetAxesLabelColor ¶ added in v0.3.0
func (plot *Plot) SetAxesLabelColor(color tcell.Color)
SetAxesLabelColor sets axes x and y label color.
func (*Plot) SetDotMarkerRune ¶ added in v0.3.0
SetDotMarkerRune sets dot marker rune.
func (*Plot) SetDrawAxes ¶ added in v0.3.0
SetDrawAxes set true in order to draw axes to screen.
func (*Plot) SetDrawXAxisLabel ¶ added in v0.6.0
SetDrawXAxisLabel set true in order to draw x axis label to screen.
func (*Plot) SetDrawYAxisLabel ¶ added in v0.6.0
SetDrawYAxisLabel set true in order to draw y axis label to screen.
func (*Plot) SetLineColor ¶ added in v0.3.0
func (plot *Plot) SetLineColor(color []tcell.Color)
SetLineColor sets chart line color.
func (*Plot) SetPlotType ¶ added in v0.3.0
SetPlotType sets plot type (linechart or scatter).
func (*Plot) SetXAxisLabelFunc ¶ added in v0.9.0
SetXAxisLabelFunc sets x axis label function.
func (*Plot) SetYAxisAutoScaleMax ¶ added in v0.9.0
SetYAxisAutoScaleMax enables YAxix max value autoscale.
func (*Plot) SetYAxisAutoScaleMin ¶ added in v0.9.0
SetYAxisAutoScaleMin enables YAxis min value autoscale.
func (*Plot) SetYAxisLabelDataType ¶ added in v0.8.0
func (plot *Plot) SetYAxisLabelDataType(dataType PlotYAxisLabelDataType)
SetYAxisLabelDataType sets Y axis label data type (integer or float).
type PlotType ¶ added in v0.3.0
type PlotType uint
PlotType represents plot type (line chart or scatter).
type PlotYAxisLabelDataType ¶ added in v0.8.0
type PlotYAxisLabelDataType uint
PlotYAxisLabelDataType represents plot y axis type (integer or float).
const ( PlotYAxisLabelDataInt PlotYAxisLabelDataType = iota PlotYAxisLabelDataFloat )
type Sparkline ¶ added in v0.3.0
Spartline represents a sparkline widgets.
func NewSparkline ¶ added in v0.3.0
func NewSparkline() *Sparkline
NewSparkline returns a new sparkline widget.
func (*Sparkline) Draw ¶ added in v0.3.0
func (sl *Sparkline) Draw(screen tcell.Screen)
Draw draws this primitive onto the screen.
func (*Sparkline) HasFocus ¶ added in v0.3.0
HasFocus returns whether or not this primitive has focus.
func (*Sparkline) SetDataTitle ¶ added in v0.3.0
SetDataTitle sets sparkline data title.
func (*Sparkline) SetDataTitleColor ¶ added in v0.3.0
func (sl *Sparkline) SetDataTitleColor(color tcell.Color)
SetDataTitleColor sets sparkline data title color.
func (*Sparkline) SetLineColor ¶ added in v0.3.0
func (sl *Sparkline) SetLineColor(color tcell.Color)
SetLineColor sets sparkline line color.
type Spinner ¶ added in v0.2.0
Spinner represents a spinner widget.
func NewSpinner ¶ added in v0.2.0
func NewSpinner() *Spinner
NewSpinner returns a new spinner widget.
func (*Spinner) Draw ¶ added in v0.2.0
func (s *Spinner) Draw(screen tcell.Screen)
Draw draws this primitive onto the screen.
func (*Spinner) Pulse ¶ added in v0.2.0
func (s *Spinner) Pulse()
Pulse updates the spinner to the next frame.
func (*Spinner) Reset ¶ added in v0.2.0
func (s *Spinner) Reset()
Reset sets the frame counter to 0.
func (*Spinner) SetCustomStyle ¶ added in v0.2.0
SetCustomStyle sets a list of runes as custom frames to show as the spinner.
func (*Spinner) SetStyle ¶ added in v0.2.0
func (s *Spinner) SetStyle(style SpinnerStyle) *Spinner
SetStyle sets the spinner style.
type SpinnerStyle ¶ added in v0.2.0
type SpinnerStyle int
const ( SpinnerDotsCircling SpinnerStyle = iota SpinnerDotsUpDown SpinnerBounce SpinnerLine SpinnerCircleQuarters SpinnerSquareCorners SpinnerCircleHalves SpinnerCorners SpinnerArrows SpinnerHamburger SpinnerStack SpinnerGrowHorizontal SpinnerGrowVertical SpinnerStar SpinnerBoxBounce )
type UtilModeGauge ¶
UtilModeGauge represents utilisation mode gauge permitive.
func NewUtilModeGauge ¶
func NewUtilModeGauge() *UtilModeGauge
NewUtilModeGauge returns new utilisation mode gauge permitive.
func (*UtilModeGauge) Draw ¶
func (g *UtilModeGauge) Draw(screen tcell.Screen)
Draw draws this primitive onto the screen.
func (*UtilModeGauge) Focus ¶
func (g *UtilModeGauge) Focus(delegate func(p tview.Primitive))
Focus is called when this primitive receives focus.
func (*UtilModeGauge) GetRect ¶
func (g *UtilModeGauge) GetRect() (int, int, int, int)
GetRect return primitive current rect.
func (*UtilModeGauge) GetValue ¶
func (g *UtilModeGauge) GetValue() float64
GetValue returns current gauge value.
func (*UtilModeGauge) HasFocus ¶
func (g *UtilModeGauge) HasFocus() bool
HasFocus returns whether or not this primitive has focus.
func (*UtilModeGauge) SetCritPercentage ¶
func (g *UtilModeGauge) SetCritPercentage(percentage float64)
SetCritPercentage sets critical percentage start range.
func (*UtilModeGauge) SetEmptyColor ¶ added in v0.4.0
func (g *UtilModeGauge) SetEmptyColor(color tcell.Color)
SetEmptyColor sets empty gauge color.
func (*UtilModeGauge) SetLabel ¶
func (g *UtilModeGauge) SetLabel(label string)
SetLabel sets label for this primitive.
func (*UtilModeGauge) SetLabelColor ¶
func (g *UtilModeGauge) SetLabelColor(color tcell.Color)
SetLabelColor sets label text color.
func (*UtilModeGauge) SetRect ¶
func (g *UtilModeGauge) SetRect(x, y, width, height int)
SetRect sets rect for this primitive.
func (*UtilModeGauge) SetValue ¶
func (g *UtilModeGauge) SetValue(value float64)
SetValue update the gauge progress.
func (*UtilModeGauge) SetWarnPercentage ¶
func (g *UtilModeGauge) SetWarnPercentage(percentage float64)
SetWarnPercentage sets warning percentage start range.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
demos
|
|
barchart
Demo code for the bar chart primitive.
|
Demo code for the bar chart primitive. |
demo
Demo code for the bar chart primitive.
|
Demo code for the bar chart primitive. |
dialog
Demo code for the bar chart primitive.
|
Demo code for the bar chart primitive. |
gauge_am
Demo code for the bar chart primitive.
|
Demo code for the bar chart primitive. |
gauge_pm
Demo code for the bar chart primitive.
|
Demo code for the bar chart primitive. |
gauge_um
Demo code for the bar chart primitive.
|
Demo code for the bar chart primitive. |