Documentation ¶
Overview ¶
Package heatmap contains a widget that displays heat maps.
Index ¶
- type HeatMap
- func (hp *HeatMap) ClearXLabels()
- func (hp *HeatMap) ClearYLabels()
- func (hp *HeatMap) Draw(cvs *canvas.Canvas, meta *widgetapi.Meta) error
- func (*HeatMap) Keyboard(k *terminalapi.Keyboard, meta *widgetapi.EventMeta) error
- func (*HeatMap) Mouse(m *terminalapi.Mouse, meta *widgetapi.EventMeta) error
- func (hp *HeatMap) Options() widgetapi.Options
- func (hp *HeatMap) ValueCapacity() int
- func (hp *HeatMap) Values(xLabels []string, yLabels []string, values [][]float64, opts ...Option) error
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HeatMap ¶
type HeatMap struct {
// contains filtered or unexported fields
}
HeatMap draws heat map charts.
Heatmap consists of several cells. Each cell represents a value. The larger the value, the darker the color of the cell (from white to black).
The two dimensions of the values (cells) array are determined by the length of the xLabels and yLabels arrays respectively.
HeatMap does not support mouse based zoom.
Implements widgetapi.Widget. This object is thread-safe.
func (*HeatMap) Draw ¶
Draw draws cells, X labels and Y labels as HeatMap. Implements widgetapi.Widget.Draw.
func (*HeatMap) ValueCapacity ¶
ValueCapacity returns the number of values that can fit into the canvas. This is essentially the number of available cells on the canvas as observed on the last call to draw. Returns zero if draw wasn't called.
Note that this capacity changes each time the terminal resizes, so there is no guarantee this remains the same next time Draw is called. Should be used as a hint only.
func (*HeatMap) Values ¶
func (hp *HeatMap) Values(xLabels []string, yLabels []string, values [][]float64, opts ...Option) error
Values sets the values to be displayed by the HeatMap.
Each value in values has a xLabel and a yLabel, which means len(yLabels) == len(values) and len(xLabels) == len(values[i]). But labels could be empty strings. When no labels are provided, labels will be "0", "1", "2"...
Each call to Values overwrites any previously provided values. Provided options override values set when New() was called.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is used to provide options.
func CellWidth ¶
CellWidth set the width of cells (or grids) in the heat map, not the terminal cell. The default height of each cell (grid) is 1 and the width is 3.
func XLabelCellOpts ¶
XLabelCellOpts set the cell options for the labels on the X axis.
func YLabelCellOpts ¶
YLabelCellOpts set the cell options for the labels on the Y axis.
Directories ¶
Path | Synopsis |
---|---|
Binary heatmapdemo displays a heatmap widget.
|
Binary heatmapdemo displays a heatmap widget. |
internal
|
|
axes
Package axes calculates the required layout and draws the X and Y axes of a heat map.
|
Package axes calculates the required layout and draws the X and Y axes of a heat map. |