@arcfusionz/arc-analytic-ui 0.0.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 (156) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +13 -0
  2. package/dist/components/AnomalyCard/AnomalyCard.chart.d.ts +64 -0
  3. package/dist/components/AnomalyCard/AnomalyCard.chart.js +341 -0
  4. package/dist/components/AnomalyCard/AnomalyCard.d.ts +169 -0
  5. package/dist/components/AnomalyCard/AnomalyCard.js +1019 -0
  6. package/dist/components/AnomalyCard/AnomalyCard.model.d.ts +508 -0
  7. package/dist/components/AnomalyCard/AnomalyCard.model.js +553 -0
  8. package/dist/components/AnomalyCard/index.d.ts +4 -0
  9. package/dist/components/AnomalyCard/index.js +4 -0
  10. package/dist/components/ChartCard/ChartCard.chart.d.ts +72 -0
  11. package/dist/components/ChartCard/ChartCard.chart.js +1333 -0
  12. package/dist/components/ChartCard/ChartCard.d.ts +206 -0
  13. package/dist/components/ChartCard/ChartCard.js +718 -0
  14. package/dist/components/ChartCard/ChartCard.model.d.ts +452 -0
  15. package/dist/components/ChartCard/ChartCard.model.js +1223 -0
  16. package/dist/components/ChartCard/index.d.ts +4 -0
  17. package/dist/components/ChartCard/index.js +4 -0
  18. package/dist/components/ComparisonCard/ComparisonCard.chart.d.ts +80 -0
  19. package/dist/components/ComparisonCard/ComparisonCard.chart.js +337 -0
  20. package/dist/components/ComparisonCard/ComparisonCard.d.ts +200 -0
  21. package/dist/components/ComparisonCard/ComparisonCard.js +1325 -0
  22. package/dist/components/ComparisonCard/ComparisonCard.model.d.ts +309 -0
  23. package/dist/components/ComparisonCard/ComparisonCard.model.js +263 -0
  24. package/dist/components/ComparisonCard/index.d.ts +4 -0
  25. package/dist/components/ComparisonCard/index.js +4 -0
  26. package/dist/components/ForecastCard/ForecastCard.chart.d.ts +82 -0
  27. package/dist/components/ForecastCard/ForecastCard.chart.js +416 -0
  28. package/dist/components/ForecastCard/ForecastCard.d.ts +148 -0
  29. package/dist/components/ForecastCard/ForecastCard.js +1029 -0
  30. package/dist/components/ForecastCard/ForecastCard.model.d.ts +497 -0
  31. package/dist/components/ForecastCard/ForecastCard.model.js +554 -0
  32. package/dist/components/ForecastCard/index.d.ts +4 -0
  33. package/dist/components/ForecastCard/index.js +4 -0
  34. package/dist/components/HighlightCard/HighlightCard.chart.d.ts +122 -0
  35. package/dist/components/HighlightCard/HighlightCard.chart.js +660 -0
  36. package/dist/components/HighlightCard/HighlightCard.d.ts +202 -0
  37. package/dist/components/HighlightCard/HighlightCard.js +1286 -0
  38. package/dist/components/HighlightCard/HighlightCard.model.d.ts +692 -0
  39. package/dist/components/HighlightCard/HighlightCard.model.js +875 -0
  40. package/dist/components/HighlightCard/index.d.ts +4 -0
  41. package/dist/components/HighlightCard/index.js +4 -0
  42. package/dist/components/InsightCard/InsightCard.chart.d.ts +91 -0
  43. package/dist/components/InsightCard/InsightCard.chart.js +471 -0
  44. package/dist/components/InsightCard/InsightCard.d.ts +161 -0
  45. package/dist/components/InsightCard/InsightCard.js +961 -0
  46. package/dist/components/InsightCard/InsightCard.model.d.ts +405 -0
  47. package/dist/components/InsightCard/InsightCard.model.js +421 -0
  48. package/dist/components/InsightCard/index.d.ts +4 -0
  49. package/dist/components/InsightCard/index.js +4 -0
  50. package/dist/components/MetricCard/MetricCard.chart.d.ts +79 -0
  51. package/dist/components/MetricCard/MetricCard.chart.js +435 -0
  52. package/dist/components/MetricCard/MetricCard.d.ts +227 -0
  53. package/dist/components/MetricCard/MetricCard.js +1293 -0
  54. package/dist/components/MetricCard/MetricCard.model.d.ts +521 -0
  55. package/dist/components/MetricCard/MetricCard.model.js +627 -0
  56. package/dist/components/MetricCard/index.d.ts +4 -0
  57. package/dist/components/MetricCard/index.js +4 -0
  58. package/dist/components/ProfileCard/ProfileCard.chart.d.ts +64 -0
  59. package/dist/components/ProfileCard/ProfileCard.chart.js +427 -0
  60. package/dist/components/ProfileCard/ProfileCard.d.ts +140 -0
  61. package/dist/components/ProfileCard/ProfileCard.js +735 -0
  62. package/dist/components/ProfileCard/ProfileCard.model.d.ts +279 -0
  63. package/dist/components/ProfileCard/ProfileCard.model.js +244 -0
  64. package/dist/components/ProfileCard/index.d.ts +4 -0
  65. package/dist/components/ProfileCard/index.js +4 -0
  66. package/dist/components/ProgressCard/ProgressCard.chart.d.ts +73 -0
  67. package/dist/components/ProgressCard/ProgressCard.chart.js +373 -0
  68. package/dist/components/ProgressCard/ProgressCard.d.ts +137 -0
  69. package/dist/components/ProgressCard/ProgressCard.js +908 -0
  70. package/dist/components/ProgressCard/ProgressCard.model.d.ts +385 -0
  71. package/dist/components/ProgressCard/ProgressCard.model.js +389 -0
  72. package/dist/components/ProgressCard/index.d.ts +4 -0
  73. package/dist/components/ProgressCard/index.js +4 -0
  74. package/dist/components/ReportCard/ReportCard.chart.d.ts +45 -0
  75. package/dist/components/ReportCard/ReportCard.chart.js +231 -0
  76. package/dist/components/ReportCard/ReportCard.d.ts +153 -0
  77. package/dist/components/ReportCard/ReportCard.js +1118 -0
  78. package/dist/components/ReportCard/ReportCard.model.d.ts +392 -0
  79. package/dist/components/ReportCard/ReportCard.model.js +399 -0
  80. package/dist/components/ReportCard/index.d.ts +4 -0
  81. package/dist/components/ReportCard/index.js +4 -0
  82. package/dist/components/SankeyCard/SankeyCard.chart.d.ts +75 -0
  83. package/dist/components/SankeyCard/SankeyCard.chart.js +249 -0
  84. package/dist/components/SankeyCard/SankeyCard.d.ts +185 -0
  85. package/dist/components/SankeyCard/SankeyCard.js +788 -0
  86. package/dist/components/SankeyCard/SankeyCard.model.d.ts +501 -0
  87. package/dist/components/SankeyCard/SankeyCard.model.js +789 -0
  88. package/dist/components/SankeyCard/index.d.ts +4 -0
  89. package/dist/components/SankeyCard/index.js +4 -0
  90. package/dist/components/StatusCard/StatusCard.chart.d.ts +60 -0
  91. package/dist/components/StatusCard/StatusCard.chart.js +188 -0
  92. package/dist/components/StatusCard/StatusCard.d.ts +176 -0
  93. package/dist/components/StatusCard/StatusCard.js +989 -0
  94. package/dist/components/StatusCard/StatusCard.model.d.ts +555 -0
  95. package/dist/components/StatusCard/StatusCard.model.js +776 -0
  96. package/dist/components/StatusCard/index.d.ts +4 -0
  97. package/dist/components/StatusCard/index.js +4 -0
  98. package/dist/components/TableCard/TableCard.chart.d.ts +53 -0
  99. package/dist/components/TableCard/TableCard.chart.js +192 -0
  100. package/dist/components/TableCard/TableCard.d.ts +140 -0
  101. package/dist/components/TableCard/TableCard.js +811 -0
  102. package/dist/components/TableCard/TableCard.model.d.ts +381 -0
  103. package/dist/components/TableCard/TableCard.model.js +475 -0
  104. package/dist/components/TableCard/index.d.ts +4 -0
  105. package/dist/components/TableCard/index.js +4 -0
  106. package/dist/components/TargetCard/TargetCard.chart.d.ts +52 -0
  107. package/dist/components/TargetCard/TargetCard.chart.js +273 -0
  108. package/dist/components/TargetCard/TargetCard.d.ts +143 -0
  109. package/dist/components/TargetCard/TargetCard.js +910 -0
  110. package/dist/components/TargetCard/TargetCard.model.d.ts +468 -0
  111. package/dist/components/TargetCard/TargetCard.model.js +581 -0
  112. package/dist/components/TargetCard/index.d.ts +4 -0
  113. package/dist/components/TargetCard/index.js +4 -0
  114. package/dist/components/TreeCard/TreeCard.chart.d.ts +80 -0
  115. package/dist/components/TreeCard/TreeCard.chart.js +178 -0
  116. package/dist/components/TreeCard/TreeCard.d.ts +182 -0
  117. package/dist/components/TreeCard/TreeCard.js +1187 -0
  118. package/dist/components/TreeCard/TreeCard.model.d.ts +330 -0
  119. package/dist/components/TreeCard/TreeCard.model.js +401 -0
  120. package/dist/components/TreeCard/index.d.ts +4 -0
  121. package/dist/components/TreeCard/index.js +4 -0
  122. package/dist/components/TrendCard/TrendCard.chart.d.ts +75 -0
  123. package/dist/components/TrendCard/TrendCard.chart.js +393 -0
  124. package/dist/components/TrendCard/TrendCard.d.ts +224 -0
  125. package/dist/components/TrendCard/TrendCard.js +1053 -0
  126. package/dist/components/TrendCard/TrendCard.model.d.ts +545 -0
  127. package/dist/components/TrendCard/TrendCard.model.js +623 -0
  128. package/dist/components/TrendCard/index.d.ts +4 -0
  129. package/dist/components/TrendCard/index.js +4 -0
  130. package/dist/index.d.ts +76 -0
  131. package/dist/index.js +57 -0
  132. package/dist/lib/vega/ArcVegaChart.d.ts +24 -0
  133. package/dist/lib/vega/ArcVegaChart.js +42 -0
  134. package/dist/lib/vega/ArcVegaSurface.d.ts +13 -0
  135. package/dist/lib/vega/ArcVegaSurface.js +38 -0
  136. package/dist/lib/vega/axisTicks.js +156 -0
  137. package/dist/lib/vega/config.d.ts +29 -0
  138. package/dist/lib/vega/config.js +113 -0
  139. package/dist/lib/vega/embed.d.ts +29 -0
  140. package/dist/lib/vega/embed.js +29 -0
  141. package/dist/lib/vega/engine.d.ts +10 -0
  142. package/dist/lib/vega/engine.js +6 -0
  143. package/dist/lib/vega/formatters.d.ts +125 -0
  144. package/dist/lib/vega/formatters.js +277 -0
  145. package/dist/lib/vega/index.d.ts +11 -0
  146. package/dist/lib/vega/load.d.ts +13 -0
  147. package/dist/lib/vega/load.js +21 -0
  148. package/dist/lib/vega/time.d.ts +45 -0
  149. package/dist/lib/vega/time.js +105 -0
  150. package/dist/lib/vega/tokens.d.ts +73 -0
  151. package/dist/lib/vega/tokens.js +137 -0
  152. package/dist/lib/vega/tooltip.d.ts +45 -0
  153. package/dist/lib/vega/tooltip.js +124 -0
  154. package/dist/lib/vega/useArcVega.d.ts +43 -0
  155. package/dist/lib/vega/useArcVega.js +121 -0
  156. package/package.json +60 -0
