render

package
v0.2.1-0...-b772245 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GaugeWidget

type GaugeWidget interface {
	Widget
	Sync(isPercent bool, value float64) error
	SetColor(hexColor string) error
}

GaugeWidget knows how to render a Gauge kind widget that can be in percent or not and supports color changes.

type GraphWidget

type GraphWidget interface {
	Widget
	// GetGraphPointQuantity will return the number of points the graph can display
	// on the X axis at this given moment (is a best effort, when updating the graph
	// could have changed the size).
	GetGraphPointQuantity() int
	// Sync will sync the different series on the graph.
	Sync(series []Series) error
}

GraphWidget knows how to render a Graph kind widget that renders lines in a two axis space using lines, dots... depending on the render implementation.

type Renderer

type Renderer interface {
	LoadDashboard(ctx context.Context, grid *grid.Grid) ([]Widget, error)
	SetTemplater(vs map[string]variable.Variabler, override map[string]string)
	Close()
}

Renderer is the interface that knows how to load a dashboard to be rendered in some target of UI.

type Series

type Series struct {
	Label string
	Color string
	// XLabels are the labels that will be displayed on the X axis
	// the position of the label is the index of the slice.
	XLabels []string
	// Value slice, if there is no value we will use a nil value
	// we could use NaN floats but nil is more idiomatic and easy
	// to understand.
	Values []*Value
}

Series are the series that can be rendered.

type SinglestatWidget

type SinglestatWidget interface {
	Widget
	Sync(text string) error
	SetColor(hexColor string) error
}

SinglestatWidget knows how to render a Singlestat kind widget that can render text and supports changing color.

type Value

type Value float64

Value is the value of a metric.

type Widget

type Widget interface {
	GetWidgetCfg() model.Widget
}

Widget represnets a widget that can be rendered on the view.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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