@sophistry/charts 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +32 -2
- package/dist/3d/bar-chart3d.d.ts +55 -0
- package/dist/3d/definitions.d.ts +37 -0
- package/dist/3d/definitions.js +14 -0
- package/dist/3d/forward.d.ts +64 -0
- package/dist/3d/index.d.ts +30 -0
- package/dist/3d/index.js +1 -0
- package/dist/3d/quiver3d.d.ts +52 -0
- package/dist/3d/scatter3d.d.ts +44 -0
- package/dist/3d/stem3d.d.ts +45 -0
- package/dist/3d/surface-grid3d.d.ts +33 -0
- package/dist/3d/tri-surface3d.d.ts +45 -0
- package/dist/3d/voxels3d.d.ts +25 -0
- package/dist/3d/wireframe3d.d.ts +30 -0
- package/dist/band.d.ts +20 -0
- package/dist/bars/bar-chart.d.ts +143 -0
- package/dist/bars/bar-labels.d.ts +116 -0
- package/dist/bars/bars.d.ts +223 -0
- package/dist/bars/bullet.d.ts +157 -0
- package/dist/bars/candlestick.d.ts +97 -0
- package/dist/bars/funnel.d.ts +90 -0
- package/dist/bars/histogram.d.ts +108 -0
- package/dist/bars/index.d.ts +22 -0
- package/dist/bars/race.d.ts +28 -0
- package/dist/bars/rules.d.ts +121 -0
- package/dist/bars/shared.d.ts +41 -0
- package/dist/bars/transforms.d.ts +249 -0
- package/dist/bars/waterfall.d.ts +106 -0
- package/dist/batch.d.ts +142 -0
- package/dist/channels-_Xf-p6Lx.js +56 -0
- package/dist/chart.d.ts +87 -0
- package/dist/color-norm.d.ts +90 -0
- package/dist/context.d.ts +111 -0
- package/dist/curves/density.d.ts +125 -0
- package/dist/curves/ecdf.d.ts +72 -0
- package/dist/curves/fill-between.d.ts +100 -0
- package/dist/curves/index.d.ts +15 -0
- package/dist/curves/line-plot.d.ts +104 -0
- package/dist/curves/regression.d.ts +124 -0
- package/dist/curves/shared.d.ts +52 -0
- package/dist/curves/stack-plot.d.ts +140 -0
- package/dist/curves/stairs.d.ts +170 -0
- package/dist/data/channels.d.ts +170 -0
- package/dist/end-space.d.ts +81 -0
- package/dist/entries/definitions.d.ts +20 -0
- package/dist/entries/definitions.js +6 -0
- package/dist/frame/band-axis.d.ts +42 -0
- package/dist/frame/coords.d.ts +111 -0
- package/dist/frame/fit.d.ts +170 -0
- package/dist/frame/format.d.ts +40 -0
- package/dist/frame/guide-metrics.d.ts +36 -0
- package/dist/frame/guides.d.ts +67 -0
- package/dist/frame/keys.d.ts +96 -0
- package/dist/frame/layout.d.ts +145 -0
- package/dist/frame/registry.d.ts +31 -0
- package/dist/frame/reports.d.ts +53 -0
- package/dist/frame/secondary-axes.d.ts +73 -0
- package/dist/frame/secondary.d.ts +56 -0
- package/dist/frame/tooltip-overlay.d.ts +64 -0
- package/dist/frame/types.d.ts +658 -0
- package/dist/grids/barbs.d.ts +51 -0
- package/dist/grids/cell-rects.d.ts +37 -0
- package/dist/grids/cells.d.ts +130 -0
- package/dist/grids/contour-f.d.ts +80 -0
- package/dist/grids/contour-shared.d.ts +53 -0
- package/dist/grids/contour.d.ts +84 -0
- package/dist/grids/dendrogram.d.ts +104 -0
- package/dist/grids/heatmap.d.ts +163 -0
- package/dist/grids/hex-bin.d.ts +93 -0
- package/dist/grids/hist2d.d.ts +107 -0
- package/dist/grids/imshow.d.ts +84 -0
- package/dist/grids/index.d.ts +26 -0
- package/dist/grids/pcolormesh.d.ts +90 -0
- package/dist/grids/ramp-cells.d.ts +66 -0
- package/dist/grids/tri-contour.d.ts +120 -0
- package/dist/grids/tri-shared.d.ts +61 -0
- package/dist/grids/tripcolor.d.ts +73 -0
- package/dist/guides/colorbar.d.ts +110 -0
- package/dist/guides/index.d.ts +11 -0
- package/dist/guides/legend.d.ts +118 -0
- package/dist/guides/nodes.d.ts +13 -0
- package/dist/guides/size-legend.d.ts +233 -0
- package/dist/hierarchy/breadcrumbs.d.ts +133 -0
- package/dist/hierarchy/circle-pack.d.ts +72 -0
- package/dist/hierarchy/drill.d.ts +245 -0
- package/dist/hierarchy/frame.d.ts +67 -0
- package/dist/hierarchy/icicle.d.ts +76 -0
- package/dist/hierarchy/index.d.ts +20 -0
- package/dist/hierarchy/labels.d.ts +24 -0
- package/dist/hierarchy/mosaic.d.ts +130 -0
- package/dist/hierarchy/own-tooltip.d.ts +12 -0
- package/dist/hierarchy/props.d.ts +13 -0
- package/dist/hierarchy/sankey.d.ts +132 -0
- package/dist/hierarchy/shared.d.ts +247 -0
- package/dist/hierarchy/sunburst.d.ts +74 -0
- package/dist/hierarchy/tree.d.ts +124 -0
- package/dist/hierarchy/treemap.d.ts +76 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +5 -0
- package/dist/item-tooltip.d.ts +33 -0
- package/dist/join.d.ts +223 -0
- package/dist/math/3d/bar3d.d.ts +27 -0
- package/dist/math/3d/quiver3d.d.ts +26 -0
- package/dist/math/3d/scatter3d.d.ts +15 -0
- package/dist/math/3d/stem3d.d.ts +22 -0
- package/dist/math/3d/surfaceGrid3d.d.ts +33 -0
- package/dist/math/3d/trisurface.d.ts +11 -0
- package/dist/math/3d/voxels.d.ts +17 -0
- package/dist/math/aggregate.d.ts +68 -0
- package/dist/math/bar.d.ts +31 -0
- package/dist/math/barLabels.d.ts +83 -0
- package/dist/math/barbs.d.ts +36 -0
- package/dist/math/boxplot.d.ts +36 -0
- package/dist/math/breadcrumbs.d.ts +128 -0
- package/dist/math/bubble.d.ts +38 -0
- package/dist/math/bullet.d.ts +110 -0
- package/dist/math/chord.d.ts +103 -0
- package/dist/math/cluster.d.ts +88 -0
- package/dist/math/contour.d.ts +48 -0
- package/dist/math/contourf.d.ts +50 -0
- package/dist/math/dodge.d.ts +36 -0
- package/dist/math/ecdf.d.ts +41 -0
- package/dist/math/errorbar.d.ts +27 -0
- package/dist/math/eventplot.d.ts +26 -0
- package/dist/math/facet.d.ts +90 -0
- package/dist/math/fillBetween.d.ts +28 -0
- package/dist/math/gauge.d.ts +71 -0
- package/dist/math/hexbin.d.ts +20 -0
- package/dist/math/hierarchy.d.ts +179 -0
- package/dist/math/hierarchyJoin.d.ts +59 -0
- package/dist/math/histogram.d.ts +36 -0
- package/dist/math/histogram2d.d.ts +44 -0
- package/dist/math/imshow.d.ts +26 -0
- package/dist/math/index.d.ts +139 -0
- package/dist/math/index.js +3 -0
- package/dist/math/jitter.d.ts +16 -0
- package/dist/math/join.d.ts +135 -0
- package/dist/math/keyframes.d.ts +127 -0
- package/dist/math/legend.d.ts +120 -0
- package/dist/math/line.d.ts +53 -0
- package/dist/math/morph.d.ts +81 -0
- package/dist/math/mosaic.d.ts +119 -0
- package/dist/math/ordinal.d.ts +79 -0
- package/dist/math/parallel.d.ts +38 -0
- package/dist/math/pcolormesh.d.ts +22 -0
- package/dist/math/pie.d.ts +105 -0
- package/dist/math/polarArea.d.ts +34 -0
- package/dist/math/radar.d.ts +110 -0
- package/dist/math/range.d.ts +98 -0
- package/dist/math/regression.d.ts +109 -0
- package/dist/math/reveal.d.ts +63 -0
- package/dist/math/sankey.d.ts +154 -0
- package/dist/math/scatter.d.ts +14 -0
- package/dist/math/shared/binning.d.ts +23 -0
- package/dist/math/shared/gridCells.d.ts +41 -0
- package/dist/math/shared/gridExtent.d.ts +5 -0
- package/dist/math/shared/pairs.d.ts +2 -0
- package/dist/math/shared/polar.d.ts +23 -0
- package/dist/math/stack.d.ts +69 -0
- package/dist/math/stackplot.d.ts +35 -0
- package/dist/math/stairs.d.ts +17 -0
- package/dist/math/stem.d.ts +21 -0
- package/dist/math/symbol.d.ts +25 -0
- package/dist/math/tree.d.ts +117 -0
- package/dist/math/tricontour.d.ts +76 -0
- package/dist/math/violin.d.ts +99 -0
- package/dist/math/waffle.d.ts +48 -0
- package/dist/math/waterfall.d.ts +28 -0
- package/dist/math-CSHNpGej.js +3648 -0
- package/dist/mix.d.ts +24 -0
- package/dist/multiview/brush.d.ts +165 -0
- package/dist/multiview/chart-group.d.ts +265 -0
- package/dist/multiview/chart-link.d.ts +188 -0
- package/dist/multiview/chart-zoom.d.ts +144 -0
- package/dist/multiview/facet.d.ts +238 -0
- package/dist/multiview/group-guides.d.ts +99 -0
- package/dist/multiview/index.d.ts +17 -0
- package/dist/multiview/joint-plot.d.ts +114 -0
- package/dist/multiview/pair-plot.d.ts +153 -0
- package/dist/multiview/panels.d.ts +22 -0
- package/dist/multiview/parallel-coordinates.d.ts +109 -0
- package/dist/points/event-plot.d.ts +67 -0
- package/dist/points/index.d.ts +19 -0
- package/dist/points/labels.d.ts +70 -0
- package/dist/points/links.d.ts +123 -0
- package/dist/points/rects.d.ts +80 -0
- package/dist/points/rug.d.ts +72 -0
- package/dist/points/scatter.d.ts +169 -0
- package/dist/points/segment-marks.d.ts +39 -0
- package/dist/points/shared.d.ts +34 -0
- package/dist/points/stem.d.ts +75 -0
- package/dist/points/strip.d.ts +145 -0
- package/dist/points/symbol-marker.d.ts +33 -0
- package/dist/points/ticks.d.ts +102 -0
- package/dist/props.d.ts +126 -0
- package/dist/radial/chord.d.ts +148 -0
- package/dist/radial/gauge.d.ts +126 -0
- package/dist/radial/index.d.ts +15 -0
- package/dist/radial/pie-chart.d.ts +143 -0
- package/dist/radial/polar-area-chart.d.ts +135 -0
- package/dist/radial/radar-chart.d.ts +176 -0
- package/dist/radial/radial-bar-chart.d.ts +116 -0
- package/dist/radial/shared.d.ts +78 -0
- package/dist/radial/waffle.d.ts +130 -0
- package/dist/raster.d.ts +43 -0
- package/dist/series.d.ts +71 -0
- package/dist/src-CwGo1bes.js +19221 -0
- package/dist/stagger.d.ts +54 -0
- package/dist/statistics/box-plot.d.ts +151 -0
- package/dist/statistics/error-bar.d.ts +148 -0
- package/dist/statistics/groups.d.ts +140 -0
- package/dist/statistics/index.d.ts +7 -0
- package/dist/statistics/violin-plot.d.ts +143 -0
- package/dist/text-width.d.ts +9 -0
- package/dist/tooltip.d.ts +276 -0
- package/dist/util.d.ts +33 -0
- package/dist/voxels-9lJ2TZS4.js +235 -0
- package/dist/wireframe3d-D157GZAq.js +345 -0
- package/package.json +86 -3
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `barChart`: a one-series categorical bar chart with names underneath, as
|
|
3
|
+
* its own plot: a `chart` whose children are a `bars` layer, the names (an
|
|
4
|
+
* internal `BarNames` layer of label nodes) and the user's children.
|
|
5
|
+
*/
|
|
6
|
+
import type { AxisOptions, CoordinateSystem, SceneNode } from "@sophistry/core";
|
|
7
|
+
import type { ColorInput } from "@sophistry/core/color";
|
|
8
|
+
import type { Bounds, Point, Range } from "@sophistry/core/geometry";
|
|
9
|
+
import type { Channel, ColorChannel } from "../data/channels.js";
|
|
10
|
+
import type { TransitionProps } from "../props.js";
|
|
11
|
+
/**
|
|
12
|
+
* What {@link barChartHandle} hands back: bar boxes in scene units, and the chart's coordinate system.
|
|
13
|
+
*
|
|
14
|
+
* @category Charts
|
|
15
|
+
*/
|
|
16
|
+
export interface BarChartHandle {
|
|
17
|
+
/** How many bars there are — `data.length`. */
|
|
18
|
+
count(): number;
|
|
19
|
+
/**
|
|
20
|
+
* One bar's box in scene units, or null if the index is out of range. Feed it to `nextTo` or
|
|
21
|
+
* `surroundingRectangle` to annotate a bar.
|
|
22
|
+
*/
|
|
23
|
+
barBounds(index: number): Bounds | null;
|
|
24
|
+
/** The chart's coordinate system: x is the slot index, y the value. */
|
|
25
|
+
coords: CoordinateSystem;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Props of {@link barChart}: `value` is required unless `data` is `number[]`.
|
|
29
|
+
*
|
|
30
|
+
* @category Charts
|
|
31
|
+
*/
|
|
32
|
+
export interface BarChartProps<T = unknown> extends TransitionProps<T> {
|
|
33
|
+
/** One bar per datum. */
|
|
34
|
+
data: readonly T[];
|
|
35
|
+
/**
|
|
36
|
+
* The bar's value, in data units. Defaults to the datum when `data` is `number[]`; required
|
|
37
|
+
* otherwise. Negative values hang below the baseline; non-finite values leave an empty slot.
|
|
38
|
+
*/
|
|
39
|
+
value?: Channel<T, number>;
|
|
40
|
+
/** The name drawn under each bar. Omitted, no names are drawn. */
|
|
41
|
+
label?: Channel<T, string>;
|
|
42
|
+
/** `[min, max, step?]` in data units. Omitted, fitted to the data (including 0). */
|
|
43
|
+
yRange?: Range;
|
|
44
|
+
/** Width of the plotting area. */
|
|
45
|
+
width: number;
|
|
46
|
+
/** Height of the plotting area. */
|
|
47
|
+
height: number;
|
|
48
|
+
/** Centre of the plotting area. Defaults to the origin. */
|
|
49
|
+
center?: Point;
|
|
50
|
+
/**
|
|
51
|
+
* Bar width as a fraction of the slot pitch.
|
|
52
|
+
* @default 0.6
|
|
53
|
+
*/
|
|
54
|
+
barWidth?: number;
|
|
55
|
+
/** One colour for every bar, or `(d, i) => colour`. Wins over `colors`. */
|
|
56
|
+
color?: ColorChannel<T>;
|
|
57
|
+
/** Colours cycled across the bars by index. Defaults to the theme's categorical colours. */
|
|
58
|
+
colors?: readonly ColorInput[];
|
|
59
|
+
/**
|
|
60
|
+
* Fill opacity, 0..1.
|
|
61
|
+
* @default 0.75
|
|
62
|
+
*/
|
|
63
|
+
fillOpacity?: number;
|
|
64
|
+
/** Outline width of every bar. */
|
|
65
|
+
barStrokeWidth?: number;
|
|
66
|
+
/**
|
|
67
|
+
* The value axis: `false` hides it; an object styles it and sets its ticks.
|
|
68
|
+
* @default true
|
|
69
|
+
*/
|
|
70
|
+
yAxis?: boolean | AxisOptions;
|
|
71
|
+
/**
|
|
72
|
+
* Whether to draw the line the bars stand on.
|
|
73
|
+
* @default true
|
|
74
|
+
*/
|
|
75
|
+
baseline?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Font size of the bar labels.
|
|
78
|
+
* @default 0.28
|
|
79
|
+
*/
|
|
80
|
+
labelFontSize?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Gap between the baseline (or a negative bar's bottom) and its label.
|
|
83
|
+
* @default 0.16
|
|
84
|
+
*/
|
|
85
|
+
labelGap?: number;
|
|
86
|
+
/**
|
|
87
|
+
* Reveal, 0..1: the axis, baseline and labels first, then each bar grows out of the baseline.
|
|
88
|
+
* @default 1
|
|
89
|
+
* @see https://sophistry.dev/guides/chart-animation/#reveals
|
|
90
|
+
*/
|
|
91
|
+
progress?: number;
|
|
92
|
+
/**
|
|
93
|
+
* The data to transition to, bars matched by `label` (else index): they slide to their new slot
|
|
94
|
+
* and value; new ones grow in, removed ones shrink away. A sort is a transition to the same
|
|
95
|
+
* data reordered. See {@link TransitionProps}.
|
|
96
|
+
* @see https://sophistry.dev/guides/chart-animation/#data-transitions
|
|
97
|
+
*/
|
|
98
|
+
to?: readonly T[];
|
|
99
|
+
/**
|
|
100
|
+
* Fraction of a transition's enter stage spent staggering entering bars (and their labels). See
|
|
101
|
+
* {@link TransitionProps}.
|
|
102
|
+
* @default 0
|
|
103
|
+
*/
|
|
104
|
+
enterStagger?: number;
|
|
105
|
+
/** Paint order; higher draws later. */
|
|
106
|
+
zIndex?: number;
|
|
107
|
+
visible?: boolean;
|
|
108
|
+
/** Placed inside the chart's coordinate context. */
|
|
109
|
+
children?: readonly SceneNode[];
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* A `barChart` node's handle, as of its last
|
|
113
|
+
* update.
|
|
114
|
+
*
|
|
115
|
+
* @param node - A node made by {@link barChart}.
|
|
116
|
+
* @returns The handle, or null for a node that is not a `barChart`.
|
|
117
|
+
* @category Charts
|
|
118
|
+
*/
|
|
119
|
+
export declare function barChartHandle(node: SceneNode): BarChartHandle | null;
|
|
120
|
+
/**
|
|
121
|
+
* A one-series categorical bar chart with names underneath, as its own plot
|
|
122
|
+
* sized by `width`/`height` (not inside an `axes` or `chart`). Children
|
|
123
|
+
* share its coordinates: slot `i` is centred at `i + 0.5`. For horizontal,
|
|
124
|
+
* stacked or multi-layer bars use a `chart` with {@link bars}, which this is
|
|
125
|
+
* built from.
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```ts
|
|
129
|
+
* import { createScene } from "@sophistry/core";
|
|
130
|
+
* import { barChart } from "@sophistry/charts";
|
|
131
|
+
*
|
|
132
|
+
* const scene = createScene({ host: document.querySelector("#figure")!, units: 10 });
|
|
133
|
+
* const sales = [
|
|
134
|
+
* { quarter: "Q1", units: 120 },
|
|
135
|
+
* { quarter: "Q2", units: 90 },
|
|
136
|
+
* ];
|
|
137
|
+
* scene.add(barChart.create({ data: sales, value: "units", label: "quarter", width: 8, height: 4 }));
|
|
138
|
+
* ```
|
|
139
|
+
*
|
|
140
|
+
* @see https://sophistry.dev/reference/chart-catalogue/#bars
|
|
141
|
+
* @category Charts
|
|
142
|
+
*/
|
|
143
|
+
export declare const barChart: import("@sophistry/core").Definition<BarChartProps<any>, import("@sophistry/core/internal").CompositeNode<BarChartProps<any>>, keyof BarChartProps<any>>;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `bars` `labels`: what each bar's value label and its stack's total write,
|
|
3
|
+
* where they sit (past the bar's growing end, or inside it when it fits),
|
|
4
|
+
* and the label props that draw them. Pure: `bars` builds one entry per
|
|
5
|
+
* label on each update and keeps the label nodes in a keyed list.
|
|
6
|
+
*/
|
|
7
|
+
import type { CoordinateSystem, LabelProps } from "@sophistry/core";
|
|
8
|
+
import type { ColorInput } from "@sophistry/core/color";
|
|
9
|
+
import type { Bounds, TickFormatterSpec } from "@sophistry/core/geometry";
|
|
10
|
+
import type { Theme } from "@sophistry/core/themes";
|
|
11
|
+
import type { Channel, ChannelFn } from "../data/channels.js";
|
|
12
|
+
/**
|
|
13
|
+
* Where `bars` `labels` are written and how.
|
|
14
|
+
*
|
|
15
|
+
* @category Charts
|
|
16
|
+
*/
|
|
17
|
+
export interface BarLabelOptions<T> {
|
|
18
|
+
/**
|
|
19
|
+
* Where each bar's label goes: `"inside"` centred in the bar (or its stacked segment), `"edge"`
|
|
20
|
+
* just past its end, `"none"` for no per-bar labels (e.g. only `total`).
|
|
21
|
+
* @default "inside"
|
|
22
|
+
*/
|
|
23
|
+
position?: "inside" | "edge" | "none";
|
|
24
|
+
/** Your own text, a key of `T` or `(d, i) => string`, instead of the number. */
|
|
25
|
+
text?: Channel<T, string>;
|
|
26
|
+
/**
|
|
27
|
+
* How the number is written: a format string (`",.0f"`, `".1%"`), a built-in name (`"percent"`,
|
|
28
|
+
* `"si"`) or a function. Applies to totals too; under `offset="normalize"` segments show their
|
|
29
|
+
* share as a percent.
|
|
30
|
+
*/
|
|
31
|
+
format?: TickFormatterSpec;
|
|
32
|
+
/**
|
|
33
|
+
* With `layout="stack"`, write each stack's total just past its end.
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
total?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Whether an inside label that doesn't fit its bar is hidden or drawn anyway.
|
|
39
|
+
* @default "hide"
|
|
40
|
+
*/
|
|
41
|
+
overflow?: "hide" | "show";
|
|
42
|
+
/**
|
|
43
|
+
* Text colour. Defaults to the theme foreground outside the bar, and to whichever of foreground or
|
|
44
|
+
* background reads better on the fill inside it.
|
|
45
|
+
*/
|
|
46
|
+
color?: ColorInput;
|
|
47
|
+
/**
|
|
48
|
+
* Gap in scene units between an edge label and the bar's end (inside: the room kept from each
|
|
49
|
+
* edge). Defaults to 0.08 (0.04 inside).
|
|
50
|
+
*/
|
|
51
|
+
offset?: number;
|
|
52
|
+
}
|
|
53
|
+
/** The label settings every bar of a `bars` shares, for one update. */
|
|
54
|
+
export interface BarLabels<T> {
|
|
55
|
+
/** `labels` as options: undefined for `true` and a channel (the edge labels). */
|
|
56
|
+
options: BarLabelOptions<T> | undefined;
|
|
57
|
+
/** The custom text channel, if any. */
|
|
58
|
+
custom: ChannelFn<T, string> | undefined;
|
|
59
|
+
vertical: boolean;
|
|
60
|
+
/** Where each bar's own label goes. */
|
|
61
|
+
position: "inside" | "edge" | "none";
|
|
62
|
+
fontSize: number;
|
|
63
|
+
fontFamily: string;
|
|
64
|
+
/** A number as labels write it: the `format`, else a normalized share as a percent, else with `rest`'s decimal places. */
|
|
65
|
+
writeNumber(shown: number, rest: number, share: boolean): string;
|
|
66
|
+
}
|
|
67
|
+
/** Reads `bars`' label props into the settings every bar shares. */
|
|
68
|
+
export declare function barLabelSettings<T>(spec: {
|
|
69
|
+
labels: boolean | Channel<T, string> | BarLabelOptions<T> | undefined;
|
|
70
|
+
labelFontSize: number | undefined;
|
|
71
|
+
vertical: boolean;
|
|
72
|
+
coords: CoordinateSystem;
|
|
73
|
+
theme: Theme;
|
|
74
|
+
/** Whether the bars are a normalized stack (shares, written as percents). */
|
|
75
|
+
normalized: boolean;
|
|
76
|
+
}): BarLabels<T>;
|
|
77
|
+
/** What one bar's labels read from it on one frame. */
|
|
78
|
+
export interface BarLabelState<T> {
|
|
79
|
+
key: unknown;
|
|
80
|
+
datum: T;
|
|
81
|
+
index: number;
|
|
82
|
+
/** The value `labels={true}` writes. */
|
|
83
|
+
value: number;
|
|
84
|
+
/** The number option labels write: `value`, or a normalized segment's share. */
|
|
85
|
+
share: number;
|
|
86
|
+
/** Its stack's total when it carries it, else undefined. */
|
|
87
|
+
total: number | undefined;
|
|
88
|
+
/** 0..1: how present the bar is while entering or leaving. */
|
|
89
|
+
presence: number;
|
|
90
|
+
/** The bar as drawn, and at full length on this frame. */
|
|
91
|
+
grown: Bounds;
|
|
92
|
+
rest: Bounds | null;
|
|
93
|
+
/** The bar's fade (1 when opaque). */
|
|
94
|
+
opacity: number;
|
|
95
|
+
/** The bar's reveal, 0..1. */
|
|
96
|
+
t: number;
|
|
97
|
+
/** A number counted up with the bar's reveal. */
|
|
98
|
+
counted(value: number): number;
|
|
99
|
+
color: string;
|
|
100
|
+
/** True when the bar runs down (or left) from its foot. */
|
|
101
|
+
backward: boolean;
|
|
102
|
+
fillOpacity: number;
|
|
103
|
+
}
|
|
104
|
+
/** One label to draw: its key in the list and its props. */
|
|
105
|
+
export interface BarLabelEntry {
|
|
106
|
+
key: string;
|
|
107
|
+
props: LabelProps;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* One bar's edge label, inside label and stack total, as label props placed
|
|
111
|
+
* on its box. Appends to `out`.
|
|
112
|
+
*/
|
|
113
|
+
export declare function barLabelEntries<T>(labels: BarLabels<T>, own: BarLabelState<T>, theme: Theme, layer: {
|
|
114
|
+
zIndex: number | undefined;
|
|
115
|
+
visible: boolean | undefined;
|
|
116
|
+
}, out: BarLabelEntry[]): void;
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `bars`: bars on a categorical axis, one per datum, drawn as one instances
|
|
3
|
+
* node of `rect`s; their value labels are label nodes in a keyed list.
|
|
4
|
+
*
|
|
5
|
+
* Follows the per-datum mark steps of `points/scatter.ts`, with the bar's
|
|
6
|
+
* own pieces:
|
|
7
|
+
*
|
|
8
|
+
* - each dataset becomes a {@link BarSide} (categories, values, bases,
|
|
9
|
+
* sub-bands, stacks, totals), cached by its inputs, so a frame of a
|
|
10
|
+
* reveal or a blend reuses it;
|
|
11
|
+
* - the keyed join (`createKeyedData`) pairs bars across `data` and `to`;
|
|
12
|
+
* a bar in both slides to its new band and value, a bar only in `to`
|
|
13
|
+
* grows out of its foot, one only in `data` shrinks into it (or fades
|
|
14
|
+
* when it can't shrink); mid axis-kind swap each end draws through its
|
|
15
|
+
* own plot and the boxes blend in scene units;
|
|
16
|
+
* - the reveal scales each box off its foot (`"grow"`), about zero
|
|
17
|
+
* (`"stack"`), or fades it (`"fade"`, or on an axis without zero). It
|
|
18
|
+
* is geometry and per-item opacity, so it batches; a bar not started is
|
|
19
|
+
* left out of the batch.
|
|
20
|
+
*/
|
|
21
|
+
import type { SceneNode } from "@sophistry/core";
|
|
22
|
+
import type { ColorInput } from "@sophistry/core/color";
|
|
23
|
+
import type { BandKey, Bounds } from "@sophistry/core/geometry";
|
|
24
|
+
import type { MarkTransition } from "../batch.js";
|
|
25
|
+
import type { Channel, ColorChannel } from "../data/channels.js";
|
|
26
|
+
import type { StackOffset } from "../math/stack.js";
|
|
27
|
+
import type { BarReveal, KeyedTransitionProps, RevealProps, StaggerOrder } from "../props.js";
|
|
28
|
+
import type { TooltipSpec } from "../tooltip.js";
|
|
29
|
+
import type { BarLabelOptions } from "./bar-labels.js";
|
|
30
|
+
import type { StackOptions } from "./transforms.js";
|
|
31
|
+
/**
|
|
32
|
+
* What {@link barsHandle} hands back.
|
|
33
|
+
*
|
|
34
|
+
* @category Charts
|
|
35
|
+
*/
|
|
36
|
+
export interface BarsHandle {
|
|
37
|
+
/** How many bars there are — `data.length`. */
|
|
38
|
+
count(): number;
|
|
39
|
+
/**
|
|
40
|
+
* One bar's full-height box in scene units, or null if the index is out of range, its value is not
|
|
41
|
+
* finite, or its category is not on the axis.
|
|
42
|
+
*/
|
|
43
|
+
barBounds(index: number): Bounds | null;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Props of {@link bars}: `value` is required unless `data` is `number[]`.
|
|
47
|
+
*
|
|
48
|
+
* @category Charts
|
|
49
|
+
*/
|
|
50
|
+
export interface BarsProps<T = unknown> extends KeyedTransitionProps<T>, RevealProps {
|
|
51
|
+
/** One bar per datum. */
|
|
52
|
+
data: readonly T[];
|
|
53
|
+
/** The bar's category: which band it stands in. Defaults to the datum's index. */
|
|
54
|
+
category?: Channel<T, BandKey>;
|
|
55
|
+
/**
|
|
56
|
+
* The bar's value, in data units. Defaults to the datum itself when `data` is `number[]`; required
|
|
57
|
+
* otherwise. Non-finite values leave the band empty.
|
|
58
|
+
*/
|
|
59
|
+
value?: Channel<T, number>;
|
|
60
|
+
/**
|
|
61
|
+
* `"vertical"` stands bars on a categorical x axis; `"horizontal"` lays them along a categorical y
|
|
62
|
+
* axis.
|
|
63
|
+
* @default "vertical"
|
|
64
|
+
*/
|
|
65
|
+
orientation?: "vertical" | "horizontal";
|
|
66
|
+
/**
|
|
67
|
+
* The series each bar belongs to: colours the bars through the chart's shared colour scale and
|
|
68
|
+
* legend, and is what `layout` stacks or dodges.
|
|
69
|
+
*/
|
|
70
|
+
series?: Channel<T, BandKey>;
|
|
71
|
+
/**
|
|
72
|
+
* Each bar's identity across data changes and transitions. See {@link KeyedTransitionProps}.
|
|
73
|
+
* Defaults to the datum's place within its `series`, else its index.
|
|
74
|
+
*/
|
|
75
|
+
key?: Channel<T, BandKey>;
|
|
76
|
+
/**
|
|
77
|
+
* How bars sharing a category are arranged: `"overlay"` each fills its band (or `subband`) from
|
|
78
|
+
* its `base`; `"stack"` end to end by series (negative values stack down; replaces `base`);
|
|
79
|
+
* `"dodge"` side by side, one sub-band per series (replaces `subband`). Without a `series`, bars
|
|
80
|
+
* are told apart by their order.
|
|
81
|
+
* @default "overlay"
|
|
82
|
+
*/
|
|
83
|
+
layout?: "overlay" | "stack" | "dodge";
|
|
84
|
+
/**
|
|
85
|
+
* With `layout="stack"`: `"zero"` or `"normalize"` (shares of the total). See {@link StackOffset}.
|
|
86
|
+
* @default "zero"
|
|
87
|
+
*/
|
|
88
|
+
offset?: StackOffset;
|
|
89
|
+
/**
|
|
90
|
+
* With `layout="stack"`: which series sits at the bottom: `"appearance"`, `"reverse"`, `"sum"`,
|
|
91
|
+
* `"insideOut"`, or the series keys bottom to top.
|
|
92
|
+
* @default "appearance"
|
|
93
|
+
*/
|
|
94
|
+
order?: StackOptions<T>["order"];
|
|
95
|
+
/** One colour for every bar, or `(d, i) => colour`. Wins over `colors` and `series`. */
|
|
96
|
+
color?: ColorChannel<T>;
|
|
97
|
+
/**
|
|
98
|
+
* Colours cycled across the bars by index. Wins over `series`. Defaults to the theme's
|
|
99
|
+
* categorical colours.
|
|
100
|
+
*/
|
|
101
|
+
colors?: readonly ColorInput[];
|
|
102
|
+
/**
|
|
103
|
+
* Fill opacity, 0..1.
|
|
104
|
+
* @default 0.75
|
|
105
|
+
*/
|
|
106
|
+
fillOpacity?: number;
|
|
107
|
+
/** Outline width. */
|
|
108
|
+
strokeWidth?: number;
|
|
109
|
+
/**
|
|
110
|
+
* Where each bar starts, in data units, for floating bars (Gantt spans, waterfall steps). Omitted,
|
|
111
|
+
* bars start at the baseline and the chart keeps zero in view.
|
|
112
|
+
*/
|
|
113
|
+
base?: Channel<T, number>;
|
|
114
|
+
/**
|
|
115
|
+
* The part `[from, to]` of the category's band the bar fills, as fractions (what {@link dodge}
|
|
116
|
+
* writes). Omitted, the bar fills its band.
|
|
117
|
+
*/
|
|
118
|
+
subband?: Channel<T, readonly [number, number]>;
|
|
119
|
+
/**
|
|
120
|
+
* How `progress` reveals the bars: `"grow"` out of their foot, `"stack"` the whole stack scaled
|
|
121
|
+
* about zero together, `"fade"` in at full length. With no zero on the value axis (log or
|
|
122
|
+
* truncated), bars fade. Defaults to `"grow"` (`"stack"` under `layout="stack"`).
|
|
123
|
+
* @see https://sophistry.dev/guides/chart-animation/#reveals
|
|
124
|
+
*/
|
|
125
|
+
reveal?: BarReveal;
|
|
126
|
+
/**
|
|
127
|
+
* Value labels: `true` writes each bar's number past its end, a channel writes your own text, and
|
|
128
|
+
* {@link BarLabelOptions} places and formats them.
|
|
129
|
+
* @default false
|
|
130
|
+
*/
|
|
131
|
+
labels?: boolean | Channel<T, string> | BarLabelOptions<T>;
|
|
132
|
+
/**
|
|
133
|
+
* Font size of `labels`.
|
|
134
|
+
* @default 0.24
|
|
135
|
+
*/
|
|
136
|
+
labelFontSize?: number;
|
|
137
|
+
/**
|
|
138
|
+
* Reveal, 0..1: every bar grows out of its baseline (or `base`).
|
|
139
|
+
* @default 1
|
|
140
|
+
* @see https://sophistry.dev/guides/chart-animation/#reveals
|
|
141
|
+
*/
|
|
142
|
+
progress?: number;
|
|
143
|
+
/**
|
|
144
|
+
* Fraction of the reveal spent staggering bar after bar, in category order, 0..0.95.
|
|
145
|
+
* @default 0
|
|
146
|
+
*/
|
|
147
|
+
stagger?: number;
|
|
148
|
+
/**
|
|
149
|
+
* The order `stagger` reveals bars in. See {@link StaggerOrder}.
|
|
150
|
+
* @default "position"
|
|
151
|
+
*/
|
|
152
|
+
staggerOrder?: StaggerOrder;
|
|
153
|
+
/**
|
|
154
|
+
* Fraction of a transition's enter stage spent staggering entering bars, in `staggerOrder`. See
|
|
155
|
+
* {@link TransitionProps}.
|
|
156
|
+
* @default 0
|
|
157
|
+
*/
|
|
158
|
+
enterStagger?: number;
|
|
159
|
+
/**
|
|
160
|
+
* The data to transition to, matched to `data` by `key`: bars slide to their new band and value;
|
|
161
|
+
* new ones grow from their foot, removed ones shrink into it. See {@link KeyedTransitionProps}.
|
|
162
|
+
* @see https://sophistry.dev/guides/chart-animation/#data-transitions
|
|
163
|
+
*/
|
|
164
|
+
to?: readonly T[];
|
|
165
|
+
/**
|
|
166
|
+
* Hover tooltip: `true` for a row per channel (`category`, `series`, `value`), or a template,
|
|
167
|
+
* function or options. See {@link TooltipSpec}.
|
|
168
|
+
*/
|
|
169
|
+
tooltip?: TooltipSpec<T>;
|
|
170
|
+
/**
|
|
171
|
+
* How bars move when `data` changes (outside a `to` blend): a tween or a
|
|
172
|
+
* spring in the node's tween bank; new bars grow out of their foot,
|
|
173
|
+
* removed ones shrink into it. Omitted, data changes are instant.
|
|
174
|
+
*/
|
|
175
|
+
transition?: MarkTransition;
|
|
176
|
+
/**
|
|
177
|
+
* Paint order; higher draws later. The bars paint at `zIndex + UNDER_AXES_Z_INDEX` (above the
|
|
178
|
+
* grid, under the axis they stand on), their labels at `zIndex`.
|
|
179
|
+
* @default 0
|
|
180
|
+
*/
|
|
181
|
+
zIndex?: number;
|
|
182
|
+
visible?: boolean;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* A `bars` node's handle: the bar count and each
|
|
186
|
+
* bar's full-height box as of its last update.
|
|
187
|
+
*
|
|
188
|
+
* @param node - A node made by {@link bars}.
|
|
189
|
+
* @returns The handle, or null for a node that is not a `bars`.
|
|
190
|
+
* @category Charts
|
|
191
|
+
*/
|
|
192
|
+
export declare function barsHandle(node: SceneNode): BarsHandle | null;
|
|
193
|
+
/**
|
|
194
|
+
* Bars on a categorical axis, inside a `chart`: the one bar mark behind
|
|
195
|
+
* grouped, stacked, normalized, diverging and floating bar charts. Give it
|
|
196
|
+
* a `series` and a `layout` (or feed it {@link stack} / {@link dodge}
|
|
197
|
+
* output) for multi-series bars. Drawn as one instances node of rects:
|
|
198
|
+
* hover and tooltips resolve per bar (`event.key` is the bar's key), and
|
|
199
|
+
* `transition` tweens or springs bars to new data. `to` + `blend` is the
|
|
200
|
+
* seekable keyed transition.
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* ```ts
|
|
204
|
+
* import { bars, chart } from "@sophistry/charts";
|
|
205
|
+
*
|
|
206
|
+
* const sales = [
|
|
207
|
+
* { quarter: "Q1", region: "north", units: 3 },
|
|
208
|
+
* { quarter: "Q1", region: "south", units: 5 },
|
|
209
|
+
* { quarter: "Q2", region: "north", units: 4 },
|
|
210
|
+
* { quarter: "Q2", region: "south", units: 2 },
|
|
211
|
+
* ];
|
|
212
|
+
* chart.create({
|
|
213
|
+
* width: 6,
|
|
214
|
+
* height: 4,
|
|
215
|
+
* legendTitle: "Region",
|
|
216
|
+
* children: [bars.create({ data: sales, category: "quarter", value: "units", series: "region", layout: "stack" })],
|
|
217
|
+
* });
|
|
218
|
+
* ```
|
|
219
|
+
*
|
|
220
|
+
* @see https://sophistry.dev/reference/chart-catalogue/#bars
|
|
221
|
+
* @category Charts
|
|
222
|
+
*/
|
|
223
|
+
export declare const bars: import("@sophistry/core").Definition<BarsProps<any>, import("@sophistry/core/internal").CompositeNode<BarsProps<any>>, keyof BarsProps<any>>;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `bullet`: one measure against a target and qualitative ranges per row,
|
|
3
|
+
* drawn in scene units (no `chart`). The qualitative bands, the measure bars
|
|
4
|
+
* and the target markers are three instances nodes of `rect`s (they paint
|
|
5
|
+
* at three depths); titles and tick numbers are label nodes.
|
|
6
|
+
*
|
|
7
|
+
* The tooltip overlay is the chart frame's; until a shared one exists,
|
|
8
|
+
* `bullet` keeps its own tooltip state (the bars' handlers show and hide
|
|
9
|
+
* it) and draws no panel.
|
|
10
|
+
*/
|
|
11
|
+
import type { SceneNode } from "@sophistry/core";
|
|
12
|
+
import type { ColorInput } from "@sophistry/core/color";
|
|
13
|
+
import type { Point } from "@sophistry/core/geometry";
|
|
14
|
+
import type { Channel, ColorChannel, Quantity } from "../data/channels.js";
|
|
15
|
+
import type { TooltipSpec, TooltipState } from "../tooltip.js";
|
|
16
|
+
/**
|
|
17
|
+
* Props of {@link bullet}: `value` is required unless `data` is `number[]`.
|
|
18
|
+
*
|
|
19
|
+
* @category Charts
|
|
20
|
+
*/
|
|
21
|
+
export interface BulletProps<T = unknown> {
|
|
22
|
+
/** One bullet per datum, stacked top-down in data order. */
|
|
23
|
+
data: readonly T[];
|
|
24
|
+
/**
|
|
25
|
+
* The featured measure. Defaults to the datum when `data` is `number[]`; required otherwise. A
|
|
26
|
+
* non-finite value draws no bar.
|
|
27
|
+
*/
|
|
28
|
+
value?: Channel<T, number>;
|
|
29
|
+
/** The comparative measure, drawn as a short perpendicular line. Omitted, no marker. */
|
|
30
|
+
target?: Channel<T, number>;
|
|
31
|
+
/**
|
|
32
|
+
* Qualitative thresholds, ascending, each where a band ends: `[150, 225, 300]` reads poor /
|
|
33
|
+
* satisfactory / good. The last band runs to the end of the scale.
|
|
34
|
+
*/
|
|
35
|
+
ranges?: Channel<T, readonly number[]>;
|
|
36
|
+
/** The row's title, right-aligned to the left of its scale. */
|
|
37
|
+
label?: Channel<T, string>;
|
|
38
|
+
/**
|
|
39
|
+
* Where a row's scale starts, in data units: a number or a channel. Defaults to 0 (or below the
|
|
40
|
+
* smallest value when one is negative).
|
|
41
|
+
*/
|
|
42
|
+
min?: Quantity<T>;
|
|
43
|
+
/**
|
|
44
|
+
* Where a row's scale ends, in data units: a number or a channel. Defaults to the largest of
|
|
45
|
+
* the row's value, target and thresholds.
|
|
46
|
+
*/
|
|
47
|
+
max?: Quantity<T>;
|
|
48
|
+
/**
|
|
49
|
+
* Give every row the same scale instead of its own (use when rows measure the same thing).
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
sharedScale?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Round default scale ends out to tick values.
|
|
55
|
+
* @default true
|
|
56
|
+
*/
|
|
57
|
+
nice?: boolean;
|
|
58
|
+
/** Width of the chart, titles included. */
|
|
59
|
+
width: number;
|
|
60
|
+
/** Height of the chart; each row gets an equal slot. */
|
|
61
|
+
height: number;
|
|
62
|
+
/** Centre of the chart. Defaults to the origin. */
|
|
63
|
+
center?: Point;
|
|
64
|
+
/**
|
|
65
|
+
* Width kept for the titles. Defaults to the widest title plus a gap, at most 45% of `width`.
|
|
66
|
+
*/
|
|
67
|
+
labelWidth?: number;
|
|
68
|
+
/**
|
|
69
|
+
* Colour of the measure bar, constant or `(d, i) => colour`. Defaults to the theme's first
|
|
70
|
+
* series colour.
|
|
71
|
+
*/
|
|
72
|
+
color?: ColorChannel<T>;
|
|
73
|
+
/**
|
|
74
|
+
* One colour per band, worst first. Defaults to graded greys from background toward foreground,
|
|
75
|
+
* the worst band strongest.
|
|
76
|
+
*/
|
|
77
|
+
rangeColors?: readonly ColorInput[];
|
|
78
|
+
/** Colour of the target marker. Defaults to the theme's foreground. */
|
|
79
|
+
targetColor?: ColorInput;
|
|
80
|
+
/**
|
|
81
|
+
* Thickness of the measure bar, as a fraction of the band's.
|
|
82
|
+
* @default 1/3
|
|
83
|
+
*/
|
|
84
|
+
barSize?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Gap between rows, as a fraction of a row's slot.
|
|
87
|
+
* @default 0.35
|
|
88
|
+
*/
|
|
89
|
+
padding?: number;
|
|
90
|
+
/**
|
|
91
|
+
* Write tick numbers under each row's scale.
|
|
92
|
+
* @default true
|
|
93
|
+
*/
|
|
94
|
+
ticks?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Title font size.
|
|
97
|
+
* @default 0.24
|
|
98
|
+
*/
|
|
99
|
+
labelFontSize?: number;
|
|
100
|
+
/**
|
|
101
|
+
* Tick-number font size.
|
|
102
|
+
* @default 0.16
|
|
103
|
+
*/
|
|
104
|
+
tickFontSize?: number;
|
|
105
|
+
/**
|
|
106
|
+
* Reveal, 0..1: bands, titles and ticks fade in first; then each row's bar grows from zero and
|
|
107
|
+
* its target draws in, rows staggered top-down.
|
|
108
|
+
* @default 1
|
|
109
|
+
* @see https://sophistry.dev/guides/chart-animation/#reveals
|
|
110
|
+
*/
|
|
111
|
+
progress?: number;
|
|
112
|
+
/**
|
|
113
|
+
* Fraction of the data reveal spent staggering row after row, 0..0.95.
|
|
114
|
+
* @default 0.3
|
|
115
|
+
*/
|
|
116
|
+
stagger?: number;
|
|
117
|
+
/** Hover tooltip on the bar: `true` for "label: value (target T)", or `(d, i) => string`. */
|
|
118
|
+
tooltip?: TooltipSpec<T>;
|
|
119
|
+
/** Paint order; higher draws later. */
|
|
120
|
+
zIndex?: number;
|
|
121
|
+
visible?: boolean;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* A bullet chart: one measure against a target and qualitative ranges per
|
|
125
|
+
* row, a compact dashboard KPI that stacks into a table. Each row gets its
|
|
126
|
+
* own scale unless `sharedScale`. Draws in scene units; needs no `chart`.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```ts
|
|
130
|
+
* import { createScene } from "@sophistry/core";
|
|
131
|
+
* import { bullet } from "@sophistry/charts";
|
|
132
|
+
*
|
|
133
|
+
* const scene = createScene({ host: document.querySelector("#figure")!, units: 10 });
|
|
134
|
+
* scene.add(
|
|
135
|
+
* bullet.create({
|
|
136
|
+
* data: [{ name: "Revenue", value: 270, target: 250, ranges: [150, 225, 300] }],
|
|
137
|
+
* value: "value",
|
|
138
|
+
* target: "target",
|
|
139
|
+
* ranges: "ranges",
|
|
140
|
+
* label: "name",
|
|
141
|
+
* width: 8,
|
|
142
|
+
* height: 1.5,
|
|
143
|
+
* }),
|
|
144
|
+
* );
|
|
145
|
+
* ```
|
|
146
|
+
*
|
|
147
|
+
* @see https://sophistry.dev/reference/chart-catalogue/#gauges-bullets-waffles-mosaics-and-radial-bars
|
|
148
|
+
* @category Charts
|
|
149
|
+
*/
|
|
150
|
+
export declare const bullet: import("@sophistry/core").Definition<BulletProps<any>, import("@sophistry/core/internal").CompositeNode<BulletProps<any>>, keyof BulletProps<any>>;
|
|
151
|
+
/**
|
|
152
|
+
* A `bullet` node's tooltip state (what its bars show on hover), for an
|
|
153
|
+
* overlay to bind to; null for a node that is not a `bullet`.
|
|
154
|
+
*
|
|
155
|
+
* @category Charts
|
|
156
|
+
*/
|
|
157
|
+
export declare function bulletTooltip(node: SceneNode): TooltipState | null;
|