@@ -0,0 +1,206 @@
1
+ import { ChartAggregate, ChartCardLabels, ChartCardSize, ChartCardStatus, ChartExtent, ChartFieldType, ChartRecord, ChartSeriesColor, ChartSort, ChartType } from "./ChartCard.model.js";
2
+ import { ReactNode } from "react";
3
+ import { BoxProps } from "@arcfusionz/arc-primitive-ui";
4
+ import { TopLevelSpec } from "vega-lite";
5
+ import { Result } from "vega-embed";
6
+ //#region src/components/ChartCard/ChartCard.d.ts
7
+ /** Where the legend sits relative to the plot. */
8
+ type ChartLegendPosition = "top" | "bottom";
9
+ /**
10
+ * How the table twin's control is exposed. `focus` (default) keeps the card
11
+ * face to title, legend and chart while leaving the data one Tab key away;
12
+ * `visible` draws the button always; `none` removes it — only when another
13
+ * surface exposes the same values to keyboard and screen-reader users.
14
+ */
15
+ type ChartTableToggle = "focus" | "visible" | "none";
16
+ interface ChartCardProps extends Omit<BoxProps, "children" | "padding" | "title"> {
17
+ /** The chart's title — the panel's heading, and the only prominent text the card carries. Pass `name` too when this is not plain text. */
18
+ title: ReactNode;
19
+ /** Plain-text title used in the generated descriptions and control labels. Defaults to `title` when it is a string. */
20
+ name?: string;
21
+ /**
22
+ * Which form to draw — 36 of them, one per distinct Vega-Lite encoding,
23
+ * grouped by the comparison each makes visible: magnitude and ranking
24
+ * (`bar`, `bar-horizontal`, `bar-grouped`, `lollipop`), part-to-whole
25
+ * (`bar-stacked`, `bar-normalized`, `area-stacked`, `area-normalized`,
26
+ * `pie`, `donut`, `radial`), change over time (`line`, `line-points`,
27
+ * `step`, `trail`, `area`, `streamgraph`, `slope`), deviation and flow
28
+ * (`bar-diverging`, `bar-range`, `waterfall`), correlation (`scatter`,
29
+ * `bubble`, `connected-scatter`, `heatmap-binned`, `radar`), distribution
30
+ * (`histogram`, `density`, `boxplot`, `violin`, `strip`, `dot`, `errorbar`,
31
+ * `errorband`) and many categories at once (`heatmap`, `punchcard`).
32
+ * Stamped as `data-type`.
33
+ */
34
+ type: ChartType;
35
+ /**
36
+ * The rows to plot — plain records from any transport. The card reads them
37
+ * through the field-name props below and knows nothing about how they were
38
+ * fetched. Pass `[]` while loading to reserve the plot's height.
39
+ */
40
+ data: readonly ChartRecord[];
41
+ /** Field name for the primary dimension — the x position, or a heatmap's column. */
42
+ x?: string;
43
+ /** Field name for the second position: the measure on most forms, a heatmap's row on the table-shaped ones. */
44
+ y?: string;
45
+ /** Field name for identity — one series per distinct value, in first-seen order. Drives the colour and the legend. */
46
+ series?: string;
47
+ /**
48
+ * Field name for the measure where it is NOT a position: a slice's angle, a
49
+ * cell's colour, a punch card's area. Falls back to `y`, which is the
50
+ * measure everywhere else.
51
+ */
52
+ value?: string;
53
+ /** Field name for a second measure drawn as area — `bubble` and `trail`. Named `sizeBy` because `size` is the card's density. */
54
+ sizeBy?: string;
55
+ /** Field name closing a range — the end of a `bar-range` span. */
56
+ x2?: string;
57
+ /** Vega-Lite type of the `x` field. Inferred from the rows (`Date` and ISO-8601 strings are temporal, numbers quantitative, everything else nominal). */
58
+ xType?: ChartFieldType;
59
+ /** Vega-Lite type of the `y` field. Inferred the same way. */
60
+ yType?: ChartFieldType;
61
+ /** Plain-text name of the dimension, used in the tooltip, the table header and the description. Defaults to the `x` field's name. */
62
+ xLabel?: string;
63
+ /** Plain-text name of the second position. Defaults to the `y` field's name. */
64
+ yLabel?: string;
65
+ /** Plain-text name of the measure. Defaults to the `value` (or `y`) field's name. */
66
+ valueLabel?: string;
67
+ /** Plain-text name of the identity dimension. Defaults to the `series` field's name. */
68
+ seriesLabel?: string;
69
+ /** Plain-text name of the size measure. Defaults to the `size` field's name. */
70
+ sizeLabel?: string;
71
+ /**
72
+ * Draw the axis titles from `xLabel` / `yLabel`. Default `false` — the title
73
+ * names the subject, the description names every field, and an axis title on
74
+ * a dashboard tile is furniture.
75
+ */
76
+ axisTitles?: boolean;
77
+ /** Draw the axes at all. Default `true`; `false` strips the plot to its marks — the table twin still carries every value. */
78
+ axes?: boolean;
79
+ /** Draw grid lines behind the marks. Default `true`. */
80
+ grid?: boolean;
81
+ /**
82
+ * Draw the legend — one chip per series with a swatch in the plot's own mark
83
+ * shape, or, for a form whose colour is a measure, the ramp's buckets.
84
+ * Default `true` when there is more than one series or the colour is a ramp,
85
+ * `false` for a single series. The tooltip, the table and the description
86
+ * name every series regardless.
87
+ */
88
+ legend?: boolean;
89
+ /** Where the legend sits. Default `top` — under the title and above the plot. */
90
+ legendPosition?: ChartLegendPosition;
91
+ /**
92
+ * Keys of the series currently shown, controlled — pair with
93
+ * `onVisibleSeriesChange`. A key is the `series` field's value. Omit for the
94
+ * uncontrolled card (`defaultVisibleSeries`, else every series). The card
95
+ * never hides the last one: a plot with nothing in it is not a state.
96
+ */
97
+ visibleSeries?: readonly string[];
98
+ /** The series shown on first render when `visibleSeries` is uncontrolled. Default: all of them. */
99
+ defaultVisibleSeries?: readonly string[];
100
+ /** Called with the remaining keys when the reader shows or hides a series from the legend. */
101
+ onVisibleSeriesChange?: (keys: string[]) => void;
102
+ /**
103
+ * How colour is used. `auto` (default) picks against the theme's identity
104
+ * budget: one series takes the emphasis hue, two or three take the
105
+ * `chart-1…N` slots, and past the budget the sequential ramp takes over —
106
+ * repeating a slot would make two series look like one. `categorical` forces
107
+ * identity slots and degrades to the ramp for the same reason. `sequential`
108
+ * is for ORDERED series (cohorts, buckets, quarters). `emphasis` puts the
109
+ * first series in the hue and the rest in the context gray. A form whose
110
+ * colour encodes a MEASURE ignores this — colour there has a job already.
111
+ * The resolved job is stamped as `data-series-color`.
112
+ */
113
+ seriesColor?: ChartSeriesColor;
114
+ /**
115
+ * Fold every series past this count into one `Other` whose readings are the
116
+ * sum of the folded ones — honest only for additive measures, which passing
117
+ * this asserts. The biggest series survive; the fold keeps the consumer's
118
+ * order, so a colour slot never moves. Stamped as `data-folded`.
119
+ */
120
+ maxSeries?: number;
121
+ /** Rank the x categories by the measure: `desc` for a ranked bar chart, `asc`, or `none` (default, the consumer's order). Ignored for a continuous x. */
122
+ sort?: ChartSort;
123
+ /**
124
+ * Aggregation Vega applies to the measure, named in the description so the
125
+ * transform is never silent. Only the forms that aggregate read it
126
+ * (`histogram`, `density`, `boxplot`, `violin`, `errorbar`, `errorband`,
127
+ * `heatmap-binned`).
128
+ */
129
+ aggregate?: ChartAggregate;
130
+ /** Bin-count ceiling for `histogram` and `heatmap-binned`. Default 20. */
131
+ maxBins?: number;
132
+ /**
133
+ * Whisker or band extent. `boxplot` takes `"min-max"` (default — no separate
134
+ * outlier layer, so no observation is hidden) or a number such as `1.5` for
135
+ * the Tukey form; `errorbar` and `errorband` take `"ci"` (default),
136
+ * `"stderr"`, `"stdev"` or `"iqr"`.
137
+ */
138
+ extent?: ChartExtent;
139
+ /** Hole size of a `donut`, as a fraction of the outer radius. Default 0.6. */
140
+ innerRadius?: number;
141
+ /**
142
+ * Number format for the axis, the legend, the tooltip, the table and the
143
+ * description — one grammar so nothing rounds two ways: `number[:digits]`,
144
+ * `integer`, `compact[:digits]`, `percent[:digits]`,
145
+ * `currency:CODE[:digits|compact]`. Default `compact`.
146
+ */
147
+ format?: string;
148
+ /** Custom formatter for the measure. Takes precedence over `format` everywhere a value is rendered. */
149
+ formatValue?: (value: number) => string;
150
+ /** Plot height in pixels, axes included. Defaults per `size` (180 / 240 / 320), plus 24 when `axes` draws the x labels. */
151
+ height?: number;
152
+ /** Show the hover tooltip. Default `true`. Every value it shows is also in the table twin, so `false` loses nothing but the convenience. */
153
+ tooltip?: boolean;
154
+ /** The transport's status. `loading` with rows already present is a refresh: the previous render stays under the veil. Default `ready`. */
155
+ status?: ChartCardStatus;
156
+ /** The consumer's filter is active — no rows then reads as no-match rather than empty, with a clear-filters action when `onClearFilters` is set. */
157
+ filtered?: boolean;
158
+ /** The data is older than the product's freshness rule (TanStack Query's `isStale`). Shows a badge, stamps `data-stale` and says so in the description. */
159
+ stale?: boolean;
160
+ /** Recovery action for the error state; renders a retry button when set. */
161
+ onRetry?: () => void;
162
+ /** Recovery action for the no-match state; renders a clear-filters button when set. */
163
+ onClearFilters?: () => void;
164
+ /** Density: `sm` for dense grids, `md` (default), `lg` for a hero panel. Scales the title, the padding and the default plot height. */
165
+ size?: ChartCardSize;
166
+ /** Heading level of the title for the document outline. Default 3 — panels usually sit under a page's h2. */
167
+ titleLevel?: 2 | 3 | 4 | 5 | 6;
168
+ /** BCP 47 locale for every number and date. Defaults to the runtime's. Thai products on the Gregorian calendar pass `th-TH-u-ca-gregory`. */
169
+ locale?: string;
170
+ /** IANA time zone for dates. Defaults to the runtime's — pass it for deterministic output and single-business-zone reporting. */
171
+ timeZone?: string;
172
+ /** Overrides for every rendered or announced string. */
173
+ labels?: Partial<ChartCardLabels>;
174
+ /** Replaces the generated accessible description of the card (the figure's `aria-describedby` text). */
175
+ description?: string;
176
+ /** Trailing header slot — a ghost `Button` or `Menu` for expand, export or settings, as the reference cards carry. Empty by default. */
177
+ action?: ReactNode;
178
+ /**
179
+ * How the table twin's control is exposed. `focus` (default) hides it until
180
+ * it is tabbed to, so the card face stays title + legend + chart while every
181
+ * value stays one key away; `visible` always draws it; `none` removes it.
182
+ */
183
+ tableToggle?: ChartTableToggle;
184
+ /** Open the data popover on first render, anchored to the card. */
185
+ defaultTableOpen?: boolean;
186
+ /** Called with vega-embed's result once the plot mounts — for `view` access in advanced compositions. */
187
+ onEmbed?: (result: Result) => void;
188
+ /** Escape hatch: transform the plot spec before it renders. Voids the token and accessibility guarantees for whatever it changes. */
189
+ patchSpec?: (spec: TopLevelSpec) => TopLevelSpec;
190
+ }
191
+ /**
192
+ * A chart panel for dashboards: a title, a legend, and a chart — nothing else
193
+ * on its face. `type` picks one of 36 Vega-Lite forms, `data` is plain records
194
+ * and the remaining fields are field NAMES, so the same card draws a stacked
195
+ * bar, a donut, a heatmap, a box plot or a radar without changing shape.
196
+ *
197
+ * Where the other cards in this package answer one fixed question in text and
198
+ * illustrate it with a plot, ChartCard is the plot: the comparison is the form
199
+ * the consumer chose. Every state is handled and layout-stable, and the text
200
+ * equivalents the chart owes a screen reader — a generated description, a
201
+ * generated plot label, and a table twin holding every value — are all there,
202
+ * none of them on the card's face.
203
+ */
204
+ declare const ChartCard: import("react").ForwardRefExoticComponent<ChartCardProps & import("react").RefAttributes<HTMLElement>>;
205
+ //#endregion
206
+ export { ChartCard, ChartCardProps, ChartLegendPosition, ChartTableToggle };