Documentation ¶
Index ¶
- type BarChart
- type Button
- type Checkbox
- type DrawDirection
- type Form
- func (self *Form) Draw(buf *Buffer)
- func (self *Form) HandleKeyboard(e Event)
- func (self *Form) ScrollAmount(amount int)
- func (self *Form) ScrollDown()
- func (self *Form) ScrollUp()
- func (self *Form) SelectedNode() *FormNode
- func (self *Form) SetNodes(nodes []*FormNode)
- func (self *Form) ToggleExpand()
- func (self *Form) Walk(fn FormWalkFn)
- type FormItem
- type FormNode
- type FormWalkFn
- type Gauge
- type GaugeFillType
- type GaugeType
- type Image
- type Label
- type List
- func (self *List) Draw(buf *Buffer)
- func (self *List) ScrollAmount(amount int)
- func (self *List) ScrollBottom()
- func (self *List) ScrollDown()
- func (self *List) ScrollHalfPageDown()
- func (self *List) ScrollHalfPageUp()
- func (self *List) ScrollPageDown()
- func (self *List) ScrollPageUp()
- func (self *List) ScrollTop()
- func (self *List) ScrollUp()
- type Paragraph
- type PieChart
- type PieChartLabel
- type Plot
- type PlotMarker
- type PlotType
- type Sparkline
- type SparklineGroup
- type StackedBarChart
- type TabPane
- type Table
- type TextField
- type Tree
- func (self *Tree) Collapse()
- func (self *Tree) CollapseAll()
- func (self *Tree) Draw(buf *Buffer)
- func (self *Tree) Expand()
- func (self *Tree) ExpandAll()
- func (self *Tree) ScrollAmount(amount int)
- func (self *Tree) ScrollBottom()
- func (self *Tree) ScrollDown()
- func (self *Tree) ScrollHalfPageDown()
- func (self *Tree) ScrollHalfPageUp()
- func (self *Tree) ScrollPageDown()
- func (self *Tree) ScrollPageUp()
- func (self *Tree) ScrollTop()
- func (self *Tree) ScrollUp()
- func (self *Tree) SelectedNode() *TreeNode
- func (self *Tree) SetNodes(nodes []*TreeNode)
- func (self *Tree) ToggleExpand()
- func (self *Tree) Walk(fn TreeWalkFn)
- type TreeNode
- type TreeWalkFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BarChart ¶
type BarChart struct { Block BarColors []Color LabelStyles []Style NumStyles []Style // only Fg and Modifier are used NumFormatter func(float64) string Data []float64 Labels []string BarWidth int BarGap int MaxVal float64 }
func NewBarChart ¶
func NewBarChart() *BarChart
type Button ¶
type Button struct {
// contains filtered or unexported fields
}
Button implements item interface
type Checkbox ¶
type Checkbox struct {
// contains filtered or unexported fields
}
Checkbox implements item interface
func NewCheckbox ¶
NewCheckbox creates a new instance of Checkbox object
type Form ¶
type Form struct { Block TextStyle Style SelectedTextStyle Style WrapText bool // contains filtered or unexported fields }
Form is a form widget.
func (*Form) HandleKeyboard ¶
func (self *Form) HandleKeyboard(e Event)
HandleKeyboard handle special events that don't need to mapped by hand.
func (*Form) ScrollAmount ¶
ScrollAmount scrolls by amount given. If amount is < 0, then scroll up. There is no need to set self.topRow, as this will be set automatically when drawn, since if the selected item is off screen then the topRow variable will change accordingly.
func (*Form) ScrollDown ¶
func (self *Form) ScrollDown()
func (*Form) SelectedNode ¶
func (*Form) ToggleExpand ¶
func (self *Form) ToggleExpand()
func (*Form) Walk ¶
func (self *Form) Walk(fn FormWalkFn)
type FormNode ¶
type FormNode struct { Item FormItem Expanded bool Nodes []*FormNode // contains filtered or unexported fields }
FormNode is a form node.
type FormWalkFn ¶
FormWalkFn is a function used for walking a Form. To interrupt the walking process function should return false.
type Gauge ¶
type Gauge struct { Block Percent int BarColor Color Label string LabelStyle Style Type GaugeType FillType GaugeFillType }
type GaugeFillType ¶
type GaugeFillType int
const ( GaugeNatural GaugeFillType = iota GaugeReverse )
type Image ¶
type Label ¶
type Label struct {
// contains filtered or unexported fields
}
Label implements item interface
type List ¶
type List struct { Block Rows []string WrapText bool TextStyle Style SelectedRow int SelectedRowStyle Style // contains filtered or unexported fields }
func (*List) ScrollAmount ¶
ScrollAmount scrolls by amount given. If amount is < 0, then scroll up. There is no need to set self.topRow, as this will be set automatically when drawn, since if the selected item is off screen then the topRow variable will change accordingly.
func (*List) ScrollBottom ¶
func (self *List) ScrollBottom()
func (*List) ScrollDown ¶
func (self *List) ScrollDown()
func (*List) ScrollHalfPageDown ¶
func (self *List) ScrollHalfPageDown()
func (*List) ScrollHalfPageUp ¶
func (self *List) ScrollHalfPageUp()
func (*List) ScrollPageDown ¶
func (self *List) ScrollPageDown()
func (*List) ScrollPageUp ¶
func (self *List) ScrollPageUp()
type Paragraph ¶
func NewParagraph ¶
func NewParagraph() *Paragraph
type PieChart ¶
type PieChart struct { Block Data []float64 // list of data items Colors []Color // colors to by cycled through LabelFormatter PieChartLabel // callback function for labels AngleOffset float64 // which angle to start drawing at? (see piechartOffsetUp) }
func NewPieChart ¶
func NewPieChart() *PieChart
NewPieChart Creates a new pie chart with reasonable defaults and no labels.
type PieChartLabel ¶
PieChartLabel callback
type Plot ¶
type Plot struct { Block Data [][]float64 DataLabels []string MaxVal float64 LineColors []Color AxesColor Color // TODO ShowAxes bool Marker PlotMarker DotMarkerRune rune PlotType PlotType HorizontalScale int DrawDirection DrawDirection // TODO }
Plot has two modes: line(default) and scatter. Plot also has two marker types: braille(default) and dot. A single braille character is a 2x4 grid of dots, so using braille gives 2x X resolution and 4x Y resolution over dot mode.
type Sparkline ¶
type Sparkline struct { Data []float64 Title string TitleStyle Style LineColor Color MaxVal float64 MaxHeight int // TODO }
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 ¶
type SparklineGroup struct { Block Sparklines []*Sparkline }
SparklineGroup is a renderable widget which groups together the given sparklines.
func NewSparklineGroup ¶
func NewSparklineGroup(sls ...*Sparkline) *SparklineGroup
func (*SparklineGroup) Draw ¶
func (self *SparklineGroup) Draw(buf *Buffer)
type StackedBarChart ¶
type StackedBarChart struct { Block BarColors []Color LabelStyles []Style NumStyles []Style // only Fg and Modifier are used NumFormatter func(float64) string Data [][]float64 Labels []string BarWidth int BarGap int MaxVal float64 }
func NewStackedBarChart ¶
func NewStackedBarChart() *StackedBarChart
func (*StackedBarChart) Draw ¶
func (self *StackedBarChart) Draw(buf *Buffer)
type TabPane ¶
type TabPane struct { Block TabNames []string ActiveTabIndex int ActiveTabStyle Style InactiveTabStyle Style }
TabPane is a renderable widget which can be used to conditionally render certain tabs/views. TabPane shows a list of Tab names. The currently selected tab can be found through the `ActiveTabIndex` field.
func NewTabPane ¶
func (*TabPane) FocusRight ¶
func (self *TabPane) FocusRight()
type Table ¶
type Table struct { Block Rows [][]string ColumnWidths []int TextStyle Style RowSeparator bool TextAlignment Alignment RowStyles map[int]Style FillRow bool // ColumnResizer is called on each Draw. Can be used for custom column sizing. ColumnResizer func() }
Table is like: ┌ Awesome Table ───────────────────────────────────────────────┐ │ Col0 | Col1 | Col2 | Col3 | Col4 | Col5 | Col6 | │──────────────────────────────────────────────────────────────│ │ Some Item #1 | AAA | 123 | CCCCC | EEEEE | GGGGG | IIIII | │──────────────────────────────────────────────────────────────│ │ Some Item #2 | BBB | 456 | DDDDD | FFFFF | HHHHH | JJJJJ | └──────────────────────────────────────────────────────────────┘
type TextField ¶
type TextField struct {
// contains filtered or unexported fields
}
TextField implements item interface
func NewTextField ¶
NewTextField creates a new instance of TextField object
type Tree ¶
type Tree struct { Block TextStyle Style SelectedRowStyle Style WrapText bool // contains filtered or unexported fields }
Tree is a tree widget.
func (*Tree) CollapseAll ¶
func (self *Tree) CollapseAll()
func (*Tree) ScrollAmount ¶
ScrollAmount scrolls by amount given. If amount is < 0, then scroll up. There is no need to set self.topRow, as this will be set automatically when drawn, since if the selected item is off screen then the topRow variable will change accordingly.
func (*Tree) ScrollBottom ¶
func (self *Tree) ScrollBottom()
func (*Tree) ScrollDown ¶
func (self *Tree) ScrollDown()
func (*Tree) ScrollHalfPageDown ¶
func (self *Tree) ScrollHalfPageDown()
func (*Tree) ScrollHalfPageUp ¶
func (self *Tree) ScrollHalfPageUp()
func (*Tree) ScrollPageDown ¶
func (self *Tree) ScrollPageDown()
func (*Tree) ScrollPageUp ¶
func (self *Tree) ScrollPageUp()
func (*Tree) SelectedNode ¶
func (*Tree) ToggleExpand ¶
func (self *Tree) ToggleExpand()
func (*Tree) Walk ¶
func (self *Tree) Walk(fn TreeWalkFn)
type TreeNode ¶
type TreeNode struct { Value fmt.Stringer Expanded bool Nodes []*TreeNode // contains filtered or unexported fields }
TreeNode is a tree node.
type TreeWalkFn ¶
TreeWalkFn is a function used for walking a Tree. To interrupt the walking process function should return false.