viz

package
v0.0.0-...-724e02d Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2017 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OrderedColors = []color.RGBA{
	{0, 0, 0, 255},
	{255, 0, 0, 255},
	{0, 200, 0, 255},
	{0, 0, 255, 255},
	{125, 0, 0, 255},
	{0, 125, 0, 255},
	{0, 0, 125, 255},
	{125, 125, 0, 255},
	{125, 0, 125, 255},
	{0, 125, 125, 255},
	{125, 125, 125, 255},
	{255, 125, 0, 255},
	{0, 125, 255, 255},
	{0, 0, 0, 255},
	{200, 200, 200, 255},
	{255, 0, 0, 255},
	{0, 200, 0, 255},
	{0, 0, 255, 255},
	{125, 0, 0, 255},
	{0, 125, 0, 255},
	{0, 0, 125, 255},
	{125, 125, 0, 255},
	{125, 0, 125, 255},
	{0, 125, 125, 255},
	{125, 125, 125, 255},
	{200, 200, 200, 255},
	{255, 125, 0, 255},
	{0, 125, 255, 255},
}

Functions

func NewEntryPairsHistogram

func NewEntryPairsHistogram(pairs EntryPairs, n int) *plotter.Histogram

NewEntryPairsHistogram plots a Historam (using n bins) of the durations in the passed in EntryPairs The weight (i.e. height) of each bin is simply the number of pairs in the bin. The minimum and maximum bins are computed from the minimum/maximum duration in the EntryPairs collection

func NewScaledEntryPairsHistogram

func NewScaledEntryPairsHistogram(pairs EntryPairs, n int, min time.Duration, max time.Duration) *plotter.Histogram

NewScaledEntyrPairsHistogram allows you to specify the minimum and maximum bounds of the Histogram. This is useful to compare different EntryPairs on equal footing.

Types

type Board

type Board struct {
	SubPlots []*SubPlot
}

Board represents a collection of SubPlots

func (*Board) AddSubPlot

func (b *Board) AddSubPlot(plot *plot.Plot, rect Rect)

AddSubPlot adds a plotinum plot as a SubPlot on the board.

Rect represents the rectangle the SubPlot will occupy -- the entire board has width 1.0 and height 1.0 and the rectangle (called a unit rectangle) should consume some fraction of this space.

func (*Board) Save

func (b *Board) Save(width, height float64, file string) (err error)

Save saves the board (i.e. all subplots, appropriately laid out) to the specified filename. It basically rips off the implementation of Save in plotinum to support various file formats.

type LineThumbnailer

type LineThumbnailer struct {
	draw.LineStyle
}

func (*LineThumbnailer) Thumbnail

func (l *LineThumbnailer) Thumbnail(c *draw.Canvas)

type Rect

type Rect struct {
	X, Y, Width, Height float64
}

Rect represents a rectangle

type SubPlot

type SubPlot struct {
	Plot *plot.Plot
	Rect Rect
}

SubPlot represents a plotinum plot placed within a particular unit rectangle

func (SubPlot) ScaledRect

func (sp SubPlot) ScaledRect(width, height float64) draw.Rectangle

ScaledRect returns a plotinum Rectangle, appropriately scaled to match the SubPlot's unit rectangle

type TimelinesPlotter

type TimelinesPlotter struct {
	Timelines  Timelines
	MinSeconds float64
	MaxSeconds float64
	Padding    float64
}

TimelinesPlotter plots a stack of Timelines in the specified time range

func NewTimelinesPlotter

func NewTimelinesPlotter(timelines Timelines, minSeconds float64, maxSeconds float64) *TimelinesPlotter

func (*TimelinesPlotter) DataRange

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

func (*TimelinesPlotter) Plot

func (t *TimelinesPlotter) Plot(da draw.Canvas, p *plot.Plot)

type UniformBoard

type UniformBoard struct {
	Board
	Horizontal int
	Vertical   int
	Padding    float64
	// contains filtered or unexported fields
}

UniformBoard is a Board that can automatically place a grid of subplots

func NewCorrelationBoard

func NewCorrelationBoard(timelines Timelines) (*UniformBoard, error)

Constructs and returns a correlation board between all possible entry pairs

func NewEntryPairsHistogramBoard

func NewEntryPairsHistogramBoard(timelines Timelines) *UniformBoard

func NewGroupedCorrelationBoard

func NewGroupedCorrelationBoard(group *GroupedTimelines) (*UniformBoard, error)

Constructs and returns a correlation board between all possible entry pairs

func NewGroupedTimelineEntryPairsHistogramBoard

func NewGroupedTimelineEntryPairsHistogramBoard(group *GroupedTimelines) *UniformBoard

func NewUniformBoard

func NewUniformBoard(horizontal int, vertical int, padding float64) *UniformBoard

NewUniformBoard returns a UniformBoard ready to accept horizontalxvertical subplots

func (*UniformBoard) AddNextSubPlot

func (b *UniformBoard) AddNextSubPlot(plot *plot.Plot)

AddNextSubPlot populates the next available subplot in the UniformBoard with the passed-in plot

func (*UniformBoard) AddSubPlotAt

func (b *UniformBoard) AddSubPlotAt(plot *plot.Plot, i int, j int) error

AddSubPlotAt adds the passed in plotinum subplot to the UniformBoard. The subplot is ith subplot across, and the jth plot up.

Jump to

Keyboard shortcuts

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