Documentation ¶
Index ¶
- Constants
- type BarChart
- type CPUTableChart
- func (c *CPUTableChart) DisableCursor()
- func (c *CPUTableChart) Draw(buf *ui.Buffer)
- func (c *CPUTableChart) EnableCursor()
- func (c *CPUTableChart) ScrollBottom()
- func (c *CPUTableChart) ScrollDown()
- func (c *CPUTableChart) ScrollHalfPageDown()
- func (c *CPUTableChart) ScrollHalfPageUp()
- func (c *CPUTableChart) ScrollPageDown()
- func (c *CPUTableChart) ScrollPageUp()
- func (c *CPUTableChart) ScrollToIndex(idx int)
- func (c *CPUTableChart) ScrollTop()
- func (c *CPUTableChart) ScrollUp()
- type HorizontalBarChart
- type LineGraph
- type ScrollableWidget
- type Sparkline
- type SparklineGroup
- type Table
- func (t *Table) DisableCursor()
- func (t *Table) Draw(buf *ui.Buffer)
- func (t *Table) EnableCursor()
- func (t *Table) ScrollBottom()
- func (t *Table) ScrollDown()
- func (t *Table) ScrollHalfPageDown()
- func (t *Table) ScrollHalfPageUp()
- func (t *Table) ScrollPageDown()
- func (t *Table) ScrollPageUp()
- func (t *Table) ScrollToIndex(idx int)
- func (t *Table) ScrollTop()
- func (t *Table) ScrollUp()
Constants ¶
const ( // UpArrow is a symbol used when sorting tables UpArrow = "▲" // DownArrow is a symbol used when sorting tables DownArrow = "▼" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BarChart ¶
type BarChart struct { NumFormatter func(float64) string Labels []string BarColors []ui.Color LabelStyles []ui.Style NumStyles []ui.Style Data []float64 ui.Block BarWidth int BarGap int MaxVal float64 }
BarChart is a widget to display Bar Graphs
type CPUTableChart ¶
type CPUTableChart struct { *ui.Block Data []float64 NumCores int CellSize int TopRow int StatusColor []ui.Color NumRows int NumCols int DefaultBorderColor ui.Color // indicates default border color ActiveBorderColor ui.Color // indicates active border color }
CPUTableChart is a custom widget to display a CPU Table
func NewCPUTableChart ¶
func NewCPUTableChart() *CPUTableChart
NewCPUTableChart is a constructor for type CPUTableChart
func (*CPUTableChart) DisableCursor ¶
func (c *CPUTableChart) DisableCursor()
DisableCursor turns off the cursor and un highlights the table
func (*CPUTableChart) Draw ¶
func (c *CPUTableChart) Draw(buf *ui.Buffer)
Draw helps draw the CPU table Chart widget onto the UI buffer
func (*CPUTableChart) EnableCursor ¶
func (c *CPUTableChart) EnableCursor()
EnableCursor turns on the cursor and highlights the table
func (*CPUTableChart) ScrollBottom ¶
func (c *CPUTableChart) ScrollBottom()
ScrollBottom moves the cursor to the bottom
func (*CPUTableChart) ScrollDown ¶
func (c *CPUTableChart) ScrollDown()
ScrollDown moves the cursor one position downwards
func (*CPUTableChart) ScrollHalfPageDown ¶
func (c *CPUTableChart) ScrollHalfPageDown()
ScrollHalfPageDown moves the cursor half a page down
func (*CPUTableChart) ScrollHalfPageUp ¶
func (c *CPUTableChart) ScrollHalfPageUp()
ScrollHalfPageUp moves the cursor half a page up
func (*CPUTableChart) ScrollPageDown ¶
func (c *CPUTableChart) ScrollPageDown()
ScrollPageDown moves the cursor a page down
func (*CPUTableChart) ScrollPageUp ¶
func (c *CPUTableChart) ScrollPageUp()
ScrollPageUp moves the cursor a page up
func (*CPUTableChart) ScrollToIndex ¶
func (c *CPUTableChart) ScrollToIndex(idx int)
ScrollToIndex moves the cursor to a specified index
func (*CPUTableChart) ScrollTop ¶
func (c *CPUTableChart) ScrollTop()
ScrollTop moves the cursor to the top
func (*CPUTableChart) ScrollUp ¶
func (c *CPUTableChart) ScrollUp()
ScrollUp moves the cursor one position upwards
type HorizontalBarChart ¶
type HorizontalBarChart struct { *ui.Block BarColors []ui.Color // Custom bar colors LabelStyles []ui.Style // Styles label styles Data []float64 Labels []string MaxVal float64 BarGap int // Gap between bars BarWidth int // Width of each bar ColResizer func() // Function to resize bar }
HorizontalBarChart is a custom widget to display a horizontal bar graph
func NewHorizontalBarChart ¶
func NewHorizontalBarChart() *HorizontalBarChart
NewHorizontalBarChart is a constructor for the type HorizontalBarChart
func (*HorizontalBarChart) Draw ¶
func (h *HorizontalBarChart) Draw(buf *ui.Buffer)
Draw helps draw the Horizontal Bar Chart widget onto the UI buffer
type LineGraph ¶
type LineGraph struct { *ui.Block Data map[string][]float64 Labels map[string]string HorizontalScale int MaxVal float64 LineColors map[string]ui.Color DefaultLineColor ui.Color }
LineGraph implements a line graph of data points.
func NewLineGraph ¶
func NewLineGraph() *LineGraph
NewLineGraph creates and returns a lineGraph instance
type ScrollableWidget ¶
type ScrollableWidget interface { ScrollUp() ScrollDown() ScrollTop() ScrollBottom() ScrollHalfPageUp() ScrollHalfPageDown() ScrollPageUp() ScrollPageDown() DisableCursor() EnableCursor() }
ScrollableWidget is any widget that can have it's cursor scrolled, enabled and disabled
type Sparkline ¶
type Sparkline struct { Data []float64 Title string TitleStyle ui.Style LineColor ui.Color MaxVal float64 MaxHeight int // TODO Reverse bool }
Sparkline is like: ▅▆▂▂▅▇▂▂▃▆▆▆▅▃. The data points should be non-negative integers.
func NewSparkline ¶
func NewSparkline() *Sparkline
NewSparkline returns a unrenderable single sparkline that needs to be added to a SparklineGroup
type SparklineGroup ¶
SparklineGroup is a renderable widget which groups together the given sparklines.
func NewSparklineGroup ¶
func NewSparklineGroup(sls ...*Sparkline) *SparklineGroup
NewSparklineGroup is a constructor for the type SparklineGroup
func (*SparklineGroup) Draw ¶
func (s *SparklineGroup) Draw(buf *ui.Buffer)
Draw helps draw the Sparkline widget onto the UI buffer
type Table ¶
type Table struct { *ui.Block Header []string Rows [][]string // Different Styles for Header and Rows HeaderStyle ui.Style RowStyle ui.Style ColWidths []int ColGap int PadLeft int ShowCursor bool CursorColor ui.Color ShowLocation bool UniqueCol int // the column used to uniquely identify each table row SelectedItem string // used to keep the cursor on the correct item if the data changes SelectedRow int TopRow int // used to indicate where in the table we are scrolled at // Map that stores custom column colors ColColor map[int]ui.Color ColResizer func() IsHelp bool // indicates if table is a help widget DefaultBorderColor ui.Color // indicates default border color ActiveBorderColor ui.Color // indicates active border color }
Table is a custom table widget
func (*Table) DisableCursor ¶
func (t *Table) DisableCursor()
DisableCursor turns off the cursor and un highlights the table
func (*Table) EnableCursor ¶
func (t *Table) EnableCursor()
EnableCursor turns on the cursor and highlights the table
func (*Table) ScrollBottom ¶
func (t *Table) ScrollBottom()
ScrollBottom moves the cursor to the bottom
func (*Table) ScrollDown ¶
func (t *Table) ScrollDown()
ScrollDown moves the cursor one position downwards
func (*Table) ScrollHalfPageDown ¶
func (t *Table) ScrollHalfPageDown()
ScrollHalfPageDown moves the cursor half a page down
func (*Table) ScrollHalfPageUp ¶
func (t *Table) ScrollHalfPageUp()
ScrollHalfPageUp moves the cursor half a page up
func (*Table) ScrollPageDown ¶
func (t *Table) ScrollPageDown()
ScrollPageDown moves the cursor a page down
func (*Table) ScrollToIndex ¶
ScrollToIndex moves the cursor to a specified index