plot

package
v0.0.0-...-39b93c0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ScatterCommand command.Definition

Functions

func IsSet

func IsSet(el rune, p Point) bool

IsSet returns true of point (x: 0-1, y: 0-3) is set in the Braille character provided. Returns false if the character is not Braille.

func PlotRune

func PlotRune(el *rune, p Point, shouldSet bool)

func Scaler

func Scaler(inlowx, inlowy, inhighx, inhighy float64,
	outlowx, outlowy, outhighx, outhighy int) func(x, y float64) Point

Scaler returns a scaling function translating values from the input rectange to the output rectangle.

func ScatterPlot

func ScatterPlot(tm *Map, topLeft, size Point, f *os.File)

ScatterPlot draws the data in the passed open file within the given rectangle of the given Map.

Types

type Alignment

type Alignment int

Alignment specifies the justification of drawn text.

const (
	LEFT Alignment = iota
	CENTER
	RIGHT
)

Values for text alignment in PlotText

type Map

type Map struct {
	W, H int
	// contains filtered or unexported fields
}

TextMap is a grid of characters on which to draw.

func NewMap

func NewMap(w, h int) *Map

NewMap returns a pointer to a text map of the given dimensions.

func (*Map) Plot

func (tm *Map) Plot(p Point, shouldSet bool)

Plot sets or unsets the Braille pixel at the passed point.

func (*Map) PlotText

func (tm *Map) PlotText(at Point, a Alignment, s string)

PlotText places text at the given refernece point, expanding eith to the left or right, or centered, based on the passed alignment.

func (*Map) String

func (tm *Map) String() string

type Point

type Point struct {
	X, Y int
}

Point is a location in either a Map or Braille coordinate space.

Jump to

Keyboard shortcuts

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