@motionscript/charts 0.1.0 → 0.1.1-alpha.1
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 +38 -0
- package/README.md +98 -28
- package/dist/bar-chart/bar-chart.d.ts +242 -119
- package/dist/bar-chart/bar-chart.d.ts.map +1 -1
- package/dist/bar-chart/bar-chart.js +231 -260
- package/dist/bar-chart/bar-chart.js.map +1 -1
- package/dist/bar-chart/category-axis.d.ts +16 -38
- package/dist/bar-chart/category-axis.d.ts.map +1 -1
- package/dist/bar-chart/category-axis.js +59 -68
- package/dist/bar-chart/category-axis.js.map +1 -1
- package/dist/bar-chart/chart-bars.d.ts +60 -91
- package/dist/bar-chart/chart-bars.d.ts.map +1 -1
- package/dist/bar-chart/chart-bars.js +88 -125
- package/dist/bar-chart/chart-bars.js.map +1 -1
- package/dist/bar-chart/index.d.ts +5 -13
- package/dist/bar-chart/index.d.ts.map +1 -1
- package/dist/bar-chart/index.js +2 -9
- package/dist/bar-chart/index.js.map +1 -1
- package/dist/bar-chart/shared.d.ts +40 -132
- package/dist/bar-chart/shared.d.ts.map +1 -1
- package/dist/bar-chart/shared.js +70 -158
- package/dist/bar-chart/shared.js.map +1 -1
- package/dist/browser/chunks/chunk-R3Q5EE6E.js +2 -0
- package/dist/browser/chunks/chunk-R3Q5EE6E.js.map +7 -0
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/browser/kit.js +1 -1
- package/dist/browser/manifest.json +1 -1
- package/dist/engine.d.ts +8 -17
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +8 -17
- package/dist/engine.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/kit/cartesian.d.ts +49 -35
- package/dist/kit/cartesian.d.ts.map +1 -1
- package/dist/kit/cartesian.js +80 -42
- package/dist/kit/cartesian.js.map +1 -1
- package/dist/kit/chart-canvas.d.ts +37 -40
- package/dist/kit/chart-canvas.d.ts.map +1 -1
- package/dist/kit/chart-canvas.js +53 -47
- package/dist/kit/chart-canvas.js.map +1 -1
- package/dist/kit/chart-legend.d.ts +16 -59
- package/dist/kit/chart-legend.d.ts.map +1 -1
- package/dist/kit/chart-legend.js +38 -76
- package/dist/kit/chart-legend.js.map +1 -1
- package/dist/kit/entries.d.ts +2 -0
- package/dist/kit/entries.d.ts.map +1 -1
- package/dist/kit/entries.js +2 -0
- package/dist/kit/entries.js.map +1 -1
- package/dist/kit/horizontal-axis.d.ts +77 -0
- package/dist/kit/horizontal-axis.d.ts.map +1 -0
- package/dist/kit/horizontal-axis.js +99 -0
- package/dist/kit/horizontal-axis.js.map +1 -0
- package/dist/kit/motion.d.ts +16 -3
- package/dist/kit/motion.d.ts.map +1 -1
- package/dist/kit/motion.js +15 -1
- package/dist/kit/motion.js.map +1 -1
- package/dist/{pie-chart → kit}/pie-legend.d.ts +14 -29
- package/dist/kit/pie-legend.d.ts.map +1 -0
- package/dist/kit/pie-legend.js +93 -0
- package/dist/kit/pie-legend.js.map +1 -0
- package/dist/kit/polar.d.ts +31 -0
- package/dist/kit/polar.d.ts.map +1 -0
- package/dist/kit/polar.js +33 -0
- package/dist/kit/polar.js.map +1 -0
- package/dist/kit/shared.d.ts +60 -214
- package/dist/kit/shared.d.ts.map +1 -1
- package/dist/kit/shared.js +91 -291
- package/dist/kit/shared.js.map +1 -1
- package/dist/kit/style.d.ts +254 -0
- package/dist/kit/style.d.ts.map +1 -0
- package/dist/kit/style.js +197 -0
- package/dist/kit/style.js.map +1 -0
- package/dist/kit/vertical-axis.d.ts +36 -45
- package/dist/kit/vertical-axis.d.ts.map +1 -1
- package/dist/kit/vertical-axis.js +69 -81
- package/dist/kit/vertical-axis.js.map +1 -1
- package/dist/line-chart/chart-line.d.ts +107 -40
- package/dist/line-chart/chart-line.d.ts.map +1 -1
- package/dist/line-chart/chart-line.js +172 -89
- package/dist/line-chart/chart-line.js.map +1 -1
- package/dist/line-chart/chart-region.d.ts +14 -27
- package/dist/line-chart/chart-region.d.ts.map +1 -1
- package/dist/line-chart/chart-region.js +13 -28
- package/dist/line-chart/chart-region.js.map +1 -1
- package/dist/line-chart/index.d.ts +5 -18
- package/dist/line-chart/index.d.ts.map +1 -1
- package/dist/line-chart/index.js +3 -16
- package/dist/line-chart/index.js.map +1 -1
- package/dist/line-chart/line-chart.d.ts +272 -119
- package/dist/line-chart/line-chart.d.ts.map +1 -1
- package/dist/line-chart/line-chart.js +309 -257
- package/dist/line-chart/line-chart.js.map +1 -1
- package/dist/line-chart/shared.d.ts +73 -130
- package/dist/line-chart/shared.d.ts.map +1 -1
- package/dist/line-chart/shared.js +195 -156
- package/dist/line-chart/shared.js.map +1 -1
- package/dist/line-chart/x-scale.d.ts +16 -55
- package/dist/line-chart/x-scale.d.ts.map +1 -1
- package/dist/line-chart/x-scale.js +44 -111
- package/dist/line-chart/x-scale.js.map +1 -1
- package/dist/nodes.d.ts +3 -13
- package/dist/nodes.d.ts.map +1 -1
- package/dist/nodes.js +9 -13
- package/dist/nodes.js.map +1 -1
- package/dist/pie-chart/index.d.ts +3 -15
- package/dist/pie-chart/index.d.ts.map +1 -1
- package/dist/pie-chart/index.js +1 -11
- package/dist/pie-chart/index.js.map +1 -1
- package/dist/pie-chart/pie-chart.d.ts +147 -85
- package/dist/pie-chart/pie-chart.d.ts.map +1 -1
- package/dist/pie-chart/pie-chart.js +65 -86
- package/dist/pie-chart/pie-chart.js.map +1 -1
- package/dist/pie-chart/pie-ring.d.ts +65 -196
- package/dist/pie-chart/pie-ring.d.ts.map +1 -1
- package/dist/pie-chart/pie-ring.js +154 -292
- package/dist/pie-chart/pie-ring.js.map +1 -1
- package/dist/pie-chart/shared.d.ts +78 -172
- package/dist/pie-chart/shared.d.ts.map +1 -1
- package/dist/pie-chart/shared.js +54 -177
- package/dist/pie-chart/shared.js.map +1 -1
- package/dist/radar-chart/index.d.ts +5 -0
- package/dist/radar-chart/index.d.ts.map +1 -0
- package/dist/radar-chart/index.js +5 -0
- package/dist/radar-chart/index.js.map +1 -0
- package/dist/radar-chart/radar-chart.d.ts +218 -0
- package/dist/radar-chart/radar-chart.d.ts.map +1 -0
- package/dist/radar-chart/radar-chart.js +224 -0
- package/dist/radar-chart/radar-chart.js.map +1 -0
- package/dist/radar-chart/radar-grid.d.ts +43 -0
- package/dist/radar-chart/radar-grid.d.ts.map +1 -0
- package/dist/radar-chart/radar-grid.js +61 -0
- package/dist/radar-chart/radar-grid.js.map +1 -0
- package/dist/radar-chart/radar-series.d.ts +59 -0
- package/dist/radar-chart/radar-series.d.ts.map +1 -0
- package/dist/radar-chart/radar-series.js +71 -0
- package/dist/radar-chart/radar-series.js.map +1 -0
- package/dist/radar-chart/shared.d.ts +73 -0
- package/dist/radar-chart/shared.d.ts.map +1 -0
- package/dist/radar-chart/shared.js +123 -0
- package/dist/radar-chart/shared.js.map +1 -0
- package/dist/radial-chart/index.d.ts +6 -0
- package/dist/radial-chart/index.d.ts.map +1 -0
- package/dist/radial-chart/index.js +4 -0
- package/dist/radial-chart/index.js.map +1 -0
- package/dist/radial-chart/radial-chart.d.ts +216 -0
- package/dist/radial-chart/radial-chart.d.ts.map +1 -0
- package/dist/radial-chart/radial-chart.js +174 -0
- package/dist/radial-chart/radial-chart.js.map +1 -0
- package/dist/radial-chart/radial-rings.d.ts +121 -0
- package/dist/radial-chart/radial-rings.d.ts.map +1 -0
- package/dist/radial-chart/radial-rings.js +273 -0
- package/dist/radial-chart/radial-rings.js.map +1 -0
- package/dist/radial-chart/shared.d.ts +73 -0
- package/dist/radial-chart/shared.d.ts.map +1 -0
- package/dist/radial-chart/shared.js +79 -0
- package/dist/radial-chart/shared.js.map +1 -0
- package/package.json +4 -4
- package/registry.json +21 -6
- package/src/bar-chart/bar-chart.ts +274 -315
- package/src/bar-chart/category-axis.ts +53 -88
- package/src/bar-chart/chart-bars.ts +108 -205
- package/src/bar-chart/index.ts +8 -19
- package/src/bar-chart/shared.ts +81 -309
- package/src/engine.ts +8 -17
- package/src/index.ts +2 -0
- package/src/kit/cartesian.ts +118 -55
- package/src/kit/chart-canvas.ts +50 -80
- package/src/kit/chart-legend.ts +36 -97
- package/src/kit/entries.ts +4 -1
- package/src/kit/horizontal-axis.ts +114 -0
- package/src/kit/motion.ts +18 -2
- package/src/{pie-chart → kit}/pie-legend.ts +25 -65
- package/src/kit/polar.ts +54 -0
- package/src/kit/shared.ts +104 -487
- package/src/kit/style.ts +257 -0
- package/src/kit/vertical-axis.ts +81 -115
- package/src/line-chart/chart-line.ts +185 -91
- package/src/line-chart/chart-region.ts +14 -31
- package/src/line-chart/index.ts +14 -22
- package/src/line-chart/line-chart.ts +377 -315
- package/src/line-chart/shared.ts +229 -304
- package/src/line-chart/x-scale.ts +44 -121
- package/src/nodes.ts +9 -13
- package/src/pie-chart/index.ts +3 -35
- package/src/pie-chart/pie-chart.ts +83 -134
- package/src/pie-chart/pie-ring.ts +162 -368
- package/src/pie-chart/shared.ts +92 -379
- package/src/radar-chart/index.ts +4 -0
- package/src/radar-chart/radar-chart.ts +287 -0
- package/src/radar-chart/radar-grid.ts +78 -0
- package/src/radar-chart/radar-series.ts +88 -0
- package/src/radar-chart/shared.ts +146 -0
- package/src/radial-chart/index.ts +5 -0
- package/src/radial-chart/radial-chart.ts +210 -0
- package/src/radial-chart/radial-rings.ts +328 -0
- package/src/radial-chart/shared.ts +114 -0
- package/dist/browser/chunks/chunk-TJNHLQGV.js +0 -2
- package/dist/browser/chunks/chunk-TJNHLQGV.js.map +0 -7
- package/dist/kit/chart-border.d.ts +0 -27
- package/dist/kit/chart-border.d.ts.map +0 -1
- package/dist/kit/chart-border.js +0 -28
- package/dist/kit/chart-border.js.map +0 -1
- package/dist/line-chart/horizontal-axis.d.ts +0 -79
- package/dist/line-chart/horizontal-axis.d.ts.map +0 -1
- package/dist/line-chart/horizontal-axis.js +0 -129
- package/dist/line-chart/horizontal-axis.js.map +0 -1
- package/dist/pie-chart/pie-legend.d.ts.map +0 -1
- package/dist/pie-chart/pie-legend.js +0 -117
- package/dist/pie-chart/pie-legend.js.map +0 -1
- package/src/kit/chart-border.ts +0 -50
- package/src/line-chart/horizontal-axis.ts +0 -151
package/dist/browser/kit.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,_,a,aa,b,ba,c,ca,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunks/chunk-
|
|
1
|
+
import{$,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,_,a,aa,b,ba,c,ca,d,da,e,ea,f,fa,g,ga,h,ha,i,ia,j,ja,k,ka,l,la,m,ma,n,na,o,oa,p,q,r,s,t,u,v,w,x,y,z}from"./chunks/chunk-R3Q5EE6E.js";export{_ as CARTESIAN_GRID,Y as CHART_COLORS,$ as CHART_LEGEND,X as CHART_PALETTE_DEFAULT,W as CHART_STYLE_FAMILY,aa as CHART_STYLE_PRESETS,Z as CHART_TEXT,o as ChartCanvas,Q as ChartLegend,J as DEFAULT_LEGEND,r as DEFAULT_MARKERS,H as DEFAULT_X_AXIS,I as DEFAULT_Y_AXIS,ja as DEG,s as ENTER_SHARE,V as HorizontalAxis,p as LEGEND_SLIDE,ma as PIE_SPOTLIGHT_DIM,ia as PieLegend,l as SERIES_ARG,D as SPOTLIGHT_DIM,U as VerticalAxis,x as armed,y as arrival,w as arrivalOf,v as arrivalsEntry,k as asParts,ga as axisConfigOf,S as axisPads,u as beats,g as boundText,T as captionColumn,d as cartesianFrame,e as chartViews,h as columnGhost,i as fade,K as formatMarker,M as formatPercent,t as frameEase,a as frameGap,j as fresh,b as headroom,f as laidOutSize,q as legendAway,ha as legendConfigOf,A as lerpAxisDomain,B as lerpAxisEntry,m as loadPaints,R as markerCaption,L as markerStep,da as markerText,N as markerValues,O as niceRange,P as niceTicks,E as num,G as numericFields,c as overhang,ba as paletteFill,z as resolveAxisDomain,na as resolvedFill,oa as ringFills,la as ringPoint,n as rule,ka as selectionFade,ca as seriesFill,C as settleAxisDomain,F as text,ea as titleText,fa as valueText};
|
|
2
2
|
//# sourceMappingURL=kit.js.map
|
package/dist/engine.d.ts
CHANGED
|
@@ -1,29 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The chart
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* reach for these to `@motionscript/charts`, so the plot panel, the value
|
|
7
|
-
* axis, the legend and the number formatting stay a real dependency. That is
|
|
8
|
-
* not a size decision — it is the only arrangement that works.
|
|
9
|
-
*
|
|
10
|
-
* A chart identifies its own parts by component identity (`VerticalAxis.is`).
|
|
11
|
-
* Copy `VerticalAxis` alongside your fork and there are now two of it — two
|
|
12
|
-
* components answering one name, and whichever one your chart did not get is
|
|
13
|
-
* a part it never finds, with no error. Keeping the kit external makes that
|
|
14
|
-
* impossible rather than unlikely.
|
|
15
|
-
*
|
|
16
|
-
* It also means a fix to the axis reaches a forked chart without a re-add,
|
|
17
|
-
* which is the half of the bargain you get back for it.
|
|
2
|
+
* The chart kit: what the five charts share, and what a copied chart does not
|
|
3
|
+
* copy. A chart finds its parts by component identity (`VerticalAxis.is`), so a
|
|
4
|
+
* second copy of `VerticalAxis` would be a second component that the chart never
|
|
5
|
+
* finds, with no error. Copies import the kit from `@motionscript/charts`.
|
|
18
6
|
*/
|
|
19
7
|
export * from "./kit/shared.js";
|
|
8
|
+
export * from "./kit/style.js";
|
|
20
9
|
export * from "./kit/cartesian.js";
|
|
21
|
-
export * from "./kit/chart-border.js";
|
|
22
10
|
export * from "./kit/chart-canvas.js";
|
|
11
|
+
export * from "./kit/horizontal-axis.js";
|
|
23
12
|
export * from "./kit/chart-legend.js";
|
|
24
13
|
export * from "./kit/entries.js";
|
|
25
14
|
export * from "./kit/motion.js";
|
|
26
15
|
export * from "./kit/paints.js";
|
|
16
|
+
export * from "./kit/pie-legend.js";
|
|
17
|
+
export * from "./kit/polar.js";
|
|
27
18
|
export * from "./kit/vertical-axis.js";
|
|
28
19
|
export * from "@motionscript/sdk/component";
|
|
29
20
|
//# sourceMappingURL=engine.d.ts.map
|
package/dist/engine.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,6BAA6B,CAAA"}
|
package/dist/engine.js
CHANGED
|
@@ -1,29 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The chart
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* reach for these to `@motionscript/charts`, so the plot panel, the value
|
|
7
|
-
* axis, the legend and the number formatting stay a real dependency. That is
|
|
8
|
-
* not a size decision — it is the only arrangement that works.
|
|
9
|
-
*
|
|
10
|
-
* A chart identifies its own parts by component identity (`VerticalAxis.is`).
|
|
11
|
-
* Copy `VerticalAxis` alongside your fork and there are now two of it — two
|
|
12
|
-
* components answering one name, and whichever one your chart did not get is
|
|
13
|
-
* a part it never finds, with no error. Keeping the kit external makes that
|
|
14
|
-
* impossible rather than unlikely.
|
|
15
|
-
*
|
|
16
|
-
* It also means a fix to the axis reaches a forked chart without a re-add,
|
|
17
|
-
* which is the half of the bargain you get back for it.
|
|
2
|
+
* The chart kit: what the five charts share, and what a copied chart does not
|
|
3
|
+
* copy. A chart finds its parts by component identity (`VerticalAxis.is`), so a
|
|
4
|
+
* second copy of `VerticalAxis` would be a second component that the chart never
|
|
5
|
+
* finds, with no error. Copies import the kit from `@motionscript/charts`.
|
|
18
6
|
*/
|
|
19
7
|
export * from "./kit/shared.js";
|
|
8
|
+
export * from "./kit/style.js";
|
|
20
9
|
export * from "./kit/cartesian.js";
|
|
21
|
-
export * from "./kit/chart-border.js";
|
|
22
10
|
export * from "./kit/chart-canvas.js";
|
|
11
|
+
export * from "./kit/horizontal-axis.js";
|
|
23
12
|
export * from "./kit/chart-legend.js";
|
|
24
13
|
export * from "./kit/entries.js";
|
|
25
14
|
export * from "./kit/motion.js";
|
|
26
15
|
export * from "./kit/paints.js";
|
|
16
|
+
export * from "./kit/pie-legend.js";
|
|
17
|
+
export * from "./kit/polar.js";
|
|
27
18
|
export * from "./kit/vertical-axis.js";
|
|
28
19
|
export * from "@motionscript/sdk/component";
|
|
29
20
|
//# sourceMappingURL=engine.js.map
|
package/dist/engine.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,6BAA6B,CAAA","sourcesContent":["/**\n * The chart kit: what the five charts share, and what a copied chart does not\n * copy. A chart finds its parts by component identity (`VerticalAxis.is`), so a\n * second copy of `VerticalAxis` would be a second component that the chart never\n * finds, with no error. Copies import the kit from `@motionscript/charts`.\n */\nexport * from \"./kit/shared\"\nexport * from \"./kit/style\"\nexport * from \"./kit/cartesian\"\nexport * from \"./kit/chart-canvas\"\nexport * from \"./kit/horizontal-axis\"\nexport * from \"./kit/chart-legend\"\nexport * from \"./kit/entries\"\nexport * from \"./kit/motion\"\nexport * from \"./kit/paints\"\nexport * from \"./kit/pie-legend\"\nexport * from \"./kit/polar\"\nexport * from \"./kit/vertical-axis\"\nexport * from \"@motionscript/sdk/component\"\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from "./line-chart/index.js";
|
|
2
2
|
export * from "./bar-chart/index.js";
|
|
3
3
|
export * from "./pie-chart/index.js";
|
|
4
|
+
export * from "./radar-chart/index.js";
|
|
5
|
+
export * from "./radial-chart/index.js";
|
|
4
6
|
export * from "./engine.js";
|
|
5
7
|
export { NODES } from "./nodes.js";
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from "./line-chart/index.js";
|
|
2
2
|
export * from "./bar-chart/index.js";
|
|
3
3
|
export * from "./pie-chart/index.js";
|
|
4
|
+
export * from "./radar-chart/index.js";
|
|
5
|
+
export * from "./radial-chart/index.js";
|
|
4
6
|
export * from "./engine.js";
|
|
5
7
|
export { NODES } from "./nodes.js";
|
|
6
8
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC","sourcesContent":["export * from \"./line-chart\";\nexport * from \"./bar-chart\";\nexport * from \"./pie-chart\";\nexport * from \"./engine\";\nexport { NODES } from \"./nodes\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC","sourcesContent":["export * from \"./line-chart\";\nexport * from \"./bar-chart\";\nexport * from \"./pie-chart\";\nexport * from \"./radar-chart\";\nexport * from \"./radial-chart\";\nexport * from \"./engine\";\nexport { NODES } from \"./nodes\";\n"]}
|
package/dist/kit/cartesian.d.ts
CHANGED
|
@@ -1,44 +1,58 @@
|
|
|
1
|
-
import { type ChildView, type Node2D, type Size2D } from "@motionscript/sdk";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
/** The
|
|
15
|
-
readonly axis: Node2D;
|
|
16
|
-
/** The plot panel: the box the grid and the marks share. */
|
|
1
|
+
import { type ChildView, type Fill, type Insets, type Node2D, type Size2D, type TextStyle } from "@motionscript/sdk";
|
|
2
|
+
import type { CartesianStyle, LegendPosition } from "./style.js";
|
|
3
|
+
/** Space between the frame's rows and columns: the plot and the legend, the axes and the legend. */
|
|
4
|
+
export declare function frameGap(style: Pick<CartesianStyle, "fontSize">): number;
|
|
5
|
+
/** Room above the plot for the top value marker, which is centred on the top grid line. */
|
|
6
|
+
export declare function headroom(style: Pick<CartesianStyle, "fontSize">): number;
|
|
7
|
+
/** How far an end marker of a horizontal value axis may hang past the plot: half a short caption. */
|
|
8
|
+
export declare function overhang(style: Pick<CartesianStyle, "fontSize">): number;
|
|
9
|
+
interface CartesianParts {
|
|
10
|
+
/** The axis beside the plot, on its left. */
|
|
11
|
+
readonly left?: Node2D;
|
|
12
|
+
/** An invisible twin of `left` under the plot, so the row there starts at the plot's left edge. */
|
|
13
|
+
readonly ghost?: Node2D;
|
|
14
|
+
/** The box the grid and the marks share. */
|
|
17
15
|
readonly plot: Node2D;
|
|
18
|
-
/**
|
|
19
|
-
readonly
|
|
20
|
-
|
|
21
|
-
readonly
|
|
16
|
+
/** The axis under the plot. */
|
|
17
|
+
readonly bottom?: Node2D;
|
|
18
|
+
readonly legend?: Node2D;
|
|
19
|
+
readonly legendAt: LegendPosition;
|
|
20
|
+
readonly gap: () => number;
|
|
21
|
+
readonly padding: () => Insets;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
* The frame the line and bar charts share
|
|
25
|
-
*
|
|
26
|
-
*
|
|
24
|
+
* The frame the line and bar charts share. A legend above or below is centred
|
|
25
|
+
* on the whole chart; one on the right is a column beside the plot. An axis the
|
|
26
|
+
* style turns off is simply not here, and the plot takes its room.
|
|
27
27
|
*/
|
|
28
28
|
export declare function cartesianFrame(parts: CartesianParts): Node2D;
|
|
29
|
-
/**
|
|
30
|
-
export
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
/** Every view under `children`, depth first in build order: the axis beside the plot comes before its twin, which holds no parts. */
|
|
30
|
+
export declare function chartViews(children: readonly ChildView[]): ChildView[];
|
|
31
|
+
/** A part's laid-out size; zero before it is built or laid out. */
|
|
32
|
+
export declare function laidOutSize(node: Node2D | undefined): Size2D;
|
|
33
|
+
/**
|
|
34
|
+
* A text style as props bound to `read`, so a style tween reaches text built
|
|
35
|
+
* once. Only the keys set at build are bound: an unset family stays unset, so
|
|
36
|
+
* the host's default face still applies.
|
|
37
|
+
*/
|
|
38
|
+
export declare function boundText(read: () => TextStyle): Record<string, unknown>;
|
|
39
|
+
interface GhostSpec {
|
|
40
|
+
readonly captions: () => readonly string[];
|
|
41
|
+
/** How many captions the real axis built. */
|
|
42
|
+
readonly count: number;
|
|
43
|
+
readonly text: () => TextStyle;
|
|
44
|
+
readonly title: string;
|
|
45
|
+
readonly titleText: () => TextStyle;
|
|
46
|
+
readonly tickPad: () => number;
|
|
47
|
+
readonly titlePad: () => number;
|
|
35
48
|
}
|
|
36
49
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
50
|
+
* An invisible column as wide as a vertical axis built from the same captions:
|
|
51
|
+
* the widest caption plus the tick padding, and the rotated title before it. A
|
|
52
|
+
* plain tree, so a command looking for the axis never finds this instead.
|
|
40
53
|
*/
|
|
41
|
-
export declare function
|
|
42
|
-
/**
|
|
43
|
-
export declare function
|
|
54
|
+
export declare function columnGhost(spec: GhostSpec): Node2D;
|
|
55
|
+
/** `fill` with every layer's opacity scaled by `k`. */
|
|
56
|
+
export declare function fade(fill: Fill, k: number): Fill;
|
|
57
|
+
export {};
|
|
44
58
|
//# sourceMappingURL=cartesian.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cartesian.d.ts","sourceRoot":"","sources":["../../src/kit/cartesian.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"cartesian.d.ts","sourceRoot":"","sources":["../../src/kit/cartesian.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,IAAI,EAET,KAAK,MAAM,EACX,KAAK,MAAM,EACX,KAAK,MAAM,EACX,KAAK,SAAS,EACf,MAAM,mBAAmB,CAAA;AAE1B,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7D,oGAAoG;AACpG,wBAAgB,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,GAAG,MAAM,CAExE;AAED,2FAA2F;AAC3F,wBAAgB,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,GAAG,MAAM,CAExE;AAED,qGAAqG;AACrG,wBAAgB,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,GAAG,MAAM,CAExE;AAED,UAAU,cAAc;IACtB,6CAA6C;IAC7C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,mGAAmG;IACnG,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,4CAA4C;IAC5C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,+BAA+B;IAC/B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAA;IACjC,QAAQ,CAAC,GAAG,EAAE,MAAM,MAAM,CAAA;IAC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|
+
import { Rect, RotatedBox, Text, textOps, } from "@motionscript/sdk";
|
|
2
|
+
/** Space between the frame's rows and columns: the plot and the legend, the axes and the legend. */
|
|
3
|
+
export function frameGap(style) {
|
|
4
|
+
return Math.round(style.fontSize * 0.9);
|
|
5
|
+
}
|
|
6
|
+
/** Room above the plot for the top value marker, which is centred on the top grid line. */
|
|
7
|
+
export function headroom(style) {
|
|
8
|
+
return Math.ceil(style.fontSize * 0.7);
|
|
9
|
+
}
|
|
10
|
+
/** How far an end marker of a horizontal value axis may hang past the plot: half a short caption. */
|
|
11
|
+
export function overhang(style) {
|
|
12
|
+
return Math.ceil(style.fontSize * 1.1);
|
|
13
|
+
}
|
|
13
14
|
/**
|
|
14
|
-
* The frame the line and bar charts share
|
|
15
|
-
*
|
|
16
|
-
*
|
|
15
|
+
* The frame the line and bar charts share. A legend above or below is centred
|
|
16
|
+
* on the whole chart; one on the right is a column beside the plot. An axis the
|
|
17
|
+
* style turns off is simply not here, and the plot takes its room.
|
|
17
18
|
*/
|
|
18
19
|
export function cartesianFrame(parts) {
|
|
20
|
+
const top = new Rect({ flow: "horizontal", width: "fill", height: "fill", children: [...(parts.left ? [parts.left] : []), parts.plot] });
|
|
21
|
+
const rows = [top];
|
|
22
|
+
if (parts.bottom) {
|
|
23
|
+
rows.push(new Rect({ flow: "horizontal", width: "fill", height: "hug", children: [...(parts.ghost ? [parts.ghost] : []), parts.bottom] }));
|
|
24
|
+
}
|
|
25
|
+
const body = new Rect({ flow: "vertical", width: "fill", height: "fill", children: rows });
|
|
26
|
+
const legend = parts.legend && parts.legendAt !== "none" ? parts.legend : undefined;
|
|
27
|
+
const main = new Rect({
|
|
28
|
+
flow: "horizontal",
|
|
29
|
+
width: "fill",
|
|
30
|
+
height: "fill",
|
|
31
|
+
align: "center",
|
|
32
|
+
gap: parts.gap,
|
|
33
|
+
children: [body, ...(legend && parts.legendAt === "right" ? [legend] : [])],
|
|
34
|
+
});
|
|
35
|
+
const across = (node) => new Rect({ flow: "horizontal", width: "fill", height: "hug", align: "center", children: [node] });
|
|
19
36
|
return new Rect({
|
|
20
37
|
flow: "vertical",
|
|
21
38
|
width: "fill",
|
|
22
39
|
height: "fill",
|
|
23
|
-
|
|
40
|
+
gap: parts.gap,
|
|
41
|
+
padding: parts.padding,
|
|
24
42
|
children: [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
width: "fill",
|
|
29
|
-
children: [parts.gutter, new Rect({ flow: "vertical", width: "fill", gap: 20, children: [...parts.below] })],
|
|
30
|
-
}),
|
|
43
|
+
...(legend && parts.legendAt === "top" ? [across(legend)] : []),
|
|
44
|
+
main,
|
|
45
|
+
...(legend && parts.legendAt === "bottom" ? [across(legend)] : []),
|
|
31
46
|
],
|
|
32
47
|
});
|
|
33
48
|
}
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const axis = top?.children[0];
|
|
46
|
-
const plot = top?.children[1];
|
|
47
|
-
const below = bottom?.children[1];
|
|
48
|
-
if (!axis || !VerticalAxis.is(axis) || !plot || !below)
|
|
49
|
-
continue;
|
|
50
|
-
return { axis, plot: plot.children, below: below.children };
|
|
51
|
-
}
|
|
52
|
-
return null;
|
|
49
|
+
/** Every view under `children`, depth first in build order: the axis beside the plot comes before its twin, which holds no parts. */
|
|
50
|
+
export function chartViews(children) {
|
|
51
|
+
const out = [];
|
|
52
|
+
const walk = (views) => {
|
|
53
|
+
for (const view of views) {
|
|
54
|
+
out.push(view);
|
|
55
|
+
walk(view.children);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
walk(children);
|
|
59
|
+
return out;
|
|
53
60
|
}
|
|
54
|
-
/** A part's laid-out size
|
|
61
|
+
/** A part's laid-out size; zero before it is built or laid out. */
|
|
55
62
|
export function laidOutSize(node) {
|
|
56
63
|
const bounds = node?.layoutBounds;
|
|
57
64
|
return { width: bounds?.width ?? 0, height: bounds?.height ?? 0 };
|
|
58
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* A text style as props bound to `read`, so a style tween reaches text built
|
|
68
|
+
* once. Only the keys set at build are bound: an unset family stays unset, so
|
|
69
|
+
* the host's default face still applies.
|
|
70
|
+
*/
|
|
71
|
+
export function boundText(read) {
|
|
72
|
+
const keys = Object.keys(textOps.styleProps(read()));
|
|
73
|
+
const props = {};
|
|
74
|
+
for (const key of keys)
|
|
75
|
+
props[key] = () => read()[key];
|
|
76
|
+
return props;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* An invisible column as wide as a vertical axis built from the same captions:
|
|
80
|
+
* the widest caption plus the tick padding, and the rotated title before it. A
|
|
81
|
+
* plain tree, so a command looking for the axis never finds this instead.
|
|
82
|
+
*/
|
|
83
|
+
export function columnGhost(spec) {
|
|
84
|
+
const captions = Array.from({ length: spec.count }, (_, i) => new Text({ ...boundText(spec.text), text: () => spec.captions()[i] ?? "" }));
|
|
85
|
+
const children = [];
|
|
86
|
+
if (spec.title !== "") {
|
|
87
|
+
children.push(new RotatedBox({ angle: -90, width: "hug", height: "hug", children: new Text({ ...boundText(spec.titleText), text: spec.title }) }));
|
|
88
|
+
}
|
|
89
|
+
children.push(new Rect({ flow: "vertical", width: "hug", height: "hug", padding: () => ({ right: spec.tickPad() }), children: captions }));
|
|
90
|
+
return new Rect({ opacity: 0, flow: "horizontal", gap: spec.titlePad, width: "hug", height: 0, children });
|
|
91
|
+
}
|
|
92
|
+
/** `fill` with every layer's opacity scaled by `k`. */
|
|
93
|
+
export function fade(fill, k) {
|
|
94
|
+
const layers = (Array.isArray(fill) ? fill : [fill]);
|
|
95
|
+
return layers.map((layer) => (typeof layer === "object" && layer !== null ? { ...layer, opacity: (layer.opacity ?? 1) * k } : layer));
|
|
96
|
+
}
|
|
59
97
|
//# sourceMappingURL=cartesian.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|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,EAAE,CAAC,KAAK,CAAC;YAAE,SAAQ;QAC7B,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAA;QACpC,MAAM,IAAI,GAAG,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAA;QAC7B,MAAM,IAAI,GAAG,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAA;QAC7B,MAAM,KAAK,GAAG,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAA;QACjC,IAAI,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK;YAAE,SAAQ;QAChE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAA;IAC7D,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,WAAW,CAAC,IAAwB;IAClD,MAAM,MAAM,GAAG,IAAI,EAAE,YAAY,CAAA;IACjC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC,EAAE,CAAA;AACnE,CAAC","sourcesContent":["import { Rect, type ChildView, type Node2D, type Size2D } from \"@motionscript/sdk\"\n\nimport { VerticalAxis } from \"./vertical-axis\"\n\n/**\n * Headroom above the plot, in px.\n *\n * Two jobs, and the second is why it is real padding on the composition rather\n * than a number the point-mapping math imagines: a series peaking at the top of\n * the scale isn't flush to the top edge, **and** the top marker, which is\n * centred on that top grid line, has somewhere to be. Without it the marker's\n * upper half is drawn above the chart's own box.\n */\nexport const TOP_HEADROOM = 24\n\n/** The parts of a cartesian chart's frame, as {@link cartesianFrame} arranges them. */\nexport interface CartesianParts {\n /** The value axis, left of the plot. */\n readonly axis: Node2D\n /** The plot panel: the box the grid and the marks share. */\n readonly plot: Node2D\n /** An invisible twin of the value axis, reserving its gutter under the plot. */\n readonly gutter: Node2D\n /** What sits under the plot, top to bottom: the other axis, then the legend. */\n readonly below: readonly Node2D[]\n}\n\n/**\n * The frame the line and bar charts share: the value axis beside the plot, and\n * under them the gutter beside the rows below the plot, so those rows start at\n * the plot's left edge rather than the chart's.\n */\nexport function cartesianFrame(parts: CartesianParts): Node2D {\n return new Rect({\n flow: \"vertical\",\n width: \"fill\",\n height: \"fill\",\n padding: { top: TOP_HEADROOM },\n children: [\n new Rect({ flow: \"horizontal\", height: \"fill\", width: \"fill\", children: [parts.axis, parts.plot] }),\n new Rect({\n flow: \"horizontal\",\n width: \"fill\",\n children: [parts.gutter, new Rect({ flow: \"vertical\", width: \"fill\", gap: 20, children: [...parts.below] })],\n }),\n ],\n }) as unknown as Node2D\n}\n\n/** A cartesian frame's parts, as a command reaches them through its chart's children. */\nexport interface CartesianViews {\n readonly axis: ChildView\n /** The plot panel's own children: the grid, the marks, the border. */\n readonly plot: readonly ChildView[]\n readonly below: readonly ChildView[]\n}\n\n/**\n * The frame among a chart's children: the last child shaped as\n * {@link cartesianFrame} builds it. The chart builds it after the children it\n * was given, and a document adds its own later still, so it is found by shape.\n */\nexport function cartesianViews(children: readonly ChildView[]): CartesianViews | null {\n for (let i = children.length - 1; i >= 0; i--) {\n const frame = children[i]\n if (!Rect.is(frame)) continue\n const [top, bottom] = frame.children\n const axis = top?.children[0]\n const plot = top?.children[1]\n const below = bottom?.children[1]\n if (!axis || !VerticalAxis.is(axis) || !plot || !below) continue\n return { axis, plot: plot.children, below: below.children }\n }\n return null\n}\n\n/** A part's laid-out size, or nothing before it is built or laid out. */\nexport function laidOutSize(node: Node2D | undefined): Size2D {\n const bounds = node?.layoutBounds\n return { width: bounds?.width ?? 0, height: bounds?.height ?? 0 }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"cartesian.js","sourceRoot":"","sources":["../../src/kit/cartesian.ts"],"names":[],"mappings":"AAA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AAU,IAAI,CAAC,IAAU,EAAE,CAAS;IACxC,MAAM,MAAM,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAmB,CAAA;IACtE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,CAAE,KAA8B,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAS,CAAA;AACzK,CAAC","sourcesContent":["import {\n Rect,\n RotatedBox,\n Text,\n textOps,\n type ChildView,\n type Fill,\n type FillResolved,\n type Insets,\n type Node2D,\n type Size2D,\n type TextStyle,\n} from \"@motionscript/sdk\"\n\nimport type { CartesianStyle, LegendPosition } from \"./style\"\n\n/** Space between the frame's rows and columns: the plot and the legend, the axes and the legend. */\nexport function frameGap(style: Pick<CartesianStyle, \"fontSize\">): number {\n return Math.round(style.fontSize * 0.9)\n}\n\n/** Room above the plot for the top value marker, which is centred on the top grid line. */\nexport function headroom(style: Pick<CartesianStyle, \"fontSize\">): number {\n return Math.ceil(style.fontSize * 0.7)\n}\n\n/** How far an end marker of a horizontal value axis may hang past the plot: half a short caption. */\nexport function overhang(style: Pick<CartesianStyle, \"fontSize\">): number {\n return Math.ceil(style.fontSize * 1.1)\n}\n\ninterface CartesianParts {\n /** The axis beside the plot, on its left. */\n readonly left?: Node2D\n /** An invisible twin of `left` under the plot, so the row there starts at the plot's left edge. */\n readonly ghost?: Node2D\n /** The box the grid and the marks share. */\n readonly plot: Node2D\n /** The axis under the plot. */\n readonly bottom?: Node2D\n readonly legend?: Node2D\n readonly legendAt: LegendPosition\n readonly gap: () => number\n readonly padding: () => Insets\n}\n\n/**\n * The frame the line and bar charts share. A legend above or below is centred\n * on the whole chart; one on the right is a column beside the plot. An axis the\n * style turns off is simply not here, and the plot takes its room.\n */\nexport function cartesianFrame(parts: CartesianParts): Node2D {\n const top = new Rect({ flow: \"horizontal\", width: \"fill\", height: \"fill\", children: [...(parts.left ? [parts.left] : []), parts.plot] })\n const rows: Node2D[] = [top as unknown as Node2D]\n if (parts.bottom) {\n rows.push(new Rect({ flow: \"horizontal\", width: \"fill\", height: \"hug\", children: [...(parts.ghost ? [parts.ghost] : []), parts.bottom] }) as unknown as Node2D)\n }\n const body = new Rect({ flow: \"vertical\", width: \"fill\", height: \"fill\", children: rows })\n const legend = parts.legend && parts.legendAt !== \"none\" ? parts.legend : undefined\n const main = new Rect({\n flow: \"horizontal\",\n width: \"fill\",\n height: \"fill\",\n align: \"center\",\n gap: parts.gap,\n children: [body, ...(legend && parts.legendAt === \"right\" ? [legend] : [])],\n })\n const across = (node: Node2D) => new Rect({ flow: \"horizontal\", width: \"fill\", height: \"hug\", align: \"center\", children: [node] })\n return new Rect({\n flow: \"vertical\",\n width: \"fill\",\n height: \"fill\",\n gap: parts.gap,\n padding: parts.padding,\n children: [\n ...(legend && parts.legendAt === \"top\" ? [across(legend)] : []),\n main,\n ...(legend && parts.legendAt === \"bottom\" ? [across(legend)] : []),\n ],\n }) as unknown as Node2D\n}\n\n/** Every view under `children`, depth first in build order: the axis beside the plot comes before its twin, which holds no parts. */\nexport function chartViews(children: readonly ChildView[]): ChildView[] {\n const out: ChildView[] = []\n const walk = (views: readonly ChildView[]) => {\n for (const view of views) {\n out.push(view)\n walk(view.children)\n }\n }\n walk(children)\n return out\n}\n\n/** A part's laid-out size; zero before it is built or laid out. */\nexport function laidOutSize(node: Node2D | undefined): Size2D {\n const bounds = node?.layoutBounds\n return { width: bounds?.width ?? 0, height: bounds?.height ?? 0 }\n}\n\n/**\n * A text style as props bound to `read`, so a style tween reaches text built\n * once. Only the keys set at build are bound: an unset family stays unset, so\n * the host's default face still applies.\n */\nexport function boundText(read: () => TextStyle): Record<string, unknown> {\n const keys = Object.keys(textOps.styleProps(read())) as (keyof TextStyle)[]\n const props: Record<string, unknown> = {}\n for (const key of keys) props[key] = () => read()[key]\n return props\n}\n\ninterface GhostSpec {\n readonly captions: () => readonly string[]\n /** How many captions the real axis built. */\n readonly count: number\n readonly text: () => TextStyle\n readonly title: string\n readonly titleText: () => TextStyle\n readonly tickPad: () => number\n readonly titlePad: () => number\n}\n\n/**\n * An invisible column as wide as a vertical axis built from the same captions:\n * the widest caption plus the tick padding, and the rotated title before it. A\n * plain tree, so a command looking for the axis never finds this instead.\n */\nexport function columnGhost(spec: GhostSpec): Node2D {\n const captions = Array.from({ length: spec.count }, (_, i) => new Text({ ...boundText(spec.text), text: () => spec.captions()[i] ?? \"\" }))\n const children: Node2D[] = []\n if (spec.title !== \"\") {\n children.push(new RotatedBox({ angle: -90, width: \"hug\", height: \"hug\", children: new Text({ ...boundText(spec.titleText), text: spec.title }) }) as unknown as Node2D)\n }\n children.push(new Rect({ flow: \"vertical\", width: \"hug\", height: \"hug\", padding: () => ({ right: spec.tickPad() }), children: captions }) as unknown as Node2D)\n return new Rect({ opacity: 0, flow: \"horizontal\", gap: spec.titlePad, width: \"hug\", height: 0, children }) as unknown as Node2D\n}\n\n/** `fill` with every layer's opacity scaled by `k`. */\nexport function fade(fill: Fill, k: number): Fill {\n const layers = (Array.isArray(fill) ? fill : [fill]) as FillResolved[]\n return layers.map((layer) => (typeof layer === \"object\" && layer !== null ? { ...layer, opacity: ((layer as { opacity?: number }).opacity ?? 1) * k } : layer)) as Fill\n}\n"]}
|
|
@@ -1,67 +1,64 @@
|
|
|
1
|
-
import { type Fill, type FillResolved, type NodeOf, type Node2D as _Node2D, type Node2DProps
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
fill: Fill;
|
|
6
|
-
/** Drop shadow of the panel. Default none. */
|
|
7
|
-
shadow: Shadow;
|
|
8
|
-
/** Stroke of the vertical grid lines (one per {@link xMarkers}). */
|
|
9
|
-
xGridStroke: Stroke;
|
|
10
|
-
/** Stroke of the horizontal grid lines (one per {@link yMarkers}). */
|
|
11
|
-
yGridStroke: Stroke;
|
|
12
|
-
/**
|
|
13
|
-
* Data-unit x positions to draw a vertical grid line at — one per horizontal
|
|
14
|
-
* axis marker, so a line lands under every marker regardless of spacing.
|
|
15
|
-
* Positions at (or past) an {@link xExtent} edge coincide with the border and
|
|
16
|
-
* are skipped. Pass an empty list for a chart whose horizontal axis is
|
|
17
|
-
* categorical and so has no numeric position to rule at.
|
|
18
|
-
*/
|
|
19
|
-
xMarkers: number[];
|
|
20
|
-
/** Data-unit y positions to draw a horizontal grid line at. */
|
|
21
|
-
yMarkers: number[];
|
|
22
|
-
/** `[min, max]` of the horizontal scale — maps {@link xMarkers} into the panel. */
|
|
23
|
-
xExtent: Range;
|
|
24
|
-
/** `[min, max]` of the vertical scale — maps {@link yMarkers} into the panel. */
|
|
25
|
-
yExtent: Range;
|
|
26
|
-
}
|
|
1
|
+
import { type Fill, type FillResolved, type NodeOf, type Node2D as _Node2D, type Node2DProps as _Node2DProps, type RenderContext, type Stroke, type StrokeResolved, type Vector2 } from "@motionscript/sdk";
|
|
2
|
+
import type { Range } from "./shared.js";
|
|
3
|
+
/** One rule per draw: stroking a union of open paths paints nothing, and a dashed rule keeps its own phase. */
|
|
4
|
+
export declare function rule(ctx: RenderContext, from: Vector2, to: Vector2, stroke: StrokeResolved[], opacity?: number): void;
|
|
27
5
|
/**
|
|
28
|
-
* The plot
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* The thick frame is a **separate** {@link ChartBorder} node so it can be drawn
|
|
33
|
-
* *over* the marks while this panel sits under them. Grid lines are placed from
|
|
34
|
-
* the axis marker positions (in data units) mapped into the panel through
|
|
35
|
-
* {@link ChartCanvasProps.xExtent}/`yExtent` — so each line lands under its
|
|
36
|
-
* marker whether or not the markers are evenly spaced.
|
|
6
|
+
* The plot backdrop: the panel fill, the grid and the axis rules, sized from its
|
|
7
|
+
* box. Grid lines are placed from data-unit marker positions mapped through the
|
|
8
|
+
* extents, so each lands under its marker however the markers are spaced; a line
|
|
9
|
+
* on an edge is drawn just inside it.
|
|
37
10
|
*/
|
|
38
11
|
export declare const ChartCanvas: import("@motionscript/sdk").Component<"chartCanvas", import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
|
|
39
12
|
readonly fill: import("@motionscript/sdk").Type<Fill, FillResolved[], false>;
|
|
40
|
-
|
|
13
|
+
/** The vertical grid lines, one per `xMarkers` entry. */
|
|
41
14
|
readonly xGridStroke: import("@motionscript/sdk").Type<Stroke, StrokeResolved[], false>;
|
|
15
|
+
/** The horizontal grid lines, one per `yMarkers` entry. */
|
|
42
16
|
readonly yGridStroke: import("@motionscript/sdk").Type<Stroke, StrokeResolved[], false>;
|
|
43
17
|
readonly xMarkers: import("@motionscript/sdk").Type<number[], number[], false>;
|
|
44
18
|
readonly yMarkers: import("@motionscript/sdk").Type<number[], number[], false>;
|
|
19
|
+
/** `[min, max]` of each scale, mapping the markers into the panel. */
|
|
45
20
|
readonly xExtent: import("@motionscript/sdk").Type<Range, Range, false>;
|
|
46
21
|
readonly yExtent: import("@motionscript/sdk").Type<Range, Range, false>;
|
|
47
|
-
|
|
22
|
+
/** The baseline and the value-axis rule. */
|
|
23
|
+
readonly axisStroke: import("@motionscript/sdk").Type<Stroke, StrokeResolved[], false>;
|
|
24
|
+
/** Where the horizontal axis rule sits on the y scale, or `null` for none. */
|
|
25
|
+
readonly xAxisAt: import("@motionscript/sdk").Type<number | null, number | null, false>;
|
|
26
|
+
/** Where the vertical axis rule sits on the x scale, or `null` for none. */
|
|
27
|
+
readonly yAxisAt: import("@motionscript/sdk").Type<number | null, number | null, false>;
|
|
28
|
+
}>, {}, null, _Node2D<_Node2DProps>, import("@motionscript/sdk").CallProps<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
|
|
48
29
|
readonly fill: import("@motionscript/sdk").Type<Fill, FillResolved[], false>;
|
|
49
|
-
|
|
30
|
+
/** The vertical grid lines, one per `xMarkers` entry. */
|
|
50
31
|
readonly xGridStroke: import("@motionscript/sdk").Type<Stroke, StrokeResolved[], false>;
|
|
32
|
+
/** The horizontal grid lines, one per `yMarkers` entry. */
|
|
51
33
|
readonly yGridStroke: import("@motionscript/sdk").Type<Stroke, StrokeResolved[], false>;
|
|
52
34
|
readonly xMarkers: import("@motionscript/sdk").Type<number[], number[], false>;
|
|
53
35
|
readonly yMarkers: import("@motionscript/sdk").Type<number[], number[], false>;
|
|
36
|
+
/** `[min, max]` of each scale, mapping the markers into the panel. */
|
|
54
37
|
readonly xExtent: import("@motionscript/sdk").Type<Range, Range, false>;
|
|
55
38
|
readonly yExtent: import("@motionscript/sdk").Type<Range, Range, false>;
|
|
39
|
+
/** The baseline and the value-axis rule. */
|
|
40
|
+
readonly axisStroke: import("@motionscript/sdk").Type<Stroke, StrokeResolved[], false>;
|
|
41
|
+
/** Where the horizontal axis rule sits on the y scale, or `null` for none. */
|
|
42
|
+
readonly xAxisAt: import("@motionscript/sdk").Type<number | null, number | null, false>;
|
|
43
|
+
/** Where the vertical axis rule sits on the x scale, or `null` for none. */
|
|
44
|
+
readonly yAxisAt: import("@motionscript/sdk").Type<number | null, number | null, false>;
|
|
56
45
|
}>, null, import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
|
|
57
46
|
readonly fill: import("@motionscript/sdk").Type<Fill, FillResolved[], false>;
|
|
58
|
-
|
|
47
|
+
/** The vertical grid lines, one per `xMarkers` entry. */
|
|
59
48
|
readonly xGridStroke: import("@motionscript/sdk").Type<Stroke, StrokeResolved[], false>;
|
|
49
|
+
/** The horizontal grid lines, one per `yMarkers` entry. */
|
|
60
50
|
readonly yGridStroke: import("@motionscript/sdk").Type<Stroke, StrokeResolved[], false>;
|
|
61
51
|
readonly xMarkers: import("@motionscript/sdk").Type<number[], number[], false>;
|
|
62
52
|
readonly yMarkers: import("@motionscript/sdk").Type<number[], number[], false>;
|
|
53
|
+
/** `[min, max]` of each scale, mapping the markers into the panel. */
|
|
63
54
|
readonly xExtent: import("@motionscript/sdk").Type<Range, Range, false>;
|
|
64
55
|
readonly yExtent: import("@motionscript/sdk").Type<Range, Range, false>;
|
|
65
|
-
|
|
56
|
+
/** The baseline and the value-axis rule. */
|
|
57
|
+
readonly axisStroke: import("@motionscript/sdk").Type<Stroke, StrokeResolved[], false>;
|
|
58
|
+
/** Where the horizontal axis rule sits on the y scale, or `null` for none. */
|
|
59
|
+
readonly xAxisAt: import("@motionscript/sdk").Type<number | null, number | null, false>;
|
|
60
|
+
/** Where the vertical axis rule sits on the x scale, or `null` for none. */
|
|
61
|
+
readonly yAxisAt: import("@motionscript/sdk").Type<number | null, number | null, false>;
|
|
62
|
+
}>, {}, _Node2D<_Node2DProps>>>>;
|
|
66
63
|
export type ChartCanvas = NodeOf<typeof ChartCanvas>;
|
|
67
64
|
//# sourceMappingURL=chart-canvas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-canvas.d.ts","sourceRoot":"","sources":["../../src/kit/chart-canvas.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"chart-canvas.d.ts","sourceRoot":"","sources":["../../src/kit/chart-canvas.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,IAAI,EACT,KAAK,YAAY,EACjB,KAAK,MAAM,EAEX,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,WAAW,IAAI,YAAY,EAChC,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,cAAc,EACnB,KAAK,OAAO,EACb,MAAM,mBAAmB,CAAA;AAI1B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AASrC,+GAA+G;AAC/G,wBAAgB,IAAI,CAAC,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,EAAE,OAAO,SAAI,GAAG,IAAI,CAEhH;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW;;IAIpB,yDAAyD;;IAEzD,2DAA2D;;;;IAI3D,sEAAsE;;;IAGtE,4CAA4C;;IAE5C,8EAA8E;;IAE9E,4EAA4E;;;;IAb5E,yDAAyD;;IAEzD,2DAA2D;;;;IAI3D,sEAAsE;;;IAGtE,4CAA4C;;IAE5C,8EAA8E;;IAE9E,4EAA4E;;;;IAb5E,yDAAyD;;IAEzD,2DAA2D;;;;IAI3D,sEAAsE;;;IAGtE,4CAA4C;;IAE5C,8EAA8E;;IAE9E,4EAA4E;;gCAgC9E,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,WAAW,CAAC,CAAA"}
|