@motionscript/charts 0.1.0-alpha.8 → 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/CHANGELOG.md +6 -0
- package/LICENSE +201 -201
- package/NOTICE +49 -49
- package/README.md +99 -99
- package/dist/bar-chart/bar-chart.js.map +1 -1
- package/dist/bar-chart/category-axis.js.map +1 -1
- package/dist/bar-chart/chart-bars.js.map +1 -1
- package/dist/bar-chart/index.js.map +1 -1
- package/dist/bar-chart/shared.js.map +1 -1
- package/dist/browser/chunks/{chunk-XROBIRQK.js → chunk-TJNHLQGV.js} +1 -1
- package/dist/browser/chunks/chunk-TJNHLQGV.js.map +7 -0
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/kit.js +1 -1
- package/dist/browser/manifest.json +1 -1
- package/dist/engine.d.ts +1 -1
- package/dist/engine.js +1 -1
- package/dist/engine.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/kit/cartesian.js.map +1 -1
- package/dist/kit/chart-border.js.map +1 -1
- package/dist/kit/chart-canvas.js.map +1 -1
- package/dist/kit/chart-legend.js.map +1 -1
- package/dist/kit/entries.js.map +1 -1
- package/dist/kit/motion.js.map +1 -1
- package/dist/kit/paints.js.map +1 -1
- package/dist/kit/shared.js.map +1 -1
- package/dist/kit/vertical-axis.js.map +1 -1
- package/dist/line-chart/chart-line.js.map +1 -1
- package/dist/line-chart/chart-region.js.map +1 -1
- package/dist/line-chart/horizontal-axis.js.map +1 -1
- package/dist/line-chart/index.d.ts +1 -1
- package/dist/line-chart/index.js +1 -1
- package/dist/line-chart/index.js.map +1 -1
- package/dist/line-chart/line-chart.js.map +1 -1
- package/dist/line-chart/shared.js.map +1 -1
- package/dist/line-chart/x-scale.js.map +1 -1
- package/dist/nodes.js.map +1 -1
- package/dist/pie-chart/index.js.map +1 -1
- package/dist/pie-chart/pie-chart.js.map +1 -1
- package/dist/pie-chart/pie-legend.js.map +1 -1
- package/dist/pie-chart/pie-ring.js.map +1 -1
- package/dist/pie-chart/shared.js.map +1 -1
- package/package.json +4 -4
- package/registry.json +23 -23
- package/src/bar-chart/bar-chart.ts +542 -542
- package/src/bar-chart/category-axis.ts +162 -162
- package/src/bar-chart/chart-bars.ts +287 -287
- package/src/bar-chart/index.ts +31 -31
- package/src/bar-chart/shared.ts +354 -354
- package/src/engine.ts +28 -28
- package/src/index.ts +5 -5
- package/src/kit/cartesian.ts +81 -81
- package/src/kit/chart-border.ts +50 -50
- package/src/kit/chart-canvas.ts +122 -122
- package/src/kit/chart-legend.ts +229 -229
- package/src/kit/entries.ts +20 -20
- package/src/kit/motion.ts +90 -90
- package/src/kit/paints.ts +15 -15
- package/src/kit/shared.ts +782 -782
- package/src/kit/vertical-axis.ts +194 -194
- package/src/line-chart/chart-line.ts +156 -156
- package/src/line-chart/chart-region.ts +90 -90
- package/src/line-chart/horizontal-axis.ts +151 -151
- package/src/line-chart/index.ts +39 -39
- package/src/line-chart/line-chart.ts +598 -598
- package/src/line-chart/shared.ts +473 -473
- package/src/line-chart/x-scale.ts +382 -382
- package/src/nodes.ts +18 -18
- package/src/pie-chart/index.ts +37 -37
- package/src/pie-chart/pie-chart.ts +296 -296
- package/src/pie-chart/pie-legend.ts +169 -169
- package/src/pie-chart/pie-ring.ts +848 -848
- package/src/pie-chart/shared.ts +496 -496
- package/dist/browser/chunks/chunk-XROBIRQK.js.map +0 -7
- package/src/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
|
@@ -1,151 +1,151 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Rect,
|
|
3
|
-
Text,
|
|
4
|
-
Types,
|
|
5
|
-
component2d,
|
|
6
|
-
insetsOps,
|
|
7
|
-
textOps,
|
|
8
|
-
type NodeOf,
|
|
9
|
-
type Node2D,
|
|
10
|
-
} from "@motionscript/sdk";
|
|
11
|
-
|
|
12
|
-
import { asParts, fresh } from "../kit/entries";
|
|
13
|
-
import { armed, arrival, arrivalOf, arrivalsEntry, beats, frameEase, type Arrival } from "../kit/motion";
|
|
14
|
-
import {
|
|
15
|
-
DEFAULT_X_AXIS,
|
|
16
|
-
enterBudget,
|
|
17
|
-
type AxisConfig,
|
|
18
|
-
type Range,
|
|
19
|
-
} from "../kit/shared";
|
|
20
|
-
import { markerCaption } from "../kit/vertical-axis";
|
|
21
|
-
|
|
22
|
-
/** How far a marker starts above its slot when it enters, in px. */
|
|
23
|
-
const SLIDE = 24;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* The horizontal axis of a {@link LineChart}: a **row of {@link Text} nodes**,
|
|
27
|
-
* one per marker value, running left-to-right. Pure layout — the mirror of the
|
|
28
|
-
* kit's `VerticalAxis`, including its bound (not snapshotted) marker text and
|
|
29
|
-
* positions, and its landed resting state.
|
|
30
|
-
*
|
|
31
|
-
* Markers are always placed **by value** across the range, whatever they say:
|
|
32
|
-
* `2026-03` sits three months along, not three slots along. That is what keeps
|
|
33
|
-
* it distinct from a bar chart's bottom axis, which centres a caption on each
|
|
34
|
-
* slot and has no scale at all — the two only look alike. What the values are
|
|
35
|
-
* captioned *as* is the chart's to decide, in `captions`.
|
|
36
|
-
*
|
|
37
|
-
* `enter` staggers the markers in **left-to-right**: each starts lifted a
|
|
38
|
-
* little above its slot and transparent, then fades and slides down into place.
|
|
39
|
-
*/
|
|
40
|
-
export const HorizontalAxis = component2d({
|
|
41
|
-
key: "horizontalAxis",
|
|
42
|
-
state: {
|
|
43
|
-
/** `[min, max]` of the horizontal scale the markers are positioned within. */
|
|
44
|
-
range: fresh<Range>(() => [0, 1]),
|
|
45
|
-
/** Tick values (in data units) to draw along the axis. */
|
|
46
|
-
markers: fresh<number[]>(() => []),
|
|
47
|
-
/**
|
|
48
|
-
* How each marker is captioned, one per entry of `markers` and in its order.
|
|
49
|
-
* Empty (the default), or short, captions a marker with its bare numeric
|
|
50
|
-
* reading; a chart whose x column names months or categories writes those.
|
|
51
|
-
*/
|
|
52
|
-
captions: fresh<string[]>(() => []),
|
|
53
|
-
/** Marker/caption text style, grid stroke, and gutters — see {@link AxisConfig}. */
|
|
54
|
-
axis: Types.custom<AxisConfig>(DEFAULT_X_AXIS),
|
|
55
|
-
/** Caption drawn centred in the gutter beneath the marker row; empty (the default) hides it. */
|
|
56
|
-
label: "",
|
|
57
|
-
arrivals: arrivalsEntry(),
|
|
58
|
-
},
|
|
59
|
-
// A plain node filled its parent; one made of its markers would hug them.
|
|
60
|
-
defaults: { width: "fill", height: "fill" },
|
|
61
|
-
children: (state) => {
|
|
62
|
-
const tickPad = insetsOps.resolve(state.axis.tickPadding).top;
|
|
63
|
-
const titlePad = insetsOps.resolve(state.axis.titlePadding).top;
|
|
64
|
-
|
|
65
|
-
const column: Node2D[] = [];
|
|
66
|
-
// The column's parent is the axis: its box is what the markers are placed in.
|
|
67
|
-
const box = () => (column[0]?.parent as Node2D | null | undefined)?.layoutBounds ?? { width: 0, height: 0 };
|
|
68
|
-
/** The live tick values, left → right — re-read every frame, not snapshotted. */
|
|
69
|
-
const sorted = () => [...state.markers].sort((a, b) => a - b);
|
|
70
|
-
/** Tick `i`'s fraction across the live `range`, 0 at the left edge. */
|
|
71
|
-
const fracAt = (value: number | undefined) => {
|
|
72
|
-
if (value === undefined) return 0;
|
|
73
|
-
const [min, max] = state.range;
|
|
74
|
-
return max <= min ? 0 : (value - min) / (max - min);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
const markers = state.markers.map((_, i) => {
|
|
78
|
-
const marker: Node2D = new Text({
|
|
79
|
-
...textOps.styleProps(state.axis.labelStyle),
|
|
80
|
-
text: () => {
|
|
81
|
-
const value = sorted()[i];
|
|
82
|
-
return value === undefined ? "" : markerCaption(state, value);
|
|
83
|
-
},
|
|
84
|
-
x: () => {
|
|
85
|
-
const width = box().width;
|
|
86
|
-
const centred = (fracAt(sorted()[i]) - 0.5) * width;
|
|
87
|
-
// Held inside the axis's right edge, which is also the *chart's*: the
|
|
88
|
-
// last marker is centred on the last grid line, so half of `2026-06`
|
|
89
|
-
// — or of `3300` — would be drawn outside the node's box and outside
|
|
90
|
-
// the rectangle the editor draws around it. Only the right edge is
|
|
91
|
-
// held, because the left one has the vertical axis's whole gutter
|
|
92
|
-
// beyond it, and a marker overhanging into that is inside the chart.
|
|
93
|
-
const limit = width / 2 - marker.layoutBounds.width / 2;
|
|
94
|
-
return Math.min(centred, limit);
|
|
95
|
-
},
|
|
96
|
-
opacity: () => arrivalOf(state.arrivals, i).opacity,
|
|
97
|
-
y: () => arrivalOf(state.arrivals, i).shift,
|
|
98
|
-
});
|
|
99
|
-
return marker;
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
const children: Node2D[] = [
|
|
103
|
-
new Rect({ width: "fill", height: "hug", padding: { top: tickPad }, children: markers }),
|
|
104
|
-
];
|
|
105
|
-
if (state.label !== "") {
|
|
106
|
-
children.push(
|
|
107
|
-
new Text({
|
|
108
|
-
...textOps.styleProps(state.axis.titleStyle),
|
|
109
|
-
text: state.label,
|
|
110
|
-
opacity: () => arrivalOf(state.arrivals, "label").opacity,
|
|
111
|
-
y: () => arrivalOf(state.arrivals, "label").shift,
|
|
112
|
-
}),
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
column.push(new Rect({ flow: "vertical", gap: titlePad, height: "hug", width: "fill", children }));
|
|
117
|
-
return asParts(column);
|
|
118
|
-
},
|
|
119
|
-
commands: {
|
|
120
|
-
/**
|
|
121
|
-
* Stagger the markers in left to right, then slide the caption in after
|
|
122
|
-
* them. Its first frame arms them all: lifted by `slide` and transparent.
|
|
123
|
-
*
|
|
124
|
-
* The timeline's duration is the **whole** entrance — see
|
|
125
|
-
* `VerticalAxis.enter` and {@link enterBudget}.
|
|
126
|
-
*/
|
|
127
|
-
enter: {
|
|
128
|
-
args: {
|
|
129
|
-
stagger: Types.custom<number | undefined>(undefined),
|
|
130
|
-
slide: Types.number(SLIDE),
|
|
131
|
-
},
|
|
132
|
-
run: (timeline, state) => {
|
|
133
|
-
const { stagger, slide } = timeline.args;
|
|
134
|
-
const count = state.markers.length;
|
|
135
|
-
const captioned = state.label !== "";
|
|
136
|
-
const from: Arrival = { opacity: 0, shift: slide };
|
|
137
|
-
const keys = [...state.markers.keys(), ...(captioned ? ["label"] : [])];
|
|
138
|
-
const arm = timeline.animate(() => ({ arrivals: armed(keys, from) }));
|
|
139
|
-
if (count === 0) return arm;
|
|
140
|
-
const { step, per, caption } = enterBudget(timeline.duration, count, captioned, stagger);
|
|
141
|
-
const ease = frameEase(timeline);
|
|
142
|
-
// Left marker leads: the row is already left → right.
|
|
143
|
-
const markers = state.markers.map((_, i) => ({ at: i * step, duration: per, piece: arrival(timeline, i, from, ease) }));
|
|
144
|
-
const label = captioned ? [{ at: (count - 1) * step + per, duration: caption, piece: arrival(timeline, "label", from, ease) }] : [];
|
|
145
|
-
return timeline.together([arm, beats(timeline, [...markers, ...label])]);
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
export type HorizontalAxis = NodeOf<typeof HorizontalAxis>;
|
|
1
|
+
import {
|
|
2
|
+
Rect,
|
|
3
|
+
Text,
|
|
4
|
+
Types,
|
|
5
|
+
component2d,
|
|
6
|
+
insetsOps,
|
|
7
|
+
textOps,
|
|
8
|
+
type NodeOf,
|
|
9
|
+
type Node2D,
|
|
10
|
+
} from "@motionscript/sdk";
|
|
11
|
+
|
|
12
|
+
import { asParts, fresh } from "../kit/entries";
|
|
13
|
+
import { armed, arrival, arrivalOf, arrivalsEntry, beats, frameEase, type Arrival } from "../kit/motion";
|
|
14
|
+
import {
|
|
15
|
+
DEFAULT_X_AXIS,
|
|
16
|
+
enterBudget,
|
|
17
|
+
type AxisConfig,
|
|
18
|
+
type Range,
|
|
19
|
+
} from "../kit/shared";
|
|
20
|
+
import { markerCaption } from "../kit/vertical-axis";
|
|
21
|
+
|
|
22
|
+
/** How far a marker starts above its slot when it enters, in px. */
|
|
23
|
+
const SLIDE = 24;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The horizontal axis of a {@link LineChart}: a **row of {@link Text} nodes**,
|
|
27
|
+
* one per marker value, running left-to-right. Pure layout — the mirror of the
|
|
28
|
+
* kit's `VerticalAxis`, including its bound (not snapshotted) marker text and
|
|
29
|
+
* positions, and its landed resting state.
|
|
30
|
+
*
|
|
31
|
+
* Markers are always placed **by value** across the range, whatever they say:
|
|
32
|
+
* `2026-03` sits three months along, not three slots along. That is what keeps
|
|
33
|
+
* it distinct from a bar chart's bottom axis, which centres a caption on each
|
|
34
|
+
* slot and has no scale at all — the two only look alike. What the values are
|
|
35
|
+
* captioned *as* is the chart's to decide, in `captions`.
|
|
36
|
+
*
|
|
37
|
+
* `enter` staggers the markers in **left-to-right**: each starts lifted a
|
|
38
|
+
* little above its slot and transparent, then fades and slides down into place.
|
|
39
|
+
*/
|
|
40
|
+
export const HorizontalAxis = component2d({
|
|
41
|
+
key: "horizontalAxis",
|
|
42
|
+
state: {
|
|
43
|
+
/** `[min, max]` of the horizontal scale the markers are positioned within. */
|
|
44
|
+
range: fresh<Range>(() => [0, 1]),
|
|
45
|
+
/** Tick values (in data units) to draw along the axis. */
|
|
46
|
+
markers: fresh<number[]>(() => []),
|
|
47
|
+
/**
|
|
48
|
+
* How each marker is captioned, one per entry of `markers` and in its order.
|
|
49
|
+
* Empty (the default), or short, captions a marker with its bare numeric
|
|
50
|
+
* reading; a chart whose x column names months or categories writes those.
|
|
51
|
+
*/
|
|
52
|
+
captions: fresh<string[]>(() => []),
|
|
53
|
+
/** Marker/caption text style, grid stroke, and gutters — see {@link AxisConfig}. */
|
|
54
|
+
axis: Types.custom<AxisConfig>(DEFAULT_X_AXIS),
|
|
55
|
+
/** Caption drawn centred in the gutter beneath the marker row; empty (the default) hides it. */
|
|
56
|
+
label: "",
|
|
57
|
+
arrivals: arrivalsEntry(),
|
|
58
|
+
},
|
|
59
|
+
// A plain node filled its parent; one made of its markers would hug them.
|
|
60
|
+
defaults: { width: "fill", height: "fill" },
|
|
61
|
+
children: (state) => {
|
|
62
|
+
const tickPad = insetsOps.resolve(state.axis.tickPadding).top;
|
|
63
|
+
const titlePad = insetsOps.resolve(state.axis.titlePadding).top;
|
|
64
|
+
|
|
65
|
+
const column: Node2D[] = [];
|
|
66
|
+
// The column's parent is the axis: its box is what the markers are placed in.
|
|
67
|
+
const box = () => (column[0]?.parent as Node2D | null | undefined)?.layoutBounds ?? { width: 0, height: 0 };
|
|
68
|
+
/** The live tick values, left → right — re-read every frame, not snapshotted. */
|
|
69
|
+
const sorted = () => [...state.markers].sort((a, b) => a - b);
|
|
70
|
+
/** Tick `i`'s fraction across the live `range`, 0 at the left edge. */
|
|
71
|
+
const fracAt = (value: number | undefined) => {
|
|
72
|
+
if (value === undefined) return 0;
|
|
73
|
+
const [min, max] = state.range;
|
|
74
|
+
return max <= min ? 0 : (value - min) / (max - min);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const markers = state.markers.map((_, i) => {
|
|
78
|
+
const marker: Node2D = new Text({
|
|
79
|
+
...textOps.styleProps(state.axis.labelStyle),
|
|
80
|
+
text: () => {
|
|
81
|
+
const value = sorted()[i];
|
|
82
|
+
return value === undefined ? "" : markerCaption(state, value);
|
|
83
|
+
},
|
|
84
|
+
x: () => {
|
|
85
|
+
const width = box().width;
|
|
86
|
+
const centred = (fracAt(sorted()[i]) - 0.5) * width;
|
|
87
|
+
// Held inside the axis's right edge, which is also the *chart's*: the
|
|
88
|
+
// last marker is centred on the last grid line, so half of `2026-06`
|
|
89
|
+
// — or of `3300` — would be drawn outside the node's box and outside
|
|
90
|
+
// the rectangle the editor draws around it. Only the right edge is
|
|
91
|
+
// held, because the left one has the vertical axis's whole gutter
|
|
92
|
+
// beyond it, and a marker overhanging into that is inside the chart.
|
|
93
|
+
const limit = width / 2 - marker.layoutBounds.width / 2;
|
|
94
|
+
return Math.min(centred, limit);
|
|
95
|
+
},
|
|
96
|
+
opacity: () => arrivalOf(state.arrivals, i).opacity,
|
|
97
|
+
y: () => arrivalOf(state.arrivals, i).shift,
|
|
98
|
+
});
|
|
99
|
+
return marker;
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
const children: Node2D[] = [
|
|
103
|
+
new Rect({ width: "fill", height: "hug", padding: { top: tickPad }, children: markers }),
|
|
104
|
+
];
|
|
105
|
+
if (state.label !== "") {
|
|
106
|
+
children.push(
|
|
107
|
+
new Text({
|
|
108
|
+
...textOps.styleProps(state.axis.titleStyle),
|
|
109
|
+
text: state.label,
|
|
110
|
+
opacity: () => arrivalOf(state.arrivals, "label").opacity,
|
|
111
|
+
y: () => arrivalOf(state.arrivals, "label").shift,
|
|
112
|
+
}),
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
column.push(new Rect({ flow: "vertical", gap: titlePad, height: "hug", width: "fill", children }));
|
|
117
|
+
return asParts(column);
|
|
118
|
+
},
|
|
119
|
+
commands: {
|
|
120
|
+
/**
|
|
121
|
+
* Stagger the markers in left to right, then slide the caption in after
|
|
122
|
+
* them. Its first frame arms them all: lifted by `slide` and transparent.
|
|
123
|
+
*
|
|
124
|
+
* The timeline's duration is the **whole** entrance — see
|
|
125
|
+
* `VerticalAxis.enter` and {@link enterBudget}.
|
|
126
|
+
*/
|
|
127
|
+
enter: {
|
|
128
|
+
args: {
|
|
129
|
+
stagger: Types.custom<number | undefined>(undefined),
|
|
130
|
+
slide: Types.number(SLIDE),
|
|
131
|
+
},
|
|
132
|
+
run: (timeline, state) => {
|
|
133
|
+
const { stagger, slide } = timeline.args;
|
|
134
|
+
const count = state.markers.length;
|
|
135
|
+
const captioned = state.label !== "";
|
|
136
|
+
const from: Arrival = { opacity: 0, shift: slide };
|
|
137
|
+
const keys = [...state.markers.keys(), ...(captioned ? ["label"] : [])];
|
|
138
|
+
const arm = timeline.animate(() => ({ arrivals: armed(keys, from) }));
|
|
139
|
+
if (count === 0) return arm;
|
|
140
|
+
const { step, per, caption } = enterBudget(timeline.duration, count, captioned, stagger);
|
|
141
|
+
const ease = frameEase(timeline);
|
|
142
|
+
// Left marker leads: the row is already left → right.
|
|
143
|
+
const markers = state.markers.map((_, i) => ({ at: i * step, duration: per, piece: arrival(timeline, i, from, ease) }));
|
|
144
|
+
const label = captioned ? [{ at: (count - 1) * step + per, duration: caption, piece: arrival(timeline, "label", from, ease) }] : [];
|
|
145
|
+
return timeline.together([arm, beats(timeline, [...markers, ...label])]);
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
export type HorizontalAxis = NodeOf<typeof HorizontalAxis>;
|
package/src/line-chart/index.ts
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The line chart: a cartesian plot with a traced polyline, spotlit regions and
|
|
3
|
-
* a staggered entrance.
|
|
4
|
-
*
|
|
5
|
-
* {@link LineChart} composes the parts below plus the shared ones in the kit
|
|
6
|
-
* (the plot panel, the value axis, the legend); each part is exported too, so
|
|
7
|
-
* another node type can reuse one on its own.
|
|
8
|
-
*
|
|
9
|
-
* These files are what
|
|
10
|
-
* that is *not* here comes from the kit and stays a dependency — see
|
|
11
|
-
* `../engine.ts` for why that line is where it is.
|
|
12
|
-
*/
|
|
13
|
-
export { LineChart, lineChartDomains } from "./line-chart"
|
|
14
|
-
export type { LineChartDomains, LineChartProps, LineChartValues } from "./line-chart"
|
|
15
|
-
export { ChartRegion } from "./chart-region"
|
|
16
|
-
export { ChartLine } from "./chart-line"
|
|
17
|
-
export { HorizontalAxis } from "./horizontal-axis"
|
|
18
|
-
export {
|
|
19
|
-
DEFAULT_CHART_THEME,
|
|
20
|
-
EMPTY_REGION_BOX,
|
|
21
|
-
clipPolylineToBox,
|
|
22
|
-
hasRegion,
|
|
23
|
-
lerpChartTheme,
|
|
24
|
-
resolveChartTheme,
|
|
25
|
-
resolveRegionBox,
|
|
26
|
-
resolveYScale,
|
|
27
|
-
seriesPoints,
|
|
28
|
-
yExtent,
|
|
29
|
-
} from "./shared"
|
|
30
|
-
export type {
|
|
31
|
-
ChartConfig,
|
|
32
|
-
ChartTheme,
|
|
33
|
-
LineSeries,
|
|
34
|
-
PlotRegion,
|
|
35
|
-
RegionBox,
|
|
36
|
-
RegionConfig,
|
|
37
|
-
} from "./shared"
|
|
38
|
-
export { formatInstant, parseInstant, resolveXScale } from "./x-scale"
|
|
39
|
-
export type { XScale, XScaleKind } from "./x-scale"
|
|
1
|
+
/**
|
|
2
|
+
* The line chart: a cartesian plot with a traced polyline, spotlit regions and
|
|
3
|
+
* a staggered entrance.
|
|
4
|
+
*
|
|
5
|
+
* {@link LineChart} composes the parts below plus the shared ones in the kit
|
|
6
|
+
* (the plot panel, the value axis, the legend); each part is exported too, so
|
|
7
|
+
* another node type can reuse one on its own.
|
|
8
|
+
*
|
|
9
|
+
* These files are what a copy of the line chart takes (`registry.json`). Everything they reach for
|
|
10
|
+
* that is *not* here comes from the kit and stays a dependency — see
|
|
11
|
+
* `../engine.ts` for why that line is where it is.
|
|
12
|
+
*/
|
|
13
|
+
export { LineChart, lineChartDomains } from "./line-chart"
|
|
14
|
+
export type { LineChartDomains, LineChartProps, LineChartValues } from "./line-chart"
|
|
15
|
+
export { ChartRegion } from "./chart-region"
|
|
16
|
+
export { ChartLine } from "./chart-line"
|
|
17
|
+
export { HorizontalAxis } from "./horizontal-axis"
|
|
18
|
+
export {
|
|
19
|
+
DEFAULT_CHART_THEME,
|
|
20
|
+
EMPTY_REGION_BOX,
|
|
21
|
+
clipPolylineToBox,
|
|
22
|
+
hasRegion,
|
|
23
|
+
lerpChartTheme,
|
|
24
|
+
resolveChartTheme,
|
|
25
|
+
resolveRegionBox,
|
|
26
|
+
resolveYScale,
|
|
27
|
+
seriesPoints,
|
|
28
|
+
yExtent,
|
|
29
|
+
} from "./shared"
|
|
30
|
+
export type {
|
|
31
|
+
ChartConfig,
|
|
32
|
+
ChartTheme,
|
|
33
|
+
LineSeries,
|
|
34
|
+
PlotRegion,
|
|
35
|
+
RegionBox,
|
|
36
|
+
RegionConfig,
|
|
37
|
+
} from "./shared"
|
|
38
|
+
export { formatInstant, parseInstant, resolveXScale } from "./x-scale"
|
|
39
|
+
export type { XScale, XScaleKind } from "./x-scale"
|