tlplot

package
v0.0.0-...-f2d3015 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2022 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisplayPlot

func DisplayPlot(p *plot.Plot) error

func DisplayPlotExportable

func DisplayPlotExportable(p *plot.Plot, exportDir string) error

func DisplayPlotExternal

func DisplayPlotExternal(p *plot.Plot, width, height vg.Length) (err error)

func SavePlot

func SavePlot(p *plot.Plot, width, height vg.Length, path string, format string) error

func WriteClosePlot

func WriteClosePlot(p *plot.Plot, width, height vg.Length, output io.WriteCloser, format string) (err error)

func WritePlot

func WritePlot(p *plot.Plot, width, height vg.Length, output io.Writer, format string) error

Types

type Activity

type Activity struct {
	Start float64
	End   float64
	Color color.Color
	Label string
}

type Marker

type Marker struct {
	Time  float64
	Glyph draw.GlyphStyle
	Label string
}

type PlotWidget

type PlotWidget struct {
	Plot        *plot.Plot
	SizeGrabber *SizeGrabber
	BaseX       plot.Axis
	DPI         int
	ExportDir   string
	AdjWidth    vg.Length
	AdjHeight   vg.Length

	SliderMin, SliderMax       float64 // in axis units
	IsSettingNewSlider         bool
	NewSliderA, NewSliderB     float64
	GenSliderMin, GenSliderMax float64

	Busy       bool
	Ready      chan imageAndRegion
	Image      image.Image
	DrawRegion vg.Rectangle
}

func (*PlotWidget) Export

func (p *PlotWidget) Export()

func (*PlotWidget) ForwardTransform

func (p *PlotWidget) ForwardTransform(axisX float64) (pixelX float32, ok bool)

func (*PlotWidget) GenImage

func (p *PlotWidget) GenImage(w, h vg.Length) (image.Image, vg.Rectangle)

func (*PlotWidget) GetImage

func (p *PlotWidget) GetImage(size image.Point) image.Image

func (*PlotWidget) Layout

func (p *PlotWidget) Layout(gtx layout.Context) layout.Dimensions

func (*PlotWidget) OnReady

func (p *PlotWidget) OnReady(ready imageAndRegion)

func (*PlotWidget) ReverseTransform

func (p *PlotWidget) ReverseTransform(pixelX float32) (axisX float64, ok bool)

func (*PlotWidget) ZoomOut

func (p *PlotWidget) ZoomOut()

type SizeGrabber

type SizeGrabber struct {
	Rectangle vg.Rectangle
}

func (*SizeGrabber) Plot

func (s *SizeGrabber) Plot(canvas draw.Canvas, p *plot.Plot)

type TimelinePlot

type TimelinePlot struct {
	Activities []Activity
	Markers    []Marker
	Location   float64
	Height     vg.Length
	LastX      float64
	BoxStyle   draw.LineStyle
	TextStyle  draw.TextStyle
}

func NewTimelinePlot

func NewTimelinePlot(activities []Activity, markers []Marker, loc float64, height vg.Length, lastX float64) *TimelinePlot

func (*TimelinePlot) DataRange

func (t *TimelinePlot) DataRange() (xmin, xmax, ymin, ymax float64)

func (*TimelinePlot) Plot

func (t *TimelinePlot) Plot(c draw.Canvas, plt *plot.Plot)

Jump to

Keyboard shortcuts

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