@motionscript/charts 0.1.0-alpha.6 → 0.1.0-alpha.7
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 +18 -0
- package/dist/bar-chart/bar-chart.d.ts +45 -1
- package/dist/bar-chart/bar-chart.d.ts.map +1 -1
- package/dist/bar-chart/category-axis.d.ts +12 -1
- package/dist/bar-chart/category-axis.d.ts.map +1 -1
- package/dist/bar-chart/chart-bars.d.ts +15 -1
- package/dist/bar-chart/chart-bars.d.ts.map +1 -1
- package/dist/browser/index.js.map +2 -2
- package/dist/browser/manifest.json +1 -1
- package/dist/kit/chart-border.d.ts +3 -1
- package/dist/kit/chart-border.d.ts.map +1 -1
- package/dist/kit/chart-canvas.d.ts +10 -1
- package/dist/kit/chart-canvas.d.ts.map +1 -1
- package/dist/kit/chart-legend.d.ts +48 -1
- package/dist/kit/chart-legend.d.ts.map +1 -1
- package/dist/kit/vertical-axis.d.ts +13 -1
- package/dist/kit/vertical-axis.d.ts.map +1 -1
- package/dist/line-chart/chart-line.d.ts +46 -37
- package/dist/line-chart/chart-line.d.ts.map +1 -1
- package/dist/line-chart/chart-line.js +11 -1
- package/dist/line-chart/chart-line.js.map +1 -1
- package/dist/line-chart/chart-region.d.ts +21 -22
- package/dist/line-chart/chart-region.d.ts.map +1 -1
- package/dist/line-chart/chart-region.js +5 -1
- package/dist/line-chart/chart-region.js.map +1 -1
- package/dist/line-chart/horizontal-axis.d.ts +43 -25
- package/dist/line-chart/horizontal-axis.d.ts.map +1 -1
- package/dist/line-chart/horizontal-axis.js +10 -1
- package/dist/line-chart/horizontal-axis.js.map +1 -1
- package/dist/line-chart/line-chart.d.ts +46 -1
- package/dist/line-chart/line-chart.d.ts.map +1 -1
- package/dist/pie-chart/pie-chart.d.ts +34 -1
- package/dist/pie-chart/pie-chart.d.ts.map +1 -1
- package/dist/pie-chart/pie-legend.d.ts +31 -1
- package/dist/pie-chart/pie-legend.d.ts.map +1 -1
- package/dist/pie-chart/pie-ring.d.ts +19 -1
- package/dist/pie-chart/pie-ring.d.ts.map +1 -1
- package/dist/pie-chart/shared.d.ts +2 -2
- package/dist/pie-chart/shared.d.ts.map +1 -1
- package/dist/pie-chart/shared.js +2 -2
- package/dist/pie-chart/shared.js.map +1 -1
- package/package.json +4 -4
- package/src/line-chart/chart-line.ts +11 -36
- package/src/line-chart/chart-region.ts +5 -21
- package/src/line-chart/horizontal-axis.ts +10 -25
- package/src/pie-chart/shared.ts +2 -2
|
@@ -15,7 +15,7 @@ const SLIDE = 24;
|
|
|
15
15
|
* `2026-03` sits three months along, not three slots along. That is what keeps
|
|
16
16
|
* it distinct from a bar chart's bottom axis, which centres a caption on each
|
|
17
17
|
* slot and has no scale at all — the two only look alike. What the values are
|
|
18
|
-
* captioned *as* is the chart's to decide
|
|
18
|
+
* captioned *as* is the chart's to decide, in `captions`.
|
|
19
19
|
*
|
|
20
20
|
* `enter` staggers the markers in **left-to-right**: each starts lifted a
|
|
21
21
|
* little above its slot and transparent, then fades and slides down into place.
|
|
@@ -23,10 +23,19 @@ const SLIDE = 24;
|
|
|
23
23
|
export const HorizontalAxis = component2d({
|
|
24
24
|
key: "horizontalAxis",
|
|
25
25
|
state: {
|
|
26
|
+
/** `[min, max]` of the horizontal scale the markers are positioned within. */
|
|
26
27
|
range: fresh(() => [0, 1]),
|
|
28
|
+
/** Tick values (in data units) to draw along the axis. */
|
|
27
29
|
markers: fresh(() => []),
|
|
30
|
+
/**
|
|
31
|
+
* How each marker is captioned, one per entry of `markers` and in its order.
|
|
32
|
+
* Empty (the default), or short, captions a marker with its bare numeric
|
|
33
|
+
* reading; a chart whose x column names months or categories writes those.
|
|
34
|
+
*/
|
|
28
35
|
captions: fresh(() => []),
|
|
36
|
+
/** Marker/caption text style, grid stroke, and gutters — see {@link AxisConfig}. */
|
|
29
37
|
axis: Types.custom(DEFAULT_X_AXIS),
|
|
38
|
+
/** Caption drawn centred in the gutter beneath the marker row; empty (the default) hides it. */
|
|
30
39
|
label: "",
|
|
31
40
|
arrivals: arrivalsEntry(),
|
|
32
41
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"horizontal-axis.js","sourceRoot":"","sources":["../../src/line-chart/horizontal-axis.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,WAAW,EACX,SAAS,EACT,OAAO,GAIR,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAgB,MAAM,eAAe,CAAC;AACzG,OAAO,EACL,cAAc,EACd,WAAW,GAGZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAsBrD,oEAAoE;AACpE,MAAM,KAAK,GAAG,EAAE,CAAC;AAKjB;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC;IACxC,GAAG,EAAE,gBAAgB;IACrB,KAAK,EAAE;QACL,KAAK,EAAE,KAAK,CAAQ,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACjC,OAAO,EAAE,KAAK,CAAW,GAAG,EAAE,CAAC,EAAE,CAAC;QAClC,QAAQ,EAAE,KAAK,CAAW,GAAG,EAAE,CAAC,EAAE,CAAC;QACnC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAa,cAAc,CAAC;QAC9C,KAAK,EAAE,EAAE;QACT,QAAQ,EAAE,aAAa,EAAE;KAC1B;IACD,0EAA0E;IAC1E,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;IAC3C,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;QAClB,MAAM,OAAO,GAAG,SAAS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type Node2D,\r\n type Node2DProps,\r\n} from \"@motionscript/sdk\";\r\n\r\nimport { asParts, fresh } from \"../kit/entries\";\r\nimport { armed, arrival, arrivalOf, arrivalsEntry, beats, frameEase, type Arrival } from \"../kit/motion\";\r\nimport {\r\n DEFAULT_X_AXIS,\r\n enterBudget,\r\n type AxisConfig,\r\n type Range,\r\n} from \"../kit/shared\";\r\nimport { markerCaption } from \"../kit/vertical-axis\";\r\n\r\nexport interface HorizontalAxisProps extends Node2DProps {\r\n /** `[min, max]` of the horizontal scale the markers are positioned within. */\r\n range: Range;\r\n /** Tick values (in data units) to draw along the axis. */\r\n markers: number[];\r\n /**\r\n * How each marker is captioned, one per entry of `markers` and in its order.\r\n * Empty (the default), or short, captions a marker with its bare numeric\r\n * reading; a chart whose x column names months or categories writes those.\r\n */\r\n captions: string[];\r\n /** Marker/caption text style, grid stroke, and gutters — see {@link AxisConfig}. */\r\n axis: AxisConfig;\r\n /**\r\n * Caption drawn centred in the gutter beneath the marker row. Empty string\r\n * (the default) hides it.\r\n */\r\n label: string;\r\n}\r\n\r\n/** How far a marker starts above its slot when it enters, in px. */\r\nconst SLIDE = 24;\r\n\r\n/** How a tick value is captioned — see {@link HorizontalAxisProps.captions}. */\r\nexport type MarkerLabel = (value: number) => string;\r\n\r\n/**\r\n * The horizontal axis of a {@link LineChart}: a **row of {@link Text} nodes**,\r\n * one per marker value, running left-to-right. Pure layout — the mirror of the\r\n * kit's `VerticalAxis`, including its bound (not snapshotted) marker text and\r\n * positions, and its landed resting state.\r\n *\r\n * Markers are always placed **by value** across the range, whatever they say:\r\n * `2026-03` sits three months along, not three slots along. That is what keeps\r\n * it distinct from a bar chart's bottom axis, which centres a caption on each\r\n * slot and has no scale at all — the two only look alike. What the values are\r\n * captioned *as* is the chart's to decide; see {@link HorizontalAxisProps.captions}.\r\n *\r\n * `enter` staggers the markers in **left-to-right**: each starts lifted a\r\n * little above its slot and transparent, then fades and slides down into place.\r\n */\r\nexport const HorizontalAxis = component2d({\r\n key: \"horizontalAxis\",\r\n state: {\r\n range: fresh<Range>(() => [0, 1]),\r\n markers: fresh<number[]>(() => []),\r\n captions: fresh<string[]>(() => []),\r\n axis: Types.custom<AxisConfig>(DEFAULT_X_AXIS),\r\n label: \"\",\r\n arrivals: arrivalsEntry(),\r\n },\r\n // A plain node filled its parent; one made of its markers would hug them.\r\n defaults: { width: \"fill\", height: \"fill\" },\r\n children: (state) => {\r\n const tickPad = insetsOps.resolve(state.axis.tickPadding).top;\r\n const titlePad = insetsOps.resolve(state.axis.titlePadding).top;\r\n\r\n const column: Node2D[] = [];\r\n // The column's parent is the axis: its box is what the markers are placed in.\r\n const box = () => (column[0]?.parent as Node2D | null | undefined)?.layoutBounds ?? { width: 0, height: 0 };\r\n /** The live tick values, left → right — re-read every frame, not snapshotted. */\r\n const sorted = () => [...state.markers].sort((a, b) => a - b);\r\n /** Tick `i`'s fraction across the live `range`, 0 at the left edge. */\r\n const fracAt = (value: number | undefined) => {\r\n if (value === undefined) return 0;\r\n const [min, max] = state.range;\r\n return max <= min ? 0 : (value - min) / (max - min);\r\n };\r\n\r\n const markers = state.markers.map((_, i) => {\r\n const marker: Node2D = new Text({\r\n ...textOps.styleProps(state.axis.labelStyle),\r\n text: () => {\r\n const value = sorted()[i];\r\n return value === undefined ? \"\" : markerCaption(state, value);\r\n },\r\n x: () => {\r\n const width = box().width;\r\n const centred = (fracAt(sorted()[i]) - 0.5) * width;\r\n // Held inside the axis's right edge, which is also the *chart's*: the\r\n // last marker is centred on the last grid line, so half of `2026-06`\r\n // — or of `3300` — would be drawn outside the node's box and outside\r\n // the rectangle the editor draws around it. Only the right edge is\r\n // held, because the left one has the vertical axis's whole gutter\r\n // beyond it, and a marker overhanging into that is inside the chart.\r\n const limit = width / 2 - marker.layoutBounds.width / 2;\r\n return Math.min(centred, limit);\r\n },\r\n opacity: () => arrivalOf(state.arrivals, i).opacity,\r\n y: () => arrivalOf(state.arrivals, i).shift,\r\n });\r\n return marker;\r\n });\r\n\r\n const children: Node2D[] = [\r\n new Rect({ width: \"fill\", height: \"hug\", padding: { top: tickPad }, children: markers }),\r\n ];\r\n if (state.label !== \"\") {\r\n children.push(\r\n new Text({\r\n ...textOps.styleProps(state.axis.titleStyle),\r\n text: state.label,\r\n opacity: () => arrivalOf(state.arrivals, \"label\").opacity,\r\n y: () => arrivalOf(state.arrivals, \"label\").shift,\r\n }),\r\n );\r\n }\r\n\r\n column.push(new Rect({ flow: \"vertical\", gap: titlePad, height: \"hug\", width: \"fill\", children }));\r\n return asParts(column);\r\n },\r\n commands: {\r\n /**\r\n * Stagger the markers in left to right, then slide the caption in after\r\n * them. Its first frame arms them all: lifted by `slide` and transparent.\r\n *\r\n * The timeline's duration is the **whole** entrance — see\r\n * `VerticalAxis.enter` and {@link enterBudget}.\r\n */\r\n enter: {\r\n args: {\r\n stagger: Types.custom<number | undefined>(undefined),\r\n slide: Types.number(SLIDE),\r\n },\r\n run: (timeline, state) => {\r\n const { stagger, slide } = timeline.args;\r\n const count = state.markers.length;\r\n const captioned = state.label !== \"\";\r\n const from: Arrival = { opacity: 0, shift: slide };\r\n const keys = [...state.markers.keys(), ...(captioned ? [\"label\"] : [])];\r\n const arm = timeline.animate(() => ({ arrivals: armed(keys, from) }));\r\n if (count === 0) return arm;\r\n const { step, per, caption } = enterBudget(timeline.duration, count, captioned, stagger);\r\n const ease = frameEase(timeline);\r\n // Left marker leads: the row is already left → right.\r\n const markers = state.markers.map((_, i) => ({ at: i * step, duration: per, piece: arrival(timeline, i, from, ease) }));\r\n const label = captioned ? [{ at: (count - 1) * step + per, duration: caption, piece: arrival(timeline, \"label\", from, ease) }] : [];\r\n return timeline.together([arm, beats(timeline, [...markers, ...label])]);\r\n },\r\n },\r\n },\r\n});\r\n\r\nexport type HorizontalAxis = NodeOf<typeof HorizontalAxis>;\r\n"]}
|
|
1
|
+
{"version":3,"file":"horizontal-axis.js","sourceRoot":"","sources":["../../src/line-chart/horizontal-axis.ts"],"names":[],"mappings":"AAAA,O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,CAAC,CAAC;gBACtE,IAAI,KAAK,KAAK,CAAC;oBAAE,OAAO,GAAG,CAAC;gBAC5B,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,WAAW,CAAC,QAAQ,CAAC,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;gBACzF,MAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;gBACjC,sDAAsD;gBACtD,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;gBACxH,MAAM,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBACpI,OAAO,QAAQ,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,GAAG,OAAO,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAC3E,CAAC;SACF;KACF;CACF,CAAC,CAAC","sourcesContent":["import {\r\n Rect,\r\n Text,\r\n Types,\r\n component2d,\r\n insetsOps,\r\n textOps,\r\n type NodeOf,\r\n type Node2D,\r\n} from \"@motionscript/sdk\";\r\n\r\nimport { asParts, fresh } from \"../kit/entries\";\r\nimport { armed, arrival, arrivalOf, arrivalsEntry, beats, frameEase, type Arrival } from \"../kit/motion\";\r\nimport {\r\n DEFAULT_X_AXIS,\r\n enterBudget,\r\n type AxisConfig,\r\n type Range,\r\n} from \"../kit/shared\";\r\nimport { markerCaption } from \"../kit/vertical-axis\";\r\n\r\n/** How far a marker starts above its slot when it enters, in px. */\r\nconst SLIDE = 24;\r\n\r\n/**\r\n * The horizontal axis of a {@link LineChart}: a **row of {@link Text} nodes**,\r\n * one per marker value, running left-to-right. Pure layout — the mirror of the\r\n * kit's `VerticalAxis`, including its bound (not snapshotted) marker text and\r\n * positions, and its landed resting state.\r\n *\r\n * Markers are always placed **by value** across the range, whatever they say:\r\n * `2026-03` sits three months along, not three slots along. That is what keeps\r\n * it distinct from a bar chart's bottom axis, which centres a caption on each\r\n * slot and has no scale at all — the two only look alike. What the values are\r\n * captioned *as* is the chart's to decide, in `captions`.\r\n *\r\n * `enter` staggers the markers in **left-to-right**: each starts lifted a\r\n * little above its slot and transparent, then fades and slides down into place.\r\n */\r\nexport const HorizontalAxis = component2d({\r\n key: \"horizontalAxis\",\r\n state: {\r\n /** `[min, max]` of the horizontal scale the markers are positioned within. */\r\n range: fresh<Range>(() => [0, 1]),\r\n /** Tick values (in data units) to draw along the axis. */\r\n markers: fresh<number[]>(() => []),\r\n /**\r\n * How each marker is captioned, one per entry of `markers` and in its order.\r\n * Empty (the default), or short, captions a marker with its bare numeric\r\n * reading; a chart whose x column names months or categories writes those.\r\n */\r\n captions: fresh<string[]>(() => []),\r\n /** Marker/caption text style, grid stroke, and gutters — see {@link AxisConfig}. */\r\n axis: Types.custom<AxisConfig>(DEFAULT_X_AXIS),\r\n /** Caption drawn centred in the gutter beneath the marker row; empty (the default) hides it. */\r\n label: \"\",\r\n arrivals: arrivalsEntry(),\r\n },\r\n // A plain node filled its parent; one made of its markers would hug them.\r\n defaults: { width: \"fill\", height: \"fill\" },\r\n children: (state) => {\r\n const tickPad = insetsOps.resolve(state.axis.tickPadding).top;\r\n const titlePad = insetsOps.resolve(state.axis.titlePadding).top;\r\n\r\n const column: Node2D[] = [];\r\n // The column's parent is the axis: its box is what the markers are placed in.\r\n const box = () => (column[0]?.parent as Node2D | null | undefined)?.layoutBounds ?? { width: 0, height: 0 };\r\n /** The live tick values, left → right — re-read every frame, not snapshotted. */\r\n const sorted = () => [...state.markers].sort((a, b) => a - b);\r\n /** Tick `i`'s fraction across the live `range`, 0 at the left edge. */\r\n const fracAt = (value: number | undefined) => {\r\n if (value === undefined) return 0;\r\n const [min, max] = state.range;\r\n return max <= min ? 0 : (value - min) / (max - min);\r\n };\r\n\r\n const markers = state.markers.map((_, i) => {\r\n const marker: Node2D = new Text({\r\n ...textOps.styleProps(state.axis.labelStyle),\r\n text: () => {\r\n const value = sorted()[i];\r\n return value === undefined ? \"\" : markerCaption(state, value);\r\n },\r\n x: () => {\r\n const width = box().width;\r\n const centred = (fracAt(sorted()[i]) - 0.5) * width;\r\n // Held inside the axis's right edge, which is also the *chart's*: the\r\n // last marker is centred on the last grid line, so half of `2026-06`\r\n // — or of `3300` — would be drawn outside the node's box and outside\r\n // the rectangle the editor draws around it. Only the right edge is\r\n // held, because the left one has the vertical axis's whole gutter\r\n // beyond it, and a marker overhanging into that is inside the chart.\r\n const limit = width / 2 - marker.layoutBounds.width / 2;\r\n return Math.min(centred, limit);\r\n },\r\n opacity: () => arrivalOf(state.arrivals, i).opacity,\r\n y: () => arrivalOf(state.arrivals, i).shift,\r\n });\r\n return marker;\r\n });\r\n\r\n const children: Node2D[] = [\r\n new Rect({ width: \"fill\", height: \"hug\", padding: { top: tickPad }, children: markers }),\r\n ];\r\n if (state.label !== \"\") {\r\n children.push(\r\n new Text({\r\n ...textOps.styleProps(state.axis.titleStyle),\r\n text: state.label,\r\n opacity: () => arrivalOf(state.arrivals, \"label\").opacity,\r\n y: () => arrivalOf(state.arrivals, \"label\").shift,\r\n }),\r\n );\r\n }\r\n\r\n column.push(new Rect({ flow: \"vertical\", gap: titlePad, height: \"hug\", width: \"fill\", children }));\r\n return asParts(column);\r\n },\r\n commands: {\r\n /**\r\n * Stagger the markers in left to right, then slide the caption in after\r\n * them. Its first frame arms them all: lifted by `slide` and transparent.\r\n *\r\n * The timeline's duration is the **whole** entrance — see\r\n * `VerticalAxis.enter` and {@link enterBudget}.\r\n */\r\n enter: {\r\n args: {\r\n stagger: Types.custom<number | undefined>(undefined),\r\n slide: Types.number(SLIDE),\r\n },\r\n run: (timeline, state) => {\r\n const { stagger, slide } = timeline.args;\r\n const count = state.markers.length;\r\n const captioned = state.label !== \"\";\r\n const from: Arrival = { opacity: 0, shift: slide };\r\n const keys = [...state.markers.keys(), ...(captioned ? [\"label\"] : [])];\r\n const arm = timeline.animate(() => ({ arrivals: armed(keys, from) }));\r\n if (count === 0) return arm;\r\n const { step, per, caption } = enterBudget(timeline.duration, count, captioned, stagger);\r\n const ease = frameEase(timeline);\r\n // Left marker leads: the row is already left → right.\r\n const markers = state.markers.map((_, i) => ({ at: i * step, duration: per, piece: arrival(timeline, i, from, ease) }));\r\n const label = captioned ? [{ at: (count - 1) * step + per, duration: caption, piece: arrival(timeline, \"label\", from, ease) }] : [];\r\n return timeline.together([arm, beats(timeline, [...markers, ...label])]);\r\n },\r\n },\r\n },\r\n});\r\n\r\nexport type HorizontalAxis = NodeOf<typeof HorizontalAxis>;\r\n"]}
|
|
@@ -150,6 +150,51 @@ export declare const LineChart: import("@motionscript/sdk").Component<"lineChart
|
|
|
150
150
|
* remembers wherever the chart rests then.
|
|
151
151
|
*/
|
|
152
152
|
readonly home: import("@motionscript/sdk").Type<LineChartDomains | null, LineChartDomains | null, false>;
|
|
153
|
-
}>, null
|
|
153
|
+
}>, null, import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
|
|
154
|
+
readonly data: import("@motionscript/sdk").Type<DataRecord[], DataRecord[], false>;
|
|
155
|
+
readonly xField: "";
|
|
156
|
+
readonly series: import("@motionscript/sdk").Type<import("../index.js").ChartSeries[], import("../index.js").ChartSeries[], false>;
|
|
157
|
+
readonly xAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
|
|
158
|
+
readonly yAxis: import("@motionscript/sdk").Type<AxisDomainConfig, AxisDomainConfig, false>;
|
|
159
|
+
readonly theme: import("@motionscript/sdk").Type<ChartTheme, ChartConfig, false>;
|
|
160
|
+
/**
|
|
161
|
+
* The spotlit slice of the plot in data units, or `null` for none. The box
|
|
162
|
+
* snaps; the animation is {@link regionReveal} drawing the rules on.
|
|
163
|
+
*/
|
|
164
|
+
readonly region: import("@motionscript/sdk").Type<PlotRegion | null, PlotRegion | null, false>;
|
|
165
|
+
/**
|
|
166
|
+
* How far the `region` call-out is drawn in, `[0, 1]`: the rules grow out and
|
|
167
|
+
* the wash fades up as it climbs, while every line's out-of-region stretch
|
|
168
|
+
* fades to the theme's `region.dimOpacity`.
|
|
169
|
+
*/
|
|
170
|
+
readonly regionReveal: 0;
|
|
171
|
+
/** Read as the chart is built: the legend is a part the chart builds or doesn't. */
|
|
172
|
+
readonly showLegend: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
173
|
+
/**
|
|
174
|
+
* The domain `zoomTo` first left, so `resetZoom` restores the chart as it
|
|
175
|
+
* stood, auto-derived ticks included. Cleared by `resetZoom`, so the next zoom
|
|
176
|
+
* remembers wherever the chart rests then.
|
|
177
|
+
*/
|
|
178
|
+
readonly home: import("@motionscript/sdk").Type<LineChartDomains | null, LineChartDomains | null, false>;
|
|
179
|
+
}>, {
|
|
180
|
+
readonly enter: {};
|
|
181
|
+
readonly spotlightRegion: {
|
|
182
|
+
readonly region: import("@motionscript/sdk").Type<PlotRegion | undefined, PlotRegion | undefined, false>;
|
|
183
|
+
};
|
|
184
|
+
readonly clearRegion: {};
|
|
185
|
+
readonly zoomTo: {
|
|
186
|
+
readonly region: import("@motionscript/sdk").Type<PlotRegion | undefined, PlotRegion | undefined, false>;
|
|
187
|
+
};
|
|
188
|
+
readonly resetZoom: {};
|
|
189
|
+
readonly showSeries: {
|
|
190
|
+
readonly seriesIndex: import("@motionscript/sdk").Type<number, number, false>;
|
|
191
|
+
};
|
|
192
|
+
readonly hideSeries: {
|
|
193
|
+
readonly seriesIndex: import("@motionscript/sdk").Type<number, number, false>;
|
|
194
|
+
};
|
|
195
|
+
readonly spotlightSeries: {
|
|
196
|
+
readonly seriesIndex: import("@motionscript/sdk").Type<number, number, false>;
|
|
197
|
+
};
|
|
198
|
+
}, Node2D<Node2DProps>>>>;
|
|
154
199
|
export type LineChart = NodeOf<typeof LineChart>;
|
|
155
200
|
//# sourceMappingURL=line-chart.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line-chart.d.ts","sourceRoot":"","sources":["../../src/line-chart/line-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,UAAU,EAEf,KAAK,MAAM,EAEX,KAAK,MAAM,EACX,KAAK,WAAW,EAIjB,MAAM,mBAAmB,CAAA;AAU1B,OAAO,EAWL,KAAK,gBAAgB,EACrB,KAAK,KAAK,EACX,MAAM,eAAe,CAAA;AAItB,OAAO,EAOL,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,UAAU,EAEhB,MAAM,UAAU,CAAA;AAGjB,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD,kEAAkE;IAClE,IAAI,EAAE,UAAU,EAAE,CAAA;IAClB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAA;IACd,oFAAoF;IACpF,MAAM,EAAE,UAAU,EAAE,CAAA;IACpB,oEAAoE;IACpE,KAAK,CAAC,EAAE,gBAAgB,CAAA;IACxB,oEAAoE;IACpE,KAAK,CAAC,EAAE,gBAAgB,CAAA;IACxB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,CAAA;IAC1B;;;;OAIG;IACH,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,+DAA+D;AAC/D,M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AAG,gBAAgB,CAKrE;AAoGD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,SAAS;;;;;;;IASlB;;;OAGG;;IAEH;;;;OAIG;;IAEH,oFAAoF;;IAEpF;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAjBH;;;OAGG;;IAEH;;;;OAIG;;IAEH,oFAAoF;;IAEpF;;;;OAIG;;;;;;;;;IAjBH;;;OAGG;;IAEH;;;;OAIG;;IAEH,oFAAoF;;IAEpF;;;;OAIG;;;;;;;;;;;;;;;;;;;;;yBA4PL,CAAA;AAEF,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,SAAS,CAAC,CAAA"}
|
|
@@ -114,6 +114,39 @@ export declare const PieChart: import("@motionscript/sdk").Component<"pieChart",
|
|
|
114
114
|
readonly showLegend: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
115
115
|
/** Read as the chart is built: whether the hole's summary is drawn at rest. */
|
|
116
116
|
readonly showCenter: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
117
|
-
}>, null
|
|
117
|
+
}>, null, import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
|
|
118
|
+
readonly data: import("@motionscript/sdk").Type<DataRecord[], DataRecord[], false>;
|
|
119
|
+
readonly categoryField: "";
|
|
120
|
+
readonly valueField: "";
|
|
121
|
+
readonly theme: import("@motionscript/sdk").Type<PieChartTheme, PieChartConfig, false>;
|
|
122
|
+
readonly labelMode: import("@motionscript/sdk").Type<PieLabelMode, PieLabelMode, false>;
|
|
123
|
+
readonly labelPlacement: import("@motionscript/sdk").Type<PieLabelPlacement, PieLabelPlacement, false>;
|
|
124
|
+
readonly gap: 40;
|
|
125
|
+
readonly centerLabel: "";
|
|
126
|
+
readonly centerCaption: "";
|
|
127
|
+
/**
|
|
128
|
+
* How far each slice is pushed out of the ring, `0`–`1` per index. Held here
|
|
129
|
+
* rather than on the ring because two parts read it: the wedges grow out by
|
|
130
|
+
* it, and the legend entries dim by it. Seeded flush, one to a row.
|
|
131
|
+
*/
|
|
132
|
+
readonly pops: import("@motionscript/sdk").Type<number[], number[], false>;
|
|
133
|
+
/** Read as the chart is built: the legend is a part the chart builds or doesn't. */
|
|
134
|
+
readonly showLegend: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
135
|
+
/** Read as the chart is built: whether the hole's summary is drawn at rest. */
|
|
136
|
+
readonly showCenter: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
137
|
+
}>, {
|
|
138
|
+
readonly enter: {};
|
|
139
|
+
readonly revealCenter: {};
|
|
140
|
+
readonly selectSlice: {
|
|
141
|
+
readonly sliceIndex: import("@motionscript/sdk").Type<number, number, false>;
|
|
142
|
+
};
|
|
143
|
+
readonly deselectSlice: {
|
|
144
|
+
readonly sliceIndex: import("@motionscript/sdk").Type<number, number, false>;
|
|
145
|
+
};
|
|
146
|
+
readonly selectOnlySlice: {
|
|
147
|
+
readonly sliceIndex: import("@motionscript/sdk").Type<number, number, false>;
|
|
148
|
+
};
|
|
149
|
+
readonly clearSelection: {};
|
|
150
|
+
}, Node2D<Node2DProps>>>>;
|
|
118
151
|
export type PieChart = NodeOf<typeof PieChart>;
|
|
119
152
|
//# sourceMappingURL=pie-chart.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pie-chart.d.ts","sourceRoot":"","sources":["../../src/pie-chart/pie-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,UAAU,EACf,KAAK,MAAM,EAEX,KAAK,MAAM,EACX,KAAK,WAAW,EAEjB,MAAM,mBAAmB,CAAA;AAO1B,OAAO,EAKL,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EAEvB,MAAM,UAAU,CAAA;AAEjB,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD,iEAAiE;IACjE,IAAI,EAAE,UAAU,EAAE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;;IAEH,oFAAoF;;IAEpF,+EAA+E;;;;;;;;;;;;;;;;;;;;;;;;;IAR/E;;;;OAIG;;IAEH,oFAAoF;;IAEpF,+EAA+E;;;;;;;;;;;;IAR/E;;;;OAIG;;IAEH,oFAAoF;;IAEpF,+EAA+E;;;;;;;;;;;;;;;yBAsHjF,CAAA;AAEF,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAA"}
|
|
@@ -78,6 +78,36 @@ export declare const PieLegend: import("@motionscript/sdk").Component<"pieLegend
|
|
|
78
78
|
readonly overlay: import("@motionscript/sdk").Attribute<_Fill, _FillResolved[]>;
|
|
79
79
|
readonly start: import("@motionscript/sdk").Type<number, number, false>;
|
|
80
80
|
readonly end: import("@motionscript/sdk").Type<number, number, false>;
|
|
81
|
-
}>, null
|
|
81
|
+
}>, null, import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
|
|
82
|
+
readonly slices: import("@motionscript/sdk").Type<PieSlice[], PieSlice[], false>;
|
|
83
|
+
readonly legend: import("@motionscript/sdk").Type<LegendConfig, LegendConfig, false>;
|
|
84
|
+
readonly dims: import("@motionscript/sdk").Type<number[], number[], false>;
|
|
85
|
+
readonly arrivals: import("@motionscript/sdk").Type<Readonly<Record<string, Arrival>>, Readonly<Record<string, Arrival>>, false>;
|
|
86
|
+
readonly cornerRadius: import("@motionscript/sdk").Attribute<_RectCornerRadius, _CornerRadiusResolved>;
|
|
87
|
+
readonly cornerStyle: import("@motionscript/sdk").Attribute<_RectCornerStyle, _CornerStyleResolved>;
|
|
88
|
+
readonly flow: import("@motionscript/sdk").Type<_FlowMode, _FlowResolved, false>;
|
|
89
|
+
readonly gap: import("@motionscript/sdk").Type<_GapSize, _GapSize, false>;
|
|
90
|
+
readonly wrap: boolean;
|
|
91
|
+
readonly crossGap: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
|
|
92
|
+
readonly columns: import("@motionscript/sdk").Type<number, number, false>;
|
|
93
|
+
readonly align: import("@motionscript/sdk").Attribute<_Alignment, _Vector2>;
|
|
94
|
+
readonly fill: import("@motionscript/sdk").Attribute<_Fill, _FillResolved[]>;
|
|
95
|
+
readonly stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
|
|
96
|
+
readonly shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
|
|
97
|
+
readonly overlay: import("@motionscript/sdk").Attribute<_Fill, _FillResolved[]>;
|
|
98
|
+
readonly start: import("@motionscript/sdk").Type<number, number, false>;
|
|
99
|
+
readonly end: import("@motionscript/sdk").Type<number, number, false>;
|
|
100
|
+
}>, {
|
|
101
|
+
readonly arm: unknown;
|
|
102
|
+
readonly enter: unknown;
|
|
103
|
+
readonly fillTo: readonly ["fill"];
|
|
104
|
+
readonly strokeTo: readonly ["stroke"];
|
|
105
|
+
readonly shadowTo: readonly ["shadow"];
|
|
106
|
+
readonly overlayTo: readonly ["overlay"];
|
|
107
|
+
readonly progressTo: readonly ["start", "end"];
|
|
108
|
+
readonly flash: {
|
|
109
|
+
readonly portion: import("@motionscript/sdk").Type<number, number, false>;
|
|
110
|
+
};
|
|
111
|
+
}, _Node2D<_Node2DProps>>>>;
|
|
82
112
|
export type PieLegend = NodeOf<typeof PieLegend>;
|
|
83
113
|
//# sourceMappingURL=pie-legend.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pie-legend.d.ts","sourceRoot":"","sources":["../../src/pie-chart/pie-legend.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,MAAM,EACX,KAAK,SAAS,EAEd,KAAK,SAAS,IAAI,UAAU,EAC5B,KAAK,oBAAoB,IAAI,qBAAqB,EAClD,KAAK,mBAAmB,IAAI,oBAAoB,EAChD,KAAK,IAAI,IAAI,KAAK,EAClB,KAAK,YAAY,IAAI,aAAa,EAClC,KAAK,QAAQ,IAAI,SAAS,EAC1B,KAAK,YAAY,IAAI,a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AiB,EAC1C,KAAK,eAAe,IAAI,gBAAgB,EACxC,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,cAAc,IAAI,eAAe,EACtC,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,cAAc,IAAI,eAAe,EACtC,KAAK,OAAO,IAAI,QAAQ,EACzB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EAA8D,KAAK,OAAO,EAAE,MAAM,eAAe,CAAA;AACxG,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAExC,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C,0CAA0C;IAC1C,MAAM,EAAE,QAAQ,EAAE,CAAA;IAClB,oFAAoF;IACpF,MAAM,EAAE,YAAY,CAAA;IACpB;;;OAGG;IACH,IAAI,EAAE,MAAM,EAAE,CAAA;CACf;AAKD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BA+FpB,CAAA;AAEF,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,SAAS,CAAC,CAAA"}
|
|
@@ -280,7 +280,25 @@ export declare const PieRing: import("@motionscript/sdk").Component<"pieRing", i
|
|
|
280
280
|
readonly centerLabel: "";
|
|
281
281
|
readonly centerCaption: "";
|
|
282
282
|
readonly centerReveal: 1;
|
|
283
|
-
}>, null
|
|
283
|
+
}>, null, import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
|
|
284
|
+
readonly slices: import("@motionscript/sdk").Type<PieSlice[], PieSlice[], false>;
|
|
285
|
+
readonly ring: import("@motionscript/sdk").Type<RingConfig, RingConfig, false>;
|
|
286
|
+
readonly label: import("@motionscript/sdk").Type<LabelConfig, LabelConfig, false>;
|
|
287
|
+
readonly centerStyle: import("@motionscript/sdk").Type<CenterConfig, CenterConfig, false>;
|
|
288
|
+
readonly labelMode: import("@motionscript/sdk").Type<PieLabelMode, PieLabelMode, false>;
|
|
289
|
+
readonly labelPlacement: import("@motionscript/sdk").Type<PieLabelPlacement, PieLabelPlacement, false>;
|
|
290
|
+
readonly growth: 1;
|
|
291
|
+
readonly labelReveal: 1;
|
|
292
|
+
readonly pops: import("@motionscript/sdk").Type<number[], number[], false>;
|
|
293
|
+
readonly dimOpacity: number;
|
|
294
|
+
readonly centerLabel: "";
|
|
295
|
+
readonly centerCaption: "";
|
|
296
|
+
readonly centerReveal: 1;
|
|
297
|
+
}>, {
|
|
298
|
+
readonly sweep: unknown;
|
|
299
|
+
readonly revealLabels: unknown;
|
|
300
|
+
readonly revealCenter: unknown;
|
|
301
|
+
}, Node2D<Node2DProps>>>>;
|
|
284
302
|
export type PieRing = NodeOf<typeof PieRing>;
|
|
285
303
|
export {};
|
|
286
304
|
//# sourceMappingURL=pie-ring.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pie-ring.d.ts","sourceRoot":"","sources":["../../src/pie-chart/pie-ring.ts"],"names":[],"mappings":"AAAA,OAAO,EAYL,KAAK,YAAY,EACjB,KAAK,MAAM,EACX,KAAK,MAAM,EACX,KAAK,WAAW,EAEhB,KAAK,OAAO,EACb,MAAM,mBAAmB,CAAA;AAM1B,OAAO,EAKL,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,KAAK,UAAU,EAChB,MAAM,UAAU,CAAA;AAEjB,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC/C,+DAA+D;IAC/D,MAAM,EAAE,QAAQ,EAAE,CAAA;IAClB,0EAA0E;IAC1E,IAAI,EAAE,UAAU,CAAA;IAChB,uEAAuE;IACvE,KAAK,EAAE,WAAW,CAAA;IAClB;;;;;OA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AAG,MAAM;IAMpC,4DAA4D;IAC5D,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAOpC;;;;OAIG;IACH,IAAI,iBAAiB,IAAI,MAAM,CAI9B;IAED;;;;;OAKG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAMnC,oFAAoF;IACpF,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAOlC;;;;;;;OAOG;IACH,UAAU,IAAI,cAAc,EAAE;IAmD9B,qFAAqF;IACrF,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;CAGxD;AAwBD,mCAAmC;AACnC,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,GAAG,YAAY,EAAE,EAAE,CAEvE;AA4HD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA+GlB,CAAA;AAEF,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,OAAO,CAAC,CAAA"}
|
|
@@ -199,12 +199,12 @@ export type PieChartTheme = {
|
|
|
199
199
|
/** The pie chart's out-of-the-box look. */
|
|
200
200
|
export declare const DEFAULT_PIE_CHART_THEME: PieChartConfig;
|
|
201
201
|
/**
|
|
202
|
-
* {@link PieChart}'s `theme`
|
|
202
|
+
* {@link PieChart}'s `theme` property mapper: merges the author's partial
|
|
203
203
|
* {@link PieChartTheme} onto `previous` (falling back to
|
|
204
204
|
* {@link DEFAULT_PIE_CHART_THEME} on first resolution), fully resolving every
|
|
205
205
|
* leaf so the tween below always has resolved data to interpolate.
|
|
206
206
|
*/
|
|
207
207
|
export declare function resolvePieChartTheme(theme: PieChartTheme | undefined, previous?: PieChartConfig): PieChartConfig;
|
|
208
|
-
/** {@link PieChart}'s `theme`
|
|
208
|
+
/** {@link PieChart}'s `theme` property tween — leaf by leaf. */
|
|
209
209
|
export declare function lerpPieChartTheme(from: PieChartConfig, to: PieChartConfig, t: number): PieChartConfig;
|
|
210
210
|
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/pie-chart/shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAKL,KAAK,UAAU,EACf,KAAK,IAAI,EACT,KAAK,MAAM,EAEX,KAAK,MAAM,EAEX,KAAK,SAAS,EACd,KAAK,OAAO,EACb,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAWL,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,eAAe,CAAA;AAEtB;;;;;;;;GAQG;AACH,MAAM,WAAW,QAAQ;IACvB,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAA;IAChB,8EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAA;IACb,8BAA8B;IAC9B,IAAI,EAAE,IAAI,CAAA;CACX;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,UAAU,EAAE,EAClB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,IAAI,EAAE,GACd,QAAQ,EAAE,CAOZ;AAED,4CAA4C;AAC5C,MAAM,MAAM,YAAY;AACtB;;;;;;GAMG;AACD,MAAM;AACR,yBAAyB;GACvB,UAAU;AACZ,iFAAiF;GAC/E,SAAS;AACX,4CAA4C;GAC1C,MAAM,CAAA;AAEV;;;;;;;GAOG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAA;AAE5D,yBAAyB;AACzB,eAAO,MAAM,GAAG,QAAgB,CAAA;AAEhC,2EAA2E;AAC3E,wBAAgB,UAAU,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAElD;AAED,yFAAyF;AACzF,wBAAgB,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IACrB,YAAY,EAAE,SAAS,CAAA;CACxB;AAED,wDAAwD;AACxD,MAAM,WAAW,cAAc;IAC7B,sEAAsE;IACtE,UAAU,EAAE,IAAI,EAAE,CAAA;IAClB,IAAI,EAAE,UAAU,CAAA;IAChB,KAAK,EAAE,WAAW,CAAA;IAClB,MAAM,EAAE,YAAY,CAAA;IACpB,MAAM,EAAE,YAAY,CAAA;IACpB,kFAAkF;IAClF,SAAS,EAAE;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;CAClC;AAED,2EAA2E;AAC3E,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,CAAC,EAAE,IAAI,EAAE,CAAA;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;IAC9B,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAA;CACjD,CAAA;AASD,2CAA2C;AAC3C,eAAO,MAAM,uBAAuB,EAAE,cAqCrC,CAAA;AAiGD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,aAAa,GAAG,SAAS,EAChC,QAAQ,CAAC,EAAE,cAAc,GACxB,cAAc,CAYhB;AAED,gEAAgE;AAChE,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,cAAc,EAClB,CAAC,EAAE,MAAM,GACR,cAAc,CAkBhB"}
|
package/dist/pie-chart/shared.js
CHANGED
|
@@ -203,7 +203,7 @@ function lerpCenterConfig(from, to, t) {
|
|
|
203
203
|
};
|
|
204
204
|
}
|
|
205
205
|
/**
|
|
206
|
-
* {@link PieChart}'s `theme`
|
|
206
|
+
* {@link PieChart}'s `theme` property mapper: merges the author's partial
|
|
207
207
|
* {@link PieChartTheme} onto `previous` (falling back to
|
|
208
208
|
* {@link DEFAULT_PIE_CHART_THEME} on first resolution), fully resolving every
|
|
209
209
|
* leaf so the tween below always has resolved data to interpolate.
|
|
@@ -221,7 +221,7 @@ export function resolvePieChartTheme(theme, previous) {
|
|
|
221
221
|
},
|
|
222
222
|
};
|
|
223
223
|
}
|
|
224
|
-
/** {@link PieChart}'s `theme`
|
|
224
|
+
/** {@link PieChart}'s `theme` property tween — leaf by leaf. */
|
|
225
225
|
export function lerpPieChartTheme(from, to, t) {
|
|
226
226
|
return {
|
|
227
227
|
// A palette is a list of independent paints rather than one value, so it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/pie-chart/shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,UAAU,EACV,SAAS,EACT,SAAS,EACT,OAAO,GASR,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EACL,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,GAAG,EACH,mBAAmB,EACnB,kBAAkB,EAClB,IAAI,GAGL,MAAM,eAAe,CAAA;AAoBtB;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAC9B,IAAkB,EAClB,QAAgB,EAChB,KAAa,EACb,OAAe;IAEf,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAC3B,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC;QAC7B,KAAK,EAAE,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC;QACtB,IAAI,EACF,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAE,OAAgB;KACvE,CAAC,CAAC,CAAA;AACL,CAAC;AA6BD,y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,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;QACnD,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;QACnD,SAAS,EAAE;YACT,UAAU,EAAE,UAAU,CACpB,IAAI,CAAC,SAAS,CAAC,UAAU,EACzB,EAAE,CAAC,SAAS,CAAC,UAAU,EACvB,CAAC,CACF;SACF;KACF,CAAA;AACH,CAAC","sourcesContent":["/**\r\n * Types and pure helpers specific to the {@link PieChart} family: how rows\r\n * become slices, how slices become arcs on a ring, where the labels around it\r\n * end up, and the theme all of that is drawn from.\r\n *\r\n * The one chart in the family that draws **one mark per row** rather than one\r\n * per column, which is why almost nothing about its geometry is shared: there is\r\n * no scale, no axis and no baseline, only a circle divided by share. What it\r\n * *does* share — the legend, the theme leaf resolvers, the palette, the\r\n * percentage format — comes from `../kit/shared.ts`.\r\n *\r\n * Kept renderer-agnostic (no `Node` imports) so a host's inspector mapping\r\n * can build a partial {@link PieChartTheme} without\r\n * pulling the node classes in.\r\n */\r\n\r\nimport {\r\n lerpNumber,\r\n shadowOps,\r\n strokeOps,\r\n textOps,\r\n type DataRecord,\r\n type Fill,\r\n type Shadow,\r\n type ShadowResolved,\r\n type Stroke,\r\n type StrokeResolved,\r\n type TextStyle,\r\n type Vector2,\r\n} from \"@motionscript/sdk\"\r\n\r\nimport {\r\n CHART_PALETTE,\r\n DEFAULT_LEGEND,\r\n DEFAULT_SERIES_FILLS,\r\n SPOTLIGHT_DIM,\r\n lerpLegendConfig,\r\n lerpSeriesFills,\r\n num,\r\n resolveLegendConfig,\r\n resolveSeriesFills,\r\n text,\r\n type LegendConfig,\r\n type LegendTheme,\r\n} from \"../kit/shared\"\r\n\r\n/**\r\n * One **resolved** slice of a {@link PieChart}: its caption, its magnitude, and\r\n * the paint its wedge and legend swatch take.\r\n *\r\n * This is what the ring and the legend consume, not what a scene authors: the\r\n * chart takes tabular `data` plus two field names and resolves it into these, so\r\n * the parts stay unaware of where a slice's caption, magnitude and paint came\r\n * from.\r\n */\r\nexport interface PieSlice {\r\n /** Legend caption and label text for this slice. */\r\n category: string\r\n /** This slice's magnitude. Its wedge covers `value / (sum of all values)`. */\r\n value: number\r\n /** Wedge and swatch paint. */\r\n fill: Fill\r\n}\r\n\r\n/**\r\n * Resolve tabular rows into slices: one per row, captioned by the `category`\r\n * column, sized by the `value` column, painted from `palette` by row order\r\n * (cycling when the palette is shorter than the data).\r\n *\r\n * Paint comes from the palette rather than from the rows because a pie draws one\r\n * mark per *row* — unlike the line and bar charts, where a colour belongs to a\r\n * series (a whole column) and rides on the series entry instead. Keeping it out\r\n * of the rows is what lets a pie be fed straight from a CSV of plain numbers.\r\n */\r\nexport function resolvePieSlices(\r\n data: DataRecord[],\r\n category: string,\r\n value: string,\r\n palette: Fill[]\r\n): PieSlice[] {\r\n return data.map((row, i) => ({\r\n category: text(row, category),\r\n value: num(row, value),\r\n fill:\r\n palette.length > 0 ? palette[i % palette.length] : (\"white\" as Fill),\r\n }))\r\n}\r\n\r\n/** What a {@link PieChart}'s labels say. */\r\nexport type PieLabelMode =\r\n /**\r\n * The category and its percentage, two lines. Their order flips with the\r\n * placement: a **leader** label reads category over percentage, an **inside**\r\n * label reads the percentage big over a small category caption — inside a\r\n * wedge the reader already knows which slice they're on, so the magnitude is\r\n * the thing being read.\r\n */\r\n | \"both\"\r\n /** The category only. */\r\n | \"category\"\r\n /** The percentage only — the pick when a legend already names the categories. */\r\n | \"percent\"\r\n /** No labels and no leader lines at all. */\r\n | \"none\"\r\n\r\n/**\r\n * Where a slice's label sits.\r\n *\r\n * `\"inside\"` drops the leader line entirely and centres the label in the wedge's\r\n * own band, which costs no gutter — so the ring draws bigger — and costs the eye\r\n * no round trip. `\"leader\"` is the classic treatment, and what a sliver too\r\n * narrow to hold text needs.\r\n */\r\nexport type PieLabelPlacement = \"inside\" | \"leader\" | \"none\"\r\n\r\n/** Degrees → radians. */\r\nexport const DEG = Math.PI / 180\r\n\r\n/** A slice's plotted value: negatives and non-finite values count as 0. */\r\nexport function sliceValue(slice: PieSlice): number {\r\n return slice.value > 0 && Number.isFinite(slice.value) ? slice.value : 0\r\n}\r\n\r\n/** Sum of every slice's plotted value — the denominator every share is taken against. */\r\nexport function sliceTotal(slices: PieSlice[]): number {\r\n let sum = 0\r\n for (const slice of slices) sum += sliceValue(slice)\r\n return sum\r\n}\r\n\r\n/**\r\n * The point at radius `r` and angle `a` on a ring centred on the origin, in the\r\n * node's centred, **y-up** space. Angles run **clockwise from 12 o'clock**:\r\n * `a = 0` points straight up (+y), and increasing `a` sweeps toward +x then −y.\r\n */\r\nexport function ringPoint(r: number, a: number): Vector2 {\r\n return { x: r * Math.sin(a), y: r * Math.cos(a) }\r\n}\r\n\r\n/** One slice's resolved angular span on the ring. */\r\nexport interface PieArc {\r\n /** Index of the slice in the source list. */\r\n index: number\r\n /** Start angle, radians clockwise from 12 o'clock. */\r\n a0: number\r\n /** End angle, radians clockwise from 12 o'clock. */\r\n a1: number\r\n /** Bisector angle — where this slice's label and pop-out point. */\r\n mid: number\r\n /** This slice's share of the total, in `[0, 1]`. */\r\n fraction: number\r\n}\r\n\r\n/**\r\n * Resolve slices into per-slice arcs: each covers exactly its share of the\r\n * circle, walking clockwise from `startDegrees` (0 = 12 o'clock), with the arcs\r\n * abutting. Zero/negative slices are skipped entirely; an all-zero list yields\r\n * no arcs.\r\n *\r\n * Arcs are the *undivided* shares — the gap between neighbours is not carved out\r\n * here, because a fixed angular gap reads as a wedge: wide at the rim, pinched\r\n * shut at the hole. It's applied when the wedge is drawn instead, as a\r\n * constant-width inset off both ends of every arc, so a slice still covers its\r\n * true percentage of the circle.\r\n */\r\nexport function pieArcs(slices: PieSlice[], startDegrees: number): PieArc[] {\r\n const total = sliceTotal(slices)\r\n if (total <= 0) return []\r\n\r\n const arcs: PieArc[] = []\r\n let cursor = startDegrees * DEG\r\n slices.forEach((slice, index) => {\r\n const value = sliceValue(slice)\r\n if (value <= 0) return\r\n const fraction = value / total\r\n const a0 = cursor\r\n const a1 = a0 + fraction * Math.PI * 2\r\n cursor = a1\r\n arcs.push({ index, a0, a1, mid: (a0 + a1) / 2, fraction })\r\n })\r\n return arcs\r\n}\r\n\r\n/** A label competing for vertical space in one of the two label columns. */\r\nexport interface LabelSlot {\r\n /** Where the label would sit if nothing else were in the way. */\r\n ideal: number\r\n /** Where it ends up once the column has been de-conflicted. Written by {@link relaxLabels}. */\r\n y: number\r\n}\r\n\r\n/**\r\n * Spread one column of labels so no two overlap, keeping each as close to its\r\n * `ideal` y as possible and the whole column inside `[bottom, top]`.\r\n *\r\n * Two passes, the standard treatment. Walking top-to-bottom, each label takes\r\n * the highest slot at or below its ideal that still clears the label above it by\r\n * `minGap`; if that pushes the tail past `bottom`, a reverse pass lifts it back\r\n * up. When there are more labels than the column can hold, the reverse pass wins\r\n * and the crowding is shared evenly rather than dumped off the bottom edge.\r\n *\r\n * Mutates each slot's `y` and returns `slots` re-ordered top-to-bottom.\r\n */\r\nexport function relaxLabels<T extends LabelSlot>(\r\n slots: T[],\r\n minGap: number,\r\n top: number,\r\n bottom: number\r\n): T[] {\r\n slots.sort((a, b) => b.ideal - a.ideal)\r\n\r\n let ceiling = top\r\n for (const slot of slots) {\r\n slot.y = Math.min(slot.ideal, ceiling)\r\n ceiling = slot.y - minGap\r\n }\r\n\r\n let floor = bottom\r\n for (let i = slots.length - 1; i >= 0; i--) {\r\n slots[i].y = Math.max(slots[i].y, floor)\r\n floor = slots[i].y + minGap\r\n }\r\n\r\n return slots\r\n}\r\n\r\n// ---- Theme ---------------------------------------------------------------\r\n\r\n/** The ring's geometry and paint — everything about the wedges but their colour. */\r\nexport interface RingConfig {\r\n /**\r\n * Width of the channel between adjacent slices, in px, held constant all the\r\n * way across the band — the same clearance at the hole as at the rim. (An\r\n * angular gap would splay open toward the rim instead.)\r\n */\r\n gap: number\r\n /**\r\n * Radius of the hole punched through the middle. Below 1 it reads as a\r\n * fraction of the ring's outer radius (`0.6` leaves a band 40% of the radius\r\n * thick); 1 and up as an explicit pixel radius; `0` fills the middle in,\r\n * drawing solid pie wedges.\r\n */\r\n holeRadius: number\r\n /** Angle in degrees where the first slice begins, clockwise from 12 o'clock. */\r\n startAngle: number\r\n /**\r\n * How far out a selected slice's rim reaches, as a **multiple of the ring's\r\n * outer radius**. Being relative, the emphasis scales with the chart instead\r\n * of shrinking on a big one and swamping a small one. Clamped to `[1, 1.6]`.\r\n */\r\n selectedGrow: number\r\n /** Optional outline on every wedge. */\r\n stroke: Stroke\r\n /** Optional drop shadow on every wedge. */\r\n shadow: Shadow\r\n}\r\n\r\n/** How the ring's labels are set, and the leader lines that point at them. */\r\nexport interface LabelConfig {\r\n /** The category caption on a label. */\r\n textStyle: TextStyle\r\n /** The percentage on a label. */\r\n percentStyle: TextStyle\r\n /**\r\n * Ink for a label set **inside** its wedge, both lines. Separate because an\r\n * inside label sits on the wedge's own paint rather than on the background, so\r\n * it usually wants the opposite end of the value range from everything else.\r\n */\r\n insideStyle: TextStyle\r\n /** The leader line running from a wedge out to its label. */\r\n leaderStroke: Stroke\r\n}\r\n\r\n/** The summary set in the ring's hole. */\r\nexport interface CenterConfig {\r\n labelStyle: TextStyle\r\n captionStyle: TextStyle\r\n}\r\n\r\n/** A {@link PieChart}'s full, resolved visual theme. */\r\nexport interface PieChartConfig {\r\n /** Wedge and swatch paint, cycled by **row** index (`i % length`). */\r\n sliceFills: Fill[]\r\n ring: RingConfig\r\n label: LabelConfig\r\n center: CenterConfig\r\n legend: LegendConfig\r\n /** How far everything outside the selection fades while any slice is selected. */\r\n spotlight: { dimOpacity: number }\r\n}\r\n\r\n/** Author-facing partial theme — every branch optional and deep-merged. */\r\nexport type PieChartTheme = {\r\n sliceFills?: Fill[]\r\n ring?: Partial<RingConfig>\r\n label?: Partial<LabelConfig>\r\n center?: Partial<CenterConfig>\r\n legend?: LegendTheme\r\n spotlight?: Partial<PieChartConfig[\"spotlight\"]>\r\n}\r\n\r\nconst LABEL_TEXT_STYLE: TextStyle = {\r\n fontSize: 26,\r\n fontWeight: 600,\r\n textAlign: \"center\",\r\n fill: CHART_PALETTE.markerColor,\r\n}\r\n\r\n/** The pie chart's out-of-the-box look. */\r\nexport const DEFAULT_PIE_CHART_THEME: PieChartConfig = {\r\n sliceFills: DEFAULT_SERIES_FILLS,\r\n ring: {\r\n gap: 6,\r\n // A donut rather than a solid pie by default: the hole is the largest\r\n // uninterrupted area the chart owns and the one place a conclusion can be\r\n // set. `0` here would give that away before anyone had asked for it.\r\n holeRadius: 0.6,\r\n startAngle: 0,\r\n selectedGrow: 1.08,\r\n stroke: [],\r\n shadow: [],\r\n },\r\n label: {\r\n textStyle: LABEL_TEXT_STYLE,\r\n percentStyle: { ...LABEL_TEXT_STYLE, fontWeight: 700 },\r\n // Inside labels sit on the wedge's paint, which is a mid-tone from the\r\n // palette — so they lead with the panel colour rather than the axis ink.\r\n insideStyle: { ...LABEL_TEXT_STYLE, fontWeight: 800, fill: \"#15130e\" },\r\n leaderStroke: { weight: 2, fill: CHART_PALETTE.markerColor },\r\n },\r\n center: {\r\n labelStyle: {\r\n fontSize: 46,\r\n fontWeight: 800,\r\n textAlign: \"center\",\r\n fill: CHART_PALETTE.markerColor,\r\n },\r\n captionStyle: {\r\n fontSize: 22,\r\n fontWeight: 500,\r\n textAlign: \"center\",\r\n fill: CHART_PALETTE.markerColor,\r\n },\r\n },\r\n legend: DEFAULT_LEGEND,\r\n spotlight: { dimOpacity: SPOTLIGHT_DIM },\r\n}\r\n\r\nfunction resolveRingConfig(\r\n ring: Partial<RingConfig> | undefined,\r\n previous: RingConfig\r\n): RingConfig {\r\n return {\r\n gap: ring?.gap ?? previous.gap,\r\n holeRadius: ring?.holeRadius ?? previous.holeRadius,\r\n startAngle: ring?.startAngle ?? previous.startAngle,\r\n selectedGrow: ring?.selectedGrow ?? previous.selectedGrow,\r\n stroke: strokeOps.resolve(ring?.stroke ?? previous.stroke),\r\n shadow: shadowOps.resolve(ring?.shadow ?? previous.shadow),\r\n }\r\n}\r\n\r\nfunction lerpRingConfig(\r\n from: RingConfig,\r\n to: RingConfig,\r\n t: number\r\n): RingConfig {\r\n return {\r\n gap: lerpNumber(from.gap, to.gap, t),\r\n holeRadius: lerpNumber(from.holeRadius, to.holeRadius, t),\r\n startAngle: lerpNumber(from.startAngle, to.startAngle, t),\r\n selectedGrow: lerpNumber(from.selectedGrow, to.selectedGrow, t),\r\n stroke: strokeOps.lerp(\r\n from.stroke as StrokeResolved[],\r\n to.stroke as StrokeResolved[],\r\n t\r\n ),\r\n shadow: shadowOps.lerp(\r\n from.shadow as ShadowResolved[],\r\n to.shadow as ShadowResolved[],\r\n t\r\n ),\r\n }\r\n}\r\n\r\nfunction resolveLabelConfig(\r\n label: Partial<LabelConfig> | undefined,\r\n previous: LabelConfig\r\n): LabelConfig {\r\n return {\r\n textStyle: textOps.resolveStyle(label?.textStyle, previous.textStyle),\r\n percentStyle: textOps.resolveStyle(\r\n label?.percentStyle,\r\n previous.percentStyle\r\n ),\r\n insideStyle: textOps.resolveStyle(label?.insideStyle, previous.insideStyle),\r\n leaderStroke: strokeOps.resolve(\r\n label?.leaderStroke ?? previous.leaderStroke\r\n ),\r\n }\r\n}\r\n\r\nfunction lerpLabelConfig(\r\n from: LabelConfig,\r\n to: LabelConfig,\r\n t: number\r\n): LabelConfig {\r\n return {\r\n textStyle: textOps.lerpStyle(from.textStyle, to.textStyle, t),\r\n percentStyle: textOps.lerpStyle(from.percentStyle, to.percentStyle, t),\r\n insideStyle: textOps.lerpStyle(from.insideStyle, to.insideStyle, t),\r\n leaderStroke: strokeOps.lerp(\r\n from.leaderStroke as StrokeResolved[],\r\n to.leaderStroke as StrokeResolved[],\r\n t\r\n ),\r\n }\r\n}\r\n\r\nfunction resolveCenterConfig(\r\n center: Partial<CenterConfig> | undefined,\r\n previous: CenterConfig\r\n): CenterConfig {\r\n return {\r\n labelStyle: textOps.resolveStyle(center?.labelStyle, previous.labelStyle),\r\n captionStyle: textOps.resolveStyle(\r\n center?.captionStyle,\r\n previous.captionStyle\r\n ),\r\n }\r\n}\r\n\r\nfunction lerpCenterConfig(\r\n from: CenterConfig,\r\n to: CenterConfig,\r\n t: number\r\n): CenterConfig {\r\n return {\r\n labelStyle: textOps.lerpStyle(from.labelStyle, to.labelStyle, t),\r\n captionStyle: textOps.lerpStyle(from.captionStyle, to.captionStyle, t),\r\n }\r\n}\r\n\r\n/**\r\n * {@link PieChart}'s `theme` @property mapper: merges the author's partial\r\n * {@link PieChartTheme} onto `previous` (falling back to\r\n * {@link DEFAULT_PIE_CHART_THEME} on first resolution), fully resolving every\r\n * leaf so the tween below always has resolved data to interpolate.\r\n */\r\nexport function resolvePieChartTheme(\r\n theme: PieChartTheme | undefined,\r\n previous?: PieChartConfig\r\n): PieChartConfig {\r\n const base = previous ?? DEFAULT_PIE_CHART_THEME\r\n return {\r\n sliceFills: resolveSeriesFills(theme?.sliceFills, base.sliceFills),\r\n ring: resolveRingConfig(theme?.ring, base.ring),\r\n label: resolveLabelConfig(theme?.label, base.label),\r\n center: resolveCenterConfig(theme?.center, base.center),\r\n legend: resolveLegendConfig(theme?.legend, base.legend),\r\n spotlight: {\r\n dimOpacity: theme?.spotlight?.dimOpacity ?? base.spotlight.dimOpacity,\r\n },\r\n }\r\n}\r\n\r\n/** {@link PieChart}'s `theme` @property tween — leaf by leaf. */\r\nexport function lerpPieChartTheme(\r\n from: PieChartConfig,\r\n to: PieChartConfig,\r\n t: number\r\n): PieChartConfig {\r\n return {\r\n // A palette is a list of independent paints rather than one value, so it\r\n // interpolates pairwise by index; one that grows or shrinks holds the longer\r\n // side's tail, exactly as the cartesian charts' palettes do.\r\n sliceFills: lerpSeriesFills(from.sliceFills, to.sliceFills, t),\r\n ring: lerpRingConfig(from.ring, to.ring, t),\r\n label: lerpLabelConfig(from.label, to.label, t),\r\n center: lerpCenterConfig(from.center, to.center, t),\r\n legend: lerpLegendConfig(from.legend, to.legend, t),\r\n spotlight: {\r\n dimOpacity: lerpNumber(\r\n from.spotlight.dimOpacity,\r\n to.spotlight.dimOpacity,\r\n t\r\n ),\r\n },\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/pie-chart/shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,UAAU,EACV,SAAS,EACT,SAAS,EACT,OAAO,GASR,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EACL,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,GAAG,EACH,mBAAmB,EACnB,kBAAkB,EAClB,IAAI,GAGL,MAAM,eAAe,CAAA;AAoBtB;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAC9B,IAAkB,EAClB,QAAgB,EAChB,KAAa,EACb,OAAe;IAEf,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAC3B,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC;QAC7B,KAAK,EAAE,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC;QACtB,IAAI,EACF,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAE,OAAgB;KACvE,CAAC,CAAC,CAAA;AACL,CAAC;AA6BD,yBAAyB;AACzB,MAAM,CAAC,MAAM,GAAG,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,CAAA;AAEhC,2EAA2E;AAC3E,MAAM,UAAU,UAAU,CAAC,KAAe;IACxC,OAAO,KAAK,CAAC,KAAK,GAAG,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;AAC1E,CAAC;AAED,yFA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pers specific to the {@link PieChart} family: how rows\r\n * become slices, how slices become arcs on a ring, where the labels around it\r\n * end up, and the theme all of that is drawn from.\r\n *\r\n * The one chart in the family that draws **one mark per row** rather than one\r\n * per column, which is why almost nothing about its geometry is shared: there is\r\n * no scale, no axis and no baseline, only a circle divided by share. What it\r\n * *does* share — the legend, the theme leaf resolvers, the palette, the\r\n * percentage format — comes from `../kit/shared.ts`.\r\n *\r\n * Kept renderer-agnostic (no `Node` imports) so a host's inspector mapping\r\n * can build a partial {@link PieChartTheme} without\r\n * pulling the node classes in.\r\n */\r\n\r\nimport {\r\n lerpNumber,\r\n shadowOps,\r\n strokeOps,\r\n textOps,\r\n type DataRecord,\r\n type Fill,\r\n type Shadow,\r\n type ShadowResolved,\r\n type Stroke,\r\n type StrokeResolved,\r\n type TextStyle,\r\n type Vector2,\r\n} from \"@motionscript/sdk\"\r\n\r\nimport {\r\n CHART_PALETTE,\r\n DEFAULT_LEGEND,\r\n DEFAULT_SERIES_FILLS,\r\n SPOTLIGHT_DIM,\r\n lerpLegendConfig,\r\n lerpSeriesFills,\r\n num,\r\n resolveLegendConfig,\r\n resolveSeriesFills,\r\n text,\r\n type LegendConfig,\r\n type LegendTheme,\r\n} from \"../kit/shared\"\r\n\r\n/**\r\n * One **resolved** slice of a {@link PieChart}: its caption, its magnitude, and\r\n * the paint its wedge and legend swatch take.\r\n *\r\n * This is what the ring and the legend consume, not what a scene authors: the\r\n * chart takes tabular `data` plus two field names and resolves it into these, so\r\n * the parts stay unaware of where a slice's caption, magnitude and paint came\r\n * from.\r\n */\r\nexport interface PieSlice {\r\n /** Legend caption and label text for this slice. */\r\n category: string\r\n /** This slice's magnitude. Its wedge covers `value / (sum of all values)`. */\r\n value: number\r\n /** Wedge and swatch paint. */\r\n fill: Fill\r\n}\r\n\r\n/**\r\n * Resolve tabular rows into slices: one per row, captioned by the `category`\r\n * column, sized by the `value` column, painted from `palette` by row order\r\n * (cycling when the palette is shorter than the data).\r\n *\r\n * Paint comes from the palette rather than from the rows because a pie draws one\r\n * mark per *row* — unlike the line and bar charts, where a colour belongs to a\r\n * series (a whole column) and rides on the series entry instead. Keeping it out\r\n * of the rows is what lets a pie be fed straight from a CSV of plain numbers.\r\n */\r\nexport function resolvePieSlices(\r\n data: DataRecord[],\r\n category: string,\r\n value: string,\r\n palette: Fill[]\r\n): PieSlice[] {\r\n return data.map((row, i) => ({\r\n category: text(row, category),\r\n value: num(row, value),\r\n fill:\r\n palette.length > 0 ? palette[i % palette.length] : (\"white\" as Fill),\r\n }))\r\n}\r\n\r\n/** What a {@link PieChart}'s labels say. */\r\nexport type PieLabelMode =\r\n /**\r\n * The category and its percentage, two lines. Their order flips with the\r\n * placement: a **leader** label reads category over percentage, an **inside**\r\n * label reads the percentage big over a small category caption — inside a\r\n * wedge the reader already knows which slice they're on, so the magnitude is\r\n * the thing being read.\r\n */\r\n | \"both\"\r\n /** The category only. */\r\n | \"category\"\r\n /** The percentage only — the pick when a legend already names the categories. */\r\n | \"percent\"\r\n /** No labels and no leader lines at all. */\r\n | \"none\"\r\n\r\n/**\r\n * Where a slice's label sits.\r\n *\r\n * `\"inside\"` drops the leader line entirely and centres the label in the wedge's\r\n * own band, which costs no gutter — so the ring draws bigger — and costs the eye\r\n * no round trip. `\"leader\"` is the classic treatment, and what a sliver too\r\n * narrow to hold text needs.\r\n */\r\nexport type PieLabelPlacement = \"inside\" | \"leader\" | \"none\"\r\n\r\n/** Degrees → radians. */\r\nexport const DEG = Math.PI / 180\r\n\r\n/** A slice's plotted value: negatives and non-finite values count as 0. */\r\nexport function sliceValue(slice: PieSlice): number {\r\n return slice.value > 0 && Number.isFinite(slice.value) ? slice.value : 0\r\n}\r\n\r\n/** Sum of every slice's plotted value — the denominator every share is taken against. */\r\nexport function sliceTotal(slices: PieSlice[]): number {\r\n let sum = 0\r\n for (const slice of slices) sum += sliceValue(slice)\r\n return sum\r\n}\r\n\r\n/**\r\n * The point at radius `r` and angle `a` on a ring centred on the origin, in the\r\n * node's centred, **y-up** space. Angles run **clockwise from 12 o'clock**:\r\n * `a = 0` points straight up (+y), and increasing `a` sweeps toward +x then −y.\r\n */\r\nexport function ringPoint(r: number, a: number): Vector2 {\r\n return { x: r * Math.sin(a), y: r * Math.cos(a) }\r\n}\r\n\r\n/** One slice's resolved angular span on the ring. */\r\nexport interface PieArc {\r\n /** Index of the slice in the source list. */\r\n index: number\r\n /** Start angle, radians clockwise from 12 o'clock. */\r\n a0: number\r\n /** End angle, radians clockwise from 12 o'clock. */\r\n a1: number\r\n /** Bisector angle — where this slice's label and pop-out point. */\r\n mid: number\r\n /** This slice's share of the total, in `[0, 1]`. */\r\n fraction: number\r\n}\r\n\r\n/**\r\n * Resolve slices into per-slice arcs: each covers exactly its share of the\r\n * circle, walking clockwise from `startDegrees` (0 = 12 o'clock), with the arcs\r\n * abutting. Zero/negative slices are skipped entirely; an all-zero list yields\r\n * no arcs.\r\n *\r\n * Arcs are the *undivided* shares — the gap between neighbours is not carved out\r\n * here, because a fixed angular gap reads as a wedge: wide at the rim, pinched\r\n * shut at the hole. It's applied when the wedge is drawn instead, as a\r\n * constant-width inset off both ends of every arc, so a slice still covers its\r\n * true percentage of the circle.\r\n */\r\nexport function pieArcs(slices: PieSlice[], startDegrees: number): PieArc[] {\r\n const total = sliceTotal(slices)\r\n if (total <= 0) return []\r\n\r\n const arcs: PieArc[] = []\r\n let cursor = startDegrees * DEG\r\n slices.forEach((slice, index) => {\r\n const value = sliceValue(slice)\r\n if (value <= 0) return\r\n const fraction = value / total\r\n const a0 = cursor\r\n const a1 = a0 + fraction * Math.PI * 2\r\n cursor = a1\r\n arcs.push({ index, a0, a1, mid: (a0 + a1) / 2, fraction })\r\n })\r\n return arcs\r\n}\r\n\r\n/** A label competing for vertical space in one of the two label columns. */\r\nexport interface LabelSlot {\r\n /** Where the label would sit if nothing else were in the way. */\r\n ideal: number\r\n /** Where it ends up once the column has been de-conflicted. Written by {@link relaxLabels}. */\r\n y: number\r\n}\r\n\r\n/**\r\n * Spread one column of labels so no two overlap, keeping each as close to its\r\n * `ideal` y as possible and the whole column inside `[bottom, top]`.\r\n *\r\n * Two passes, the standard treatment. Walking top-to-bottom, each label takes\r\n * the highest slot at or below its ideal that still clears the label above it by\r\n * `minGap`; if that pushes the tail past `bottom`, a reverse pass lifts it back\r\n * up. When there are more labels than the column can hold, the reverse pass wins\r\n * and the crowding is shared evenly rather than dumped off the bottom edge.\r\n *\r\n * Mutates each slot's `y` and returns `slots` re-ordered top-to-bottom.\r\n */\r\nexport function relaxLabels<T extends LabelSlot>(\r\n slots: T[],\r\n minGap: number,\r\n top: number,\r\n bottom: number\r\n): T[] {\r\n slots.sort((a, b) => b.ideal - a.ideal)\r\n\r\n let ceiling = top\r\n for (const slot of slots) {\r\n slot.y = Math.min(slot.ideal, ceiling)\r\n ceiling = slot.y - minGap\r\n }\r\n\r\n let floor = bottom\r\n for (let i = slots.length - 1; i >= 0; i--) {\r\n slots[i].y = Math.max(slots[i].y, floor)\r\n floor = slots[i].y + minGap\r\n }\r\n\r\n return slots\r\n}\r\n\r\n// ---- Theme ---------------------------------------------------------------\r\n\r\n/** The ring's geometry and paint — everything about the wedges but their colour. */\r\nexport interface RingConfig {\r\n /**\r\n * Width of the channel between adjacent slices, in px, held constant all the\r\n * way across the band — the same clearance at the hole as at the rim. (An\r\n * angular gap would splay open toward the rim instead.)\r\n */\r\n gap: number\r\n /**\r\n * Radius of the hole punched through the middle. Below 1 it reads as a\r\n * fraction of the ring's outer radius (`0.6` leaves a band 40% of the radius\r\n * thick); 1 and up as an explicit pixel radius; `0` fills the middle in,\r\n * drawing solid pie wedges.\r\n */\r\n holeRadius: number\r\n /** Angle in degrees where the first slice begins, clockwise from 12 o'clock. */\r\n startAngle: number\r\n /**\r\n * How far out a selected slice's rim reaches, as a **multiple of the ring's\r\n * outer radius**. Being relative, the emphasis scales with the chart instead\r\n * of shrinking on a big one and swamping a small one. Clamped to `[1, 1.6]`.\r\n */\r\n selectedGrow: number\r\n /** Optional outline on every wedge. */\r\n stroke: Stroke\r\n /** Optional drop shadow on every wedge. */\r\n shadow: Shadow\r\n}\r\n\r\n/** How the ring's labels are set, and the leader lines that point at them. */\r\nexport interface LabelConfig {\r\n /** The category caption on a label. */\r\n textStyle: TextStyle\r\n /** The percentage on a label. */\r\n percentStyle: TextStyle\r\n /**\r\n * Ink for a label set **inside** its wedge, both lines. Separate because an\r\n * inside label sits on the wedge's own paint rather than on the background, so\r\n * it usually wants the opposite end of the value range from everything else.\r\n */\r\n insideStyle: TextStyle\r\n /** The leader line running from a wedge out to its label. */\r\n leaderStroke: Stroke\r\n}\r\n\r\n/** The summary set in the ring's hole. */\r\nexport interface CenterConfig {\r\n labelStyle: TextStyle\r\n captionStyle: TextStyle\r\n}\r\n\r\n/** A {@link PieChart}'s full, resolved visual theme. */\r\nexport interface PieChartConfig {\r\n /** Wedge and swatch paint, cycled by **row** index (`i % length`). */\r\n sliceFills: Fill[]\r\n ring: RingConfig\r\n label: LabelConfig\r\n center: CenterConfig\r\n legend: LegendConfig\r\n /** How far everything outside the selection fades while any slice is selected. */\r\n spotlight: { dimOpacity: number }\r\n}\r\n\r\n/** Author-facing partial theme — every branch optional and deep-merged. */\r\nexport type PieChartTheme = {\r\n sliceFills?: Fill[]\r\n ring?: Partial<RingConfig>\r\n label?: Partial<LabelConfig>\r\n center?: Partial<CenterConfig>\r\n legend?: LegendTheme\r\n spotlight?: Partial<PieChartConfig[\"spotlight\"]>\r\n}\r\n\r\nconst LABEL_TEXT_STYLE: TextStyle = {\r\n fontSize: 26,\r\n fontWeight: 600,\r\n textAlign: \"center\",\r\n fill: CHART_PALETTE.markerColor,\r\n}\r\n\r\n/** The pie chart's out-of-the-box look. */\r\nexport const DEFAULT_PIE_CHART_THEME: PieChartConfig = {\r\n sliceFills: DEFAULT_SERIES_FILLS,\r\n ring: {\r\n gap: 6,\r\n // A donut rather than a solid pie by default: the hole is the largest\r\n // uninterrupted area the chart owns and the one place a conclusion can be\r\n // set. `0` here would give that away before anyone had asked for it.\r\n holeRadius: 0.6,\r\n startAngle: 0,\r\n selectedGrow: 1.08,\r\n stroke: [],\r\n shadow: [],\r\n },\r\n label: {\r\n textStyle: LABEL_TEXT_STYLE,\r\n percentStyle: { ...LABEL_TEXT_STYLE, fontWeight: 700 },\r\n // Inside labels sit on the wedge's paint, which is a mid-tone from the\r\n // palette — so they lead with the panel colour rather than the axis ink.\r\n insideStyle: { ...LABEL_TEXT_STYLE, fontWeight: 800, fill: \"#15130e\" },\r\n leaderStroke: { weight: 2, fill: CHART_PALETTE.markerColor },\r\n },\r\n center: {\r\n labelStyle: {\r\n fontSize: 46,\r\n fontWeight: 800,\r\n textAlign: \"center\",\r\n fill: CHART_PALETTE.markerColor,\r\n },\r\n captionStyle: {\r\n fontSize: 22,\r\n fontWeight: 500,\r\n textAlign: \"center\",\r\n fill: CHART_PALETTE.markerColor,\r\n },\r\n },\r\n legend: DEFAULT_LEGEND,\r\n spotlight: { dimOpacity: SPOTLIGHT_DIM },\r\n}\r\n\r\nfunction resolveRingConfig(\r\n ring: Partial<RingConfig> | undefined,\r\n previous: RingConfig\r\n): RingConfig {\r\n return {\r\n gap: ring?.gap ?? previous.gap,\r\n holeRadius: ring?.holeRadius ?? previous.holeRadius,\r\n startAngle: ring?.startAngle ?? previous.startAngle,\r\n selectedGrow: ring?.selectedGrow ?? previous.selectedGrow,\r\n stroke: strokeOps.resolve(ring?.stroke ?? previous.stroke),\r\n shadow: shadowOps.resolve(ring?.shadow ?? previous.shadow),\r\n }\r\n}\r\n\r\nfunction lerpRingConfig(\r\n from: RingConfig,\r\n to: RingConfig,\r\n t: number\r\n): RingConfig {\r\n return {\r\n gap: lerpNumber(from.gap, to.gap, t),\r\n holeRadius: lerpNumber(from.holeRadius, to.holeRadius, t),\r\n startAngle: lerpNumber(from.startAngle, to.startAngle, t),\r\n selectedGrow: lerpNumber(from.selectedGrow, to.selectedGrow, t),\r\n stroke: strokeOps.lerp(\r\n from.stroke as StrokeResolved[],\r\n to.stroke as StrokeResolved[],\r\n t\r\n ),\r\n shadow: shadowOps.lerp(\r\n from.shadow as ShadowResolved[],\r\n to.shadow as ShadowResolved[],\r\n t\r\n ),\r\n }\r\n}\r\n\r\nfunction resolveLabelConfig(\r\n label: Partial<LabelConfig> | undefined,\r\n previous: LabelConfig\r\n): LabelConfig {\r\n return {\r\n textStyle: textOps.resolveStyle(label?.textStyle, previous.textStyle),\r\n percentStyle: textOps.resolveStyle(\r\n label?.percentStyle,\r\n previous.percentStyle\r\n ),\r\n insideStyle: textOps.resolveStyle(label?.insideStyle, previous.insideStyle),\r\n leaderStroke: strokeOps.resolve(\r\n label?.leaderStroke ?? previous.leaderStroke\r\n ),\r\n }\r\n}\r\n\r\nfunction lerpLabelConfig(\r\n from: LabelConfig,\r\n to: LabelConfig,\r\n t: number\r\n): LabelConfig {\r\n return {\r\n textStyle: textOps.lerpStyle(from.textStyle, to.textStyle, t),\r\n percentStyle: textOps.lerpStyle(from.percentStyle, to.percentStyle, t),\r\n insideStyle: textOps.lerpStyle(from.insideStyle, to.insideStyle, t),\r\n leaderStroke: strokeOps.lerp(\r\n from.leaderStroke as StrokeResolved[],\r\n to.leaderStroke as StrokeResolved[],\r\n t\r\n ),\r\n }\r\n}\r\n\r\nfunction resolveCenterConfig(\r\n center: Partial<CenterConfig> | undefined,\r\n previous: CenterConfig\r\n): CenterConfig {\r\n return {\r\n labelStyle: textOps.resolveStyle(center?.labelStyle, previous.labelStyle),\r\n captionStyle: textOps.resolveStyle(\r\n center?.captionStyle,\r\n previous.captionStyle\r\n ),\r\n }\r\n}\r\n\r\nfunction lerpCenterConfig(\r\n from: CenterConfig,\r\n to: CenterConfig,\r\n t: number\r\n): CenterConfig {\r\n return {\r\n labelStyle: textOps.lerpStyle(from.labelStyle, to.labelStyle, t),\r\n captionStyle: textOps.lerpStyle(from.captionStyle, to.captionStyle, t),\r\n }\r\n}\r\n\r\n/**\r\n * {@link PieChart}'s `theme` property mapper: merges the author's partial\r\n * {@link PieChartTheme} onto `previous` (falling back to\r\n * {@link DEFAULT_PIE_CHART_THEME} on first resolution), fully resolving every\r\n * leaf so the tween below always has resolved data to interpolate.\r\n */\r\nexport function resolvePieChartTheme(\r\n theme: PieChartTheme | undefined,\r\n previous?: PieChartConfig\r\n): PieChartConfig {\r\n const base = previous ?? DEFAULT_PIE_CHART_THEME\r\n return {\r\n sliceFills: resolveSeriesFills(theme?.sliceFills, base.sliceFills),\r\n ring: resolveRingConfig(theme?.ring, base.ring),\r\n label: resolveLabelConfig(theme?.label, base.label),\r\n center: resolveCenterConfig(theme?.center, base.center),\r\n legend: resolveLegendConfig(theme?.legend, base.legend),\r\n spotlight: {\r\n dimOpacity: theme?.spotlight?.dimOpacity ?? base.spotlight.dimOpacity,\r\n },\r\n }\r\n}\r\n\r\n/** {@link PieChart}'s `theme` property tween — leaf by leaf. */\r\nexport function lerpPieChartTheme(\r\n from: PieChartConfig,\r\n to: PieChartConfig,\r\n t: number\r\n): PieChartConfig {\r\n return {\r\n // A palette is a list of independent paints rather than one value, so it\r\n // interpolates pairwise by index; one that grows or shrinks holds the longer\r\n // side's tail, exactly as the cartesian charts' palettes do.\r\n sliceFills: lerpSeriesFills(from.sliceFills, to.sliceFills, t),\r\n ring: lerpRingConfig(from.ring, to.ring, t),\r\n label: lerpLabelConfig(from.label, to.label, t),\r\n center: lerpCenterConfig(from.center, to.center, t),\r\n legend: lerpLegendConfig(from.legend, to.legend, t),\r\n spotlight: {\r\n dimOpacity: lerpNumber(\r\n from.spotlight.dimOpacity,\r\n to.spotlight.dimOpacity,\r\n t\r\n ),\r\n },\r\n }\r\n}\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@motionscript/charts",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Animated data charts for Motion Script: a line chart, a bar chart and a pie chart sharing one axis, legend and theme kit.",
|
|
6
6
|
"repository": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
],
|
|
50
50
|
"license": "Apache-2.0",
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@motionscript/sdk": "^0.1.0-alpha.
|
|
52
|
+
"@motionscript/sdk": "^0.1.0-alpha.7"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/node": "^25.6.2",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"typescript": "^6.0.3",
|
|
61
61
|
"typescript-eslint": "^8.48.0",
|
|
62
62
|
"vitest": "^4.1.5",
|
|
63
|
-
"@motionscript/core": "0.1.0-alpha.
|
|
64
|
-
"@motionscript/sdk": "0.1.0-alpha.
|
|
63
|
+
"@motionscript/core": "0.1.0-alpha.7",
|
|
64
|
+
"@motionscript/sdk": "0.1.0-alpha.7"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json --resolve-full-paths && node ../../../scripts/build-browser.mjs",
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
type NodeOf,
|
|
7
7
|
// Named so this component's emitted type reaches `Node2D` through the sdk, not core.
|
|
8
8
|
type Node2D as _Node2D,
|
|
9
|
-
type Node2DProps,
|
|
10
9
|
type Stroke,
|
|
11
10
|
type StrokeResolved,
|
|
12
11
|
type Vector2,
|
|
@@ -23,40 +22,6 @@ import {
|
|
|
23
22
|
type RegionBox,
|
|
24
23
|
} from "./shared"
|
|
25
24
|
|
|
26
|
-
export interface ChartLineProps extends Node2DProps {
|
|
27
|
-
/**
|
|
28
|
-
* The series polyline, already mapped into this node's local pixel space
|
|
29
|
-
* (origin at centre, y-up) by the parent {@link LineChart}. Ordered along x.
|
|
30
|
-
*/
|
|
31
|
-
points: Vector2[]
|
|
32
|
-
/** Line colour + weight (+ optional dash/cap/join) — the per-series stroke. */
|
|
33
|
-
stroke: Stroke
|
|
34
|
-
/**
|
|
35
|
-
* Reveal of the line in `[0, 1]`: 0 hides it, 1 traces it fully from its left
|
|
36
|
-
* end to its right.
|
|
37
|
-
*
|
|
38
|
-
* Defaults to **1**, unlike the standalone chart this was ported from: in an
|
|
39
|
-
* editor a node's resting state is what the paused editor canvas paints, so a
|
|
40
|
-
* chart that only appeared once a command had run would edit blind. {@link
|
|
41
|
-
* ChartLine.enter} drives it from 0 regardless of where it rests, so the
|
|
42
|
-
* animation is unchanged.
|
|
43
|
-
*/
|
|
44
|
-
progress: number
|
|
45
|
-
/**
|
|
46
|
-
* Whether this line is drawn at all. `false` hides it outright — the switch
|
|
47
|
-
* the chart flips alongside its legend's per-series toggle.
|
|
48
|
-
*/
|
|
49
|
-
enabled: boolean
|
|
50
|
-
/**
|
|
51
|
-
* A slice of the plot to spotlight, in this node's own pixel space. When set
|
|
52
|
-
* to a real box, the stretches of the line *outside* it drop to
|
|
53
|
-
* {@link ChartLineProps.dimOpacity} while the stretches inside stay full.
|
|
54
|
-
*/
|
|
55
|
-
spotlight: RegionBox
|
|
56
|
-
/** Opacity the out-of-region stretches fade to. */
|
|
57
|
-
dimOpacity: number
|
|
58
|
-
}
|
|
59
|
-
|
|
60
25
|
/**
|
|
61
26
|
* The prefix of `pts` revealed at fraction `p ∈ [0, 1]`, measuring the reveal
|
|
62
27
|
* by *cumulative arc length* so the line traces at a steady pace regardless of
|
|
@@ -99,17 +64,27 @@ function tracePoints(pts: Vector2[], p: number): Vector2[] {
|
|
|
99
64
|
* through pre-mapped pixel `points`, drawn as one {@link Graphics2D} command list.
|
|
100
65
|
* Sized and positioned by the parent, which shares the plot's coordinate frame.
|
|
101
66
|
*
|
|
102
|
-
* Two signals drive it:
|
|
67
|
+
* Two signals drive it: `progress` traces the line in
|
|
103
68
|
* (animated by `enter`) and `enabled` shows or hides it wholesale.
|
|
104
69
|
*/
|
|
105
70
|
export const ChartLine = component2d({
|
|
106
71
|
key: "chartLine",
|
|
107
72
|
state: {
|
|
73
|
+
/** The series polyline, already mapped into this node's local pixel space (origin at centre, y-up) by the parent {@link LineChart}. Ordered along x. */
|
|
108
74
|
points: fresh<Vector2[]>(() => []),
|
|
75
|
+
/** Line colour + weight (+ optional dash/cap/join) — the per-series stroke. */
|
|
109
76
|
stroke: Types.custom<Stroke, StrokeResolved[]>([], { resolve: strokeOps.resolve, lerp: strokeOps.lerp }),
|
|
77
|
+
/**
|
|
78
|
+
* Reveal of the line in `[0, 1]`: 0 hides it, 1 traces it fully from its left
|
|
79
|
+
* end to its right. Defaults to 1, so the paused editor canvas paints the line;
|
|
80
|
+
* `enter` drives it from 0 regardless of where it rests.
|
|
81
|
+
*/
|
|
110
82
|
progress: 1,
|
|
83
|
+
/** Whether this line is drawn at all: the switch the chart flips alongside its legend's per-series toggle. */
|
|
111
84
|
enabled: true,
|
|
85
|
+
/** A slice of the plot to spotlight, in this node's own pixel space: outside it the line drops to `dimOpacity`. */
|
|
112
86
|
spotlight: fresh<RegionBox>(() => EMPTY_REGION_BOX),
|
|
87
|
+
/** Opacity the out-of-region stretches fade to. */
|
|
113
88
|
dimOpacity: SPOTLIGHT_DIM,
|
|
114
89
|
},
|
|
115
90
|
load: (loader, state) => loadPaints(loader, { strokes: [state.stroke] }),
|