Documentation ¶
Index ¶
- func RegisterTheme(th *Theme) bool
- type AnyColumn
- type AnyLayer
- type AxisOption
- type Column
- func (c Column[T]) All(d *Dataset) iter.Seq[T]
- func (c Column[T]) Delete(d *Dataset)
- func (c Column[T]) Get(d *Dataset, row int) T
- func (c Column[T]) In(d *Dataset) bool
- func (c Column[T]) Name() string
- func (c Column[T]) Set(d *Dataset, row int, value T)
- func (c Column[T]) String() string
- func (c Column[T]) Valid() bool
- type Dataset
- func (d *Dataset) AddColumn(c AnyColumn) bool
- func (d *Dataset) ColumnNames() iter.Seq[string]
- func (d *Dataset) Columns() int
- func (d *Dataset) Filter(f Filter) iter.Seq[int]
- func (d *Dataset) Grow(n int) iter.Seq[int]
- func (d *Dataset) ParseFloat(c Column[string]) (Column[float64], error)
- func (d *Dataset) ParseInt(c Column[string]) (Column[int64], error)
- func (d *Dataset) ParseUint(c Column[string]) (Column[uint64], error)
- func (d *Dataset) Print(w io.Writer) error
- func (d *Dataset) Rows() int
- type Filter
- func And(f ...Filter) Filter
- func EqualTo[T comparable](c Column[T], value T) Filter
- func FilterBy[T any](c Column[T], f func(T) bool) Filter
- func GreaterThan[T cmp.Ordered](c Column[T], value T) Filter
- func GreaterThanOrEqualTo[T cmp.Ordered](c Column[T], value T) Filter
- func In[T comparable](c Column[T], values ...T) Filter
- func LessThan[T cmp.Ordered](c Column[T], value T) Filter
- func LessThanOrEqualTo[T cmp.Ordered](c Column[T], value T) Filter
- func Matches(c Column[string], r *regexp.Regexp) Filter
- func Not(f Filter) Filter
- func NotEqualTo[T comparable](c Column[T], value T) Filter
- func Or(f ...Filter) Filter
- type Geom
- type Layer
- type Mapping
- func Constant[O comparable](value O) Mapping[O]
- func Identity[T comparable](col Column[T]) Mapping[T]
- func NiceColors[I comparable](col Column[I]) Mapping[color.Color]
- func PaletteColor(i uint64) Mapping[color.Color]
- func Scale[I, O comparable](col Column[I], f func(I) O) Mapping[O]
- func ScaleLinear[I, O Scalar](col Column[I], i0, i1 I, o0, o1 O) Mapping[O]
- func ScaleOrdinal[I, O comparable](col Column[I], i []I, o []O, alt O) Mapping[O]
- type Plot
- type PresentationOption
- type Scalar
- type Statistic
- type Theme
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterTheme ¶
Types ¶
type AnyColumn ¶
type AnyColumn interface { Name() string // contains filtered or unexported methods }
AnyColumn is a way to refer to Column[T] for all T.
type AxisOption ¶
type AxisOption func(*axis)
func Limits ¶
func Limits(min, max float64) AxisOption
func LogScale ¶
func LogScale(base int) AxisOption
func Ticks ¶
func Ticks(ticks ...float64) AxisOption
type Column ¶
type Column[T any] struct { // contains filtered or unexported fields }
Column represents a column of uniformly-typed values in a particular Dataset.
func ConvertFunc ¶
ConvertFunc converts a column of type T to a column of type S in the dataset and returns the new column. Returns an error if any conv call returns an error.
func NewColumn ¶
NewColumn returns a new column with the provided name that may be used to access and mutate a dataset.
type Dataset ¶
type Dataset struct {
// contains filtered or unexported fields
}
Dataset represents some data. The data are structured as a series of rows with uniformly-typed columns.
func (*Dataset) AddColumn ¶
AddColumn adds a new column to the dataset's structure. If the dataset already has rows, the column's data will be zero-initialized.
func (*Dataset) ColumnNames ¶
ColumnNames returns an iterator over the names of columns in the dataset.
func (*Dataset) Filter ¶
Filter returns an iterator over all rows that are accepted by the provided filter.
func (*Dataset) Grow ¶
Grow adds new rows to the dataset and returns an iterator producing those new rows. Returns an iterator over the new row indices.
func (*Dataset) ParseFloat ¶
type Filter ¶
func EqualTo ¶
func EqualTo[T comparable](c Column[T], value T) Filter
func In ¶
func In[T comparable](c Column[T], values ...T) Filter
func NotEqualTo ¶
func NotEqualTo[T comparable](c Column[T], value T) Filter
type Geom ¶
type Geom struct {
// contains filtered or unexported fields
}
func (*Geom) Dimensions ¶
type Mapping ¶
type Mapping[O comparable] struct { // contains filtered or unexported fields }
func Constant ¶
func Constant[O comparable](value O) Mapping[O]
func Identity ¶
func Identity[T comparable](col Column[T]) Mapping[T]
func NiceColors ¶
func NiceColors[I comparable](col Column[I]) Mapping[color.Color]
func Scale ¶
func Scale[I, O comparable](col Column[I], f func(I) O) Mapping[O]
func ScaleLinear ¶
func ScaleOrdinal ¶
func ScaleOrdinal[I, O comparable](col Column[I], i []I, o []O, alt O) Mapping[O]
type Plot ¶
type Plot struct {
// contains filtered or unexported fields
}
func LinePlot ¶
func LinePlot[X, Y Scalar, S comparable](d *Dataset, x Column[X], y Column[Y], series Column[S]) *Plot
LinePlot is a helper to create a simple line plot where the values of the series column determine how to group the data.
func (*Plot) Presentation ¶
func (p *Plot) Presentation(opts ...PresentationOption) *Plot
type PresentationOption ¶
type PresentationOption func(*presentOpts)
func Title ¶
func Title(title string) PresentationOption
func XAxis ¶
func XAxis(title string, aOpts ...AxisOption) PresentationOption
func YAxis ¶
func YAxis(title string, aOpts ...AxisOption) PresentationOption
type Statistic ¶
type Statistic[T Scalar] struct { // contains filtered or unexported fields }