chart2d

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: Apache-2.0 Imports: 12 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrawBoxGlyph

func DrawBoxGlyph(cx, cy, rat float32)

func DrawCircle

func DrawCircle(cx, cy, r float32, numSegments int, rat float32)

func DrawCrossGlyph

func DrawCrossGlyph(cx, cy, rat float32)

func DrawTriangleGlyph

func DrawTriangleGlyph(cx, cy, rat float32)

func DrawXGlyph

func DrawXGlyph(cx, cy, rat float32)

func ToFloat32Slice added in v0.0.2

func ToFloat32Slice(A []float64) (R []float32)

Types

type Chart2D

type Chart2D struct {
	Sc       *Screen
	RmX, RmY *RangeMap
	// contains filtered or unexported fields
}

func NewChart2D

func NewChart2D(w, h int, xmin, xmax, ymin, ymax float32, chanDepth ...int) (cc *Chart2D)

func (*Chart2D) AddColorMap added in v0.0.5

func (cc *Chart2D) AddColorMap(cm *utils.ColorMap)

func (*Chart2D) AddFunctionSurface added in v0.0.6

func (cc *Chart2D) AddFunctionSurface(name string, fs functions.FSurface, lineType LineType, lineColor color.RGBA) (err error)

func (*Chart2D) AddSeries

func (cc *Chart2D) AddSeries(name string, xI, fI interface{}, gl GlyphType, lt LineType, co color.RGBA) (err error)

func (*Chart2D) AddTriMesh added in v0.0.4

func (cc *Chart2D) AddTriMesh(name string, Tris graphics2D.TriMesh, gl GlyphType, lt LineType, co color.RGBA) (err error)

func (*Chart2D) AddVectors added in v0.0.5

func (cc *Chart2D) AddVectors(name string, Geom []graphics2D.Point, vectors [][2]float64, lt LineType, co color.RGBA) (err error)

func (*Chart2D) Plot

func (cc *Chart2D) Plot()

func (*Chart2D) StopPlot

func (cc *Chart2D) StopPlot()

type GlyphType

type GlyphType uint8
const (
	NoGlyph GlyphType = iota
	CircleGlyph
	XGlyph
	CrossGlyph
	StarGlyph
	BoxGlyph
	TriangleGlyph
)

type LineType

type LineType uint8
const (
	NoLine LineType = iota
	Solid
	Dashed
)

type NewDataMsg

type NewDataMsg struct {
	Name string
	Data Series
}

type RangeMap

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

func NewRangeMap

func NewRangeMap(xMin, xMax float32, pMin, pMax float32) *RangeMap

func (*RangeMap) GetMappedCoordinate

func (rg *RangeMap) GetMappedCoordinate(x float32) (p float32)

type Screen

type Screen struct {
	Width, Height int
	Ratio         float32
}

func NewScreen

func NewScreen(w, h int) *Screen

func (*Screen) GetRatio

func (sc *Screen) GetRatio() (rat float32)

type Series

type Series struct {
	Xdata   []float32
	Ydata   []float32
	TriMesh *graphics2D.TriMesh
	Surface *functions.FSurface
	Vectors [][2]float64
	Gl      GlyphType
	Lt      LineType
	Co      *color.RGBA
}

Jump to

Keyboard shortcuts

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