graph library

The graph prototype: a JSON-described, interactive graph (panes of marks over a shared, user-driven x viewport) drawn by a fork of graphic.

Classes

CodelesslyGraph
GraphBandSpec
A stretch of the x scale with a name: a trading session. A line mark can break at its edges and dim outside the one in use, and a price line can be drawn band by band.
GraphCrosshairSpec
The crosshair: a line through the row under the pointer and one at its price, tagged on both axes.
GraphCursor
The row and price under the pointer.
GraphEngine
GraphGuideSpec
Something drawn on a pane at a place of its scales, over the marks: a line up the pane (x alone), a line across it (y alone), a dot (x and y) or a tinted stretch of the x scale (from to to). On a linear x scale a place is a value; on rows, a row's key.
GraphHit
What is under a point: a row, and with a selection by mark the one bar or slice of it.
GraphInteractionsSpec
What each gesture does: a table of flags, never a callback.
GraphLegendKey
One key of a legend: a color, what it is called and (a slice's) its share, and where it is drawn.
GraphLegendLayout
A legend laid out: where it is, its keys, and the room it takes from the panes.
GraphLegendSpec
The legend: a key for each named mark (its color and its name), or in a polar pane for each slice (its color, its label and its share).
GraphMarkerSpec
A lettered badge at the foot of a pane, on the row with key at (an earnings date, a dividend).
GraphMarkSpec
What a mark draws: candle (open, high, low, close), line and area (y), bar (y, from zero).
GraphPaneSpec
One pane: marks over the shared x scale, on a y scale of its own.
GraphPriceLineSpec
A horizontal line at a price, tagged on the axis: a fixed value, or the last row's field (the last price).
GraphSelectionSpec
The selection: the row (or the one bar or slice) under the pointer, or pinned by a tap. The graph draws it apart from the rest and says what it holds in a tooltip; a page reads it as state (selection).
GraphSlice
A slice of an arc mark: where it starts and how far it turns (radians, clockwise from the top), without the gap beside it.
GraphSpec
A graph.
GraphStyleSpec
GraphTick
A tick an axis is told to have: a value, and what is written at it (its own number when no label is given). Written 12 or {value, label}.
GraphTransformSpec
A field worked out from the rows before them: sma, ema, rsi (written to as) and bollinger (to [as]Mid, [as]Upper, [as]Lower).
GraphViewport
GraphXSpec
The x scale: rows evenly spaced by position (an index scale, so closed sessions take no room), labeled from label, under a viewport.
GraphYSpec
A pane's y scale.
GraphZone
Where a point of the graph is: a pane's plot, its price axis, or the time axis.
RenderGraph

Constants

graphPalette → const List<Color>
The colors marks take in turn when neither they nor the style say: a blue, then hues that stand apart from it and from one another.

Functions

applyGraphTransforms(List<Json> rows, List<GraphTransformSpec> transforms) → List<Json>
rows with each of transforms' fields written into them, and _i, each row's position.
ema(List<double?> v, int period) → List<double?>
The exponential mean, seeded with the first period values' mean.
graphColor(Object? v, Color or) → Color
#RRGGBB or #AARRGGBB.
graphGrouped(String number) → String
A number as written, with a comma between its thousands: 1234.5 as 1,234.5.
rsi(List<double?> v, int period) → List<double?>
Wilder's relative strength index, 0 to 100.
sma(List<double?> v, int period) → List<double?>
The mean of the last period values.
stddev(List<double?> v, int period) → List<double?>
The standard deviation of the last period values.

Typedefs

Json = Map<String, Object?>