ChartKind.name
property · packages/mixins-ui/src/chart/kind.ts:51
readonly name: stringWritten as data-kind on the chart's root and plot, for the recipe.
Mixins / foldkit-mixins-ui
interface · packages/mixins-ui/src/chart/kind.ts:49
interface ChartKind<Data> {
readonly name: string
readonly alwaysLegend?: boolean
readonly entries: (data: Data) => ReadonlyArray<ChartEntry>
readonly points: (data: Data) => ReadonlyArray<ChartPoint>
readonly head: (data: Data) => ReadonlyArray<string>
readonly draw: <Message>(
data: Data,
frame: ChartFrame<Message>,
) => ReadonlyArray<Html>
}A kind of chart: Chart.bars, Chart.line, Chart.area and Chart.donut
are values of it, and one of your own is an object with these four readers
and a draw. The chart draws the title, the status line and the data table
from entries, points and head, so a kind needs to draw only the plot.
Data is the options the kind reads beside the chart's own.
ChartKind.nameproperty · packages/mixins-ui/src/chart/kind.ts:51
readonly name: stringWritten as data-kind on the chart's root and plot, for the recipe.
ChartKind.alwaysLegendproperty · packages/mixins-ui/src/chart/kind.ts:53
readonly alwaysLegend?: booleanShows the legend even for one entry (a donut's parts); default only from two.
ChartKind.entriesproperty · packages/mixins-ui/src/chart/kind.ts:55
readonly entries: (data: Data) => ReadonlyArray<ChartEntry>The legend's entries: series, or slices.
ChartKind.pointsproperty · packages/mixins-ui/src/chart/kind.ts:57
readonly points: (data: Data) => ReadonlyArray<ChartPoint>One per category or slice, in order.
ChartKind.headproperty · packages/mixins-ui/src/chart/kind.ts:59
readonly head: (data: Data) => ReadonlyArray<string>The data table's column heads.
ChartKind.drawproperty · packages/mixins-ui/src/chart/kind.ts:61
readonly draw: <Message>(
data: Data,
frame: ChartFrame<Message>,
) => ReadonlyArray<Html>The elements between the chart's heading and its status line: the legend, the plot.