Documentation ¶
Index ¶
- Constants
- func BrailleCellMapper(row Row, col Column, size ScreenSize) int
- func DrawAxes(ticks *ScreenTicks, ...)
- func DrawBraille(graph *RenderedGraph, output func(row Row, col Column, cell rune, id SeriesId))
- type AxisCellKind
- type Cell
- type Column
- type DomainLabeler
- type DomainProjector
- type DomainTick
- type LabelInfo
- type Labeling
- type PixelPoint
- type PlatonicAxes
- type PlatonicGraph
- type Point
- type RangeLabeler
- type RangeProjector
- type RangeScale
- type RangeTick
- type RenderedGraph
- type Row
- type ScreenGraph
- type ScreenSeries
- type ScreenSize
- type ScreenTicks
- type Series
- type SeriesId
- type SeriesSet
- type SubCellMapper
- type TickScaling
Constants ¶
View Source
const NoSeries = SeriesId(0)
Variables ¶
This section is empty.
Functions ¶
func BrailleCellMapper ¶
func BrailleCellMapper(row Row, col Column, size ScreenSize) int
func DrawAxes ¶
func DrawAxes(ticks *ScreenTicks, output func(row Row, col Column, cell rune, kind AxisCellKind))
func DrawBraille ¶
func DrawBraille(graph *RenderedGraph, output func(row Row, col Column, cell rune, id SeriesId))
Types ¶
type AxisCellKind ¶
type AxisCellKind int
const ( DomainTickKind AxisCellKind = iota RangeTickKind YAxisKind XAxisKind AxisCornerKind LabelKind )
type DomainLabeler ¶
type DomainProjector ¶
DomainProjector maps a platonic domain into a screen domain. Use it to convert data points into pixels
type DomainTick ¶
type Labeling ¶
type Labeling struct { DomainLabeler RangeLabeler LineSize int }
type PixelPoint ¶
type PlatonicAxes ¶
func AutoAxes ¶
func AutoAxes() PlatonicAxes
func (PlatonicAxes) WithPreviousRange ¶
func (a PlatonicAxes) WithPreviousRange(oldAxes PlatonicAxes) PlatonicAxes
type PlatonicGraph ¶
type PlatonicGraph struct { PlatonicAxes Series SeriesSet }
func DataToPlatonicGraph ¶
func DataToPlatonicGraph(seriesSet SeriesSet, baseAxes PlatonicAxes) *PlatonicGraph
func (PlatonicGraph) ScalePlatonicToScreen ¶
func (g PlatonicGraph) ScalePlatonicToScreen(scale RangeScale, size ScreenSize) (func(int64) Column, func(float64) Row)
func (*PlatonicGraph) ToScreen ¶
func (g *PlatonicGraph) ToScreen(scale RangeScale, size ScreenSize) *ScreenGraph
type RangeLabeler ¶
type RangeProjector ¶
RangeProjector maps a platonic range into a screen range. Use it to convert data points into pixels
type RangeScale ¶
RangeScale maps a platonic range to another platonic range. Use it to do stuff like apply log scales
type RenderedGraph ¶
type RenderedGraph struct { Cells []Cell ScreenSize SubCellMapper SubCellMapper }
type ScreenGraph ¶
type ScreenGraph struct { ScreenSize Series []ScreenSeries }
func (*ScreenGraph) Render ¶
func (s *ScreenGraph) Render(subCellMapper SubCellMapper) *RenderedGraph
type ScreenSeries ¶
type ScreenSeries struct { Points []PixelPoint Id SeriesId }
type ScreenSize ¶
func BrailleCellScreenSize ¶
func BrailleCellScreenSize(termSize ScreenSize) ScreenSize
type ScreenTicks ¶
type ScreenTicks struct { DomainTicks []DomainTick RangeTicks []RangeTick InnerGraphSize ScreenSize MarginRows Row MarginCols Column LineSize int }
func EvenlySpacedTicks ¶
func EvenlySpacedTicks(graph *PlatonicGraph, outerSize ScreenSize, scale TickScaling, labels Labeling) *ScreenTicks
type Series ¶
type Series interface { Title() string // Id should be unique in a given SeriesSet, and should be consistent // across refreshes to ensure things like coloring and ordering stay // consistent. It must not be NoSeries. Id() SeriesId // Points *must* have a domain that is monotinically increasing Points() []Point }
type SeriesId ¶
type SeriesId uint16
SeriesId identifies some series. The zero value is reserved for unset.
type SubCellMapper ¶
type SubCellMapper func(row Row, col Column, size ScreenSize) int
type TickScaling ¶
type TickScaling struct { RangeScale RangeScale RangeDensity int DomainDensity int }
Click to show internal directories.
Click to hide internal directories.