@ember-joinery/chart 0.0.0-stage → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/CHANGELOG.md +189 -0
  2. package/LICENSE.md +9 -0
  3. package/NOTICE +532 -0
  4. package/README.md +69 -2
  5. package/addon-main.cjs +4 -0
  6. package/declarations/-private/cartesian-chart.d.ts +413 -0
  7. package/declarations/-private/cartesian-chart.d.ts.map +1 -0
  8. package/declarations/-private/cartesian.d.ts +236 -0
  9. package/declarations/-private/cartesian.d.ts.map +1 -0
  10. package/declarations/-private/config.d.ts +13 -0
  11. package/declarations/-private/config.d.ts.map +1 -0
  12. package/declarations/-private/dots.d.ts +27 -0
  13. package/declarations/-private/dots.d.ts.map +1 -0
  14. package/declarations/-private/nice-ticks.d.ts +17 -0
  15. package/declarations/-private/nice-ticks.d.ts.map +1 -0
  16. package/declarations/-private/parts.d.ts +596 -0
  17. package/declarations/-private/parts.d.ts.map +1 -0
  18. package/declarations/-private/paths.d.ts +26 -0
  19. package/declarations/-private/paths.d.ts.map +1 -0
  20. package/declarations/-private/pie-chart.d.ts +244 -0
  21. package/declarations/-private/pie-chart.d.ts.map +1 -0
  22. package/declarations/-private/polar-chart.d.ts +423 -0
  23. package/declarations/-private/polar-chart.d.ts.map +1 -0
  24. package/declarations/-private/polar-geometry.d.ts +230 -0
  25. package/declarations/-private/polar-geometry.d.ts.map +1 -0
  26. package/declarations/-private/polar-parts.d.ts +315 -0
  27. package/declarations/-private/polar-parts.d.ts.map +1 -0
  28. package/declarations/-private/polar.d.ts +156 -0
  29. package/declarations/-private/polar.d.ts.map +1 -0
  30. package/declarations/-private/registry.d.ts +9 -0
  31. package/declarations/-private/registry.d.ts.map +1 -0
  32. package/declarations/-private/text-size.d.ts +13 -0
  33. package/declarations/-private/text-size.d.ts.map +1 -0
  34. package/declarations/-private/tick-interval.d.ts +35 -0
  35. package/declarations/-private/tick-interval.d.ts.map +1 -0
  36. package/declarations/components/area-chart.d.ts +16 -0
  37. package/declarations/components/area-chart.d.ts.map +1 -0
  38. package/declarations/components/bar-chart.d.ts +16 -0
  39. package/declarations/components/bar-chart.d.ts.map +1 -0
  40. package/declarations/components/chart-container.d.ts +66 -0
  41. package/declarations/components/chart-container.d.ts.map +1 -0
  42. package/declarations/components/chart-legend-content.d.ts +42 -0
  43. package/declarations/components/chart-legend-content.d.ts.map +1 -0
  44. package/declarations/components/chart-style.d.ts +19 -0
  45. package/declarations/components/chart-style.d.ts.map +1 -0
  46. package/declarations/components/chart-tooltip-content.d.ts +94 -0
  47. package/declarations/components/chart-tooltip-content.d.ts.map +1 -0
  48. package/declarations/components/dot.d.ts +22 -0
  49. package/declarations/components/dot.d.ts.map +1 -0
  50. package/declarations/components/line-chart.d.ts +16 -0
  51. package/declarations/components/line-chart.d.ts.map +1 -0
  52. package/declarations/components/pie-chart.d.ts +13 -0
  53. package/declarations/components/pie-chart.d.ts.map +1 -0
  54. package/declarations/components/radar-chart.d.ts +21 -0
  55. package/declarations/components/radar-chart.d.ts.map +1 -0
  56. package/declarations/components/radial-bar-chart.d.ts +17 -0
  57. package/declarations/components/radial-bar-chart.d.ts.map +1 -0
  58. package/declarations/components/rectangle.d.ts +32 -0
  59. package/declarations/components/rectangle.d.ts.map +1 -0
  60. package/declarations/components/sector.d.ts +47 -0
  61. package/declarations/components/sector.d.ts.map +1 -0
  62. package/declarations/index.d.ts +24 -0
  63. package/declarations/index.d.ts.map +1 -0
  64. package/declarations/test-support/chart.d.ts +162 -0
  65. package/declarations/test-support/chart.d.ts.map +1 -0
  66. package/declarations/test-support/index.d.ts +3 -0
  67. package/declarations/test-support/index.d.ts.map +1 -0
  68. package/declarations/test-support/polar-chart.d.ts +62 -0
  69. package/declarations/test-support/polar-chart.d.ts.map +1 -0
  70. package/declarations/test-support.d.ts +2 -0
  71. package/declarations/types.d.ts +138 -0
  72. package/declarations/types.d.ts.map +1 -0
  73. package/dist/cartesian-D9hWDamz.js +1217 -0
  74. package/dist/cartesian-D9hWDamz.js.map +1 -0
  75. package/dist/cartesian-chart-BLj6Q_OB.js +1123 -0
  76. package/dist/cartesian-chart-BLj6Q_OB.js.map +1 -0
  77. package/dist/components/area-chart.js +20 -0
  78. package/dist/components/area-chart.js.map +1 -0
  79. package/dist/components/bar-chart.js +20 -0
  80. package/dist/components/bar-chart.js.map +1 -0
  81. package/dist/components/chart-container.js +54 -0
  82. package/dist/components/chart-container.js.map +1 -0
  83. package/dist/components/chart-legend-content.js +48 -0
  84. package/dist/components/chart-legend-content.js.map +1 -0
  85. package/dist/components/chart-style.js +35 -0
  86. package/dist/components/chart-style.js.map +1 -0
  87. package/dist/components/chart-tooltip-content.js +131 -0
  88. package/dist/components/chart-tooltip-content.js.map +1 -0
  89. package/dist/components/dot.js +18 -0
  90. package/dist/components/dot.js.map +1 -0
  91. package/dist/components/line-chart.js +20 -0
  92. package/dist/components/line-chart.js.map +1 -0
  93. package/dist/components/pie-chart.js +6 -0
  94. package/dist/components/pie-chart.js.map +1 -0
  95. package/dist/components/radar-chart.js +22 -0
  96. package/dist/components/radar-chart.js.map +1 -0
  97. package/dist/components/radial-bar-chart.js +20 -0
  98. package/dist/components/radial-bar-chart.js.map +1 -0
  99. package/dist/components/rectangle.js +5 -0
  100. package/dist/components/rectangle.js.map +1 -0
  101. package/dist/components/sector.js +5 -0
  102. package/dist/components/sector.js.map +1 -0
  103. package/dist/config-DnsUmxOT.js +35 -0
  104. package/dist/config-DnsUmxOT.js.map +1 -0
  105. package/dist/index.js +15 -0
  106. package/dist/index.js.map +1 -0
  107. package/dist/parts-BWLhFFjB.js +355 -0
  108. package/dist/parts-BWLhFFjB.js.map +1 -0
  109. package/dist/pie-chart-CmDtW_Ge.js +646 -0
  110. package/dist/pie-chart-CmDtW_Ge.js.map +1 -0
  111. package/dist/polar-chart-GhgOSsH9.js +2242 -0
  112. package/dist/polar-chart-GhgOSsH9.js.map +1 -0
  113. package/dist/rectangle-Cl7tbXuZ.js +166 -0
  114. package/dist/rectangle-Cl7tbXuZ.js.map +1 -0
  115. package/dist/sector-7shQPJuQ.js +565 -0
  116. package/dist/sector-7shQPJuQ.js.map +1 -0
  117. package/dist/test-support.js +470 -0
  118. package/dist/test-support.js.map +1 -0
  119. package/dist/types.js +56 -0
  120. package/dist/types.js.map +1 -0
  121. package/package.json +117 -3
