graph

package
v0.0.0-...-0583f8e Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TimeTicker

func TimeTicker(packets []packet.RocketPacket) []chart.Tick

func WithFixedRange

func WithFixedRange(min, max float64) func(*Graph)

func WithLegend

func WithLegend(styles ...chart.Style) func(*Graph)

func WithTitle

func WithTitle(title string) func(*Graph)

func WithXAxis

func WithXAxis(axisName string) func(*Graph)

func WithXTicker

func WithXTicker(ticker Ticker) func(*Graph)

func WithYAxis

func WithYAxis(axisName string) func(*Graph)

func WithYTicker

func WithYTicker(ticker Ticker) func(*Graph)

Types

type Graph

type Graph struct {
	*chart.Chart
	Renderer
	XTicker, YTicker Ticker
	// contains filtered or unexported fields
}

func New

func New(renderer Renderer, options ...func(*Graph)) *Graph

func (*Graph) Draw

func (g *Graph) Draw(gtx layout.Context) layout.Dimensions

func (*Graph) Image

func (g *Graph) Image() image.Image

func (*Graph) Tick

func (g *Graph) Tick(_ time.Duration)

type MultiSeriesAdapter

type MultiSeriesAdapter func(packet.RocketPacket) (x float64, yValues []float64)

type Renderer

type Renderer func([]packet.RocketPacket) []chart.Series

func NewMultiSeriesRenderer

func NewMultiSeriesRenderer(adapter MultiSeriesAdapter, names ...string) Renderer

func NewSimpleRenderer

func NewSimpleRenderer(adapter SimpleAdapter) Renderer

type SimpleAdapter

type SimpleAdapter func(packet.RocketPacket) (float64, float64)

type Ticker

type Ticker func([]packet.RocketPacket) []chart.Tick

Jump to

Keyboard shortcuts

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