Documentation ¶
Index ¶
- func Cast[Input, Output any](ctx context.Context, input Input) (Output, error)
- func CastMany[Input, Output any](ctx context.Context, inputs ...Input) ([]Output, error)
- func CastManyMerged[Input, Output any](ctx context.Context, inputs ...[]Input) ([]Output, error)
- func CurrentTimestamp(_ context.Context) (time.Time, error)
- func CutoffEpsilon[A MathScalars](_ context.Context, delta A, old, new A) (output bool, err error)
- func CutoffExpression[Input any](expression string) func(context.Context, Input, Input) (bool, error)
- func CutoffUnchanged[A comparable](_ context.Context, old, new A) (bool, error)
- func Expression[Input, Output any](expression string) func(context.Context, *incrutil.Inputs[Input]) (Output, error)
- func FetchCSV(ctx context.Context, url string) (*types.Table, error)
- func FetchJSON(ctx context.Context, url, method, body string) (any, error)
- func FilterTableExpression(expression string) ...
- func First[T any](ctx context.Context, inputs *incrutil.Inputs[T]) (output T, err error)
- func FirstMany[T any](ctx context.Context, inputs *incrutil.Inputs[[]T]) (output T, err error)
- func Last[T any](ctx context.Context, inputs *incrutil.Inputs[T]) (output T, err error)
- func LastMany[T any](_ context.Context, inputs *incrutil.Inputs[[]T]) (output T, err error)
- func Length[T any](ctx context.Context, input T) (int64, error)
- func LengthAny(input any) int
- func LengthMany[T any](ctx context.Context, input ...T) (output int64, err error)
- func Max[T cmp.Ordered](ctx context.Context, inputValues *incrutil.Inputs[T]) (output T, _ error)
- func MaxMany[T cmp.Ordered](ctx context.Context, inputValues *incrutil.Inputs[[]T]) (output T, _ error)
- func Mean[A MathScalars](ctx context.Context, inputValues *incrutil.Inputs[A]) (output A, _ error)
- func MeanMany[A MathScalars](ctx context.Context, inputValues *incrutil.Inputs[[]A]) (output A, _ error)
- func Median[A MathScalars](ctx context.Context, inputValues *incrutil.Inputs[A]) (output A, _ error)
- func MedianMany[A MathScalars](ctx context.Context, inputValues *incrutil.Inputs[[]A]) (output A, _ error)
- func Merge[T any](ctx context.Context, inputValues *incrutil.Inputs[T]) ([]T, error)
- func MergeMany[T any](ctx context.Context, inputValues *incrutil.Inputs[[]T]) ([]T, error)
- func Min[T cmp.Ordered](ctx context.Context, inputValues *incrutil.Inputs[T]) (output T, _ error)
- func MinMany[T cmp.Ordered](ctx context.Context, inputValues *incrutil.Inputs[[]T]) (output T, _ error)
- func Percentile(percent float64) func(context.Context, *incrutil.Inputs[[]float64]) (float64, error)
- func PercentileSorted(percent float64) func(context.Context, *incrutil.Inputs[[]float64]) (float64, error)
- func ReadCSV(ctx context.Context, filepath string, modTime time.Time) (output *types.Table, err error)
- func ReadFile[Output any](ctx context.Context, filepath string, modTime time.Time) (output Output, err error)
- func ReadFileAny(_ context.Context, filepath string, output any) error
- func ReadParquet(ctx context.Context, filepath string, modtime time.Time) (output *types.Table, err error)
- func Reverse[T any](ctx context.Context, inputValues *incrutil.Inputs[T]) ([]T, error)
- func ReverseMany[T any](ctx context.Context, inputValues *incrutil.Inputs[[]T]) ([]T, error)
- func ScatterChart(config ChartConfig) func(context.Context, []float64, []float64) (types.SVG, error)
- func Sort[T cmp.Ordered](ctx context.Context, inputValues *incrutil.Inputs[T]) ([]T, error)
- func SortComparer[T any](comparers ...iter.SorterComparer[T]) func(context.Context, *incrutil.Inputs[T]) ([]T, error)
- func SortComparerMany[T any](comparers ...iter.SorterComparer[T]) func(context.Context, *incrutil.Inputs[[]T]) ([]T, error)
- func SortMany[T cmp.Ordered](ctx context.Context, inputValues *incrutil.Inputs[[]T]) ([]T, error)
- func StatFile(_ context.Context, filepath string) (time.Time, error)
- func Sum[T cmp.Ordered](ctx context.Context, inputValues *incrutil.Inputs[T]) (output T, _ error)
- func SumMany[T cmp.Ordered](ctx context.Context, inputValues *incrutil.Inputs[[]T]) (output T, _ error)
- func TableColumn[Output any](_ context.Context, columnIndex int64, input *types.Table) (output Output, err error)
- func TimeseriesChart(config ChartConfig) func(context.Context, []time.Time, []float64) (types.SVG, error)
- func TimestampAsc(t0, t1 time.Time) int
- func Zero[T any]() (output T)
- type ChartConfig
- func (cc ChartConfig) ApplyChart(target *chart.Chart)
- func (cc ChartConfig) ApplyChartThumbnail(target *chart.Chart)
- func (cc ChartConfig) ApplyPrimaryContinuousSeries(primarySeries *chart.ContinuousSeries)
- func (cc ChartConfig) ApplyPrimaryTimeSeries(primarySeries *chart.TimeSeries)
- func (cc ChartConfig) ApplyRegressionSeries(regressionSeries *chart.LinearRegressionSeries)
- type MathScalars
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CastManyMerged ¶
func CurrentTimestamp ¶
CurrentTimestamp returns the current timestamp.
func CutoffEpsilon ¶
func CutoffEpsilon[A MathScalars](_ context.Context, delta A, old, new A) (output bool, err error)
CutoffEpsilon is a simple cutoff check that does a strict comparison
func CutoffExpression ¶
func CutoffUnchanged ¶
func CutoffUnchanged[A comparable](_ context.Context, old, new A) (bool, error)
CutoffUnchanged is a simple cutoff check that does a strict comparison
func Expression ¶
func Expression[Input, Output any](expression string) func(context.Context, *incrutil.Inputs[Input]) (Output, error)
Expression returns a function that evaluates a given expression.
func FilterTableExpression ¶
func FilterTableExpression(expression string) func(context.Context, *types.Table, *incrutil.Inputs[any]) (*types.Table, error)
FilterTableExpression applies a predicate to a table on a row by row basis.
func MedianMany ¶
func Percentile ¶
func PercentileSorted ¶
func ReadCSV ¶
func ReadCSV(ctx context.Context, filepath string, modTime time.Time) (output *types.Table, err error)
ReadCSV reads a csv from a given file input and returns a table.
The table values initially will be string.
func ReadParquet ¶
func ReverseMany ¶
func ScatterChart ¶
func ScatterChart(config ChartConfig) func(context.Context, []float64, []float64) (types.SVG, error)
ScatterChart renders a chart to svg.
func SortComparer ¶
func SortComparerMany ¶
func TableColumn ¶
func TableColumn[Output any](_ context.Context, columnIndex int64, input *types.Table) (output Output, err error)
TableColumn selects the values from a given column by index.
func TimeseriesChart ¶
func TimeseriesChart(config ChartConfig) func(context.Context, []time.Time, []float64) (types.SVG, error)
TimeseriesChart renders a chart to svg.
func TimestampAsc ¶
Types ¶
type ChartConfig ¶
type ChartConfig struct { Height int `json:"height"` Width int `json:"width"` CanvasColor string `json:"canvas_color"` BackgroundColor string `json:"background_color"` SeriesFillColor string `json:"series_fill_color"` SeriesStrokeColor string `json:"series_stroke_color"` RegressionStrokeColor string `json:"regression_stroke_color"` RegressionFillColor string `json:"regression_fill_color"` HideAxisLabels bool `json:"hide_axis_labels"` HideSeries bool `json:"hide_series"` HideSeriesLastValue bool `json:"hide_series_last_value"` HideRegression bool `json:"hide_regression"` HideRegressionLastValue bool `json:"hide_regression_last_value"` }
ChartConfig is a set of configurable options for charts.
func ParseChartConfig ¶
func ParseChartConfig(expression string) (output ChartConfig)
ParseChartConfig parses a chart config from an expression.
func (ChartConfig) ApplyChart ¶
func (cc ChartConfig) ApplyChart(target *chart.Chart)
ApplyChart applies the chart config to the chart itself.
func (ChartConfig) ApplyChartThumbnail ¶
func (cc ChartConfig) ApplyChartThumbnail(target *chart.Chart)
ApplyChartThumbnail applies the chart config to the chart itself.
func (ChartConfig) ApplyPrimaryContinuousSeries ¶
func (cc ChartConfig) ApplyPrimaryContinuousSeries(primarySeries *chart.ContinuousSeries)
ApplyPrimaryContinuousSeries applies the chart config to the primary series.
func (ChartConfig) ApplyPrimaryTimeSeries ¶
func (cc ChartConfig) ApplyPrimaryTimeSeries(primarySeries *chart.TimeSeries)
ApplyPrimarySeries applies the chart config to the primary series.
func (ChartConfig) ApplyRegressionSeries ¶
func (cc ChartConfig) ApplyRegressionSeries(regressionSeries *chart.LinearRegressionSeries)
ApplyRegressionSeries applies the chart config to the primary series.
Source Files ¶
- cast.go
- chart_utils.go
- current_timestamp.go
- cutoff.go
- cutoff_expression.go
- expression.go
- expression_utils.go
- fetch_csv.go
- fetch_json.go
- fetch_utils.go
- filter_table_expression.go
- index.go
- length.go
- math_scalars.go
- merge.go
- min_max.go
- read_csv.go
- read_file.go
- read_parquet.go
- reverse.go
- scatter_chart.go
- sort.go
- stat_file.go
- stats.go
- sum.go
- table_column.go
- timeseries_chart.go
- zero.go