tchart

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2020 License: Apache-2.0, Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DeltaSame represents no difference.
	DeltaSame delta = iota

	// DeltaMore represents a higher value.
	DeltaMore

	// DeltaLess represents a lower value.
	DeltaLess
)

Variables

This section is empty.

Functions

func ToSegments

func ToSegments(row, col int) []int

ToSegments return path segments.

Types

type Component

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

Component represents a graphic component.

func NewComponent

func NewComponent(id string) *Component

NewComponent returns a new component.

func (*Component) GetSeriesColorNames

func (c *Component) GetSeriesColorNames() []string

GetSeriesColorNames returns series colors by name.

func (*Component) ID

func (c *Component) ID() string

ID returns the component ID.

func (*Component) InputHandler

func (c *Component) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler returns the handler for this primitive.

func (*Component) IsDial

func (c *Component) IsDial() bool

IsDial returns true if chart is a dial

func (*Component) SetBackgroundColor

func (c *Component) SetBackgroundColor(color tcell.Color)

SetBackgroundColor sets the graph bg color.

func (*Component) SetBlurFunc

func (c *Component) SetBlurFunc(handler func(key tcell.Key)) *Component

SetBlurFunc sets a callback fn when component gets out of focus.

func (*Component) SetLegend

func (c *Component) SetLegend(l string)

SetLegend sets the component legend.

func (*Component) SetSeriesColors

func (c *Component) SetSeriesColors(cc ...tcell.Color)

SetSeriesColors sets the component series colors.

type DotMatrix

type DotMatrix struct {
	// contains filtered or unexported fields
}

DotMatrix tracks a char matrix.

func NewDotMatrix

func NewDotMatrix(row, col int) DotMatrix

NewDotMatrix returns a new matrix.

func (DotMatrix) Print

func (d DotMatrix) Print(n int) Matrix

Print prints the matrix.

type Gauge

type Gauge struct {
	*Component
	// contains filtered or unexported fields
}

Gauge represents a gauge component.

func NewGauge

func NewGauge(id string) *Gauge

NewGauge returns a new gauge.

func (*Gauge) Add

func (g *Gauge) Add(m Metric)

Add adds a new metric.

func (*Gauge) Draw

func (g *Gauge) Draw(sc tcell.Screen)

Draw draws the primitive.

func (*Gauge) IsDial

func (g *Gauge) IsDial() bool

IsDial returns true if chart is a dial

type Matrix

type Matrix [][]rune

Matrix represents a number dial.

type Metric

type Metric struct {
	OK, Fault int
}

Metric tracks a good and error rates.

func (Metric) MaxDigits

func (m Metric) MaxDigits() int

MaxDigits returns the max of the metric.

func (Metric) Sum

func (m Metric) Sum() int

Sum returns the sum of the metrics.

type Orientation

type Orientation int

Orientation tracks char orientations.

type Segment

type Segment []int

Segment represents a dial segment.

func (Segment) CharFor

func (s Segment) CharFor(row, col int) rune

CharFor return a char based on row/col.

type Segments

type Segments []Segment

Segments represents a collection of segments.

type SparkLine

type SparkLine struct {
	*Component
	// contains filtered or unexported fields
}

SparkLine represents a sparkline component.

func NewSparkLine

func NewSparkLine(id string) *SparkLine

NewSparkLine returns a new graph.

func (*SparkLine) Add

func (s *SparkLine) Add(m Metric)

Add adds a metric.

func (*SparkLine) Draw

func (s *SparkLine) Draw(screen tcell.Screen)

Draw draws the graph.

Jump to

Keyboard shortcuts

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