@rokkit/chart 1.0.0-next.15 → 1.0.0-next.150

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.
Files changed (223) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +150 -46
  3. package/dist/Plot/index.d.ts +9 -0
  4. package/dist/PlotState.svelte.d.ts +47 -0
  5. package/dist/crossfilter/createCrossFilter.svelte.d.ts +15 -0
  6. package/dist/elements/index.d.ts +6 -0
  7. package/dist/geoms/lib/areas.d.ts +52 -0
  8. package/dist/geoms/lib/bars.d.ts +3 -0
  9. package/dist/index.d.ts +51 -0
  10. package/dist/lib/brewer.d.ts +9 -0
  11. package/dist/lib/brewing/BoxBrewer.svelte.d.ts +10 -0
  12. package/dist/lib/brewing/CartesianBrewer.svelte.d.ts +8 -0
  13. package/dist/lib/brewing/PieBrewer.svelte.d.ts +8 -0
  14. package/dist/lib/brewing/ViolinBrewer.svelte.d.ts +9 -0
  15. package/dist/lib/brewing/axes.svelte.d.ts +66 -0
  16. package/dist/lib/brewing/bars.svelte.d.ts +56 -0
  17. package/dist/lib/brewing/brewer.svelte.d.ts +145 -0
  18. package/dist/lib/brewing/colors.d.ts +17 -0
  19. package/dist/lib/brewing/dimensions.svelte.d.ts +35 -0
  20. package/dist/lib/brewing/index.svelte.d.ts +118 -0
  21. package/dist/lib/brewing/legends.svelte.d.ts +48 -0
  22. package/dist/lib/brewing/marks/arcs.d.ts +17 -0
  23. package/dist/lib/brewing/marks/areas.d.ts +31 -0
  24. package/dist/lib/brewing/marks/bars.d.ts +1 -0
  25. package/dist/lib/brewing/marks/boxes.d.ts +24 -0
  26. package/dist/lib/brewing/marks/lines.d.ts +24 -0
  27. package/dist/lib/brewing/marks/points.d.ts +40 -0
  28. package/dist/lib/brewing/marks/violins.d.ts +20 -0
  29. package/dist/lib/brewing/patterns.d.ts +14 -0
  30. package/dist/lib/brewing/scales.d.ts +28 -0
  31. package/dist/lib/brewing/scales.svelte.d.ts +24 -0
  32. package/dist/lib/brewing/stats.d.ts +31 -0
  33. package/dist/lib/brewing/symbols.d.ts +7 -0
  34. package/dist/lib/brewing/types.d.ts +162 -0
  35. package/dist/lib/chart.d.ts +40 -0
  36. package/dist/lib/context.d.ts +13 -0
  37. package/dist/lib/grid.d.ts +72 -0
  38. package/dist/lib/plot/chartProps.d.ts +177 -0
  39. package/dist/lib/plot/crossfilter.d.ts +13 -0
  40. package/dist/lib/plot/facet.d.ts +24 -0
  41. package/dist/lib/plot/frames.d.ts +47 -0
  42. package/dist/lib/plot/helpers.d.ts +3 -0
  43. package/dist/lib/plot/preset.d.ts +29 -0
  44. package/dist/lib/plot/scales.d.ts +5 -0
  45. package/dist/lib/plot/stat.d.ts +32 -0
  46. package/dist/lib/plot/types.d.ts +89 -0
  47. package/dist/lib/scales.svelte.d.ts +35 -0
  48. package/dist/lib/swatch.d.ts +12 -0
  49. package/dist/lib/ticks.d.ts +36 -0
  50. package/dist/lib/utils.d.ts +61 -0
  51. package/dist/lib/xscale.d.ts +11 -0
  52. package/dist/patterns/index.d.ts +4 -0
  53. package/dist/patterns/patterns.d.ts +72 -0
  54. package/dist/patterns/scale.d.ts +30 -0
  55. package/dist/symbols/constants/index.d.ts +1 -0
  56. package/dist/symbols/index.d.ts +5 -0
  57. package/package.json +41 -45
  58. package/src/AnimatedPlot.svelte +214 -0
  59. package/src/Chart.svelte +101 -0
  60. package/src/FacetPlot/Panel.svelte +23 -0
  61. package/src/FacetPlot.svelte +90 -0
  62. package/src/Plot/Arc.svelte +29 -0
  63. package/src/Plot/Area.svelte +25 -0
  64. package/src/Plot/Axis.svelte +73 -0
  65. package/src/Plot/Bar.svelte +96 -0
  66. package/src/Plot/Grid.svelte +30 -0
  67. package/src/Plot/Legend.svelte +167 -0
  68. package/src/Plot/Line.svelte +27 -0
  69. package/src/Plot/Point.svelte +27 -0
  70. package/src/Plot/Root.svelte +107 -0
  71. package/src/Plot/Timeline.svelte +95 -0
  72. package/src/Plot/Tooltip.svelte +81 -0
  73. package/src/Plot/index.js +9 -0
  74. package/src/Plot.svelte +189 -0
  75. package/src/PlotState.svelte.js +278 -0
  76. package/src/Sparkline.svelte +69 -0
  77. package/src/Symbol.svelte +21 -0
  78. package/src/Texture.svelte +18 -0
  79. package/src/charts/AreaChart.svelte +25 -0
  80. package/src/charts/BarChart.svelte +26 -0
  81. package/src/charts/BoxPlot.svelte +21 -0
  82. package/src/charts/BubbleChart.svelte +23 -0
  83. package/src/charts/LineChart.svelte +26 -0
  84. package/src/charts/PieChart.svelte +25 -0
  85. package/src/charts/ScatterPlot.svelte +25 -0
  86. package/src/charts/ViolinPlot.svelte +21 -0
  87. package/src/crossfilter/CrossFilter.svelte +38 -0
  88. package/src/crossfilter/FilterBar.svelte +32 -0
  89. package/src/crossfilter/FilterSlider.svelte +79 -0
  90. package/src/crossfilter/createCrossFilter.svelte.js +113 -0
  91. package/src/elements/Bar.svelte +22 -24
  92. package/src/elements/ColorRamp.svelte +20 -22
  93. package/src/elements/ContinuousLegend.svelte +20 -17
  94. package/src/elements/DefinePatterns.svelte +24 -0
  95. package/src/elements/DiscreteLegend.svelte +15 -15
  96. package/src/elements/Label.svelte +4 -8
  97. package/src/elements/SymbolGrid.svelte +22 -0
  98. package/src/elements/index.js +6 -0
  99. package/src/examples/BarChartExample.svelte +81 -0
  100. package/src/geoms/Arc.svelte +81 -0
  101. package/src/geoms/Area.svelte +50 -0
  102. package/src/geoms/Bar.svelte +142 -0
  103. package/src/geoms/Box.svelte +101 -0
  104. package/src/geoms/LabelPill.svelte +17 -0
  105. package/src/geoms/Line.svelte +100 -0
  106. package/src/geoms/Point.svelte +100 -0
  107. package/src/geoms/Violin.svelte +44 -0
  108. package/src/geoms/lib/areas.js +131 -0
  109. package/src/geoms/lib/bars.js +172 -0
  110. package/src/index.js +67 -16
  111. package/src/lib/brewer.js +25 -0
  112. package/src/lib/brewing/BoxBrewer.svelte.js +56 -0
  113. package/src/lib/brewing/CartesianBrewer.svelte.js +16 -0
  114. package/src/lib/brewing/PieBrewer.svelte.js +14 -0
  115. package/src/lib/brewing/ViolinBrewer.svelte.js +55 -0
  116. package/src/lib/brewing/axes.svelte.js +270 -0
  117. package/src/lib/brewing/bars.svelte.js +201 -0
  118. package/src/lib/brewing/brewer.svelte.js +229 -0
  119. package/src/lib/brewing/colors.js +22 -0
  120. package/src/lib/brewing/dimensions.svelte.js +56 -0
  121. package/src/lib/brewing/index.svelte.js +205 -0
  122. package/src/lib/brewing/legends.svelte.js +137 -0
  123. package/src/lib/brewing/marks/arcs.js +43 -0
  124. package/src/lib/brewing/marks/areas.js +59 -0
  125. package/src/lib/brewing/marks/bars.js +49 -0
  126. package/src/lib/brewing/marks/boxes.js +75 -0
  127. package/src/lib/brewing/marks/lines.js +48 -0
  128. package/src/lib/brewing/marks/points.js +57 -0
  129. package/src/lib/brewing/marks/violins.js +90 -0
  130. package/src/lib/brewing/patterns.js +31 -0
  131. package/src/lib/brewing/scales.js +51 -0
  132. package/src/lib/brewing/scales.svelte.js +82 -0
  133. package/src/lib/brewing/stats.js +62 -0
  134. package/src/lib/brewing/symbols.js +10 -0
  135. package/src/lib/brewing/types.js +73 -0
  136. package/src/lib/chart.js +213 -0
  137. package/src/lib/context.js +131 -0
  138. package/src/lib/grid.js +85 -0
  139. package/src/lib/plot/chartProps.js +76 -0
  140. package/src/lib/plot/crossfilter.js +16 -0
  141. package/src/lib/plot/facet.js +58 -0
  142. package/src/lib/plot/frames.js +80 -0
  143. package/src/lib/plot/helpers.js +14 -0
  144. package/src/lib/plot/preset.js +53 -0
  145. package/src/lib/plot/scales.js +56 -0
  146. package/src/lib/plot/stat.js +92 -0
  147. package/src/lib/plot/types.js +65 -0
  148. package/src/lib/scales.svelte.js +151 -0
  149. package/src/lib/swatch.js +13 -0
  150. package/src/lib/ticks.js +46 -0
  151. package/src/lib/utils.js +111 -118
  152. package/src/lib/xscale.js +31 -0
  153. package/src/patterns/DefinePatterns.svelte +32 -0
  154. package/src/patterns/PatternDef.svelte +27 -0
  155. package/src/patterns/README.md +3 -0
  156. package/src/patterns/index.js +4 -0
  157. package/src/patterns/patterns.js +208 -0
  158. package/src/patterns/scale.js +87 -0
  159. package/src/spec/chart-spec.js +29 -0
  160. package/src/symbols/RoundedSquare.svelte +33 -0
  161. package/src/symbols/Shape.svelte +37 -0
  162. package/src/symbols/constants/index.js +4 -0
  163. package/src/symbols/index.js +9 -0
  164. package/src/symbols/outline.svelte +60 -0
  165. package/src/symbols/solid.svelte +60 -0
  166. package/src/chart/FacetGrid.svelte +0 -51
  167. package/src/chart/Grid.svelte +0 -34
  168. package/src/chart/Legend.svelte +0 -16
  169. package/src/chart/PatternDefs.svelte +0 -13
  170. package/src/chart/Swatch.svelte +0 -93
  171. package/src/chart/SwatchButton.svelte +0 -29
  172. package/src/chart/SwatchGrid.svelte +0 -55
  173. package/src/chart/Symbol.svelte +0 -37
  174. package/src/chart/Texture.svelte +0 -16
  175. package/src/chart/TexturedShape.svelte +0 -27
  176. package/src/chart/TimelapseChart.svelte +0 -97
  177. package/src/chart/Timer.svelte +0 -27
  178. package/src/chart.js +0 -9
  179. package/src/components/charts/Axis.svelte +0 -66
  180. package/src/components/charts/Chart.svelte +0 -35
  181. package/src/components/index.js +0 -23
  182. package/src/components/lib/axis.js +0 -0
  183. package/src/components/lib/chart.js +0 -187
  184. package/src/components/lib/color.js +0 -327
  185. package/src/components/lib/funnel.js +0 -204
  186. package/src/components/lib/index.js +0 -19
  187. package/src/components/lib/pattern.js +0 -190
  188. package/src/components/lib/rollup.js +0 -55
  189. package/src/components/lib/shape.js +0 -199
  190. package/src/components/lib/summary.js +0 -145
  191. package/src/components/lib/theme.js +0 -23
  192. package/src/components/lib/timer.js +0 -41
  193. package/src/components/lib/utils.js +0 -165
  194. package/src/components/plots/BarPlot.svelte +0 -36
  195. package/src/components/plots/BoxPlot.svelte +0 -54
  196. package/src/components/plots/ScatterPlot.svelte +0 -30
  197. package/src/components/store.js +0 -70
  198. package/src/constants.js +0 -66
  199. package/src/elements/PatternDefs.svelte +0 -13
  200. package/src/elements/PatternMask.svelte +0 -20
  201. package/src/elements/Symbol.svelte +0 -38
  202. package/src/elements/Tooltip.svelte +0 -23
  203. package/src/funnel.svelte +0 -35
  204. package/src/geom.js +0 -105
  205. package/src/lib/axis.js +0 -75
  206. package/src/lib/colors.js +0 -32
  207. package/src/lib/geom.js +0 -4
  208. package/src/lib/shapes.js +0 -144
  209. package/src/lib/timer.js +0 -44
  210. package/src/lookup.js +0 -29
  211. package/src/plots/BarPlot.svelte +0 -55
  212. package/src/plots/BoxPlot.svelte +0 -0
  213. package/src/plots/FunnelPlot.svelte +0 -33
  214. package/src/plots/HeatMap.svelte +0 -5
  215. package/src/plots/HeatMapCalendar.svelte +0 -129
  216. package/src/plots/LinePlot.svelte +0 -55
  217. package/src/plots/Plot.svelte +0 -25
  218. package/src/plots/RankBarPlot.svelte +0 -38
  219. package/src/plots/ScatterPlot.svelte +0 -20
  220. package/src/plots/ViolinPlot.svelte +0 -11
  221. package/src/plots/heatmap.js +0 -70
  222. package/src/plots/index.js +0 -10
  223. package/src/swatch.js +0 -11
