histogram

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BLOCKS = []string{
		" ",
		"▁",
		"▂",
		"▃",
		"▄",
		"▅",
		"▆",
		"▇",
		"█",
	}
)

Functions

func Max

func Max(v []float64) float64

func Min

func Min(v []float64) float64

Types

type HistogramSpec

type HistogramSpec struct {
	pane.BaseSpec
}

func (HistogramSpec) NewFromSpec

func (s HistogramSpec) NewFromSpec(ctx *context.ProgramContext, spec pane.PaneSpec) pane.Pane

type Model

type Model struct {

	// If true, the histogram will not sample and instead draw empty columns or truncate the data to exactly fit the width.
	TrueSize bool

	YMin *float64
	YMax *float64

	pane.Pane
	// contains filtered or unexported fields
}

func New

func New(ctx *context.ProgramContext, spec HistogramSpec) *Model

func (*Model) SetData

func (m *Model) SetData(datapoints []float64)

func (*Model) SetSize

func (m *Model) SetSize(width int, height int)

func (*Model) View

func (m *Model) View() string

type NewDataMsg

type NewDataMsg struct {
	Page          string
	PaneId        int
	GalleryPaneId int // Refers to the pane within the gallery
	Data          []float64
}

Jump to

Keyboard shortcuts

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