@@ -0,0 +1,315 @@
1
+ import Component from '@glimmer/component';
2
+ import type Owner from '@ember/owner';
3
+ import type { ComponentLike, WithBoundArgs } from '@glint/template';
4
+ import { Registry } from './registry.ts';
5
+ import type { DataKey, DomainBound } from './cartesian.ts';
6
+ import type { DotArgs } from './parts';
7
+ import type { PolarPosition, PolarTick, PolarViewBox } from './polar-geometry.ts';
8
+ /** What a polar part needs of its chart: somewhere to register. */
9
+ export interface PolarRegistrar {
10
+ register(part: PolarPart): void;
11
+ unregister(part: PolarPart): void;
12
+ }
13
+ /** Every part a polar chart reads, besides the tooltip and legend. */
14
+ export type PolarPart = PolarGrid | PolarAngleAxis | PolarRadiusAxis | Radar | RadialBar;
15
+ interface PolarPartArgs {
16
+ /** The chart it belongs to; the chart's yield passes it. */
17
+ chart: PolarRegistrar;
18
+ }
19
+ /** A part that registers with its chart while it is rendered. */
20
+ declare abstract class Part<S extends {
21
+ Args: PolarPartArgs;
22
+ }> extends Component<S> {
23
+ abstract readonly kind: string;
24
+ constructor(owner: Owner, args: S['Args']);
25
+ willDestroy(): void;
26
+ }
27
+ export interface PolarGridSignature {
28
+ Args: PolarPartArgs & {
29
+ /** `polygon` (default): rings through the angle axis's ticks. `circle`: round rings. */
30
+ gridType?: 'polygon' | 'circle';
31
+ /** Whether to draw the spokes, from the centre out at each angle. Default true. */
32
+ radialLines?: boolean;
33
+ /** The rings' radii. Default the radius axis's ticks. */
34
+ polarRadius?: readonly number[];
35
+ /** The spokes' angles, in degrees. Default the angle axis's ticks. */
36
+ polarAngles?: readonly number[];
37
+ /** The lines' colour. Default `#ccc`, which the chart's CSS turns into `--border`. */
38
+ stroke?: string;
39
+ strokeWidth?: number | string;
40
+ strokeDasharray?: string;
41
+ /** Fills the outermost ring (drawn behind the others). */
42
+ fill?: string;
43
+ fillOpacity?: number | string;
44
+ /**
45
+ * Classes for every ring and spoke, as recharts puts a grid's `className` on each:
46
+ * `fill-(--color-desktop) opacity-20` fills each ring.
47
+ */
48
+ class?: string;
49
+ };
50
+ }
51
+ /** The grid behind a polar chart: recharts' `PolarGrid`. */
52
+ export declare class PolarGrid extends Part<PolarGridSignature> {
53
+ readonly kind = "polar-grid";
54
+ }
55
+ /** The arguments both polar axes share with recharts'. */
56
+ export interface PolarAxisArgs extends PolarPartArgs {
57
+ /** The key (or function) of each row's value on this axis. A category axis without one numbers the rows. */
58
+ dataKey?: DataKey;
59
+ /** `category` or `number`. Default the chart's: categories around a radar, numbers out from its centre. */
60
+ type?: 'category' | 'number';
61
+ /** The value range, as `[min, max]`: numbers, `auto`, `dataMin`, `dataMax` or functions. */
62
+ domain?: readonly [DomainBound, DomainBound];
63
+ /** Whether nice ticks may be fractions. Default false. */
64
+ allowDecimals?: boolean;
65
+ /** How many ticks a number axis aims for. */
66
+ tickCount?: number;
67
+ /** The ticks to draw, instead of computed ones. */
68
+ ticks?: readonly unknown[];
69
+ /** Runs the axis the other way. */
70
+ reversed?: boolean;
71
+ /** `auto` (by chart and type), or a scale: `linear`, `band` or `point`. */
72
+ scale?: 'auto' | 'linear' | 'band' | 'point';
73
+ /** Lays the axis out but doesn't draw it. */
74
+ hide?: boolean;
75
+ /** Whether to draw the axis line. Default true. */
76
+ axisLine?: boolean;
77
+ /** Formats each tick's label. */
78
+ tickFormatter?: (value: never, index: number) => unknown;
79
+ /**
80
+ * The axis line's colour, which the labels take as their fill. The angle axis has none by
81
+ * default (its line isn't drawn, and its labels are grey); the radius axis's is `#ccc`.
82
+ */
83
+ stroke?: string;
84
+ /** Classes for the axis's group. */
85
+ class?: string;
86
+ }
87
+ /** What an angle axis's custom `@tick` component is handed: where the label goes, and its tick. */
88
+ export interface PolarAngleAxisTickArgs {
89
+ /** Where the label goes: the end of the tick line. */
90
+ x: number;
91
+ y: number;
92
+ /** `start`, `middle` or `end`: which way the label runs from the point. */
93
+ textAnchor: 'start' | 'middle' | 'end';
94
+ /** `start` (below), `middle` or `end` (above): where it sits against the point. */
95
+ verticalAnchor: 'start' | 'middle' | 'end';
96
+ /** The tick's index: its row, on a category axis. */
97
+ index: number;
98
+ /** The tick: its `value`, its `coordinate` (an angle) and `index`. */
99
+ payload: PolarTick;
100
+ /** The label's text, as `@tickFormatter` gives it (the raw value is `payload.value`). */
101
+ value: string;
102
+ /** The label's fill: the axis's `@stroke`, if it has one. */
103
+ fill?: string;
104
+ /** `none`, as recharts passes its tick text. */
105
+ stroke: string;
106
+ /** The chart's centre, and the ring the axis is drawn on. */
107
+ cx: number;
108
+ cy: number;
109
+ radius: number;
110
+ }
111
+ export interface PolarAngleAxisSignature {
112
+ Args: PolarAxisArgs & {
113
+ /** The labels: true (default), false for none, or a component that draws each. */
114
+ tick?: boolean | ComponentLike<{
115
+ Args: PolarAngleAxisTickArgs;
116
+ Element: SVGElement;
117
+ }>;
118
+ /** Whether to draw the tick marks. Default true. */
119
+ tickLine?: boolean;
120
+ /** The tick marks' length. Default 8. */
121
+ tickSize?: number;
122
+ /** `outer` (default): marks and labels outside the ring. `inner`: inside it. */
123
+ orientation?: 'outer' | 'inner';
124
+ /** The axis line's shape: `polygon` (default) through the ticks, or a `circle`. */
125
+ axisLineType?: 'polygon' | 'circle';
126
+ };
127
+ }
128
+ /** The axis around a polar chart: recharts' `PolarAngleAxis`. */
129
+ export declare class PolarAngleAxis extends Part<PolarAngleAxisSignature> {
130
+ readonly kind = "angle-axis";
131
+ }
132
+ /** What a `Label`'s `@content` is handed, as recharts hands its `content` function. */
133
+ export interface PolarLabelContentSignature {
134
+ Args: {
135
+ /** The ring the label sits in: the chart's centre (`cx`, `cy`), the axis's radii and angle. */
136
+ viewBox: PolarViewBox;
137
+ /** The label's `@value`. */
138
+ value?: unknown;
139
+ /** The label's `@offset`. */
140
+ offset: number;
141
+ /** The label's `@position`. */
142
+ position: PolarPosition;
143
+ };
144
+ Element: Element;
145
+ }
146
+ export interface RadiusAxisLabelSignature {
147
+ Args: {
148
+ /** The axis it belongs to; the axis's yield passes it. */
149
+ axis: {
150
+ registerLabel(label: RadiusAxisLabel): void;
151
+ unregisterLabel(label: RadiusAxisLabel): void;
152
+ };
153
+ /** The text to show. */
154
+ value?: string | number;
155
+ /**
156
+ * Draws the label instead: a component handed `@viewBox` (its centre at `cx`, `cy`), as
157
+ * recharts' `content` function is handed it, for a total in the middle of a radial chart.
158
+ */
159
+ content?: ComponentLike<PolarLabelContentSignature>;
160
+ /** Where `@value` sits against the axis's ring. Default `middle`, as recharts'. */
161
+ position?: PolarPosition;
162
+ /** The space between the label and its anchor. Default 5. */
163
+ offset?: number;
164
+ /** Classes for the text. */
165
+ class?: string;
166
+ /** The text's fill. Default grey (`#808080`). */
167
+ fill?: string;
168
+ fontSize?: number | string;
169
+ };
170
+ }
171
+ /** A label for the radius axis, such as a total in the middle of the chart: recharts' `Label`. */
172
+ export declare class RadiusAxisLabel extends Component<RadiusAxisLabelSignature> {
173
+ constructor(owner: Owner, args: RadiusAxisLabelSignature['Args']);
174
+ willDestroy(): void;
175
+ }
176
+ export interface PolarRadiusAxisParts {
177
+ /** A label against the axis's ring, or one you draw (`@content`): recharts' `Label`. */
178
+ Label: WithBoundArgs<typeof RadiusAxisLabel, 'axis'>;
179
+ }
180
+ export interface PolarRadiusAxisSignature {
181
+ Args: PolarAxisArgs & {
182
+ /** The angle the axis runs out at, in degrees. Default 0 (3 o'clock). */
183
+ angle?: number;
184
+ /** Which side of the axis its labels sit: `right` (default), `left` or `middle`. */
185
+ orientation?: 'left' | 'right' | 'middle';
186
+ /** Whether to draw the labels. Default true. */
187
+ tick?: boolean;
188
+ /** Taken as upstream's examples pass it: recharts draws no tick marks on a radius axis. */
189
+ tickLine?: boolean;
190
+ };
191
+ Blocks: {
192
+ default: [PolarRadiusAxisParts];
193
+ };
194
+ }
195
+ /** The axis out from a polar chart's centre: recharts' `PolarRadiusAxis`. */
196
+ export declare class PolarRadiusAxis extends Part<PolarRadiusAxisSignature> {
197
+ readonly kind = "radius-axis";
198
+ readonly labels: Registry<RadiusAxisLabel>;
199
+ registerLabel: (label: RadiusAxisLabel) => void;
200
+ unregisterLabel: (label: RadiusAxisLabel) => void;
201
+ }
202
+ /** A radar's dots: false (default) for none, true, their attributes, or a component. */
203
+ export type RadarDotOption = boolean | {
204
+ r?: number;
205
+ fill?: string;
206
+ fillOpacity?: number | string;
207
+ stroke?: string;
208
+ strokeWidth?: number | string;
209
+ class?: string;
210
+ } | ComponentLike<{
211
+ Args: DotArgs;
212
+ Element: Element;
213
+ }>;
214
+ /** The arguments both polar series share. */
215
+ export interface PolarSeriesArgs extends PolarPartArgs {
216
+ /** The key (or function) of each row's value. */
217
+ dataKey: DataKey;
218
+ /** The series' name in the tooltip and legend. Default: its data key. */
219
+ name?: string;
220
+ /** Lays the series out but doesn't draw it. */
221
+ hide?: boolean;
222
+ /** The legend's icon type; `none` leaves the series out of the legend. */
223
+ legendType?: string;
224
+ /** `none` leaves the series out of the tooltip. */
225
+ tooltipType?: string;
226
+ fill?: string;
227
+ fillOpacity?: number | string;
228
+ stroke?: string;
229
+ strokeWidth?: number | string;
230
+ /** Classes for the series' group. */
231
+ class?: string;
232
+ }
233
+ export interface RadarSignature {
234
+ Args: PolarSeriesArgs & {
235
+ /** A dot at each point. Default none. */
236
+ dot?: RadarDotOption;
237
+ /** The dot at the active row, while the tooltip shows. Default true. */
238
+ activeDot?: RadarDotOption;
239
+ /** Joins the outline over missing values. */
240
+ connectNulls?: boolean;
241
+ };
242
+ }
243
+ /** A polygon through each row's value: recharts' `Radar`. */
244
+ export declare class Radar extends Part<RadarSignature> {
245
+ readonly kind = "radar";
246
+ }
247
+ /** What a radial bar's `@background` takes: true for recharts' track, or its attributes. */
248
+ export type RadialBarBackground = boolean | {
249
+ fill?: string;
250
+ class?: string;
251
+ };
252
+ export interface PolarLabelListSignature {
253
+ Args: {
254
+ /** The bar it labels; the bar's yield passes it. */
255
+ series: {
256
+ registerLabel(label: PolarLabelList): void;
257
+ unregisterLabel(label: PolarLabelList): void;
258
+ };
259
+ /** The key of each label's value in the row. Default: the bar's own value. */
260
+ dataKey?: DataKey;
261
+ /**
262
+ * Where each label sits against its bar: along it (`insideStart`, `insideEnd`, `end`), or
263
+ * at a point (`outside`, `middle`, `center`…). Default `middle`, the middle of the bar.
264
+ */
265
+ position?: PolarPosition;
266
+ /** The space between a label and its anchor: degrees along a bar. Default 5. */
267
+ offset?: number;
268
+ /** Formats each label's value. */
269
+ formatter?: (value: never) => unknown;
270
+ fill?: string;
271
+ fontSize?: number | string;
272
+ /** Classes for each label's `<text>`, such as `fill-white capitalize`. */
273
+ class?: string;
274
+ };
275
+ }
276
+ /** A label on each bar of a radial bar series: recharts' `LabelList` in a polar chart. */
277
+ export declare class PolarLabelList extends Component<PolarLabelListSignature> {
278
+ constructor(owner: Owner, args: PolarLabelListSignature['Args']);
279
+ willDestroy(): void;
280
+ }
281
+ export interface RadialBarParts {
282
+ /** A label on each bar: recharts' `LabelList`. */
283
+ LabelList: WithBoundArgs<typeof PolarLabelList, 'series'>;
284
+ }
285
+ export interface RadialBarSignature {
286
+ Args: PolarSeriesArgs & {
287
+ /** Bars with the same stack id stack on each other. */
288
+ stackId?: string | number;
289
+ /** The corners' radius: a number, or a percentage of the bar's width. Default 0. */
290
+ cornerRadius?: number | string;
291
+ /** Rounds the corners even where the bar is too short for them. */
292
+ forceCornerRadius?: boolean;
293
+ /** Puts the rounded corners outside the bar's ends. */
294
+ cornerIsExternal?: boolean;
295
+ /** A track behind each bar, round the whole chart: true, or its attributes. Default none. */
296
+ background?: RadialBarBackground;
297
+ /** The least angle a bar is drawn with, so a small value still shows. */
298
+ minPointSize?: number;
299
+ /** The bar's width, instead of an equal share of the band. */
300
+ barSize?: number;
301
+ maxBarSize?: number;
302
+ };
303
+ Blocks: {
304
+ default: [RadialBarParts];
305
+ };
306
+ }
307
+ /** A bar round the chart for each row: recharts' `RadialBar`. */
308
+ export declare class RadialBar extends Part<RadialBarSignature> {
309
+ readonly kind = "radial-bar";
310
+ readonly labels: Registry<PolarLabelList>;
311
+ registerLabel: (label: PolarLabelList) => void;
312
+ unregisterLabel: (label: PolarLabelList) => void;
313
+ }
314
+ export {};
315
+ //# sourceMappingURL=polar-parts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polar-parts.d.ts","sourceRoot":"","sources":["../../src/-private/polar-parts.gts"],"names":[],"mappings":"AAmYA,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAE1C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAEjF,mEAAmE;AACnE,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAA;IAC/B,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAA;CAClC;AAED,sEAAsE;AACtE,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,cAAc,GAAG,eAAe,GAAG,KAAK,GAAG,SAAS,CAAA;AAExF,UAAU,aAAa;IACrB,4DAA4D;IAC5D,KAAK,EAAE,cAAc,CAAA;CACtB;AAED,iEAAiE;AACjE,uBAAe,IAAI,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,CAAE,SAAQ,SA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AAM,CAAA;QAChB,UAAU,CAAC,EAAE,MAAM,CAAA;KACpB,CAAA;IACD,MAAM,EAAE;QAAE,OAAO,EAAE,CAAC,cAAc,CAAC,CAAA;KAAE,CAAA;CACtC;AAED,iEAAiE;AACjE,qBAAa,SAAU,SAAQ,IAAI,CAAC,kBAAkB,CAAC;IACrD,QAAQ,CAAC,IAAI,gBAAe;IAC5B,QAAQ,CAAC,MAAM,2BAAiC;IAEhD,aAAa,GAAI,OAAO,cAAc,KAAG,IAAI,CAA0B;IACvE,eAAe,GAAI,OAAO,cAAc,KAAG,IAAI,CAA6B;CAQ7E"}
@@ -0,0 +1,156 @@
1
+ import { type DataKey } from './cartesian.ts';
2
+ export declare const RADIAN: number;
3
+ export interface Point {
4
+ x: number;
5
+ y: number;
6
+ }
7
+ /** A point at `radius` and `angle` (degrees, counter-clockwise from 3 o'clock) from the centre. */
8
+ export declare function polarToCartesian(cx: number, cy: number, radius: number, angle: number): Point;
9
+ export declare function mathSign(value: number): number;
10
+ /**
11
+ * recharts' `getPercentValue`: a percentage of `total` (`'80%'`), or a number as is. With
12
+ * `validate`, a value over the total is the total.
13
+ */
14
+ export declare function percentOf(value: number | string | undefined | null, total: number, fallback?: number, validate?: boolean): number;
15
+ /** recharts' `round`: four decimals, and never `-0`. */
16
+ export declare function round(value: number, precision?: number): number;
17
+ /** The geometry a sector is drawn from. */
18
+ export interface SectorGeometry {
19
+ cx: number;
20
+ cy: number;
21
+ innerRadius: number;
22
+ outerRadius: number;
23
+ startAngle: number;
24
+ endAngle: number;
25
+ /** Rounds the corners: a number, or a percentage of the ring's width. */
26
+ cornerRadius?: number | string;
27
+ forceCornerRadius?: boolean;
28
+ cornerIsExternal?: boolean;
29
+ }
30
+ /**
31
+ * A sector's path, as recharts' `Sector` draws it, or null where it draws nothing (an outer
32
+ * radius inside the inner one, or no angle).
33
+ */
34
+ export declare function sectorD(sector: SectorGeometry): string | null;
35
+ /** What a pie does, with recharts' defaults filled in. */
36
+ export interface PieSettings {
37
+ dataKey: DataKey;
38
+ nameKey: DataKey;
39
+ name?: string;
40
+ cx: number | string;
41
+ cy: number | string;
42
+ innerRadius: number | string;
43
+ outerRadius: number | string | ((datum: unknown) => number | string);
44
+ startAngle: number;
45
+ endAngle: number;
46
+ paddingAngle: number;
47
+ minAngle: number;
48
+ cornerRadius?: number | string;
49
+ maxRadius?: number;
50
+ /** The sectors' fill where neither the row nor a `Cell` gives one. */
51
+ fill: string;
52
+ }
53
+ /** recharts' defaults for a `Pie`. */
54
+ export declare const PIE_DEFAULTS: {
55
+ readonly cx: "50%";
56
+ readonly cy: "50%";
57
+ readonly dataKey: "value";
58
+ readonly nameKey: "name";
59
+ readonly startAngle: 0;
60
+ readonly endAngle: 360;
61
+ readonly innerRadius: 0;
62
+ readonly outerRadius: "80%";
63
+ readonly paddingAngle: 0;
64
+ readonly minAngle: 0;
65
+ readonly fill: "#808080";
66
+ readonly stroke: "#fff";
67
+ };
68
+ /** A sector of a pie, as recharts computes it. */
69
+ export interface PieSector {
70
+ index: number;
71
+ cx: number;
72
+ cy: number;
73
+ innerRadius: number;
74
+ outerRadius: number;
75
+ maxRadius: number;
76
+ startAngle: number;
77
+ endAngle: number;
78
+ midAngle: number;
79
+ middleRadius: number;
80
+ paddingAngle: number;
81
+ percent: number;
82
+ cornerRadius?: number | string;
83
+ value: number;
84
+ /** The row's name (its `nameKey`), or its index. */
85
+ name: unknown;
86
+ /** The row, with its `Cell`'s attributes over it. */
87
+ payload: Record<string, unknown>;
88
+ /** The row's (or its `Cell`'s) fill, else the pie's. */
89
+ fill: string;
90
+ /** Where the tooltip points for this sector: the middle of its ring, at its middle angle. */
91
+ tooltipPosition: Point;
92
+ }
93
+ /** The plot area: the chart less its margins and its legend. */
94
+ export interface Offset {
95
+ top: number;
96
+ left: number;
97
+ width: number;
98
+ height: number;
99
+ }
100
+ /**
101
+ * recharts' `computePieSectors`: each row's sector, its angle its share of the total. A `Cell`
102
+ * at a row's index lays its attributes (its `fill`) over the row. Undefined when the rows sum
103
+ * to nothing.
104
+ */
105
+ export declare function pieSectors(settings: PieSettings, data: readonly unknown[], cells: readonly Record<string, unknown>[], offset: Offset): PieSector[] | undefined;
106
+ /**
107
+ * The angles recharts draws a pie's sectors at. Its animation (which ends there even when it
108
+ * doesn't run) lays each sector after the last by its angle, rounded to four decimals, so the
109
+ * drawn sectors carry that rounding: the last can end a hair past 360°. Labels and the tooltip
110
+ * keep the angles `pieSectors()` computed, as recharts' do.
111
+ */
112
+ export declare function drawnSectorAngles(sectors: readonly PieSector[]): {
113
+ startAngle: number;
114
+ endAngle: number;
115
+ }[];
116
+ /** A text's `dy` for its vertical anchor, on one line, as recharts' `Text` works it out. */
117
+ export declare const TEXT_DY: {
118
+ readonly start: "0.71em";
119
+ readonly middle: "0.355em";
120
+ readonly end: "0em";
121
+ };
122
+ export interface PieLabelPlacement {
123
+ /** Where the text goes, and which end of it is there. */
124
+ x: number;
125
+ y: number;
126
+ textAnchor: 'start' | 'middle' | 'end';
127
+ /** The label line, from the sector's edge out to the text. */
128
+ line: [Point, Point];
129
+ }
130
+ /**
131
+ * recharts' `PieLabels`: a label out past a sector's edge (by `offsetRadius`, 20 by default), at
132
+ * its middle angle, with a line to it, its text anchored away from the centre.
133
+ */
134
+ export declare function pieLabelPlacement(sector: PieSector, offsetRadius?: number): PieLabelPlacement;
135
+ /** Where a polar label sits against a sector (or the chart's ring). */
136
+ export type PolarLabelPosition = 'outside' | 'center' | 'centerTop' | 'centerBottom' | 'middle';
137
+ /** A sector, or the chart's whole ring, as a polar label reads it: recharts' polar view box. */
138
+ export interface PolarViewBox {
139
+ cx: number;
140
+ cy: number;
141
+ innerRadius: number;
142
+ outerRadius: number;
143
+ startAngle: number;
144
+ endAngle: number;
145
+ clockWise: boolean;
146
+ }
147
+ /** recharts' `getAttrsOfPolarLabel`: where a label sits against a sector, and how it is anchored. */
148
+ export declare function polarLabelPlacement(viewBox: Omit<PolarViewBox, 'clockWise'>, offset: number, position: PolarLabelPosition | undefined): {
149
+ x: number;
150
+ y: number;
151
+ textAnchor: 'start' | 'middle' | 'end';
152
+ dy: string;
153
+ };
154
+ /** recharts' `inRangeOfSector`: whether a point is inside a sector's ring and angles. */
155
+ export declare function inSector(point: Point, sector: Omit<SectorGeometry, 'cornerRadius'>): boolean;
156
+ //# sourceMappingURL=polar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polar.d.ts","sourceRoot":"","sources":["../../src/-private/polar.ts"],"names":[],"mappings":"AAWA,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAEtD,eAAO,MAAM,MAAM,QAAgB,CAAA;AAEnC,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV;AAED,mGAAmG;AACnG,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,KAAK,CAK7F;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAG9C;AAED;;;GAGG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,EACzC,KAAK,EAAE,MAAM,EACb,QAAQ,SAAI,EACZ,QAAQ,UAAQ,GACf,MAAM,CAWR;AAED,wDAAwD;AACxD,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,SAAI,GAAG,MAAM,CAI1D;AAqBD,2CAA2C;AAC3C,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,yEAAyE;IACzE,YAAY,CAAC,EAAE,MAA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AE,SAAS,EAAE,YAAY,SAAK,GAAG,iBAAiB,CAUzF;AAED,uEAAuE;AACvE,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,cAAc,GAAG,QAAQ,CAAA;AAE/F,gGAAgG;AAChG,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,OAAO,CAAA;CACnB;AAED,qGAAqG;AACrG,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,EACxC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,kBAAkB,GAAG,SAAS,GACvC;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAa9E;AAaD,yFAAyF;AACzF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,GAAG,OAAO,CAiB5F"}
@@ -0,0 +1,9 @@
1
+ export declare class Registry<T> {
2
+ #private;
3
+ private revision;
4
+ /** Every registered item, in the order the parts were constructed. */
5
+ get items(): readonly T[];
6
+ add(item: T): void;
7
+ remove(item: T): void;
8
+ }
9
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/-private/registry.ts"],"names":[],"mappings":"AAiBA,qBAAa,QAAQ,CAAC,CAAC;;IAGZ,OAAO,CAAC,QAAQ,CAAI;IAE7B,sEAAsE;IACtE,IAAI,KAAK,IAAI,SAAS,CAAC,EAAE,CAGxB;IAED,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;IAKlB,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;CAKtB"}
@@ -0,0 +1,13 @@
1
+ export interface TextStyle {
2
+ fontSize?: string;
3
+ letterSpacing?: string;
4
+ }
5
+ export interface TextSize {
6
+ width: number;
7
+ height: number;
8
+ }
9
+ /** The width and height of `text` in the page's font, at the given size and letter spacing. */
10
+ export declare function getStringSize(text: unknown, style?: TextStyle): TextSize;
11
+ /** Forgets every measurement, for a test that changes the page's fonts. */
12
+ export declare function clearStringSizeCache(): void;
13
+ //# sourceMappingURL=text-size.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-size.d.ts","sourceRoot":"","sources":["../../src/-private/text-size.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf;AAiCD,+FAA+F;AAC/F,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,GAAE,SAAc,GAAG,QAAQ,CAa5E;AAED,2EAA2E;AAC3E,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C"}
@@ -0,0 +1,35 @@
1
+ import { type TextStyle } from './text-size.ts';
2
+ /** One tick: its value, where it sits along the axis, and its index among the axis's ticks. */
3
+ export interface Tick {
4
+ value: unknown;
5
+ coordinate: number;
6
+ index: number;
7
+ /** Where its label is drawn, when it is moved to stay inside the chart. */
8
+ tickCoord?: number;
9
+ isShow?: boolean;
10
+ }
11
+ /** How an axis thins its ticks: as recharts' `interval` prop. */
12
+ export type TickInterval = number | 'preserveStart' | 'preserveEnd' | 'preserveStartEnd' | 'equidistantPreserveStart' | 'equidistantPreserveEnd';
13
+ export type Orientation = 'top' | 'bottom' | 'left' | 'right';
14
+ export interface TickIntervalOptions {
15
+ ticks: Tick[];
16
+ /** The area the labels must fit in: the whole chart. */
17
+ viewBox: {
18
+ x: number;
19
+ y: number;
20
+ width: number;
21
+ height: number;
22
+ };
23
+ orientation: Orientation;
24
+ interval: TickInterval;
25
+ minTickGap: number;
26
+ tickFormatter?: (value: never, index: number) => unknown;
27
+ unit?: string;
28
+ /** Whether labels are drawn at all (`tick={false}` draws none). */
29
+ tick: boolean;
30
+ angle?: number;
31
+ style: TextStyle;
32
+ }
33
+ /** The ticks to draw, each with where its label goes (`tickCoord`). */
34
+ export declare function visibleTicks(options: TickIntervalOptions): Tick[];
35
+ //# sourceMappingURL=tick-interval.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tick-interval.d.ts","sourceRoot":"","sources":["../../src/-private/tick-interval.ts"],"names":[],"mappings":"AAQA,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE9D,+FAA+F;AAC/F,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,OAAO,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,iEAAiE;AACjE,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,eAAe,GACf,aAAa,GACb,kBAAkB,GAClB,0BAA0B,GAC1B,wBAAwB,CAAA;AAE5B,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;AAE7D,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,wDAAwD;IACxD,OAAO,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IAChE,WAAW,EAAE,WAAW,CAAA;IACxB,QAAQ,EAAE,YAAY,CAAA;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAA;IACxD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,mEAAmE;IACnE,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,SAAS,CAAA;CACjB;AAgLD,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,EAAE,CAkCjE"}
@@ -0,0 +1,16 @@
1
+ import CartesianChart from '../-private/cartesian-chart';
2
+ import type { ChartName } from '../-private/cartesian.ts';
3
+ /**
4
+ * recharts' `AreaChart`, as Glimmer SVG. It yields its parts (axes, grid, series, tooltip and
5
+ * legend); inside a `ChartContainer`, take it from the container's yield (`chart.AreaChart`), which
6
+ * gives it the container's config and size.
7
+ *
8
+ * <chart.AreaChart @data={{chartData}} as |c|>
9
+ * <c.CartesianGrid @vertical={{false}} />
10
+ * <c.XAxis @dataKey="month" />
11
+ * </chart.AreaChart>
12
+ */
13
+ export default class AreaChart extends CartesianChart {
14
+ get chartName(): ChartName;
15
+ }
16
+ //# sourceMappingURL=area-chart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"area-chart.d.ts","sourceRoot":"","sources":["../../src/components/area-chart.gts"],"names":[],"mappings":"AAkBA,OAAO,cAAc,MAAM,iCAAiC,CAAA;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEzD;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,cAAc;IACnD,IAAa,SAAS,IAAI,SAAS,CAElC;CACF"}
@@ -0,0 +1,16 @@
1
+ import CartesianChart from '../-private/cartesian-chart';
2
+ import type { ChartName } from '../-private/cartesian.ts';
3
+ /**
4
+ * recharts' `BarChart`, as Glimmer SVG. It yields its parts (axes, grid, series, tooltip and
5
+ * legend); inside a `ChartContainer`, take it from the container's yield (`chart.BarChart`), which
6
+ * gives it the container's config and size.
7
+ *
8
+ * <chart.BarChart @data={{chartData}} as |c|>
9
+ * <c.CartesianGrid @vertical={{false}} />
10
+ * <c.XAxis @dataKey="month" />
11
+ * </chart.BarChart>
12
+ */
13
+ export default class BarChart extends CartesianChart {
14
+ get chartName(): ChartName;
15
+ }
16
+ //# sourceMappingURL=bar-chart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bar-chart.d.ts","sourceRoot":"","sources":["../../src/components/bar-chart.gts"],"names":[],"mappings":"AAkBA,OAAO,cAAc,MAAM,iCAAiC,CAAA;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEzD;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,cAAc;IAClD,IAAa,SAAS,IAAI,SAAS,CAElC;CACF"}