heatmap

package
v0.0.0-...-d30abd5 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

README

package heatmap

import "github.com/zeebo/rothko/draw/heatmap"

package heatmap provides implementations of drawing rothko heatmaps.

Usage

type Heatmap
type Heatmap struct {
}

Heatmap is a struct that draws heatmaps from provided columns.

func New
func New(opts Options) *Heatmap

New returns a new Heatmap using the given options.

func (*Heatmap) Draw
func (d *Heatmap) Draw(ctx context.Context, col draw.Column)

Draw writes the column to the canvas.

type Options
type Options struct {
	// Colors is the slice of colors to map the column data on to.
	Colors []draw.Color

	// Canvas to draw on to
	Canvas draw.Canvas

	// Map takes a value from the Data in the column, and expects it to be
	// mapped to a value in [0,1] specifying the color.
	Map func(float64) float64
}

Options are the things you can specify to control the rendering of a heatmap.

Documentation

Overview

package heatmap provides implementations of drawing rothko heatmaps.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Heatmap

type Heatmap struct {
	// contains filtered or unexported fields
}

Heatmap is a struct that draws heatmaps from provided columns.

func New

func New(opts Options) *Heatmap

New returns a new Heatmap using the given options.

func (*Heatmap) Draw

func (d *Heatmap) Draw(ctx context.Context, col draw.Column)

Draw writes the column to the canvas.

type Options

type Options struct {
	// Colors is the slice of colors to map the column data on to.
	Colors []draw.Color

	// Canvas to draw on to
	Canvas draw.Canvas

	// Map takes a value from the Data in the column, and expects it to be
	// mapped to a value in [0,1] specifying the color.
	Map func(float64) float64
}

Options are the things you can specify to control the rendering of a heatmap.

Jump to

Keyboard shortcuts

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