@@ -0,0 +1,162 @@
1
+ export type ChartMargin = {
2
+ /**
3
+ * - Top margin
4
+ */
5
+ top: number;
6
+ /**
7
+ * - Right margin
8
+ */
9
+ right: number;
10
+ /**
11
+ * - Bottom margin
12
+ */
13
+ bottom: number;
14
+ /**
15
+ * - Left margin
16
+ */
17
+ left: number;
18
+ };
19
+ export type ChartDimensions = {
20
+ /**
21
+ * - Total chart width
22
+ */
23
+ width: number;
24
+ /**
25
+ * - Total chart height
26
+ */
27
+ height: number;
28
+ /**
29
+ * - Chart margins
30
+ */
31
+ margin: ChartMargin;
32
+ /**
33
+ * - Chart width without margins
34
+ */
35
+ innerWidth: number;
36
+ /**
37
+ * - Chart height without margins
38
+ */
39
+ innerHeight: number;
40
+ };
41
+ export type ChartScales = {
42
+ /**
43
+ * - X-axis scale function
44
+ */
45
+ x: Function;
46
+ /**
47
+ * - Y-axis scale function
48
+ */
49
+ y: Function;
50
+ /**
51
+ * - Color scale function
52
+ */
53
+ color: Function;
54
+ };
55
+ export type ScaleFields = {
56
+ /**
57
+ * - X-axis field
58
+ */
59
+ x: string;
60
+ /**
61
+ * - Y-axis field
62
+ */
63
+ y: string;
64
+ /**
65
+ * - Color field
66
+ */
67
+ color: string;
68
+ };
69
+ export type TickData = {
70
+ /**
71
+ * - Tick value
72
+ */
73
+ value: any;
74
+ /**
75
+ * - Tick position in pixels
76
+ */
77
+ position: number;
78
+ /**
79
+ * - Formatted tick label
80
+ */
81
+ formattedValue: string;
82
+ };
83
+ export type AxisData = {
84
+ /**
85
+ * - Tick data
86
+ */
87
+ ticks: TickData[];
88
+ /**
89
+ * - Axis label
90
+ */
91
+ label: string;
92
+ /**
93
+ * - SVG transform attribute value
94
+ */
95
+ transform: string;
96
+ /**
97
+ * - SVG transform for the label
98
+ */
99
+ labelTransform: string;
100
+ };
101
+ export type BarData = {
102
+ /**
103
+ * - Original data point
104
+ */
105
+ data: Object;
106
+ /**
107
+ * - X position
108
+ */
109
+ x: number;
110
+ /**
111
+ * - Y position
112
+ */
113
+ y: number;
114
+ /**
115
+ * - Width of the bar
116
+ */
117
+ width: number;
118
+ /**
119
+ * - Height of the bar
120
+ */
121
+ height: number;
122
+ /**
123
+ * - Color of the bar
124
+ */
125
+ color: string;
126
+ };
127
+ export type LegendItem = {
128
+ /**
129
+ * - Legend item value
130
+ */
131
+ value: any;
132
+ /**
133
+ * - Item color
134
+ */
135
+ color: string;
136
+ /**
137
+ * - Y position
138
+ */
139
+ y: number;
140
+ /**
141
+ * - Shape type ('rect' or 'circle')
142
+ */
143
+ shape: string;
144
+ /**
145
+ * - Size of the marker
146
+ */
147
+ markerSize: number;
148
+ };
149
+ export type LegendData = {
150
+ /**
151
+ * - Legend items
152
+ */
153
+ items: LegendItem[];
154
+ /**
155
+ * - Legend title
156
+ */
157
+ title: string;
158
+ /**
159
+ * - SVG transform attribute value
160
+ */
161
+ transform: string;
162
+ };
@@ -0,0 +1,40 @@
1
+ export function chart(data: any, aes: any): Chart;
2
+ declare class Chart {
3
+ constructor(data: any, opts: any);
4
+ width: number;
5
+ height: number;
6
+ flipCoords: any;
7
+ x: any;
8
+ y: any;
9
+ value: any;
10
+ valueLabel: any;
11
+ valueFormat: any;
12
+ fill: any;
13
+ color: any;
14
+ shape: any;
15
+ padding(value: any): this;
16
+ spacing: number;
17
+ margin(value: any): this;
18
+ domain: {
19
+ x: any[];
20
+ y: any[];
21
+ };
22
+ stat: any;
23
+ data: any;
24
+ refresh(): this;
25
+ range: {
26
+ x: any[];
27
+ y: any[];
28
+ } | undefined;
29
+ origin: {
30
+ x: any;
31
+ y: any;
32
+ } | undefined;
33
+ scale: {
34
+ x: any;
35
+ y: any;
36
+ } | undefined;
37
+ aggregate(value: any, stat: any): void;
38
+ ticks(axis: any, count: any, fontSize?: number): any;
39
+ }
40
+ export {};
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Creates chart context and provides it to child components
3
+ *
4
+ * @param {Object} options Initial chart options
5
+ * @returns {Object} Chart context with all stores and methods
6
+ */
7
+ export function createChartContext(options?: Object): Object;
8
+ /**
9
+ * Gets chart context provided by parent component
10
+ *
11
+ * @returns {Object} Chart context
12
+ */
13
+ export function getChartContext(): Object;
@@ -0,0 +1,72 @@
1
+ /**
2
+ * @typedef GridPoint
3
+ * @property {number} x - x-coordinate of the point
4
+ * @property {number} y - y-coordinate of the point
5
+ * @property {number} r - radius of the point
6
+ */
7
+ /**
8
+ * @typedef SwatchGrid
9
+ * @property {number} width - width of the grid
10
+ * @property {number} height - height of the grid
11
+ * @property {GridPoint[]} data - data points of the grid
12
+ */
13
+ /**
14
+ * @tyoedef {Object} GridOptions
15
+ * @property {number} [pad=0] - The padding between the items
16
+ * @property {number} [columns=0] - The number of columns
17
+ * @property {number} [rows=0] - The number of rows
18
+ */
19
+ /**
20
+ * Calculates a grid of centres to fit a list of items of `size` within the number of `columns` and `rows`.
21
+ *
22
+ * - Attempts to find a best fit square if both columns and rows are not specified
23
+ * - Value in columns is prioritized over rows for recalculating the grid
24
+ * - Supports padding between the items
25
+ *
26
+ * @param {number} count - number of items
27
+ * @param {number} size - size of the items
28
+ * @param {GridOptions} options - options for the grid
29
+ * @returns {SwatchGrid}
30
+ */
31
+ export function swatchGrid(count: number, size: number, options: GridOptions): SwatchGrid;
32
+ /**
33
+ * Spreads values as patterns with colors from a palette
34
+ *
35
+ * @param {number[]} values - values to spread
36
+ * @param {string[]} patterns - patterns to spread
37
+ * @param {string[]} palette - colors to spread
38
+ * @returns {Record<number, { id: string, pattern: string, color: string }>}
39
+ */
40
+ export function spreadValuesAsPatterns(values: number[], patterns: string[], palette: string[]): Record<number, {
41
+ id: string;
42
+ pattern: string;
43
+ color: string;
44
+ }>;
45
+ export type GridPoint = {
46
+ /**
47
+ * - x-coordinate of the point
48
+ */
49
+ x: number;
50
+ /**
51
+ * - y-coordinate of the point
52
+ */
53
+ y: number;
54
+ /**
55
+ * - radius of the point
56
+ */
57
+ r: number;
58
+ };
59
+ export type SwatchGrid = {
60
+ /**
61
+ * - width of the grid
62
+ */
63
+ width: number;
64
+ /**
65
+ * - height of the grid
66
+ */
67
+ height: number;
68
+ /**
69
+ * - data points of the grid
70
+ */
71
+ data: GridPoint[];
72
+ };
@@ -0,0 +1,177 @@
1
+ /**
2
+ * Common props shared by all high-level chart wrappers.
3
+ */
4
+ export type ChartProps = {
5
+ /**
6
+ * - Data array to visualize
7
+ */
8
+ data?: Object[] | undefined;
9
+ /**
10
+ * - Field name for the X axis
11
+ */
12
+ x?: string | undefined;
13
+ /**
14
+ * - Field name for the Y axis
15
+ */
16
+ y?: string | undefined;
17
+ /**
18
+ * - Field name for fill color grouping (alias for color)
19
+ */
20
+ fill?: string | undefined;
21
+ /**
22
+ * - Field name for color grouping
23
+ */
24
+ color?: string | undefined;
25
+ /**
26
+ * - Field name for pattern fill grouping
27
+ */
28
+ pattern?: string | undefined;
29
+ /**
30
+ * - Aggregation stat: 'identity' | 'sum' | 'mean' | 'count' | 'min' | 'max' | 'median' | 'boxplot'
31
+ */
32
+ stat?: string | undefined;
33
+ /**
34
+ * - SVG width in pixels
35
+ */
36
+ width?: number | undefined;
37
+ /**
38
+ * - SVG height in pixels
39
+ */
40
+ height?: number | undefined;
41
+ /**
42
+ * - Color mode: 'light' | 'dark'
43
+ */
44
+ mode?: string | undefined;
45
+ /**
46
+ * - Whether to show grid lines
47
+ */
48
+ grid?: boolean | undefined;
49
+ /**
50
+ * - Whether to show the legend
51
+ */
52
+ legend?: boolean | undefined;
53
+ };
54
+ export type BarChartProps = Object;
55
+ export type PieChartProps = {
56
+ /**
57
+ * - Data array to visualize
58
+ */
59
+ data?: Object[] | undefined;
60
+ /**
61
+ * - Field name for slice labels (drives color key)
62
+ */
63
+ label?: string | undefined;
64
+ /**
65
+ * - Field name for slice values (theta)
66
+ */
67
+ y?: string | undefined;
68
+ /**
69
+ * - Alternative to label for color grouping
70
+ */
71
+ fill?: string | undefined;
72
+ /**
73
+ * - Inner radius as fraction of outer (0=pie, 0.5=donut)
74
+ */
75
+ innerRadius?: number | undefined;
76
+ /**
77
+ * - Aggregation stat (default sum for pie charts)
78
+ */
79
+ stat?: string | undefined;
80
+ /**
81
+ * - SVG width in pixels
82
+ */
83
+ width?: number | undefined;
84
+ /**
85
+ * - SVG height in pixels
86
+ */
87
+ height?: number | undefined;
88
+ /**
89
+ * - Color mode: 'light' | 'dark'
90
+ */
91
+ mode?: string | undefined;
92
+ /**
93
+ * - Whether to show the legend
94
+ */
95
+ legend?: boolean | undefined;
96
+ };
97
+ export type BoxViolinChartProps = {
98
+ /**
99
+ * - Data array to visualize
100
+ */
101
+ data?: Object[] | undefined;
102
+ /**
103
+ * - Field name for the category axis (groups)
104
+ */
105
+ x?: string | undefined;
106
+ /**
107
+ * - Field name for the value axis (raw observations)
108
+ */
109
+ y?: string | undefined;
110
+ /**
111
+ * - Field name for fill color; when different from x, sub-groups within each x-band (like grouped bars); lighter shade used for body, darker shade for whiskers/outline
112
+ */
113
+ fill?: string | undefined;
114
+ /**
115
+ * - SVG width in pixels
116
+ */
117
+ width?: number | undefined;
118
+ /**
119
+ * - SVG height in pixels
120
+ */
121
+ height?: number | undefined;
122
+ /**
123
+ * - Color mode: 'light' | 'dark'
124
+ */
125
+ mode?: string | undefined;
126
+ /**
127
+ * - Whether to show grid lines
128
+ */
129
+ grid?: boolean | undefined;
130
+ /**
131
+ * - Whether to show the legend
132
+ */
133
+ legend?: boolean | undefined;
134
+ };
135
+ export type ScatterBubbleChartProps = {
136
+ /**
137
+ * - Data array to visualize
138
+ */
139
+ data?: Object[] | undefined;
140
+ /**
141
+ * - Field name for X position
142
+ */
143
+ x?: string | undefined;
144
+ /**
145
+ * - Field name for Y position
146
+ */
147
+ y?: string | undefined;
148
+ /**
149
+ * - Field name for color grouping
150
+ */
151
+ color?: string | undefined;
152
+ /**
153
+ * - Field name for point radius (BubbleChart: required)
154
+ */
155
+ size?: string | undefined;
156
+ /**
157
+ * - SVG width in pixels
158
+ */
159
+ width?: number | undefined;
160
+ /**
161
+ * - SVG height in pixels
162
+ */
163
+ height?: number | undefined;
164
+ /**
165
+ * - Color mode: 'light' | 'dark'
166
+ */
167
+ mode?: string | undefined;
168
+ /**
169
+ * - Whether to show grid lines
170
+ */
171
+ grid?: boolean | undefined;
172
+ /**
173
+ * - Whether to show the legend
174
+ */
175
+ legend?: boolean | undefined;
176
+ };
177
+ export type LineAreaChartProps = Object;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Applies dimming state to data rows using crossfilter instance.
3
+ * Maps each row to { data: row, dimmed: boolean }.
4
+ *
5
+ * @param {Object[]} data - raw data array
6
+ * @param {Object} cf - crossfilter instance (from createCrossFilter)
7
+ * @param {Object} channels - { x, y, color, ... } field name mapping
8
+ * @returns {{ data: Object, dimmed: boolean }[]}
9
+ */
10
+ export function applyDimming(data: Object[], cf: Object, channels: Object): {
11
+ data: Object;
12
+ dimmed: boolean;
13
+ }[];
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Splits data into a Map of panels keyed by facet field value.
3
+ * Preserves insertion order of first occurrence.
4
+ *
5
+ * @param {Object[]} data
6
+ * @param {string} field
7
+ * @returns {Map<unknown, Object[]>}
8
+ */
9
+ export function splitByField(data: Object[], field: string): Map<unknown, Object[]>;
10
+ /**
11
+ * Computes x/y domains for each panel.
12
+ *
13
+ * @param {Map<unknown, Object[]>} panels
14
+ * @param {{ x: string, y: string }} channels
15
+ * @param {'fixed'|'free'|'free_x'|'free_y'} scalesMode
16
+ * @returns {Map<unknown, { xDomain: unknown[], yDomain: [number, number] }>}
17
+ */
18
+ export function getFacetDomains(panels: Map<unknown, Object[]>, channels: {
19
+ x: string;
20
+ y: string;
21
+ }, scalesMode?: "fixed" | "free" | "free_x" | "free_y"): Map<unknown, {
22
+ xDomain: unknown[];
23
+ yDomain: [number, number];
24
+ }>;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Extracts animation frames from data, keyed by time field value.
3
+ * Preserves insertion order of time values.
4
+ *
5
+ * @param {Object[]} data
6
+ * @param {string} timeField
7
+ * @returns {Map<unknown, Object[]>}
8
+ */
9
+ export function extractFrames(data: Object[], timeField: string): Map<unknown, Object[]>;
10
+ /**
11
+ * Ensures all frame values (byField) appear for every (x, color?) combination.
12
+ * Uses dataset alignBy to fill missing frame-value combos with y=0 so bars
13
+ * animate smoothly rather than disappearing between frames.
14
+ *
15
+ * Call after pre-aggregation. The result can be split directly by extractFrames
16
+ * with no further per-frame normalization needed.
17
+ *
18
+ * @param {Object[]} data - pre-aggregated rows, one per (x, color?, byField)
19
+ * @param {{ x?: string, y: string, color?: string }} channels
20
+ * @param {string} byField - the frame field (e.g. 'year')
21
+ * @returns {Object[]}
22
+ */
23
+ export function completeFrames(data: Object[], channels: {
24
+ x?: string;
25
+ y: string;
26
+ color?: string;
27
+ }, byField: string): Object[];
28
+ /**
29
+ * Computes static x/y domains from the full (pre-split) data array.
30
+ * These domains stay constant throughout the animation so values are
31
+ * always comparable across frames.
32
+ *
33
+ * NOTE: y domain is pinned to [0, max] — assumes bar chart semantics.
34
+ * Pass an explicit yDomain override for scatter/line charts where y can
35
+ * be negative.
36
+ *
37
+ * @param {Object[]} data - full dataset (before frame extraction)
38
+ * @param {{ x: string, y: string }} channels
39
+ * @returns {{ xDomain: unknown[], yDomain: [number, number] }}
40
+ */
41
+ export function computeStaticDomains(data: Object[], channels: {
42
+ x: string;
43
+ y: string;
44
+ }): {
45
+ xDomain: unknown[];
46
+ yDomain: [number, number];
47
+ };
@@ -0,0 +1,3 @@
1
+ export function resolveFormat(field: any, helpers?: {}): any;
2
+ export function resolveTooltip(helpers?: {}): any;
3
+ export function resolveGeom(type: any, helpers?: {}): any;
@@ -0,0 +1,29 @@
1
+ export function resolvePreset(name: any, helpers?: {}): {
2
+ colors: any;
3
+ patterns: any;
4
+ symbols: any;
5
+ };
6
+ export namespace DEFAULT_PRESET {
7
+ export let colors: string[];
8
+ export { PATTERN_ORDER as patterns };
9
+ export { SYMBOL_ORDER as symbols };
10
+ }
11
+ export namespace ACCESSIBLE_PRESET {
12
+ let colors_1: string[];
13
+ export { colors_1 as colors };
14
+ export { PATTERN_ORDER as patterns };
15
+ export { SYMBOL_ORDER as symbols };
16
+ }
17
+ export namespace PRINT_PRESET {
18
+ let colors_2: string[];
19
+ export { colors_2 as colors };
20
+ export let patterns: string[];
21
+ export { SYMBOL_ORDER as symbols };
22
+ }
23
+ export type PlotPreset = {
24
+ colors: string[];
25
+ patterns: string[];
26
+ symbols: string[];
27
+ };
28
+ import { PATTERN_ORDER } from '../brewing/patterns.js';
29
+ import { SYMBOL_ORDER } from '../brewing/symbols.js';
@@ -0,0 +1,5 @@
1
+ export function inferFieldType(data: any, field: any): "continuous" | "band";
2
+ export function inferOrientation(xType: any, yType: any): "none" | "vertical" | "horizontal";
3
+ export function buildUnifiedXScale(datasets: any, field: any, width: any, opts?: {}): any;
4
+ export function buildUnifiedYScale(datasets: any, field: any, height: any, opts?: {}): any;
5
+ export function inferColorScaleType(data: any, field: any, spec?: {}): any;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Resolves a stat name to an aggregation function.
3
+ * Checks built-ins first, then helpers.stats, then warns and falls back to identity.
4
+ *
5
+ * @param {string} name
6
+ * @param {Object} helpers
7
+ * @returns {Function}
8
+ */
9
+ export function resolveStat(name: string, helpers?: Object): Function;
10
+ /**
11
+ * Infers group-by fields from channels by excluding value fields.
12
+ * valueFields may contain channel keys (e.g. ['y', 'size']) OR field values (e.g. ['cty']).
13
+ * A channel's field is excluded if either the channel key OR the field value is in valueFields.
14
+ *
15
+ * @param {Record<string, string|undefined>} channels
16
+ * @param {string[]} valueFields
17
+ * @returns {string[]}
18
+ */
19
+ export function inferGroupByFields(channels: Record<string, string | undefined>, valueFields: string[]): string[];
20
+ /**
21
+ * Applies a stat aggregation to data based on a geom config.
22
+ * Returns data unchanged for identity stat.
23
+ *
24
+ * @param {Object[]} data
25
+ * @param {{ stat?: string, channels?: Record<string, string> }} geomConfig
26
+ * @param {Object} helpers
27
+ * @returns {Object[]}
28
+ */
29
+ export function applyGeomStat(data: Object[], geomConfig: {
30
+ stat?: string;
31
+ channels?: Record<string, string>;
32
+ }, helpers?: Object): Object[];