heatmap

package
v1.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: BSD-3-Clause, MIT Imports: 10 Imported by: 0

Documentation

Overview

Package heatmap draws a svg heatmap.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFillGradient

func CreateFillGradient(svg *strings.Builder, data Legend, gradient []color.Space)

CreateFillGradient writes a gradient with the fill color.

func CreateLegend

func CreateLegend(data Legend)

CreateLegend creates a legend for a dotplot.

func CreateLegendHeader

func CreateLegendHeader(svg *strings.Builder)

CreateLegendHeader writes the opening svg tag.

func CreateLegendTitle

func CreateLegendTitle(svg *strings.Builder, title string)

CreateLegendTitle writes the legend title.

func WriteElement

func WriteElement(file afero.File) func(str string)

WriteElement writes an svg element/tag to a file.

func WriteHeader

func WriteHeader(h *Heatmap, writeString func(string))

WriteHeader writes an opening svg tag with dimensions.

func WriteLabels

func WriteLabels(h *Heatmap, writeString func(string))

WriteLabels writes column and row labels.

func WriteMarkup

func WriteMarkup(h *Heatmap, writeString func(string))

WriteMarkup writes annotations, markers and column/row headings.

Types

type Heatmap

type Heatmap struct {
	AbundanceCap float64
	Annotations  types.Annotations
	CellSize     int
	Columns      []string
	FillColor    string
	FontSize     int
	Invert       bool
	LeftMargin   int
	Markers      types.Markers
	Matrix       [][]float64
	MinAbundance float64
	NumColors    int
	PlotHeight   int
	PlotWidth    int
	Rows         []string
	SvgHeight    int
	SvgWidth     int
	TopMargin    int
	XLabel       string
	YLabel       string
}

Heatmap properties.

func Initialize

func Initialize() *Heatmap

Initialize a heatmap.

func (*Heatmap) Draw

func (h *Heatmap) Draw(filename string)

Draw a heatmap in svg format.

type Legend

type Legend struct {
	Filename  string
	NumColors int
	Settings  types.Settings
	Title     string
}

Legend settings.

Jump to

Keyboard shortcuts

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