@mechane-ai/elements 0.45.0 → 0.47.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 (340) hide show
  1. package/README.md +353 -50
  2. package/bin/mechane-elements-catalog.mjs +42 -4
  3. package/dist/ai.js +268 -202
  4. package/dist/catalog.json +2480 -71
  5. package/dist/categorical-values-DdfGIowV.js +107 -0
  6. package/dist/cells--Bd1fQFR.js +384 -0
  7. package/dist/chart-cursor-1mFd48Jc.js +23 -0
  8. package/dist/chart-link-AE_xuxiP.js +35 -0
  9. package/dist/chart-tones-ei3BC2AL.js +27 -0
  10. package/dist/charts/cartesian.js +1 -2792
  11. package/dist/charts/cells.js +1 -0
  12. package/dist/charts/comparison.js +1 -0
  13. package/dist/charts/distribution.js +1 -709
  14. package/dist/charts/figure.js +3404 -0
  15. package/dist/charts/graph.js +1 -641
  16. package/dist/charts/hierarchy.js +1 -112
  17. package/dist/charts/image.js +1 -0
  18. package/dist/charts/matrix.js +3 -637
  19. package/dist/charts/plot.js +15 -0
  20. package/dist/charts/relationship.js +1 -0
  21. package/dist/charts/text.js +1 -0
  22. package/dist/charts/timeline.js +1 -233
  23. package/dist/charts/transforms.js +677 -0
  24. package/dist/charts/trend.js +1 -0
  25. package/dist/charts.js +8 -3
  26. package/dist/{code-block-Cpfr7B6a.js → code-block-DioAM2bZ.js} +67 -52
  27. package/dist/collections.js +1 -1735
  28. package/dist/color-legend-CIo7DhXB.js +62 -0
  29. package/dist/content/code.js +1 -1
  30. package/dist/content/diff.js +67 -66
  31. package/dist/content/link.js +1 -1
  32. package/dist/content/markdown.js +2 -2
  33. package/dist/content/tree.js +2 -2
  34. package/dist/{content-link-CGeFFb9F.js → content-link-NWuHp5rC.js} +1 -1
  35. package/dist/content.js +1 -1
  36. package/dist/csp.js +6 -11
  37. package/dist/dates-Cww8UR_n.js +810 -0
  38. package/dist/dumbbell-plot-B2ZTgQaI.js +508 -0
  39. package/dist/embedding-map-CGM_k6lC.js +1929 -0
  40. package/dist/feedback.js +1 -1
  41. package/dist/figure-format-B8kRZMlo.js +36 -0
  42. package/dist/figure-frame-wRkIEAwe.js +270 -0
  43. package/dist/forms/dates.js +1 -750
  44. package/dist/{forms-DeU0Tiv3.js → forms-CEbwzlRR.js} +50 -41
  45. package/dist/forms.js +3 -3
  46. package/dist/heatmap-scale-Zte6Ya-g.js +20 -0
  47. package/dist/image-grid-CVA4SOy_.js +598 -0
  48. package/dist/index.js +1 -1
  49. package/dist/kits/evaluation.js +431 -0
  50. package/dist/kits/explainers.js +452 -0
  51. package/dist/kits/interpretability.js +1033 -0
  52. package/dist/kits/operations.js +239 -0
  53. package/dist/kits/training.js +335 -0
  54. package/dist/label-place-Z0fryBZb.js +42 -0
  55. package/dist/layout.js +207 -207
  56. package/dist/locate-Bcg3QcP4.js +11 -0
  57. package/dist/navigation.js +4 -3
  58. package/dist/packages/ai/src/conversation.d.ts +2 -0
  59. package/dist/packages/ai/src/prompt-input.d.ts +7 -2
  60. package/dist/packages/charts/src/cartesian/bar-chart.d.ts +40 -21
  61. package/dist/packages/charts/src/cartesian/bar-data.d.ts +15 -4
  62. package/dist/packages/charts/src/cartesian/bar-overlays.d.ts +7 -3
  63. package/dist/packages/charts/src/cartesian/breakdown-bar.d.ts +10 -8
  64. package/dist/packages/charts/src/cartesian/bridge-chart.d.ts +20 -16
  65. package/dist/packages/charts/src/cartesian/bridge-data.d.ts +5 -4
  66. package/dist/packages/charts/src/cartesian/composition-bars.d.ts +8 -4
  67. package/dist/packages/charts/src/cartesian/index.d.ts +6 -5
  68. package/dist/packages/charts/src/cartesian/reference-lines.d.ts +25 -18
  69. package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +37 -26
  70. package/dist/packages/charts/src/cartesian/sparkline.d.ts +14 -2
  71. package/dist/packages/charts/src/cartesian/time-series-bands.d.ts +3 -2
  72. package/dist/packages/charts/src/cartesian/time-series-data.d.ts +12 -2
  73. package/dist/packages/charts/src/cartesian/time-series-line.d.ts +2 -2
  74. package/dist/packages/charts/src/cartesian/time-series-overlays.d.ts +6 -4
  75. package/dist/packages/charts/src/cartesian/time-series.d.ts +61 -27
  76. package/dist/packages/charts/src/cartesian/value-labels.d.ts +22 -0
  77. package/dist/packages/charts/src/categorical-values.d.ts +15 -10
  78. package/dist/packages/charts/src/cells/bar-cell.d.ts +13 -0
  79. package/dist/packages/charts/src/cells/cell-layout.d.ts +81 -0
  80. package/dist/packages/charts/src/cells/change-cell.d.ts +17 -0
  81. package/dist/packages/charts/src/cells/heat-cell.d.ts +19 -0
  82. package/dist/packages/charts/src/cells/index.d.ts +11 -0
  83. package/dist/packages/charts/src/cells/interval-cell.d.ts +16 -0
  84. package/dist/packages/charts/src/cells/spark-cell.d.ts +22 -0
  85. package/dist/packages/charts/src/chart-frame.d.ts +17 -12
  86. package/dist/packages/charts/src/chart-grid.d.ts +19 -0
  87. package/dist/packages/charts/src/chart-input.d.ts +1 -9
  88. package/dist/packages/charts/src/chart-inspection.d.ts +1 -2
  89. package/dist/packages/charts/src/chart-link.d.ts +56 -0
  90. package/dist/packages/charts/src/chart-range.d.ts +33 -0
  91. package/dist/packages/charts/src/chart-rows.d.ts +20 -0
  92. package/dist/packages/charts/src/chart-theme.d.ts +17 -0
  93. package/dist/packages/charts/src/chart.d.ts +73 -0
  94. package/dist/packages/charts/src/comparison/bullet-bar.d.ts +34 -0
  95. package/dist/packages/charts/src/comparison/comparison-plot.d.ts +54 -0
  96. package/dist/packages/charts/src/comparison/dot-plot.d.ts +41 -0
  97. package/dist/packages/charts/src/comparison/dumbbell-plot.d.ts +33 -0
  98. package/dist/packages/charts/src/comparison/index.d.ts +6 -0
  99. package/dist/packages/charts/src/distribution/box-plot.d.ts +40 -0
  100. package/dist/packages/charts/src/distribution/distribution-input.d.ts +5 -3
  101. package/dist/packages/charts/src/distribution/distribution-plot.d.ts +28 -161
  102. package/dist/packages/charts/src/distribution/ecdf.d.ts +16 -15
  103. package/dist/packages/charts/src/distribution/group-plot-input.d.ts +35 -0
  104. package/dist/packages/charts/src/distribution/group-plot-layout.d.ts +79 -0
  105. package/dist/packages/charts/src/distribution/group-plot.d.ts +73 -0
  106. package/dist/packages/charts/src/distribution/histogram.d.ts +16 -16
  107. package/dist/packages/charts/src/distribution/index.d.ts +11 -0
  108. package/dist/packages/charts/src/distribution/interval-plot.d.ts +16 -13
  109. package/dist/packages/charts/src/distribution/ranked-bars.d.ts +17 -14
  110. package/dist/packages/charts/src/distribution/ridgeline.d.ts +34 -0
  111. package/dist/packages/charts/src/distribution/strip-plot.d.ts +37 -0
  112. package/dist/packages/charts/src/distribution/violin-plot.d.ts +34 -0
  113. package/dist/packages/charts/src/figure/figure-format.d.ts +34 -0
  114. package/dist/packages/charts/src/figure/figure-frame.d.ts +47 -0
  115. package/dist/packages/charts/src/figure/figure-props.d.ts +54 -0
  116. package/dist/packages/charts/src/figure/tone-scope.d.ts +32 -0
  117. package/dist/packages/charts/src/graph/attribution-graph.d.ts +62 -0
  118. package/dist/packages/charts/src/graph/attribution-layout.d.ts +88 -0
  119. package/dist/packages/charts/src/graph/flow-diagram.d.ts +14 -15
  120. package/dist/packages/charts/src/graph/flow-layout.d.ts +4 -2
  121. package/dist/packages/charts/src/graph/graph-canvas.d.ts +33 -0
  122. package/dist/packages/charts/src/graph/index.d.ts +6 -2
  123. package/dist/packages/charts/src/graph/relation-graph.d.ts +24 -13
  124. package/dist/packages/charts/src/graph/tree-diagram.d.ts +41 -0
  125. package/dist/packages/charts/src/graph/tree-layout.d.ts +71 -0
  126. package/dist/packages/charts/src/hierarchy/area-mark.d.ts +17 -0
  127. package/dist/packages/charts/src/hierarchy/icicle.d.ts +35 -0
  128. package/dist/packages/charts/src/hierarchy/index.d.ts +2 -0
  129. package/dist/packages/charts/src/hierarchy/partition-layout.d.ts +25 -0
  130. package/dist/packages/charts/src/hierarchy/treemap-layout.d.ts +26 -0
  131. package/dist/packages/charts/src/hierarchy/treemap.d.ts +11 -9
  132. package/dist/packages/charts/src/image/attribution-legend.d.ts +13 -0
  133. package/dist/packages/charts/src/image/attribution-overlay.d.ts +50 -0
  134. package/dist/packages/charts/src/image/attribution-ramp.d.ts +16 -0
  135. package/dist/packages/charts/src/image/image-atlas.d.ts +37 -0
  136. package/dist/packages/charts/src/image/image-fill.d.ts +9 -0
  137. package/dist/packages/charts/src/image/image-grid.d.ts +26 -0
  138. package/dist/packages/charts/src/image/image-input.d.ts +27 -0
  139. package/dist/packages/charts/src/image/image-tile.d.ts +27 -0
  140. package/dist/packages/charts/src/image/index.d.ts +7 -0
  141. package/dist/packages/charts/src/index.d.ts +16 -1
  142. package/dist/packages/charts/src/matrix/attention-matrix.d.ts +41 -0
  143. package/dist/packages/charts/src/matrix/calendar-heatmap.d.ts +37 -0
  144. package/dist/packages/charts/src/matrix/color-legend.d.ts +9 -2
  145. package/dist/packages/charts/src/matrix/confusion-matrix.d.ts +36 -0
  146. package/dist/packages/charts/src/matrix/correlation-matrix.d.ts +34 -0
  147. package/dist/packages/charts/src/matrix/heatmap-scale.d.ts +8 -2
  148. package/dist/packages/charts/src/matrix/index.d.ts +14 -3
  149. package/dist/packages/charts/src/matrix/matrix-cells.d.ts +27 -3
  150. package/dist/packages/charts/src/matrix/matrix-figure.d.ts +50 -0
  151. package/dist/packages/charts/src/matrix/matrix-mark.d.ts +34 -0
  152. package/dist/packages/charts/src/matrix/matrix-presets.d.ts +20 -0
  153. package/dist/packages/charts/src/matrix/matrix-range.d.ts +45 -0
  154. package/dist/packages/charts/src/matrix/matrix-strip.d.ts +13 -14
  155. package/dist/packages/charts/src/matrix/matrix-types.d.ts +40 -0
  156. package/dist/packages/charts/src/matrix/matrix.d.ts +13 -11
  157. package/dist/packages/charts/src/matrix/token-heatmap.d.ts +16 -10
  158. package/dist/packages/charts/src/plot/contours.d.ts +45 -0
  159. package/dist/packages/charts/src/plot/index.d.ts +49 -0
  160. package/dist/packages/charts/src/plot/label-place.d.ts +35 -0
  161. package/dist/packages/charts/src/plot/locate.d.ts +18 -0
  162. package/dist/packages/charts/src/plot/path.d.ts +39 -0
  163. package/dist/packages/charts/src/plot/plot-axes.d.ts +20 -0
  164. package/dist/packages/charts/src/plot/plot-layout.d.ts +221 -0
  165. package/dist/packages/charts/src/plot/plot-marks.d.ts +124 -0
  166. package/dist/packages/charts/src/plot/plot-surface.d.ts +32 -0
  167. package/dist/packages/charts/src/plot/render/density-layer.d.ts +17 -0
  168. package/dist/packages/charts/src/plot/render/hit-index.d.ts +37 -0
  169. package/dist/packages/charts/src/plot/render/plot-viewport.d.ts +39 -0
  170. package/dist/packages/charts/src/plot/render/point-layer.d.ts +41 -0
  171. package/dist/packages/charts/src/plot/render/theme-colors.d.ts +15 -0
  172. package/dist/packages/charts/src/plot/scale.d.ts +48 -0
  173. package/dist/packages/charts/src/plot/ticks.d.ts +34 -0
  174. package/dist/packages/charts/src/plot-width.d.ts +3 -3
  175. package/dist/packages/charts/src/relationship/contour-plot.d.ts +61 -0
  176. package/dist/packages/charts/src/relationship/density-map.d.ts +45 -0
  177. package/dist/packages/charts/src/relationship/embedding-map.d.ts +75 -0
  178. package/dist/packages/charts/src/relationship/index.d.ts +11 -0
  179. package/dist/packages/charts/src/relationship/level-legend.d.ts +11 -0
  180. package/dist/packages/charts/src/relationship/measures.d.ts +85 -0
  181. package/dist/packages/charts/src/relationship/parallel-coordinates.d.ts +30 -0
  182. package/dist/packages/charts/src/relationship/range-controls.d.ts +20 -0
  183. package/dist/packages/charts/src/relationship/scatter-matrix.d.ts +20 -0
  184. package/dist/packages/charts/src/spec/chart-guide.d.ts +21 -0
  185. package/dist/packages/charts/src/spec/figure-registry.d.ts +44 -0
  186. package/dist/packages/charts/src/spec/figure-spec.d.ts +147 -0
  187. package/dist/packages/charts/src/spec/figure-text.d.ts +8 -0
  188. package/dist/packages/charts/src/spec/figure.d.ts +12 -0
  189. package/dist/packages/charts/src/spec/guide-data.d.ts +85 -0
  190. package/dist/packages/charts/src/spec/index.d.ts +10 -0
  191. package/dist/packages/charts/src/spec/validate-figure.d.ts +15 -0
  192. package/dist/packages/charts/src/text/index.d.ts +11 -0
  193. package/dist/packages/charts/src/text/token-examples.d.ts +42 -0
  194. package/dist/packages/charts/src/text/token-grid.d.ts +47 -0
  195. package/dist/packages/charts/src/text/token-links.d.ts +49 -0
  196. package/dist/packages/charts/src/text/token-predictions.d.ts +38 -0
  197. package/dist/packages/charts/src/text/token-scale.d.ts +20 -0
  198. package/dist/packages/charts/src/text/token-text.d.ts +39 -0
  199. package/dist/packages/charts/src/timeline/event-strip.d.ts +70 -0
  200. package/dist/packages/charts/src/timeline/index.d.ts +3 -1
  201. package/dist/packages/charts/src/timeline/waterfall.d.ts +29 -14
  202. package/dist/packages/charts/src/transforms/bins.d.ts +91 -0
  203. package/dist/packages/charts/src/transforms/density.d.ts +53 -0
  204. package/dist/packages/charts/src/transforms/fits.d.ts +50 -0
  205. package/dist/packages/charts/src/transforms/index.d.ts +19 -0
  206. package/dist/packages/charts/src/transforms/matrices.d.ts +49 -0
  207. package/dist/packages/charts/src/transforms/quantiles.d.ts +96 -0
  208. package/dist/packages/charts/src/transforms/ranks.d.ts +44 -0
  209. package/dist/packages/charts/src/transforms/runs.d.ts +47 -0
  210. package/dist/packages/charts/src/transforms/sampling.d.ts +75 -0
  211. package/dist/packages/charts/src/transforms/smoothing.d.ts +41 -0
  212. package/dist/packages/charts/src/transforms/values.d.ts +70 -0
  213. package/dist/packages/charts/src/trend/bump-chart.d.ts +33 -0
  214. package/dist/packages/charts/src/trend/column-figure.d.ts +38 -0
  215. package/dist/packages/charts/src/trend/column-positions.d.ts +21 -0
  216. package/dist/packages/charts/src/trend/curve-chart.d.ts +69 -0
  217. package/dist/packages/charts/src/trend/end-labels.d.ts +40 -0
  218. package/dist/packages/charts/src/trend/horizon-chart.d.ts +37 -0
  219. package/dist/packages/charts/src/trend/index.d.ts +10 -0
  220. package/dist/packages/charts/src/trend/line-locate.d.ts +21 -0
  221. package/dist/packages/charts/src/trend/runs-chart.d.ts +50 -0
  222. package/dist/packages/charts/src/trend/slope-chart.d.ts +35 -0
  223. package/dist/packages/collections/src/collection-controls.d.ts +5 -1
  224. package/dist/packages/collections/src/collection-filters.d.ts +4 -1
  225. package/dist/packages/collections/src/control-toolbar.d.ts +13 -0
  226. package/dist/packages/collections/src/data-table-layout.d.ts +78 -0
  227. package/dist/packages/collections/src/data-table-rows.d.ts +54 -0
  228. package/dist/packages/collections/src/data-table-styles.d.ts +340 -0
  229. package/dist/packages/collections/src/data-table-text.d.ts +13 -0
  230. package/dist/packages/collections/src/data-table-trigger.d.ts +23 -0
  231. package/dist/packages/collections/src/data-table.d.ts +3 -85
  232. package/dist/packages/collections/src/index.d.ts +11 -6
  233. package/dist/packages/collections/src/query-controls.d.ts +6 -2
  234. package/dist/packages/collections/src/table-results.d.ts +47 -13
  235. package/dist/packages/collections/src/timeline.d.ts +1 -0
  236. package/dist/packages/collections/src/use-collection-controls.d.ts +2 -1
  237. package/dist/packages/collections/src/use-table-window.d.ts +25 -0
  238. package/dist/packages/content/src/viewer.d.ts +8 -0
  239. package/dist/packages/core/src/disclosure.d.ts +9 -1
  240. package/dist/packages/core/src/index.d.ts +1 -0
  241. package/dist/packages/core/src/route-link.d.ts +11 -0
  242. package/dist/packages/forms/src/dates/date-inputs.d.ts +3 -1
  243. package/dist/packages/forms/src/file-picker.d.ts +15 -0
  244. package/dist/packages/forms/src/form-controls.d.ts +1 -6
  245. package/dist/packages/forms/src/forms.d.ts +4 -1
  246. package/dist/packages/forms/src/index.d.ts +4 -2
  247. package/dist/packages/forms/src/selection.d.ts +14 -0
  248. package/dist/packages/foundations/src/csp/index.d.ts +1 -1
  249. package/dist/packages/foundations/src/csp/provider.d.ts +7 -2
  250. package/dist/packages/kits/src/evaluation/evaluation-data.d.ts +31 -0
  251. package/dist/packages/kits/src/evaluation/index.d.ts +8 -0
  252. package/dist/packages/kits/src/evaluation/leaderboard-cells.d.ts +62 -0
  253. package/dist/packages/kits/src/evaluation/leaderboard.d.ts +59 -0
  254. package/dist/packages/kits/src/evaluation/model-comparison.d.ts +59 -0
  255. package/dist/packages/kits/src/evaluation/score-breakdown.d.ts +33 -0
  256. package/dist/packages/kits/src/explainers/bound-value.d.ts +29 -0
  257. package/dist/packages/kits/src/explainers/figures.d.ts +31 -0
  258. package/dist/packages/kits/src/explainers/index.d.ts +8 -0
  259. package/dist/packages/kits/src/explainers/linked-target.d.ts +22 -0
  260. package/dist/packages/kits/src/explainers/story-steps.d.ts +46 -0
  261. package/dist/packages/kits/src/explainers/term.d.ts +29 -0
  262. package/dist/packages/kits/src/interpretability/attention-head-grid.d.ts +56 -0
  263. package/dist/packages/kits/src/interpretability/attribution-workbench.d.ts +29 -0
  264. package/dist/packages/kits/src/interpretability/embedding-atlas.d.ts +41 -0
  265. package/dist/packages/kits/src/interpretability/feature-card.d.ts +33 -0
  266. package/dist/packages/kits/src/interpretability/feature-list.d.ts +51 -0
  267. package/dist/packages/kits/src/interpretability/feature-logits.d.ts +23 -0
  268. package/dist/packages/kits/src/interpretability/features.d.ts +70 -0
  269. package/dist/packages/kits/src/interpretability/index.d.ts +16 -0
  270. package/dist/packages/kits/src/interpretability/kit-styles.d.ts +118 -0
  271. package/dist/packages/kits/src/interpretability/logit-lens.d.ts +50 -0
  272. package/dist/packages/kits/src/interpretability/node-panel.d.ts +32 -0
  273. package/dist/packages/kits/src/interpretability/shared-link.d.ts +8 -0
  274. package/dist/packages/kits/src/interpretability/steering-panel.d.ts +52 -0
  275. package/dist/packages/kits/src/operations/budget-board.d.ts +49 -0
  276. package/dist/packages/kits/src/operations/incident-timeline.d.ts +30 -0
  277. package/dist/packages/kits/src/operations/index.d.ts +6 -0
  278. package/dist/packages/kits/src/operations/service-health.d.ts +66 -0
  279. package/dist/packages/kits/src/training/index.d.ts +8 -0
  280. package/dist/packages/kits/src/training/run-dashboard.d.ts +49 -0
  281. package/dist/packages/kits/src/training/run-legend.d.ts +21 -0
  282. package/dist/packages/kits/src/training/run-marker.d.ts +5 -0
  283. package/dist/packages/kits/src/training/run-state.d.ts +7 -0
  284. package/dist/packages/kits/src/training/run-table.d.ts +63 -0
  285. package/dist/packages/kits/src/training/runs-overview.d.ts +20 -0
  286. package/dist/packages/kits/src/training/runs.d.ts +34 -0
  287. package/dist/packages/navigation/src/index.d.ts +1 -1
  288. package/dist/path-BglsXpnO.js +59 -0
  289. package/dist/{pierre-diff-B3tD3-6z.js → pierre-diff-DlvjyuJn.js} +1 -1
  290. package/dist/plot-axes-DJkLW4wk.js +100 -0
  291. package/dist/plot-layout-BEuoOHbs.js +911 -0
  292. package/dist/plot-marks-A64v7aTw.js +226 -0
  293. package/dist/plot-surface-CJTIqtck.js +51 -0
  294. package/dist/{plot-width-CIqBiHcd.js → plot-width-DcqtSgzb.js} +22 -3
  295. package/dist/point-layer-C-EYETAt.js +655 -0
  296. package/dist/reference-lines-CWA8VeUR.js +82 -0
  297. package/dist/scale-C2xgZyZN.js +63 -0
  298. package/dist/slope-chart-DT22h_ym.js +1279 -0
  299. package/dist/{src-gqEebHEa.js → src-1EHkSFS-.js} +395 -274
  300. package/dist/{src-DBNncL7_.js → src-BPTDJqt0.js} +48 -68
  301. package/dist/{src-Dcs3SZ9V.js → src-CExIrXPC.js} +170 -194
  302. package/dist/src-CGc_hjxJ.js +409 -0
  303. package/dist/{src-DcW_gMX8.js → src-CpdJlDhO.js} +480 -362
  304. package/dist/src-D5NXRJZe.js +2195 -0
  305. package/dist/src-DIS0YOj0.js +44 -0
  306. package/dist/styles2.css +574 -161
  307. package/dist/time-series-IB3CB93O.js +2668 -0
  308. package/dist/token-heatmap-C00DnoNO.js +1354 -0
  309. package/dist/token-predictions-Cxx29iDr.js +1093 -0
  310. package/dist/tone-scope-DKiSw-JR.js +32 -0
  311. package/dist/tree-diagram-DsckNKaW.js +1629 -0
  312. package/dist/treemap-9_DpLCW9.js +472 -0
  313. package/dist/values-963L6n1m.js +65 -0
  314. package/dist/violin-plot-BhPHKXsN.js +1291 -0
  315. package/dist/waterfall-CGksuTy5.js +576 -0
  316. package/package.json +57 -7
  317. package/recipes/allocation-report.tsx +15 -7
  318. package/skills/extend-elements/SKILL.md +134 -0
  319. package/skills/review-elements/SKILL.md +118 -0
  320. package/skills/upgrade-elements/SKILL.md +36 -0
  321. package/skills/upgrade-elements/references/releases.md +242 -0
  322. package/skills/use-elements/SKILL.md +70 -13
  323. package/skills/use-elements/references/agent.md +57 -0
  324. package/skills/use-elements/references/charts.md +384 -0
  325. package/skills/use-elements/references/collections.md +89 -0
  326. package/skills/use-elements/references/conversations.md +47 -0
  327. package/skills/use-elements/references/figures.md +173 -0
  328. package/skills/use-elements/references/forms.md +81 -0
  329. package/skills/use-elements/references/kits.md +198 -0
  330. package/skills/use-elements/references/styling.md +70 -0
  331. package/skills/use-elements/references/workspace.md +3 -3
  332. package/dist/categorical-values-DZLGQVW1.js +0 -63
  333. package/dist/chart-frame-Ztktqs1b.js +0 -255
  334. package/dist/chart-input-BO3BqlFO.js +0 -22
  335. package/dist/chart-navigation-BAbb5PV9.js +0 -154
  336. package/dist/header-styles-COxCYFZx.js +0 -90
  337. package/dist/packages/charts/src/chart-navigation.d.ts +0 -39
  338. package/dist/packages/charts/src/chart-surface.d.ts +0 -27
  339. package/dist/packages/navigation/src/route-link.d.ts +0 -2
  340. package/dist/src-Bk7M67zy.js +0 -396
@@ -1,2792 +1 @@
1
- import { c as e, f as t, l as n, p as r } from "../src-Dcs3SZ9V.js";
2
- import { i, n as a, r as o, t as s } from "../categorical-values-DZLGQVW1.js";
3
- import { a as c, n as l, r as u, t as d } from "../chart-navigation-BAbb5PV9.js";
4
- import { a as f, i as p, n as m } from "../chart-frame-Ztktqs1b.js";
5
- import { n as h, r as g, t as _ } from "../chart-input-BO3BqlFO.js";
6
- import { r as v } from "../tokens.stylex-dF5CACEJ.js";
7
- import { n as y, t as ee } from "../plot-width-CIqBiHcd.js";
8
- import { t as b } from "../label-spacing-BncjePGb.js";
9
- import { O as x } from "../src-DcW_gMX8.js";
10
- import { h as S } from "../src-gqEebHEa.js";
11
- import * as C from "@stylexjs/stylex";
12
- import { Button as w } from "@ui-sdk/react/button";
13
- import { useEffect as te, useId as T, useMemo as ne, useRef as E, useState as re } from "react";
14
- import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
15
- import { bindDrag as A } from "@ui-sdk/core";
16
- import { scaleBand as ie, scaleLinear as j } from "@visx/scale";
17
- import { Area as M, AreaClosed as ae, Bar as N, LinePath as P } from "@visx/shape";
18
- // packages/charts/src/chart-cursor.tsx
19
- function oe({ x: e, top: t, bottom: n, width: r }) {
20
- return /* @__PURE__ */ k("g", {
21
- "aria-hidden": !0,
22
- className: "xlshs6z xgs60n x17y187c xbabvq0 x47corl",
23
- children: [/* @__PURE__ */ O("line", {
24
- x1: e,
25
- x2: e,
26
- y1: t,
27
- y2: n,
28
- className: "xnpr05h x1ntoi03 x13efnbd"
29
- }), /* @__PURE__ */ O("line", {
30
- x1: e - r / 2,
31
- x2: e + r / 2,
32
- y1: n + 4,
33
- y2: n + 4,
34
- className: "xzly4p3 x13efnbd"
35
- })]
36
- });
37
- }
38
- // packages/charts/src/chart-inspection.tsx
39
- var F = {
40
- kzqmXN: "x1xc55vz",
41
- kZKoxP: "xdk7pt",
42
- kmuXW: "x2lah0s",
43
- $$css: !0
44
- }, se = {
45
- swatch: (e) => [
46
- F,
47
- {
48
- kWkggS: e == null ? e : "xl8spv7",
49
- $$css: !0
50
- },
51
- { "--x-backgroundColor": e ?? void 0 }
52
- ],
53
- inspector: {
54
- k1xSpc: "xrvj5dj x1boff50",
55
- kOIVth: "xunmzkg",
56
- kVAEAm: "x10l6tqk",
57
- k87sOh: "x1ridm32",
58
- kB7OPa: "x9f619",
59
- kfzvcC: "x47corl",
60
- kmVPX3: "x69ldcm",
61
- kMzoRj: "xmkeg23",
62
- ksu8eU: "x1y0btm7",
63
- kVAM5u: "x1ey3b81",
64
- kaIpWk: "x1ok0vyi",
65
- kGVxlE: "x1ghndwu",
66
- kWkggS: "xpvm0e4",
67
- kMwMTN: "xbixft",
68
- kGuDYH: "xy8obcc",
69
- kLWn49: "xas2l8k",
70
- kcqcaj: "xss6m8b",
71
- kHjlTd: "xj0a0fe",
72
- $$css: !0
73
- },
74
- summaryInspector: {
75
- k1xSpc: "xrvj5dj x1xnx9c1",
76
- $$css: !0
77
- },
78
- position: (e, t) => [{
79
- kbCHJM: e == null ? e : "xgq9j65",
80
- kzqmXN: t == null ? t : "x5lhr3w",
81
- $$css: !0
82
- }, {
83
- "--x-left": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e),
84
- "--x-width": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
85
- }]
86
- }, ce = 4;
87
- function le() {
88
- return /* @__PURE__ */ O("ul", {
89
- "aria-hidden": !0,
90
- inert: !0,
91
- className: "x78zum5 x1xnx9c1 xnby9oq x1a02dak x8zbtdt x1gkm1c7 x1ghz6dp x1717udv xe8uvvx x153jb6y xy8obcc xas2l8k",
92
- children: Array.from({ length: ce }, (e, t) => /* @__PURE__ */ k("li", {
93
- className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe x1f394nn x43dure",
94
- children: [/* @__PURE__ */ O("span", { ...C.props(se.swatch(v.line)) }), /* @__PURE__ */ k("span", {
95
- className: "x1cqoux5 xeuugli",
96
- children: [
97
- /* @__PURE__ */ O(r, {}),
98
- /* @__PURE__ */ O("span", {
99
- className: "x1s85apg xannxpe",
100
- children: /* @__PURE__ */ O(r, {})
101
- }),
102
- /* @__PURE__ */ O("span", {
103
- className: "x1s85apg xannxpe x1mqbd49 xbixft xss6m8b",
104
- children: /* @__PURE__ */ O(r, {})
105
- })
106
- ]
107
- })]
108
- }, t))
109
- });
110
- }
111
- function ue({ title: e, detail: t }) {
112
- return t === void 0 ? e : /* @__PURE__ */ k("span", {
113
- "aria-label": e,
114
- className: "x1lliihq xb3r6kr xlyipyv xuxw1ft",
115
- children: [/* @__PURE__ */ O("span", {
116
- className: "xt0psk2 x1boff50",
117
- children: e
118
- }), /* @__PURE__ */ O("span", {
119
- className: "x1s85apg xfodcyb",
120
- children: t
121
- })]
122
- });
123
- }
124
- function de({ label: e, summary: t, rows: n, notes: r = [] }) {
125
- if (e !== void 0) return [
126
- e,
127
- t,
128
- ...n.map((e) => `${e.label}: ${e.value}`),
129
- ...r
130
- ].filter((e) => e !== void 0).join(" · ");
131
- }
132
- function fe({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a, x: o, width: s, offset: c = 16, source: l, notes: u = [], hasSeriesSummary: d = !1, hasLegend: p = !0 }) {
133
- let m = p && !d, h = Math.min(260, s), g = o > s / 2 ? o - h - c : o + c, _ = Math.max(0, Math.min(s - h, g));
134
- return /* @__PURE__ */ k("div", {
135
- className: "xeuugli",
136
- children: [
137
- m && /* @__PURE__ */ k("div", {
138
- className: "xrvj5dj xeuugli",
139
- children: [i !== void 0 && /* @__PURE__ */ O("ul", {
140
- "aria-hidden": !0,
141
- inert: !0,
142
- className: "x78zum5 x1xnx9c1 xnby9oq x1a02dak x8zbtdt x1gkm1c7 x1ghz6dp x1717udv xe8uvvx x153jb6y xy8obcc xas2l8k x15r89dc xlshs6z x47corl",
143
- children: i.map((e) => /* @__PURE__ */ k("li", {
144
- className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
145
- children: [/* @__PURE__ */ O(f, {
146
- tone: e.tone,
147
- shape: e.shape
148
- }), /* @__PURE__ */ k("span", {
149
- className: "xeuugli",
150
- children: [e.label, /* @__PURE__ */ O("span", { className: "x1s85apg xannxpe x1mqbd49 xbixft xss6m8b" })]
151
- })]
152
- }, e.id))
153
- }), /* @__PURE__ */ O("ul", {
154
- "aria-label": "Legend",
155
- className: "x78zum5 x1xnx9c1 xnby9oq x1a02dak x8zbtdt x1gkm1c7 x1ghz6dp x1717udv xe8uvvx x153jb6y xy8obcc xas2l8k x15r89dc",
156
- children: r.map((e) => /* @__PURE__ */ k("li", {
157
- className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
158
- children: [/* @__PURE__ */ O(f, {
159
- tone: e.tone,
160
- shape: e.shape
161
- }), /* @__PURE__ */ k("span", {
162
- className: "xeuugli",
163
- children: [e.label, /* @__PURE__ */ O("span", {
164
- className: "x1s85apg xannxpe x1mqbd49 xbixft xss6m8b",
165
- children: t === void 0 ? "" : a.find((t) => t.id === e.id)?.value ?? "—"
166
- })]
167
- })]
168
- }, e.id))
169
- })]
170
- }),
171
- /* @__PURE__ */ O("span", {
172
- id: e,
173
- "aria-live": l === "keyboard" ? "polite" : "off",
174
- className: "x10l6tqk x1i1rx1s xjm9jq1 x1717udv xb3r6kr x1hyvwdk xuxw1ft",
175
- children: de({
176
- label: t,
177
- summary: n,
178
- rows: a,
179
- notes: u
180
- })
181
- }),
182
- t !== void 0 && /* @__PURE__ */ O("div", {
183
- "aria-hidden": !0,
184
- className: "x1n2onr6 xqtp20y x1vjfegm",
185
- children: /* @__PURE__ */ k("div", {
186
- ...C.props(se.inspector, !m && se.summaryInspector, se.position(_, h)),
187
- children: [
188
- /* @__PURE__ */ k("div", {
189
- className: "x78zum5 x1qughib x1hnptsi xk4h15q",
190
- children: [/* @__PURE__ */ O("span", { children: t }), n !== void 0 && /* @__PURE__ */ O("span", { children: n })]
191
- }),
192
- /* @__PURE__ */ O("dl", {
193
- className: "xrvj5dj xunmzkg x1ghz6dp",
194
- children: a.map((e) => /* @__PURE__ */ k("div", {
195
- className: "x78zum5 x1qughib x1pha0wt x1hnptsi",
196
- children: [/* @__PURE__ */ k("dt", {
197
- className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
198
- children: [/* @__PURE__ */ O(f, {
199
- tone: e.tone,
200
- shape: e.shape
201
- }), e.label]
202
- }), /* @__PURE__ */ O("dd", {
203
- className: "x1ghz6dp xuxw1ft",
204
- children: e.value
205
- })]
206
- }, e.id))
207
- }),
208
- u.map((e) => /* @__PURE__ */ O("span", { children: e }, e))
209
- ]
210
- })
211
- })
212
- ]
213
- });
214
- }
215
- // packages/charts/src/cartesian/bar-data.ts
216
- function I({ composition: e, series: t, categoryIds: n, domain: r }) {
217
- if (e === void 0) return;
218
- if (e.buckets.length !== n.length) return "Composition requires one explicit bucket per category.";
219
- let i = e.annotation;
220
- if (i !== void 0) {
221
- if (!n.includes(i.categoryId) || !Number.isFinite(i.value)) return "A bar annotation requires an existing category and a finite value.";
222
- if (i.value < r[0] || i.value > r[1]) return "A bar annotation must fit the supplied domain.";
223
- }
224
- for (let [n, i] of e.buckets.entries()) if (i.kind !== "gap") {
225
- if (!Number.isFinite(i.total) || i.total < r[0] || i.total > r[1]) return "Context totals must be finite and inside the supplied domain.";
226
- if (i.kind === "parts") {
227
- let e = t.map((e) => e.values[n]);
228
- if (e.some((e) => e != null && e < 0)) return "Composition parts require nonnegative reported values.";
229
- if (e.reduce((e, t) => e + (t ?? 0), 0) > r[1] || i.total < 0) return "Composition parts must fit the supplied positive domain.";
230
- }
231
- }
232
- }
233
- var pe = 6;
234
- function L(e, t) {
235
- return e === null ? !0 : e === void 0 || !Number.isFinite(e) ? !1 : e >= t[0] && e <= t[1];
236
- }
237
- function R({ marker: e, categoryCount: t, domain: n }) {
238
- let r = e.kind === "tick" ? [e.values] : [e.lower, e.upper];
239
- if (r.some((e) => e.length !== t)) return "Every bar marker requires one explicit value per category.";
240
- if (r.some((e) => e.some((e) => !L(e, n)))) return "Bar marker values must be finite and within the supplied domain.";
241
- if (e.kind === "range") for (let [t, n] of e.lower.entries()) {
242
- let r = e.upper[t] ?? null;
243
- if (n === null != (r === null) || n !== null && r !== null && n > r) return "A range marker needs both bounds, with the lower bound at most the upper bound, or neither.";
244
- }
245
- }
246
- function z({ markers: e, annotations: t, emphasizedCategoryIds: n, seriesIds: r, categoryIds: i, domain: a }) {
247
- if (e.length > pe) return `Supply at most ${pe} bar markers.`;
248
- let o = [...e, ...t];
249
- if (new Set(o.map((e) => e.id)).size !== o.length || r.some((e) => o.some((t) => t.id === e))) return "Bar series, markers, and annotations require distinct identifiers.";
250
- for (let t of e) {
251
- if (!r.includes(t.seriesId)) return "Each bar marker must refer to a supplied series.";
252
- let e = R({
253
- marker: t,
254
- categoryCount: i.length,
255
- domain: a
256
- });
257
- if (e !== void 0) return e;
258
- }
259
- for (let e of t) {
260
- let t = e.seriesId === void 0 || r.includes(e.seriesId), n = e.label.trim() !== "";
261
- if (!(i.includes(e.categoryId) && t && n)) return "Each bar annotation needs a label, a supplied category, and a supplied series when it names one.";
262
- }
263
- if (new Set(t.map((e) => JSON.stringify([e.categoryId, e.seriesId ?? null]))).size !== t.length) return "Each bar can hold one annotation.";
264
- if (new Set(n).size !== n.length || n.some((e) => !i.includes(e))) return "Emphasized categories must be unique supplied categories.";
265
- }
266
- function B({ marker: e, index: t, formatValue: n }) {
267
- if (e.kind === "tick") {
268
- let r = e.values[t] ?? null;
269
- return r === null ? "Unavailable" : n(r);
270
- }
271
- let r = e.lower[t] ?? null, i = e.upper[t] ?? null;
272
- return r === null || i === null ? "Unavailable" : `${n(r)} – ${n(i)}`;
273
- }
274
- function me(e, t) {
275
- return e.kind === "tick" ? e.values[t] ?? null : e.upper[t] ?? null;
276
- }
277
- // packages/charts/src/cartesian/bar-overlays.tsx
278
- var V = {
279
- kU5bRw: "x5lxx2x",
280
- kREpy8: "x13efnbd",
281
- $$css: !0
282
- }, H = { stroke: (e) => [
283
- V,
284
- {
285
- kjVXCG: e == null ? e : "x6mkzkt",
286
- $$css: !0
287
- },
288
- { "--x-stroke": e ?? void 0 }
289
- ] }, U = 3, W = 1, he = 1.5, ge = 3, G = 14, _e = 6.5;
290
- function K({ path: e, color: t, width: n }) {
291
- return /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O("path", {
292
- d: e,
293
- strokeWidth: n + 4,
294
- className: "xaep1og x5lxx2x x13efnbd"
295
- }), /* @__PURE__ */ O("path", {
296
- d: e,
297
- strokeWidth: n,
298
- ...C.props(H.stroke(t))
299
- })] });
300
- }
301
- function ve({ marker: e, index: t, span: n, base: r, y: i }) {
302
- let a = e.kind === "tick" ? e.values[t] ?? null : null;
303
- if (a !== null && r !== null && a !== r) return `M${n.x + n.width / 2},${i(r)} V${i(a)}`;
304
- }
305
- function ye({ marker: e, index: t, span: n, y: r }) {
306
- if (e.kind === "tick") {
307
- let i = e.values[t] ?? null;
308
- if (i === null) return;
309
- let a = r(i);
310
- return `M${n.x - ge},${a} H${n.x + n.width + ge}`;
311
- }
312
- let i = e.lower[t] ?? null, a = e.upper[t] ?? null;
313
- if (i === null || a === null) return;
314
- let o = n.x + n.width / 2, s = Math.min(G, n.width * .6) / 2, c = r(i), l = r(a);
315
- return `M${o - s},${l} H${o + s} M${o},${l} V${c} M${o - s},${c} H${o + s}`;
316
- }
317
- function be({ markers: t, categoryIds: n, span: r, barTop: i, y: a, isReceded: o }) {
318
- return /* @__PURE__ */ O("g", { children: t.map((t) => /* @__PURE__ */ O("g", { children: n.map((n, s) => {
319
- let c = r(n, t.seriesId), l = ye({
320
- marker: t,
321
- index: s,
322
- span: c,
323
- y: a
324
- });
325
- if (l === void 0) return null;
326
- let u = e[t.tone ?? "neutral"], d = ve({
327
- marker: t,
328
- index: s,
329
- span: c,
330
- base: i(s, t.seriesId),
331
- y: a
332
- });
333
- return /* @__PURE__ */ k("g", {
334
- ...C.props(y.emphasis, o(n) && y.receded),
335
- children: [d !== void 0 && /* @__PURE__ */ O(K, {
336
- path: d,
337
- color: u,
338
- width: W
339
- }), /* @__PURE__ */ O(K, {
340
- path: l,
341
- color: u,
342
- width: t.kind === "tick" ? U : he
343
- })]
344
- }, n);
345
- }) }, t.id)) });
346
- }
347
- function xe({ annotations: e, left: t, right: n }) {
348
- return /* @__PURE__ */ O("g", {
349
- "aria-hidden": !0,
350
- children: e.map((e) => {
351
- let r = e.label.length * _e / 2, i = e.x - r < t, a = e.x + r > n, o = i ? "start" : a ? "end" : "middle", s = i ? t : a ? n : e.x;
352
- return /* @__PURE__ */ O("text", {
353
- x: s,
354
- y: e.y,
355
- textAnchor: o,
356
- ...C.props(y.label, y.strongLabel, y.haloLabel, y.emphasis, e.isReceded && y.receded),
357
- children: e.label
358
- }, e.id);
359
- })
360
- });
361
- }
362
- // packages/charts/src/cartesian/composition-bars.tsx
363
- var Se = { mark: {
364
- k3nNDw: "x1hj3fc7",
365
- k1ekBW: "xwcsmn1",
366
- kIyJzY: "xtitasy x12w9bfk",
367
- kAMwcw: "x1faw7qm",
368
- $$css: !0
369
- } };
370
- function Ce({ bucket: t, series: r, focusedSeries: i, index: a, x: s, width: c, y: l, isHighlighted: u, highlightedSeriesId: d }) {
371
- let f = i !== void 0, p = i !== void 0 && !r.some((e) => e.id === i.id) ? [...r, i] : r;
372
- function m(e, t) {
373
- let n = l(t), r = l(t + e);
374
- return `translateY(${Math.min(n, r)}px) scaleY(${Math.max(+(e === 0), Math.abs(r - n))})`;
375
- }
376
- return /* @__PURE__ */ k(D, { children: [t.kind !== "gap" && /* @__PURE__ */ O("rect", {
377
- x: s,
378
- y: 0,
379
- width: c,
380
- height: 1,
381
- vectorEffect: "non-scaling-stroke",
382
- fill: e.neutral,
383
- ...C.props(Se.mark, u && y.selected),
384
- style: {
385
- transform: m(t.total, 0),
386
- opacity: f ? .18 : +(t.kind === "total")
387
- }
388
- }), p.map((l, p) => {
389
- let h = l.values[a];
390
- if (h == null) return null;
391
- let g = i?.id === l.id, _ = f ? 0 : r.slice(0, p).reduce((e, t) => e + (t.values[a] ?? 0), 0), v = f ? g : t.kind === "parts", ee = !f && d !== void 0 && d !== l.id;
392
- return /* @__PURE__ */ O("rect", {
393
- x: s,
394
- y: 0,
395
- width: c,
396
- height: 1,
397
- vectorEffect: "non-scaling-stroke",
398
- fill: e[o(l.tone, p)],
399
- stroke: n[o(l.tone, p)],
400
- ...C.props(Se.mark, y.outlined, u && y.selected),
401
- style: {
402
- transform: m(h, _),
403
- opacity: v ? ee ? .3 : 1 : 0
404
- }
405
- }, l.id);
406
- })] });
407
- }
408
- // packages/charts/src/cartesian/reference-lines.tsx
409
- var we = {
410
- kfJifR: "xhr4kjn",
411
- k5rJSQ: "x1dz65qj",
412
- kREpy8: "x13efnbd",
413
- $$css: !0
414
- }, Te = {
415
- kfJifR: "xnpr05h",
416
- kREpy8: "x13efnbd",
417
- $$css: !0
418
- }, Ee = {
419
- line: (e) => [
420
- we,
421
- {
422
- kjVXCG: e == null ? e : "x6mkzkt",
423
- $$css: !0
424
- },
425
- { "--x-stroke": e ?? void 0 }
426
- ],
427
- leader: (e) => [
428
- Te,
429
- {
430
- kjVXCG: e == null ? e : "x6mkzkt",
431
- $$css: !0
432
- },
433
- { "--x-stroke": e ?? void 0 }
434
- ]
435
- }, De = 30, Oe = 13, q = 8, J = 4, Y = 6.5, X = 40, ke = 112, Z = 16, Q = 8;
436
- function Ae({ lines: e, domain: t }) {
437
- if (e.length > Q) return `Supply at most ${Q} reference lines.`;
438
- if (!h(e)) return "Reference lines require unique identifiers.";
439
- for (let n of e) if (!(Number.isFinite(n.value) && n.value >= t[0] && n.value <= t[1]) || n.label.trim() === "") return "Each reference line needs a label and a finite value inside the value domain.";
440
- }
441
- function je(e) {
442
- return e.length > Z ? `${e.slice(0, 15)}…` : e;
443
- }
444
- function Me({ lines: e, formatValue: t }) {
445
- if (e.length === 0) return 0;
446
- let n = Math.max(...e.map((e) => Math.max(je(e.label).length, t(e.value).length)));
447
- return Math.min(ke, Math.max(X, n * Y)) + q;
448
- }
449
- function Ne({ lines: e, y: t, top: n, bottom: r }) {
450
- let i = e.map((e) => ({
451
- line: e,
452
- position: t(e.value)
453
- })).toSorted((e, t) => e.position - t.position), a = b({
454
- positions: i.map((e) => e.position),
455
- gap: De,
456
- start: n + De / 2,
457
- end: r - De / 2
458
- });
459
- return i.map((e, t) => ({
460
- ...e,
461
- center: a[t] ?? e.position
462
- }));
463
- }
464
- function Pe({ lines: t, y: n, left: r, right: i, top: a, bottom: o, formatValue: s }) {
465
- return /* @__PURE__ */ O("g", { children: Ne({
466
- lines: t,
467
- y: n,
468
- top: a,
469
- bottom: o
470
- }).map(({ line: t, position: n, center: a }) => {
471
- let o = e[t.tone ?? "neutral"], c = i + q;
472
- return /* @__PURE__ */ k("g", { children: [
473
- /* @__PURE__ */ O("line", {
474
- x1: r,
475
- x2: i,
476
- y1: n,
477
- y2: n,
478
- ...C.props(Ee.line(o))
479
- }),
480
- /* @__PURE__ */ O("path", {
481
- d: `M${i},${n} L${i + J},${a} H${i + J + 1}`,
482
- fill: "none",
483
- ...C.props(Ee.leader(o))
484
- }),
485
- /* @__PURE__ */ O("text", {
486
- x: c,
487
- y: a - 2,
488
- ...C.props(y.label, y.strongLabel),
489
- children: je(t.label)
490
- }),
491
- /* @__PURE__ */ O("text", {
492
- x: c,
493
- y: a + Oe - 2,
494
- ...C.props(y.label),
495
- children: s(t.value)
496
- })
497
- ] }, t.id);
498
- }) });
499
- }
500
- // packages/charts/src/cartesian/bar-chart.tsx
501
- var Fe = {
502
- plot: {
503
- kqGvvJ: "x1we84gm",
504
- $$css: !0
505
- },
506
- mutedMark: {
507
- kSiTet: "xuzhngd",
508
- $$css: !0
509
- }
510
- }, Ie = 200, Le = 12, Re = 30, ze = 8, Be = 14;
511
- function Ve({ title: e, description: t, report: n, series: r, layoutSeries: i, markerLegend: a = [], notes: s, children: l, inspectionId: u, label: d, detail: f, summary: p, rows: h = [], x: g = 0, width: _ = 0, offset: v, source: y, data: ee, isLoading: b = !1 }) {
512
- let x = r.map((e, t) => ({
513
- id: e.id,
514
- label: e.label,
515
- tone: o(e.tone, t)
516
- })), S = i?.map((e, t) => ({
517
- id: e.id,
518
- label: e.label,
519
- tone: o(e.tone, t)
520
- })), C = b && r.length === 0 && n?.seriesValues === void 0;
521
- return /* @__PURE__ */ k(m, {
522
- title: /* @__PURE__ */ O(ue, {
523
- title: e,
524
- detail: f
525
- }),
526
- description: t,
527
- report: n,
528
- series: x,
529
- children: [
530
- ee !== void 0 && /* @__PURE__ */ O(c, { ...ee }),
531
- C ? /* @__PURE__ */ O(le, {}) : /* @__PURE__ */ O(fe, {
532
- id: u,
533
- label: d,
534
- summary: p,
535
- legend: [...x, ...a],
536
- hasSeriesSummary: n?.seriesValues !== void 0,
537
- layoutLegend: S === void 0 ? void 0 : [...S, ...a],
538
- rows: h,
539
- notes: s,
540
- x: g,
541
- width: _,
542
- offset: v,
543
- source: y
544
- }),
545
- l
546
- ]
547
- });
548
- }
549
- function He({ title: e = "Loading chart", description: n, report: r, series: i = [], height: a = Ie }) {
550
- let o = Ue(a), s = T();
551
- return o === void 0 ? /* @__PURE__ */ O("div", {
552
- "aria-hidden": !0,
553
- inert: !0,
554
- children: /* @__PURE__ */ O(Ve, {
555
- title: e,
556
- description: n,
557
- report: r,
558
- series: i,
559
- inspectionId: s,
560
- isLoading: !0,
561
- children: /* @__PURE__ */ O("div", {
562
- ...C.props(y.plot, Fe.plot),
563
- children: /* @__PURE__ */ O(t, { height: a })
564
- })
565
- })
566
- }) : /* @__PURE__ */ O(_, {
567
- title: e,
568
- description: n,
569
- report: r,
570
- message: o
571
- });
572
- }
573
- function Ue(e) {
574
- if (!Number.isFinite(e) || e < 48) return "Chart height must be at least 48 pixels.";
575
- }
576
- function We({ categories: e, series: t, domain: n, mode: r }) {
577
- if (e.length > a.items || t.length > a.series) return `Choose a window with at most ${a.items} categories and ${a.series} series.`;
578
- if (!g(n) || n[0] > 0 || n[1] < 0) return "The bar domain must be finite, increasing, and include zero.";
579
- if (!h(e) || !h(t)) return "Bar categories and series require unique identifiers.";
580
- for (let i of t) {
581
- if (i.values.length !== e.length) return "Every series requires one explicit value per category.";
582
- for (let e of i.values) {
583
- if (e !== null && (!Number.isFinite(e) || e < n[0] || e > n[1])) return "Bar values must be finite and within the supplied domain.";
584
- if (r === "stacked" && (e === null || e < 0)) return "Stacked bars require present nonnegative values.";
585
- }
586
- }
587
- if (r === "stacked" && e.some((e, r) => t.reduce((e, t) => e + (t.values[r] ?? 0), 0) > n[1])) return "Stacked bar totals must fit the supplied domain.";
588
- }
589
- var Ge = {
590
- "x-default-marker": "x-default-marker",
591
- $$css: !0
592
- };
593
- function Ke({ title: t, description: r, report: i, categories: a, series: s, domain: c, mode: l = "grouped", formatValue: d, formatTick: f = d, highlightedSeriesId: p, selection: m, height: h = Ie, composition: g, referenceLines: v = [], markers: b = [], annotations: x = [], emphasizedCategoryIds: S = [] }) {
594
- let w = g?.focusedSeries, ne = T(), E = w === void 0 ? void 0 : We({
595
- categories: a,
596
- series: [w],
597
- domain: c,
598
- mode: "grouped"
599
- }), D = We({
600
- categories: a,
601
- series: s,
602
- domain: c,
603
- mode: l
604
- }) ?? E, A = a.map((e) => e.id), M = z({
605
- markers: b,
606
- annotations: x,
607
- emphasizedCategoryIds: S,
608
- seriesIds: [...s, ...w === void 0 ? [] : [w]].map((e) => e.id),
609
- categoryIds: A,
610
- domain: c
611
- }) ?? Ae({
612
- lines: v,
613
- domain: c
614
- }), ae = I({
615
- composition: g,
616
- series: s,
617
- categoryIds: A,
618
- domain: c
619
- }) ?? M ?? Ue(h), P = D ?? ae, F = g === void 0 ? void 0 : {
620
- id: ne,
621
- label: g.contextLabel,
622
- tone: "neutral",
623
- values: g.buckets.map((e) => e.kind === "gap" ? null : e.total)
624
- }, se = F === void 0 ? s : [
625
- F,
626
- ...s,
627
- ...w === void 0 || s.some((e) => e.id === w.id) ? [] : [w]
628
- ], ce = w !== void 0 && F !== void 0 ? [w, F] : s, { ref: le, width: ue, element: fe } = ee(), pe = T(), [L, R] = re(), [V, H] = re();
629
- te(() => {
630
- function e(e) {
631
- e.target instanceof Node && fe?.contains(e.target) !== !0 && R(void 0);
632
- }
633
- return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
634
- }, [fe]);
635
- let U = a.findIndex((e) => e.id === L?.id), W = a[U], he = a[a.findIndex((e) => e.id === m?.selectedId)], ge = a.find((e) => e.id === V) ?? he ?? a[0], G = W, _e = U, K = g?.buckets[_e], ve = w !== void 0 && F !== void 0 ? [w, F] : F === void 0 || K?.kind === "parts" ? s : [], ye = K === void 0 ? void 0 : K.kind === "gap" ? "No reported value" : d(K.total);
636
- if (P !== void 0) return /* @__PURE__ */ O(_, {
637
- title: t,
638
- description: r,
639
- report: i,
640
- message: P
641
- });
642
- let Se = ve.map((e, t) => {
643
- let n = e.values[_e];
644
- return {
645
- id: e.id,
646
- label: e.label,
647
- tone: o(e.tone, t),
648
- value: n == null ? "Unavailable" : d(n)
649
- };
650
- }), we = b.map((e) => ({
651
- id: e.id,
652
- label: e.label,
653
- tone: e.tone ?? "neutral",
654
- shape: e.kind
655
- })), Te = b.map((e) => ({
656
- id: e.id,
657
- label: e.label,
658
- tone: e.tone ?? "neutral",
659
- shape: e.kind,
660
- value: B({
661
- marker: e,
662
- index: _e,
663
- formatValue: d
664
- })
665
- })), Ee = v.map((e) => ({
666
- id: e.id,
667
- label: e.label,
668
- tone: e.tone ?? "neutral",
669
- shape: "dashed",
670
- value: d(e.value)
671
- })), De = G === void 0 ? [] : [
672
- ...Se,
673
- ...Te,
674
- ...Ee
675
- ], Oe = x.filter((e) => e.categoryId === G?.id).map((e) => e.label), q = x.length > 0 ? Re : Le, J = h - 28, Y = j({
676
- domain: [...c],
677
- range: [J, q]
678
- }), X = Math.max(44, ...Y.ticks(3).map((e) => f(e).length * 7 + 12)), ke = Me({
679
- lines: v,
680
- formatValue: f
681
- }), Z = Math.max(X + 1, ue - 16 - ke), Q = ie({
682
- domain: a.map((e) => e.id),
683
- range: [X, Z],
684
- padding: .3
685
- }), je = ie({
686
- domain: s.map((e) => e.id),
687
- range: [0, Q.bandwidth()],
688
- padding: .08
689
- }), Ne = Math.min(120, Math.max(40, ...a.map((e) => (e.axisLabel ?? e.label).length * 7))), He = Math.max(1, Math.ceil((Ne + 16) / Q.step())), Ke = l === "stacked" || g !== void 0;
690
- function Je(e, t) {
691
- let n = Q(e) ?? X;
692
- return Ke ? {
693
- x: n,
694
- width: Q.bandwidth()
695
- } : {
696
- x: n + (je(t) ?? 0),
697
- width: je.bandwidth()
698
- };
699
- }
700
- function Ye(e, t) {
701
- if (!Ke) return s.find((e) => e.id === t)?.values[e] ?? null;
702
- let n = s.flatMap((t) => [t.values[e] ?? null].filter((e) => e !== null));
703
- return n.length === 0 ? null : n.reduce((e, t) => e + t, 0);
704
- }
705
- function Xe(e) {
706
- let t = S.includes(e);
707
- return S.length > 0 && !t && W?.id !== e;
708
- }
709
- function Ze(e, t) {
710
- let n = (t === void 0 ? s : s.filter((e) => e.id === t)).flatMap((t) => [t.values[e] ?? null].filter((e) => e !== null)), r = Ke ? n.reduce((e, t) => e + Math.max(0, t), 0) : Math.max(0, ...n), i = g?.buckets[e], a = i === void 0 || i.kind === "gap" ? 0 : i.total, o = b.filter((e) => t === void 0 || e.seriesId === t).flatMap((t) => [me(t, e)].filter((e) => e !== null));
711
- return Math.max(0, r, a, ...o);
712
- }
713
- let Qe = x.map((e) => {
714
- let t = Ze(A.indexOf(e.categoryId), e.seriesId), n = e.seriesId === void 0 ? {
715
- x: Q(e.categoryId) ?? X,
716
- width: Q.bandwidth()
717
- } : Je(e.categoryId, e.seriesId);
718
- return {
719
- id: e.id,
720
- label: e.label,
721
- x: n.x + n.width / 2,
722
- y: Math.max(Be, Y(t) - ze),
723
- isReceded: Xe(e.categoryId)
724
- };
725
- }), $e = Math.max(1, Math.floor((Q.step() * He - 16) / 7));
726
- function et(e) {
727
- let t = e.currentTarget.getBoundingClientRect(), n = (e.clientX - t.left) / t.width * ue, r = Math.floor((n - X) / Q.step()), i = a[Math.max(0, Math.min(a.length - 1, r))];
728
- i !== void 0 && (e.type === "pointerdown" && H(i.id), R({
729
- id: i.id,
730
- source: "pointer"
731
- }));
732
- }
733
- return /* @__PURE__ */ O(Ve, {
734
- title: t,
735
- description: r,
736
- report: i,
737
- series: ce,
738
- layoutSeries: s,
739
- markerLegend: we,
740
- notes: Oe,
741
- inspectionId: pe,
742
- label: G?.label,
743
- detail: G === void 0 ? void 0 : [G.axisLabel ?? G.label, ye].filter(Boolean).join(" · "),
744
- summary: ye,
745
- rows: De,
746
- x: (Q(G?.id ?? "") ?? X) + Q.bandwidth() / 2,
747
- width: ue,
748
- offset: Q.bandwidth() / 2 + 8,
749
- source: L?.source,
750
- data: {
751
- label: `${t} observations`,
752
- columns: [{
753
- id: "category",
754
- label: "Category"
755
- }, {
756
- id: "value",
757
- label: "Value"
758
- }],
759
- rows: [...a.map((e, t) => ({
760
- id: e.id,
761
- values: [e.label, [
762
- qe(se, t, d),
763
- ...b.map((e) => `${e.label}: ${B({
764
- marker: e,
765
- index: t,
766
- formatValue: d
767
- })}`),
768
- ...x.filter((t) => t.categoryId === e.id).map((e) => e.label)
769
- ].join(" · ")]
770
- })), ...v.map((e) => ({
771
- id: `reference:${e.id}`,
772
- values: [e.label, d(e.value)]
773
- }))]
774
- },
775
- children: /* @__PURE__ */ O("div", {
776
- ref: le,
777
- ...C.props(y.plot, Fe.plot),
778
- children: a.length === 0 || s.length === 0 && g === void 0 ? /* @__PURE__ */ O("p", {
779
- className: "x153jb6y x1ghz6dp xy8obcc",
780
- children: "No categories"
781
- }) : /* @__PURE__ */ k(u, {
782
- role: "img",
783
- "aria-label": `${t}. Use arrow keys to inspect categories.${m === void 0 ? "" : " Press Enter to select."}`,
784
- "aria-describedby": pe,
785
- tabIndex: 0,
786
- viewBox: `0 0 ${ue} ${h}`,
787
- height: h,
788
- controls: {
789
- items: a,
790
- cursor: ge?.id,
791
- inspected: W?.id,
792
- selected: he?.id,
793
- readout: de({
794
- label: W?.label,
795
- summary: ye,
796
- rows: De,
797
- notes: Oe
798
- }),
799
- onInspect: (e) => {
800
- H(e), R({
801
- id: e,
802
- source: "keyboard"
803
- });
804
- },
805
- onDismiss: () => R(void 0),
806
- onSelect: m?.onSelect
807
- },
808
- onFocus: (e) => {
809
- if (e.currentTarget.matches(":focus-visible")) {
810
- let e = he ?? a[0];
811
- H(e?.id), R(e === void 0 ? void 0 : {
812
- id: e.id,
813
- source: "keyboard"
814
- });
815
- }
816
- },
817
- onPointerMove: (e) => {
818
- e.pointerType === "mouse" && et(e);
819
- },
820
- onPointerDown: et,
821
- onPointerLeave: (e) => {
822
- e.pointerType === "mouse" && L?.source === "pointer" && R(void 0);
823
- },
824
- onBlur: () => R(void 0),
825
- onClick: () => {
826
- W !== void 0 && m?.onSelect(W.id);
827
- },
828
- ...C.props(y.svg, y.inspectable, Ge),
829
- children: [
830
- W !== void 0 && /* @__PURE__ */ O("rect", {
831
- x: (Q(W.id) ?? X) - (Q.step() - Q.bandwidth()) / 2,
832
- y: q,
833
- width: Q.step(),
834
- height: J - q,
835
- className: "x2wnxhi"
836
- }),
837
- Y.ticks(3).map((e) => /* @__PURE__ */ k("g", { children: [/* @__PURE__ */ O("line", {
838
- x1: X,
839
- x2: Z,
840
- y1: Y(e),
841
- y2: Y(e),
842
- ...C.props(e === 0 ? y.baseline : y.grid)
843
- }), /* @__PURE__ */ O("text", {
844
- x: X - 8,
845
- y: Y(e),
846
- textAnchor: "end",
847
- dominantBaseline: "middle",
848
- ...C.props(y.label, y.tick),
849
- children: f(e)
850
- })] }, e)),
851
- g?.annotation !== void 0 && a.some((e) => e.id === g.annotation?.categoryId) && /* @__PURE__ */ O("text", {
852
- x: Q(g.annotation.categoryId),
853
- y: Math.max(q, Y(g.annotation.value) - 8),
854
- ...C.props(y.label),
855
- children: g.annotation.label
856
- }),
857
- a.map((t, r) => {
858
- let i = t.axisLabel ?? t.label, a = g?.buckets[r];
859
- return /* @__PURE__ */ k("g", { children: [/* @__PURE__ */ O("g", {
860
- ...C.props(y.emphasis, Xe(t.id) && y.receded),
861
- children: a === void 0 ? s.map((i, a) => {
862
- let c = i.values[r];
863
- if (c == null) return null;
864
- let u = l === "stacked" ? s.slice(0, a).reduce((e, t) => e + (t.values[r] ?? 0), 0) : 0, d = Y(u), f = Y(u + c), h = m?.selectedId === t.id || W?.id === t.id;
865
- return /* @__PURE__ */ O(N, {
866
- x: (Q(t.id) ?? X) + (l === "stacked" ? 0 : je(i.id) ?? 0),
867
- y: Math.min(d, f),
868
- width: l === "stacked" ? Q.bandwidth() : je.bandwidth(),
869
- height: Math.max(+(c === 0), Math.abs(f - d)),
870
- fill: e[o(i.tone, a)],
871
- stroke: n[o(i.tone, a)],
872
- ...C.props(y.outlined, h && y.selected, p !== void 0 && p !== i.id && Fe.mutedMark)
873
- }, i.id);
874
- }) : /* @__PURE__ */ O(Ce, {
875
- bucket: a,
876
- series: s,
877
- focusedSeries: w,
878
- index: r,
879
- x: Q(t.id) ?? X,
880
- width: Q.bandwidth(),
881
- y: Y,
882
- isHighlighted: m?.selectedId === t.id || W?.id === t.id,
883
- highlightedSeriesId: p
884
- })
885
- }), r % He === 0 && /* @__PURE__ */ O("text", {
886
- x: (Q(t.id) ?? X) + Q.bandwidth() / 2,
887
- y: h - 4,
888
- textAnchor: "middle",
889
- ...C.props(y.label, y.tick),
890
- children: i.length > $e ? `${i.slice(0, $e - 1)}…` : i
891
- })] }, t.id);
892
- }),
893
- /* @__PURE__ */ O(Pe, {
894
- lines: v,
895
- y: Y,
896
- left: X,
897
- right: Z,
898
- top: q,
899
- bottom: J,
900
- formatValue: f
901
- }),
902
- /* @__PURE__ */ O(be, {
903
- markers: b,
904
- categoryIds: A,
905
- span: Je,
906
- barTop: Ye,
907
- y: Y,
908
- isReceded: Xe
909
- }),
910
- /* @__PURE__ */ O(xe, {
911
- annotations: Qe,
912
- left: X,
913
- right: Z
914
- }),
915
- ge !== void 0 && /* @__PURE__ */ O(oe, {
916
- x: (Q(ge.id) ?? X) + Q.bandwidth() / 2,
917
- top: q,
918
- bottom: J,
919
- width: Math.max(8, Q.bandwidth())
920
- })
921
- ]
922
- })
923
- })
924
- });
925
- }
926
- function qe(e, t, n) {
927
- return e.map((e) => {
928
- let r = e.values[t];
929
- return `${e.label}: ${r == null ? "Unavailable" : n(r)}`;
930
- }).join(" · ");
931
- }
932
- // packages/charts/src/cartesian/breakdown-bar.tsx
933
- var Je = {
934
- kzqmXN: "x5lhr3w",
935
- kGVxlE: "x1iotiob",
936
- kZKoxP: "x5yr21d",
937
- $$css: !0
938
- }, Ye = { segment: (e, t, n) => [
939
- Je,
940
- {
941
- kWkggS: t == null ? t : "xl8spv7",
942
- $$css: !0
943
- },
944
- {
945
- "--x-width": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(`${e}%`),
946
- "--x-backgroundColor": t ?? void 0,
947
- "--x-boxShadow": `inset 0 0 0 1px ${n}` == null ? void 0 : `inset 0 0 0 1px ${n}`
948
- }
949
- ] };
950
- function Xe({ title: t, report: r, description: a, items: c, total: l, formatValue: u, selection: d }) {
951
- let f = i(c), p = c.reduce((e, t) => e + (t.value ?? 0), 0), h = 2 ** -52 * Math.max(p, l, 1) * c.length;
952
- return f === void 0 ? !Number.isFinite(l) || l < 0 || p - l > h ? /* @__PURE__ */ O(_, {
953
- title: t,
954
- report: r,
955
- description: a,
956
- message: "The total must be finite and at least the sum of recorded values."
957
- }) : /* @__PURE__ */ O(m, {
958
- title: t,
959
- report: r,
960
- description: a,
961
- children: c.length === 0 ? /* @__PURE__ */ O("p", {
962
- className: "x153jb6y x1ghz6dp xy8obcc",
963
- children: "No values"
964
- }) : /* @__PURE__ */ k(D, { children: [
965
- /* @__PURE__ */ O("div", {
966
- "aria-hidden": !0,
967
- className: "x78zum5 x170jfvy xb3r6kr x1r7kqkb xmkeg23 x1y0btm7 x1ey3b81 x1jfksii",
968
- children: c.map((t, r) => t.value === null ? null : /* @__PURE__ */ O("span", { ...C.props(Ye.segment(l === 0 ? 0 : t.value / l * 100, e[o(t.tone, r)], n[o(t.tone, r)])) }, t.id))
969
- }),
970
- /* @__PURE__ */ O(s, {
971
- items: c.map((e, t) => ({
972
- id: e.id,
973
- label: e.label,
974
- valueLabel: e.value === null ? "Unavailable" : u(e.value),
975
- tone: o(e.tone, t)
976
- })),
977
- selection: d
978
- }),
979
- l - p > h && /* @__PURE__ */ k("p", {
980
- className: "x153jb6y x1ghz6dp xy8obcc",
981
- children: [
982
- "Unassigned portion: ",
983
- u(l - p),
984
- " of ",
985
- u(l)
986
- ]
987
- })
988
- ] })
989
- }) : /* @__PURE__ */ O(_, {
990
- title: t,
991
- report: r,
992
- description: a,
993
- message: f
994
- });
995
- }
996
- // packages/charts/src/cartesian/bridge-data.ts
997
- function Ze(e) {
998
- return e.kind !== "change" || e.value === null ? "neutral" : e.value < 0 ? "negative" : "positive";
999
- }
1000
- function Qe(e) {
1001
- let t = e.map((e) => e.kind === "total" ? 0 : e.value);
1002
- return e[0]?.kind !== "start" || t.includes(null) ? null : t.reduce((e, t) => e + (t ?? 0), 0);
1003
- }
1004
- function $e({ step: e, before: t, after: n }) {
1005
- let r = e.tone ?? Ze(e);
1006
- switch (e.kind) {
1007
- case "start": return {
1008
- step: e,
1009
- from: 0,
1010
- to: e.value,
1011
- tone: r
1012
- };
1013
- case "total": return {
1014
- step: e,
1015
- from: n === null ? null : 0,
1016
- to: n,
1017
- tone: r
1018
- };
1019
- case "change": return {
1020
- step: e,
1021
- from: t,
1022
- to: n,
1023
- tone: r
1024
- };
1025
- }
1026
- }
1027
- function et(e) {
1028
- return e.map((t, n) => $e({
1029
- step: t,
1030
- before: Qe(e.slice(0, n)),
1031
- after: Qe(e.slice(0, n + 1))
1032
- }));
1033
- }
1034
- function tt(e) {
1035
- let t = e.flatMap((e) => [e.from, e.to].filter((e) => e !== null)), n = Math.min(0, ...t), r = Math.max(0, ...t);
1036
- return n === r ? [n, n + 1] : [n, r];
1037
- }
1038
- function nt({ steps: e, domain: t }) {
1039
- if (e.length > a.items) return `Choose a bridge with at most ${a.items} steps.`;
1040
- if (!h(e)) return "Bridge steps require unique identifiers.";
1041
- if (e.length > 0 && e[0]?.kind !== "start") return "A bridge begins with one start step.";
1042
- if (e.filter((e) => e.kind === "start").length > 1) return "A bridge has exactly one start step.";
1043
- if (e.some((e) => {
1044
- let t = e.kind === "total" ? null : e.value;
1045
- return t !== null && !Number.isFinite(t);
1046
- })) return "Bridge values must be finite numbers or explicit missing changes.";
1047
- let n = tt(et(e));
1048
- if (t === void 0) return Number.isFinite(n[0]) && Number.isFinite(n[1]) ? void 0 : "Running totals must stay finite.";
1049
- let r = t[0] <= n[0] && t[1] >= n[1];
1050
- if (!g(t) || !r) return "The bridge domain must be finite, increasing, and contain zero and every running total.";
1051
- }
1052
- // packages/charts/src/cartesian/bridge-chart.tsx
1053
- var rt = {
1054
- kfJifR: "xnpr05h",
1055
- $$css: !0
1056
- }, it = {
1057
- plot: {
1058
- kqGvvJ: "x1we84gm",
1059
- $$css: !0
1060
- },
1061
- bar: (e, t) => [
1062
- rt,
1063
- {
1064
- kDwRjp: e == null ? e : "x19zyb68",
1065
- kjVXCG: t == null ? t : "x6mkzkt",
1066
- $$css: !0
1067
- },
1068
- {
1069
- "--x-fill": e ?? void 0,
1070
- "--x-stroke": t ?? void 0
1071
- }
1072
- ]
1073
- }, at = 240, ot = 24, st = 28, ct = 6, lt = 14, ut = 12, dt = 7, ft = {
1074
- start: y.strongLabel,
1075
- change: void 0,
1076
- total: y.strongLabel
1077
- };
1078
- function pt(e) {
1079
- return (t) => t === 0 ? e(0) : `${t > 0 ? "+" : "−"}${e(Math.abs(t))}`;
1080
- }
1081
- function mt({ level: e, formatValue: t, formatChange: n }) {
1082
- return e.step.kind === "change" && e.step.value !== null ? n(e.step.value) : e.to === null ? "—" : t(e.to);
1083
- }
1084
- function ht({ level: e, formatValue: t, formatChange: n }) {
1085
- return e.step.kind === "change" ? e.step.value === null ? "Unavailable" : n(e.step.value) : e.to === null ? "Unavailable" : t(e.to);
1086
- }
1087
- function gt({ level: e, formatValue: t }) {
1088
- return e.from === null || e.to === null ? "Unavailable" : `${t(e.from)} → ${t(e.to)}`;
1089
- }
1090
- var _t = {
1091
- "x-default-marker": "x-default-marker",
1092
- $$css: !0
1093
- };
1094
- function vt({ title: e, description: t, report: n, steps: r, formatValue: i, formatChange: a = pt(i), formatTick: o = i, domain: s, referenceLines: l = [], selection: d, height: f = at }) {
1095
- let { ref: p, width: h, element: g } = ee(), v = T(), [b, x] = re(), [S, w] = re();
1096
- te(() => {
1097
- function e(e) {
1098
- e.target instanceof Node && g?.contains(e.target) !== !0 && x(void 0);
1099
- }
1100
- return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
1101
- }, [g]);
1102
- let ne = !Number.isFinite(f) || f < 96 ? "Chart height must be at least 96 pixels." : void 0, E = et(r), D = s ?? tt(E), A = ne ?? nt({
1103
- steps: r,
1104
- domain: s
1105
- }) ?? Ae({
1106
- lines: l,
1107
- domain: D
1108
- });
1109
- if (A !== void 0) return /* @__PURE__ */ O(_, {
1110
- title: e,
1111
- description: t,
1112
- report: n,
1113
- message: A
1114
- });
1115
- let M = E.find((e) => e.step.id === b?.id), ae = E.find((e) => e.step.id === d?.selectedId), N = E.find((e) => e.step.id === S) ?? ae ?? E[0], P = M === void 0 ? void 0 : ht({
1116
- level: M,
1117
- formatValue: i,
1118
- formatChange: a
1119
- }), F = M?.step.kind === "change" ? [{
1120
- id: "running",
1121
- label: "Running total",
1122
- tone: "neutral",
1123
- value: gt({
1124
- level: M,
1125
- formatValue: i
1126
- })
1127
- }] : [], se = l.map((e) => ({
1128
- id: e.id,
1129
- label: e.label,
1130
- tone: e.tone ?? "neutral",
1131
- shape: "dashed",
1132
- value: i(e.value)
1133
- })), ce = M === void 0 ? [] : [...F, ...se], le = f - st, I = j({
1134
- domain: [...D],
1135
- range: [le, ot]
1136
- }), pe = I.ticks(4), L = Math.max(44, ...pe.map((e) => o(e).length * dt + 12)), R = Me({
1137
- lines: l,
1138
- formatValue: o
1139
- }), z = Math.max(L + 1, h - 16 - R), B = ie({
1140
- domain: E.map((e) => e.step.id),
1141
- range: [L, z],
1142
- padding: .28
1143
- }), me = E.map((e) => ({
1144
- id: e.step.id,
1145
- label: e.step.label
1146
- })), V = Math.max(1, Math.floor((B.step() - 8) / dt));
1147
- function H(e) {
1148
- let t = e.currentTarget.getBoundingClientRect(), n = (e.clientX - t.left) / t.width * h, r = Math.floor((n - L) / B.step()), i = E[Math.max(0, Math.min(E.length - 1, r))];
1149
- i !== void 0 && (e.type === "pointerdown" && w(i.step.id), x({
1150
- id: i.step.id,
1151
- source: "pointer"
1152
- }));
1153
- }
1154
- function U(e) {
1155
- let t = e.axisLabel ?? e.label;
1156
- return t.length > V ? `${t.slice(0, V - 1)}…` : t;
1157
- }
1158
- return /* @__PURE__ */ k(m, {
1159
- title: /* @__PURE__ */ O(ue, {
1160
- title: e,
1161
- detail: M === void 0 ? void 0 : `${M.step.label} · ${P ?? ""}`
1162
- }),
1163
- description: t,
1164
- report: n,
1165
- children: [
1166
- /* @__PURE__ */ O(c, {
1167
- label: `${e} steps`,
1168
- columns: [
1169
- {
1170
- id: "step",
1171
- label: "Step"
1172
- },
1173
- {
1174
- id: "value",
1175
- label: "Value"
1176
- },
1177
- {
1178
- id: "running",
1179
- label: "Running total"
1180
- }
1181
- ],
1182
- rows: [...E.map((e) => ({
1183
- id: e.step.id,
1184
- values: [
1185
- e.step.label,
1186
- ht({
1187
- level: e,
1188
- formatValue: i,
1189
- formatChange: a
1190
- }),
1191
- e.step.kind === "change" ? gt({
1192
- level: e,
1193
- formatValue: i
1194
- }) : ht({
1195
- level: e,
1196
- formatValue: i,
1197
- formatChange: a
1198
- })
1199
- ]
1200
- })), ...l.map((e) => ({
1201
- id: `reference:${e.id}`,
1202
- values: [
1203
- e.label,
1204
- i(e.value),
1205
- ""
1206
- ]
1207
- }))]
1208
- }),
1209
- /* @__PURE__ */ O(fe, {
1210
- id: v,
1211
- label: M?.step.label,
1212
- summary: P,
1213
- legend: [],
1214
- hasLegend: !1,
1215
- rows: ce,
1216
- x: (B(M?.step.id ?? "") ?? L) + B.bandwidth() / 2,
1217
- width: h,
1218
- offset: B.bandwidth() / 2 + 8,
1219
- source: b?.source
1220
- }),
1221
- /* @__PURE__ */ O("div", {
1222
- ref: p,
1223
- ...C.props(y.plot, it.plot),
1224
- children: E.length === 0 ? /* @__PURE__ */ O("p", {
1225
- className: "x153jb6y x1ghz6dp xy8obcc",
1226
- children: "No steps"
1227
- }) : /* @__PURE__ */ k(u, {
1228
- role: "img",
1229
- "aria-label": `${e}. Use arrow keys to inspect steps.${d === void 0 ? "" : " Press Enter to select."}`,
1230
- "aria-describedby": v,
1231
- tabIndex: 0,
1232
- viewBox: `0 0 ${h} ${f}`,
1233
- height: f,
1234
- controls: {
1235
- items: me,
1236
- cursor: N?.step.id,
1237
- inspected: M?.step.id,
1238
- selected: ae?.step.id,
1239
- readout: de({
1240
- label: M?.step.label,
1241
- summary: P,
1242
- rows: ce
1243
- }),
1244
- onInspect: (e) => {
1245
- w(e), x({
1246
- id: e,
1247
- source: "keyboard"
1248
- });
1249
- },
1250
- onDismiss: () => x(void 0),
1251
- onSelect: d?.onSelect
1252
- },
1253
- onFocus: (e) => {
1254
- if (e.currentTarget.matches(":focus-visible")) {
1255
- let e = ae ?? E[0];
1256
- w(e?.step.id), x(e === void 0 ? void 0 : {
1257
- id: e.step.id,
1258
- source: "keyboard"
1259
- });
1260
- }
1261
- },
1262
- onPointerMove: (e) => {
1263
- e.pointerType === "mouse" && H(e);
1264
- },
1265
- onPointerDown: H,
1266
- onPointerLeave: (e) => {
1267
- e.pointerType === "mouse" && b?.source === "pointer" && x(void 0);
1268
- },
1269
- onBlur: () => x(void 0),
1270
- onClick: () => {
1271
- M !== void 0 && d?.onSelect(M.step.id);
1272
- },
1273
- ...C.props(y.svg, y.inspectable, _t),
1274
- children: [
1275
- M !== void 0 && /* @__PURE__ */ O("rect", {
1276
- x: (B(M.step.id) ?? L) - (B.step() - B.bandwidth()) / 2,
1277
- y: ot,
1278
- width: B.step(),
1279
- height: le - ot,
1280
- className: "x2wnxhi"
1281
- }),
1282
- pe.map((e) => /* @__PURE__ */ k("g", { children: [/* @__PURE__ */ O("line", {
1283
- x1: L,
1284
- x2: z,
1285
- y1: I(e),
1286
- y2: I(e),
1287
- ...C.props(e === 0 ? y.baseline : y.grid)
1288
- }), /* @__PURE__ */ O("text", {
1289
- x: L - 8,
1290
- y: I(e),
1291
- textAnchor: "end",
1292
- dominantBaseline: "middle",
1293
- ...C.props(y.label, y.tick),
1294
- children: o(e)
1295
- })] }, e)),
1296
- E.map((e, t) => {
1297
- let n = E[t + 1], r = B(e.step.id) ?? L;
1298
- return n === void 0 || e.to === null || n.from === null ? null : /* @__PURE__ */ O("line", {
1299
- x1: r + B.bandwidth(),
1300
- x2: B(n.step.id) ?? r,
1301
- y1: I(e.to),
1302
- y2: I(e.to),
1303
- className: "x1crw9hw xnpr05h x1ypbokr x13efnbd"
1304
- }, `connector:${e.step.id}`);
1305
- }),
1306
- E.map((e) => /* @__PURE__ */ O(yt, {
1307
- level: e,
1308
- x: B(e.step.id) ?? L,
1309
- width: B.bandwidth(),
1310
- y: I,
1311
- bottom: le,
1312
- height: f,
1313
- label: mt({
1314
- level: e,
1315
- formatValue: i,
1316
- formatChange: a
1317
- }),
1318
- axisLabel: U(e.step),
1319
- isHighlighted: M?.step.id === e.step.id || ae?.step.id === e.step.id
1320
- }, e.step.id)),
1321
- /* @__PURE__ */ O(Pe, {
1322
- lines: l,
1323
- y: I,
1324
- left: L,
1325
- right: z,
1326
- top: ot,
1327
- bottom: le,
1328
- formatValue: o
1329
- }),
1330
- N !== void 0 && /* @__PURE__ */ O(oe, {
1331
- x: (B(N.step.id) ?? L) + B.bandwidth() / 2,
1332
- top: ot,
1333
- bottom: le,
1334
- width: Math.max(8, B.bandwidth())
1335
- })
1336
- ]
1337
- })
1338
- })
1339
- ]
1340
- });
1341
- }
1342
- function yt({ level: t, x: r, width: i, y: a, bottom: o, height: s, label: c, axisLabel: l, isHighlighted: u }) {
1343
- let d = r + i / 2, f = /* @__PURE__ */ O("text", {
1344
- x: d,
1345
- y: s - 4,
1346
- textAnchor: "middle",
1347
- ...C.props(y.label, y.tick),
1348
- children: l
1349
- });
1350
- if (t.from === null || t.to === null) {
1351
- let e = t.from ?? 0, n = Math.min(o - ut, a(e) - ut / 2);
1352
- return /* @__PURE__ */ k("g", { children: [
1353
- /* @__PURE__ */ O("rect", {
1354
- x: r,
1355
- y: n,
1356
- width: i,
1357
- height: ut,
1358
- className: "xbh8q5q x1crw9hw xnpr05h x1ypbokr x13efnbd"
1359
- }),
1360
- /* @__PURE__ */ O("text", {
1361
- x: d,
1362
- y: n - ct,
1363
- textAnchor: "middle",
1364
- ...C.props(y.label),
1365
- children: c
1366
- }),
1367
- f
1368
- ] });
1369
- }
1370
- let p = Math.max(t.from, t.to), m = Math.min(t.from, t.to), h = a(p), g = Math.max(1, a(m) - h), _ = p <= 0 && m < 0 ? a(m) + lt : h - ct;
1371
- return /* @__PURE__ */ k("g", { children: [
1372
- /* @__PURE__ */ O("rect", {
1373
- x: r,
1374
- y: h,
1375
- width: i,
1376
- height: g,
1377
- ...C.props(it.bar(e[t.tone], n[t.tone]), u && y.selected)
1378
- }),
1379
- /* @__PURE__ */ O("text", {
1380
- x: d,
1381
- y: _,
1382
- textAnchor: "middle",
1383
- ...C.props(y.label, ft[t.step.kind], y.haloLabel),
1384
- children: c
1385
- }),
1386
- f
1387
- ] });
1388
- }
1389
- // packages/charts/src/cartesian/scatter-plot.tsx
1390
- var bt = 260, xt = 56, St = 20, Ct = 12, wt = 1e3, Tt = {
1391
- kzqmXN: "x1xc55vz",
1392
- kZKoxP: "xdk7pt",
1393
- kaIpWk: "x16rqkct",
1394
- $$css: !0
1395
- }, Et = {
1396
- brush: {
1397
- kFalU9: "xx69xxh",
1398
- kkrTdU: "xsid9ct",
1399
- $$css: !0
1400
- },
1401
- target: {
1402
- kVAEAm: "x10l6tqk",
1403
- k1xSpc: "xrvj5dj",
1404
- kgQiWS: "x1ku5rj1",
1405
- kzqmXN: "x187nhsf",
1406
- kZKoxP: "xn3w4p2",
1407
- k3aq6I: "x11lhmoz",
1408
- kMzoRj: "xc342km",
1409
- kmVPX3: "x1717udv",
1410
- kWkggS: "xjbqb8w",
1411
- kkrTdU: "x1ypdohk",
1412
- kfzvcC: "x67bb7w",
1413
- k3XXqK: "x1t137rt",
1414
- kPJHz1: "x13qnu6",
1415
- kZs9gx: "x19rmrnh",
1416
- k7shQP: "x9v5kkp",
1417
- kiEn40: "x175ew0f",
1418
- kmCx7Z: "xwycy1x",
1419
- kJrEVn: "x15ajoc",
1420
- kLz2MD: "x13ljvab",
1421
- k1CtGv: "xzgvv12",
1422
- $$css: !0
1423
- },
1424
- location: (e, t) => [{
1425
- kbCHJM: e == null ? e : "xgq9j65",
1426
- k87sOh: t == null ? t : "xjbys53",
1427
- $$css: !0
1428
- }, {
1429
- "--x-left": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e),
1430
- "--x-top": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
1431
- }],
1432
- dot: (e) => [
1433
- Tt,
1434
- {
1435
- kWkggS: e == null ? e : "xl8spv7",
1436
- $$css: !0
1437
- },
1438
- { "--x-backgroundColor": e ?? void 0 }
1439
- ],
1440
- selected: {
1441
- kMeerF: "x12ei19c",
1442
- kjBf7l: "xj5pgkc",
1443
- k3XXqK: "xaatb59",
1444
- kInvED: "x1ewu8gn",
1445
- $$css: !0
1446
- }
1447
- };
1448
- function Dt(t) {
1449
- let { title: n, report: r, description: i, points: a, xDomain: o, yDomain: s, xLabel: u, yLabel: f, formatX: h, formatY: g, selection: v, rangeSelection: y, emptyLabel: b } = t, x = d({
1450
- title: n,
1451
- selection: v,
1452
- items: a.map((e) => ({
1453
- id: e.id,
1454
- label: `${e.label}, ${u}: ${h(e.x)}, ${f}: ${g(e.y)}`
1455
- }))
1456
- }), { ref: S, width: te } = ee(), T = At(t);
1457
- if (T !== null) return /* @__PURE__ */ O(_, {
1458
- title: n,
1459
- report: r,
1460
- description: i,
1461
- message: T
1462
- });
1463
- let ne = j({
1464
- domain: [...o],
1465
- range: [xt, Math.max(xt, te - St)]
1466
- }), E = j({
1467
- domain: [...s],
1468
- range: [216, Ct]
1469
- });
1470
- return /* @__PURE__ */ k(m, {
1471
- title: n,
1472
- report: r,
1473
- description: i,
1474
- footer: /* @__PURE__ */ O(p, {
1475
- id: x.id,
1476
- children: x.label ?? "\xA0"
1477
- }),
1478
- children: [
1479
- a.length === 0 ? /* @__PURE__ */ O("p", {
1480
- className: "x1ghz6dp x153jb6y",
1481
- children: b
1482
- }) : /* @__PURE__ */ k(l, {
1483
- ref: S,
1484
- ...x.props,
1485
- className: "x1n2onr6 xeuugli",
1486
- children: [/* @__PURE__ */ O(Ot, {
1487
- width: te,
1488
- scaleX: ne,
1489
- scaleY: E,
1490
- ...t
1491
- }, `${o[0]}:${o[1]}:${s[0]}:${s[1]}:${te}`), a.length > 0 && /* @__PURE__ */ O("div", {
1492
- className: "x10l6tqk x10a8y8t x1n71m9f x47corl",
1493
- children: a.map((t) => {
1494
- let n = x.label !== void 0 && x.activeId === t.id;
1495
- return /* @__PURE__ */ O(w, {
1496
- type: "button",
1497
- tabIndex: -1,
1498
- onPointerEnter: () => x.inspect(t.id),
1499
- title: t.label,
1500
- "aria-label": `${t.label}, ${u}: ${h(t.x)}, ${f}: ${g(t.y)}`,
1501
- "aria-pressed": v === void 0 ? void 0 : v.selectedId === t.id,
1502
- onClick: () => {
1503
- x.inspect(t.id), v?.onSelect(t.id);
1504
- },
1505
- ...C.props(Et.target, Et.location(ne(t.x), E(t.y))),
1506
- children: /* @__PURE__ */ O("span", {
1507
- "aria-hidden": !0,
1508
- ...C.props(Et.dot(e[t.tone]), (v?.selectedId === t.id || n) && Et.selected)
1509
- })
1510
- }, t.id);
1511
- })
1512
- })]
1513
- }),
1514
- y !== void 0 && /* @__PURE__ */ O(kt, {
1515
- ...t,
1516
- rangeSelection: y
1517
- }),
1518
- /* @__PURE__ */ O(c, {
1519
- label: `${n} points`,
1520
- columns: [
1521
- {
1522
- id: "point",
1523
- label: "Point"
1524
- },
1525
- {
1526
- id: "x",
1527
- label: u
1528
- },
1529
- {
1530
- id: "y",
1531
- label: f
1532
- }
1533
- ],
1534
- rows: a.map((e) => ({
1535
- id: e.id,
1536
- values: [
1537
- e.label,
1538
- h(e.x),
1539
- g(e.y)
1540
- ]
1541
- }))
1542
- })
1543
- ]
1544
- });
1545
- }
1546
- function Ot({ width: e, scaleX: t, scaleY: n, xLabel: r, yLabel: i, formatX: a, formatY: o, rangeSelection: s }) {
1547
- let c = T(), [l, u] = re(null), d = E(null);
1548
- te(() => () => d.current?.(), []);
1549
- let f = l === null ? s?.value : {
1550
- x: [Math.min(l.start.x, l.end.x), Math.max(l.start.x, l.end.x)],
1551
- y: [Math.min(l.start.y, l.end.y), Math.max(l.start.y, l.end.y)]
1552
- };
1553
- function p(r, i, a) {
1554
- return {
1555
- x: t.copy().clamp(!0).invert((i - r.left) / r.width * e),
1556
- y: n.copy().clamp(!0).invert((a - r.top) / r.height * bt)
1557
- };
1558
- }
1559
- function m(t) {
1560
- let n = t.button === 0 && t.pointerType !== "touch";
1561
- if (s === void 0 || d.current !== null || !n) return;
1562
- let r = t.currentTarget.getBoundingClientRect(), i = (t.clientX - r.left) / r.width * e, a = (t.clientY - r.top) / r.height * bt;
1563
- if (i < xt || i > e - St || a < Ct || a > 216) return;
1564
- let o = t.currentTarget, c = o.parentElement;
1565
- if (c === null) return;
1566
- let l = p(r, t.clientX, t.clientY);
1567
- u({
1568
- start: l,
1569
- end: l
1570
- }), d.current = A(c, t.nativeEvent, {
1571
- cancelOnEscape: !0,
1572
- onMove: ({ x: e, y: t }) => u({
1573
- start: l,
1574
- end: p(o.getBoundingClientRect(), e, t)
1575
- }),
1576
- onEnd: (e, t) => {
1577
- if (d.current = null, u(null), t) return;
1578
- let n = p(o.getBoundingClientRect(), e.clientX, e.clientY);
1579
- s.onChange({
1580
- x: [Math.min(l.x, n.x), Math.max(l.x, n.x)],
1581
- y: [Math.min(l.y, n.y), Math.max(l.y, n.y)]
1582
- });
1583
- }
1584
- });
1585
- }
1586
- return /* @__PURE__ */ k("svg", {
1587
- width: e,
1588
- height: bt,
1589
- viewBox: `0 0 ${e} ${bt}`,
1590
- "aria-hidden": !0,
1591
- onPointerDown: m,
1592
- ...C.props(y.svg, s !== void 0 && Et.brush),
1593
- children: [
1594
- /* @__PURE__ */ O("defs", { children: /* @__PURE__ */ O("clipPath", {
1595
- id: c,
1596
- children: /* @__PURE__ */ O("rect", {
1597
- x: xt,
1598
- y: Ct,
1599
- width: Math.max(0, e - xt - St),
1600
- height: 204
1601
- })
1602
- }) }),
1603
- t.ticks(5).map((e) => /* @__PURE__ */ k("g", { children: [/* @__PURE__ */ O("line", {
1604
- x1: t(e),
1605
- x2: t(e),
1606
- y1: Ct,
1607
- y2: 216,
1608
- ...C.props(y.grid)
1609
- }), /* @__PURE__ */ O("text", {
1610
- x: t(e),
1611
- y: 234,
1612
- textAnchor: "middle",
1613
- ...C.props(y.label, y.tick),
1614
- children: a(e)
1615
- })] }, e)),
1616
- n.ticks(4).map((t) => /* @__PURE__ */ k("g", { children: [/* @__PURE__ */ O("line", {
1617
- x1: xt,
1618
- x2: e - St,
1619
- y1: n(t),
1620
- y2: n(t),
1621
- ...C.props(y.grid)
1622
- }), /* @__PURE__ */ O("text", {
1623
- x: 48,
1624
- y: n(t) + 4,
1625
- textAnchor: "end",
1626
- ...C.props(y.label, y.tick),
1627
- children: o(t)
1628
- })] }, t)),
1629
- /* @__PURE__ */ O("text", {
1630
- x: (xt + e - St) / 2,
1631
- y: 256,
1632
- textAnchor: "middle",
1633
- ...C.props(y.label, y.tick),
1634
- children: r
1635
- }),
1636
- /* @__PURE__ */ O("text", {
1637
- x: 12,
1638
- y: 108,
1639
- textAnchor: "middle",
1640
- transform: "rotate(-90 12 108)",
1641
- ...C.props(y.label),
1642
- children: i
1643
- }),
1644
- /* @__PURE__ */ O("g", {
1645
- clipPath: `url(#${c})`,
1646
- children: f != null && /* @__PURE__ */ O("rect", {
1647
- x: t(f.x[0]),
1648
- y: n(f.y[1]),
1649
- width: t(f.x[1]) - t(f.x[0]),
1650
- height: n(f.y[0]) - n(f.y[1]),
1651
- className: "x1e0kj8g xv7c1pl x1tg5nk6 xnpr05h x15lqr97 x47corl"
1652
- })
1653
- })
1654
- ]
1655
- });
1656
- }
1657
- function kt({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, formatX: a, formatY: o }) {
1658
- let s = e.value ?? {
1659
- x: t,
1660
- y: n
1661
- };
1662
- return /* @__PURE__ */ k("fieldset", {
1663
- className: "xrvj5dj x1n8ia3y x1xxf3xd xc342km x1717udv xeuugli",
1664
- children: [
1665
- /* @__PURE__ */ O("legend", {
1666
- className: "x153jb6y xy8obcc x1jfksii",
1667
- children: "Drag with a mouse, or adjust these bounds to select a coordinate range."
1668
- }),
1669
- /* @__PURE__ */ k(S.Root, {
1670
- value: [...s.x],
1671
- format: a,
1672
- min: t[0],
1673
- max: t[1],
1674
- step: e.xStep,
1675
- locale: e.locale,
1676
- onValueChange: (t) => e.onChange({
1677
- x: t,
1678
- y: s.y
1679
- }),
1680
- children: [/* @__PURE__ */ k("div", {
1681
- className: "x78zum5 x1a02dak x1qughib x1hnptsi x153jb6y xy8obcc xj0a0fe",
1682
- children: [/* @__PURE__ */ O(S.Label, { children: r }), /* @__PURE__ */ k("span", { children: [
1683
- a(s.x[0]),
1684
- " – ",
1685
- a(s.x[1])
1686
- ] })]
1687
- }), /* @__PURE__ */ O(S.Control, { children: /* @__PURE__ */ k(S.Track, { children: [
1688
- /* @__PURE__ */ O(S.Indicator, {}),
1689
- /* @__PURE__ */ O(S.Thumb, {
1690
- index: 0,
1691
- "aria-label": `${r} minimum`
1692
- }),
1693
- /* @__PURE__ */ O(S.Thumb, {
1694
- index: 1,
1695
- "aria-label": `${r} maximum`
1696
- })
1697
- ] }) })]
1698
- }),
1699
- /* @__PURE__ */ k(S.Root, {
1700
- value: [...s.y],
1701
- format: o,
1702
- min: n[0],
1703
- max: n[1],
1704
- step: e.yStep,
1705
- locale: e.locale,
1706
- onValueChange: (t) => e.onChange({
1707
- x: s.x,
1708
- y: t
1709
- }),
1710
- children: [/* @__PURE__ */ k("div", {
1711
- className: "x78zum5 x1a02dak x1qughib x1hnptsi x153jb6y xy8obcc xj0a0fe",
1712
- children: [/* @__PURE__ */ O(S.Label, { children: i }), /* @__PURE__ */ k("span", { children: [
1713
- o(s.y[0]),
1714
- " – ",
1715
- o(s.y[1])
1716
- ] })]
1717
- }), /* @__PURE__ */ O(S.Control, { children: /* @__PURE__ */ k(S.Track, { children: [
1718
- /* @__PURE__ */ O(S.Indicator, {}),
1719
- /* @__PURE__ */ O(S.Thumb, {
1720
- index: 0,
1721
- "aria-label": `${i} minimum`
1722
- }),
1723
- /* @__PURE__ */ O(S.Thumb, {
1724
- index: 1,
1725
- "aria-label": `${i} maximum`
1726
- })
1727
- ] }) })]
1728
- }),
1729
- /* @__PURE__ */ O(x, {
1730
- type: "button",
1731
- disabled: e.value === null,
1732
- onClick: () => e.onChange(null),
1733
- children: "Clear range"
1734
- })
1735
- ]
1736
- });
1737
- }
1738
- function At({ points: e, xDomain: t, yDomain: n, rangeSelection: r }) {
1739
- if (!g(t) || !g(n)) return "Scatter domains must contain finite, increasing endpoints.";
1740
- if (e.length > 1e3) return `This plot exceeds the ${wt}-point render limit. Supply a smaller, labelled sample.`;
1741
- if (!h(e)) return "Scatter points must have unique identifiers.";
1742
- if (e.some((e) => !Number.isFinite(e.x) || !Number.isFinite(e.y))) return "Scatter coordinates must be finite.";
1743
- if (e.some((e) => {
1744
- let r = e.x < t[0] || e.x > t[1], i = e.y < n[0] || e.y > n[1];
1745
- return r || i;
1746
- })) return "Scatter coordinates fall outside the declared domain. Widen the domain or supply a labelled window of points.";
1747
- if (r === void 0) return null;
1748
- let i = Number.isFinite(r.xStep) && r.xStep > 0 && r.xStep <= t[1] - t[0], a = Number.isFinite(r.yStep) && r.yStep > 0 && r.yStep <= n[1] - n[0];
1749
- if (!i || !a) return "Range selection steps must be finite, positive, and no larger than their domain span.";
1750
- let o = r.value;
1751
- return o === null ? null : !jt(o.x, t) || !jt(o.y, n) ? "The selected range must have finite, ordered bounds inside the declared domain." : null;
1752
- }
1753
- function jt(e, t) {
1754
- return !e.every(Number.isFinite) || e[0] > e[1] ? !1 : e[0] >= t[0] && e[1] <= t[1];
1755
- }
1756
- // packages/charts/src/cartesian/time-series-data.ts
1757
- var $ = {
1758
- series: 12,
1759
- pointsPerSeries: 2e3,
1760
- markers: 200,
1761
- panels: 12
1762
- }, Mt = .01, Nt = [
1763
- "series1",
1764
- "series2",
1765
- "series3",
1766
- "series4",
1767
- "series5",
1768
- "series6"
1769
- ];
1770
- function Pt({ series: e, isStacked: t, markers: n, timeline: r = [] }) {
1771
- let i = e[0]?.points.map((e) => e.timestamp) ?? r;
1772
- if (e.length > $.series || i.length > $.pointsPerSeries || n.length > $.markers) return `Choose a window with at most ${$.series} series, ${$.pointsPerSeries} observations per series, and ${$.markers} markers.`;
1773
- if (!h(e) || !h(n)) return "Series and markers require unique identifiers.";
1774
- for (let n of e) {
1775
- if (n.points.length !== i.length) return "Every series must supply the same observation timestamps.";
1776
- let e = zt({
1777
- points: n.points,
1778
- timestamps: i,
1779
- isStacked: t
1780
- });
1781
- if (e !== void 0) return e;
1782
- }
1783
- for (let t of n) {
1784
- let n = Ft({
1785
- marker: t,
1786
- series: e,
1787
- timestamps: i
1788
- });
1789
- if (n !== void 0) return n;
1790
- }
1791
- let a = e.flatMap((e) => e.points.flatMap((e) => e.value === null ? [] : [e.value])), o = Math.max(0, ...a) - Math.min(0, ...a), s = (i.at(-1) ?? 0) - (i[0] ?? 0);
1792
- if (!Number.isFinite(o) || !Number.isFinite(s)) return "The elapsed-time and value ranges must be finite.";
1793
- if (t && i.some((t, n) => !Number.isFinite(e.reduce((e, t) => e + (t.points[n]?.value ?? 0), 0)))) return "Stacked observation totals must be finite.";
1794
- }
1795
- function Ft({ marker: e, series: t, timestamps: n }) {
1796
- if (e.kind === "event") {
1797
- let t = n[0] ?? 0, r = n.at(-1) ?? t, i = e.timestamp >= t && e.timestamp <= r;
1798
- return Number.isFinite(e.timestamp) && i ? void 0 : "Every event marker must fall inside the observed time range.";
1799
- }
1800
- if (!n.includes(e.timestamp)) return "Every time and point marker must align with an observation timestamp.";
1801
- if (e.kind !== "time") return t.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.value === e.value ? void 0 : "Point markers must reference the recorded series value.";
1802
- }
1803
- function It({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
1804
- return JSON.stringify([
1805
- n,
1806
- r,
1807
- e.map((e) => [
1808
- e.id,
1809
- e.label,
1810
- e.tone,
1811
- e.points.map((e) => [e.timestamp, e.value])
1812
- ]),
1813
- t.map((e) => [
1814
- e.id,
1815
- e.kind,
1816
- e.timestamp,
1817
- e.label,
1818
- e.seriesId,
1819
- e.value
1820
- ])
1821
- ]);
1822
- }
1823
- function Lt(e, t, n = !1) {
1824
- if (e !== t) return [e, t];
1825
- let r = Math.max(1, Math.abs(e) * Mt), i = n ? 0 : e - r, a = t + r;
1826
- return [Number.isFinite(i) ? i : e, Number.isFinite(a) ? a : t];
1827
- }
1828
- function Rt(e, t) {
1829
- let n = e.filter((e) => e.tone === void 0);
1830
- return e.map((r, i) => {
1831
- let a = n.findIndex((e) => e.id === r.id), o = r.tone ?? Nt[a % Nt.length] ?? "series1", s = r.points.map((n, r) => {
1832
- let a = t ? e.slice(0, i).reduce((e, t) => e + (t.points[r]?.value ?? 0), 0) : 0;
1833
- return {
1834
- ...n,
1835
- base: a
1836
- };
1837
- });
1838
- return {
1839
- id: r.id,
1840
- label: r.label,
1841
- tone: o,
1842
- points: s
1843
- };
1844
- });
1845
- }
1846
- function zt({ points: e, timestamps: t, isStacked: n }) {
1847
- for (let [r, i] of e.entries()) {
1848
- let a = e[r - 1], o = a !== void 0 && i.timestamp <= a.timestamp;
1849
- if (!Number.isFinite(i.timestamp) || i.timestamp !== t[r] || o) return "Observation timestamps must be finite, aligned, and strictly increasing.";
1850
- if (i.value !== null && !Number.isFinite(i.value)) return "Observations must be finite numbers or explicit missing values.";
1851
- if (n && (i.value === null || i.value < 0)) return "Stacked observations must be present and nonnegative.";
1852
- }
1853
- }
1854
- // packages/charts/src/cartesian/time-series-line.tsx
1855
- function Bt({ series: t, x: n, y: r, inspectedTimestamp: i, pointRadius: a = 3 }) {
1856
- let o = t.points.findLastIndex((e) => e.value !== null);
1857
- return /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(P, {
1858
- data: [...t.points],
1859
- defined: (e) => e.value !== null,
1860
- x: (e) => n(e.timestamp),
1861
- y: (e) => r((e.value ?? 0) + e.base),
1862
- stroke: e[t.tone],
1863
- ...C.props(y.mark)
1864
- }), t.points.filter((e, n) => {
1865
- if (e.value === null) return !1;
1866
- let r = t.points[n - 1]?.value === null || t.points[n + 1]?.value === null, a = t.points.length === 1, s = n === o, c = e.timestamp === i;
1867
- return a || s ? !0 : r || c;
1868
- }).map((i) => /* @__PURE__ */ O("circle", {
1869
- cx: n(i.timestamp),
1870
- cy: r((i.value ?? 0) + i.base),
1871
- r: a,
1872
- fill: e[t.tone]
1873
- }, i.timestamp))] });
1874
- }
1875
- // packages/charts/src/cartesian/sparkline.tsx
1876
- var Vt = {
1877
- minimum: "Lowest",
1878
- maximum: "Highest",
1879
- last: "Latest"
1880
- }, Ht = 2.5;
1881
- function Ut({ points: e, marked: t }) {
1882
- let n = e.flatMap((e) => e.value === null ? [] : [{
1883
- ...e,
1884
- value: e.value
1885
- }]), r = n.map((e) => e.value), i = {
1886
- minimum: n.find((e) => e.value === Math.min(...r)),
1887
- maximum: n.find((e) => e.value === Math.max(...r)),
1888
- last: n.at(-1)
1889
- };
1890
- return t.flatMap((e) => {
1891
- let t = i[e];
1892
- return t === void 0 ? [] : [{
1893
- kind: e,
1894
- point: t
1895
- }];
1896
- });
1897
- }
1898
- function Wt({ title: t, summary: n, unit: r, timestampUnit: i, series: a, valueDomain: o, markedPoints: s = [], baseline: c }) {
1899
- let l = T(), u = T(), d = Gt({
1900
- title: t,
1901
- summary: n,
1902
- unit: r,
1903
- series: a,
1904
- valueDomain: o,
1905
- markedPoints: s,
1906
- baseline: c
1907
- }), f = a.points.some((e) => e.value !== null);
1908
- if (d !== void 0 || !f) return /* @__PURE__ */ O("span", {
1909
- role: "img",
1910
- "aria-label": `${t}. ${n} Values in ${r}; timestamps in ${i}. ${d ?? "No recorded values. Missing observations remain unavailable."}`,
1911
- title: d ?? "No recorded values",
1912
- className: "x2pejg6 x10w6t97 x2lah0s xxymvpz x3nfvp2 x6s0dn4 xl56j7k x153jb6y x1hz01jw xy8obcc",
1913
- children: d === void 0 ? "No data" : "Invalid trend"
1914
- });
1915
- let p = a.points[0]?.timestamp ?? 0, m = a.points.at(-1)?.timestamp ?? p, h = j({
1916
- domain: [...Lt(p, m)],
1917
- range: [3, 125]
1918
- }), g = j({
1919
- domain: [...o],
1920
- range: [29, 3]
1921
- }), _ = Rt([a], !1)[0], v = e[_?.tone ?? "series1"], y = Ut({
1922
- points: a.points,
1923
- marked: s
1924
- }), ee = y.map(({ kind: e, point: t }) => `${Vt[e]}: ${t.value} ${r}.`).join(" "), b = c === void 0 ? "" : `Reference: ${c} ${r}.`;
1925
- return /* @__PURE__ */ k("svg", {
1926
- role: "img",
1927
- "aria-labelledby": l,
1928
- "aria-describedby": u,
1929
- focusable: "false",
1930
- viewBox: "0 0 128 32",
1931
- width: 128,
1932
- height: 32,
1933
- className: "x1rg5ohu x2pejg6 x10w6t97 x2lah0s xxymvpz",
1934
- children: [
1935
- /* @__PURE__ */ O("title", {
1936
- id: l,
1937
- children: t
1938
- }),
1939
- /* @__PURE__ */ k("desc", {
1940
- id: u,
1941
- children: [
1942
- n,
1943
- " Values in ",
1944
- r,
1945
- "; timestamps in ",
1946
- i,
1947
- ". Displayed value domain: ",
1948
- o[0],
1949
- " to",
1950
- " ",
1951
- o[1],
1952
- " ",
1953
- r,
1954
- ". ",
1955
- ee,
1956
- " ",
1957
- b
1958
- ]
1959
- }),
1960
- c !== void 0 && /* @__PURE__ */ O("line", {
1961
- x1: 3,
1962
- x2: 125,
1963
- y1: g(c),
1964
- y2: g(c),
1965
- className: "x1crw9hw xnpr05h xbw2l0c x13efnbd"
1966
- }),
1967
- _ !== void 0 && /* @__PURE__ */ O(Bt, {
1968
- series: _,
1969
- x: h,
1970
- y: g,
1971
- pointRadius: 2
1972
- }),
1973
- y.map(({ kind: e, point: t }) => e === "last" ? /* @__PURE__ */ O("circle", {
1974
- cx: h(t.timestamp),
1975
- cy: g(t.value),
1976
- r: Ht,
1977
- fill: v
1978
- }, e) : /* @__PURE__ */ O("circle", {
1979
- cx: h(t.timestamp),
1980
- cy: g(t.value),
1981
- r: Ht,
1982
- stroke: v,
1983
- className: "x1fytgo2 x1r6sdyr x13efnbd"
1984
- }, e))
1985
- ]
1986
- });
1987
- }
1988
- function Gt({ title: e, summary: t, unit: n, series: r, valueDomain: i, markedPoints: a, baseline: o }) {
1989
- if (e.trim() === "" || t.trim() === "" || n.trim() === "") return "A trend requires a title, a readable summary, and a value unit.";
1990
- if (!g(i)) return "The displayed value domain must have finite, increasing bounds.";
1991
- let s = Pt({
1992
- series: [r],
1993
- isStacked: !1,
1994
- markers: []
1995
- });
1996
- if (s !== void 0) return s;
1997
- if (r.points.some((e) => e.value !== null && (e.value < i[0] || e.value > i[1]))) return "Every recorded value must be inside the declared value domain.";
1998
- if (new Set(a).size !== a.length) return "Mark each recorded point at most once.";
1999
- if (!(o === void 0 || o >= i[0] && o <= i[1])) return "The reference value must be inside the declared value domain.";
2000
- }
2001
- // packages/charts/src/cartesian/time-series-bands.ts
2002
- var Kt = {
2003
- bands: 4,
2004
- crossings: 4
2005
- }, qt = [
2006
- "series1",
2007
- "series2",
2008
- "series3",
2009
- "series4",
2010
- "series5",
2011
- "series6"
2012
- ];
2013
- function Jt(e) {
2014
- let t = [
2015
- e.lower,
2016
- e.center,
2017
- e.upper
2018
- ].filter((e) => e !== null);
2019
- return t.some((e) => !Number.isFinite(e)) ? "Band values must be finite numbers or explicit missing values." : e.lower === null == (e.upper === null) ? t.every((e, n) => n === 0 || (t[n - 1] ?? e) <= e) ? void 0 : "Band values must satisfy lower ≤ center ≤ upper." : "A band observation needs both bounds or neither.";
2020
- }
2021
- function Yt({ bands: e, crossings: t, series: n, timestamps: r }) {
2022
- if (e.length > Kt.bands || t.length > Kt.crossings) return `Supply at most ${Kt.bands} bands and ${Kt.crossings} crossings.`;
2023
- if (!h([...n, ...e]) || !h(t)) return "Series, bands, and crossings require unique identifiers.";
2024
- for (let t of e) {
2025
- if (t.points.length !== r.length || t.points.some((e, t) => e.timestamp !== r[t])) return "Every band must supply the same observation timestamps as the series.";
2026
- let e = t.points.map(Jt).find((e) => e !== void 0);
2027
- if (e !== void 0) return e;
2028
- }
2029
- let i = new Set([...n, ...e].map((e) => e.id));
2030
- for (let e of t) if (!(i.has(e.seriesId) && e.label.trim() !== "") || !Number.isFinite(e.value)) return "Each crossing needs a label, a finite value, and a supplied series or band.";
2031
- }
2032
- function Xt({ series: e, bands: t }) {
2033
- let n = e.filter((e) => e.tone === void 0).length, r = t.filter((e) => e.tone === void 0);
2034
- return t.map((e) => {
2035
- let t = n + r.findIndex((t) => t.id === e.id);
2036
- return {
2037
- ...e,
2038
- tone: e.tone ?? qt[t % qt.length] ?? "series1"
2039
- };
2040
- });
2041
- }
2042
- function Zt({ start: e, end: t, value: n, direction: r }) {
2043
- let i = e > n && t <= n, a = e < n && t >= n;
2044
- switch (r) {
2045
- case "falling": return i;
2046
- case "rising": return a;
2047
- case void 0: return i || a;
2048
- }
2049
- }
2050
- function Qt({ points: e, crossing: t }) {
2051
- let n = e.flatMap((t, n) => {
2052
- let r = e[n + 1];
2053
- return t.value === null || r === void 0 || r.value === null ? [] : [{
2054
- start: t.timestamp,
2055
- end: r.timestamp,
2056
- from: t.value,
2057
- to: r.value
2058
- }];
2059
- }).find(({ from: e, to: n }) => Zt({
2060
- start: e,
2061
- end: n,
2062
- value: t.value,
2063
- direction: t.direction
2064
- }));
2065
- if (n === void 0) return;
2066
- let r = (t.value - n.from) / (n.to - n.from);
2067
- return n.start + r * (n.end - n.start);
2068
- }
2069
- function $t({ crossings: e, series: t, bands: n }) {
2070
- return e.map((e) => ({
2071
- crossing: e,
2072
- timestamp: Qt({
2073
- points: t.find((t) => t.id === e.seriesId)?.points ?? n.find((t) => t.id === e.seriesId)?.points.map((e) => ({
2074
- timestamp: e.timestamp,
2075
- value: e.center
2076
- })) ?? [],
2077
- crossing: e
2078
- })
2079
- }));
2080
- }
2081
- function en(e, t) {
2082
- let n = Math.min(...e.map((e) => Math.abs(e - t)));
2083
- return e.find((e) => Math.abs(e - t) === n);
2084
- }
2085
- function tn(e) {
2086
- return e.flatMap((e) => e.points.flatMap((e) => [
2087
- e.lower,
2088
- e.center,
2089
- e.upper
2090
- ].filter((e) => e !== null)));
2091
- }
2092
- // packages/charts/src/cartesian/time-series-overlays.tsx
2093
- var nn = {
2094
- kDd8S0: "x1bsw5e1",
2095
- kfJifR: "xnpr05h",
2096
- kDwRjp: "xbh8q5q",
2097
- $$css: !0
2098
- }, rn = {
2099
- kVYP8I: "xd6etog",
2100
- $$css: !0
2101
- }, an = {
2102
- kfJifR: "xvlca1e",
2103
- kDwRjp: "xbh8q5q",
2104
- kREpy8: "x13efnbd",
2105
- $$css: !0
2106
- }, on = {
2107
- bandEdge: (e) => [
2108
- nn,
2109
- {
2110
- kjVXCG: e == null ? e : "x6mkzkt",
2111
- $$css: !0
2112
- },
2113
- { "--x-stroke": e ?? void 0 }
2114
- ],
2115
- bandFill: (e) => [
2116
- rn,
2117
- {
2118
- kDwRjp: e == null ? e : "x19zyb68",
2119
- $$css: !0
2120
- },
2121
- { "--x-fill": e ?? void 0 }
2122
- ],
2123
- center: (e) => [
2124
- an,
2125
- {
2126
- kjVXCG: e == null ? e : "x6mkzkt",
2127
- $$css: !0
2128
- },
2129
- { "--x-stroke": e ?? void 0 }
2130
- ]
2131
- }, sn = 16, cn = 6, ln = 6.5, un = 2.5, dn = 4, fn = 12;
2132
- function pn({ instants: e, x: t, right: n, ends: r }) {
2133
- let [i, ...a] = e;
2134
- if (i === void 0) return [];
2135
- let o = t(i.timestamp), s = i.label.length * ln + cn, c = o + s > n ? "end" : "start", l = c === "start" ? o : o - s, u = c === "start" ? o + s : o, d = r.findIndex((e) => l > e), f = d === -1 ? Math.min(r.length, 1) : d, p = [
2136
- ...r.slice(0, f),
2137
- Math.max(u, r[f] ?? u),
2138
- ...r.slice(f + 1)
2139
- ];
2140
- return [{
2141
- ...i,
2142
- lane: f,
2143
- anchor: c
2144
- }, ...pn({
2145
- instants: a,
2146
- x: t,
2147
- right: n,
2148
- ends: p
2149
- })];
2150
- }
2151
- function mn({ instants: e, x: t, right: n }) {
2152
- return pn({
2153
- instants: e.toSorted((e, t) => e.timestamp - t.timestamp),
2154
- x: t,
2155
- right: n,
2156
- ends: []
2157
- });
2158
- }
2159
- function hn(e) {
2160
- return fn + Math.max(0, ...e.map((e) => e.lane + 1)) * sn;
2161
- }
2162
- function gn(e) {
2163
- return e.lower !== null && e.upper !== null;
2164
- }
2165
- function _n({ bands: t, x: n, y: r }) {
2166
- return /* @__PURE__ */ O("g", { children: t.map((t) => {
2167
- let i = e[t.tone], a = [...t.points];
2168
- return /* @__PURE__ */ k("g", { children: [
2169
- /* @__PURE__ */ O(M, {
2170
- data: a,
2171
- defined: gn,
2172
- x: (e) => n(e.timestamp),
2173
- y0: (e) => r(e.lower ?? 0),
2174
- y1: (e) => r(e.upper ?? 0),
2175
- ...C.props(on.bandFill(i))
2176
- }),
2177
- /* @__PURE__ */ O(P, {
2178
- data: a,
2179
- defined: gn,
2180
- x: (e) => n(e.timestamp),
2181
- y: (e) => r(e.upper ?? 0),
2182
- ...C.props(on.bandEdge(i))
2183
- }),
2184
- /* @__PURE__ */ O(P, {
2185
- data: a,
2186
- defined: gn,
2187
- x: (e) => n(e.timestamp),
2188
- y: (e) => r(e.lower ?? 0),
2189
- ...C.props(on.bandEdge(i))
2190
- }),
2191
- /* @__PURE__ */ O(P, {
2192
- data: a,
2193
- defined: (e) => e.center !== null,
2194
- x: (e) => n(e.timestamp),
2195
- y: (e) => r(e.center ?? 0),
2196
- ...C.props(on.center(i))
2197
- })
2198
- ] }, t.id);
2199
- }) });
2200
- }
2201
- function vn({ placed: e, x: t, y: n, bottom: r }) {
2202
- return /* @__PURE__ */ O("g", {
2203
- "aria-hidden": !0,
2204
- children: e.map((e) => {
2205
- let i = t(e.timestamp), a = fn + e.lane * sn, o = e.anchor === "start" ? i + cn : i - cn;
2206
- return /* @__PURE__ */ k("g", { children: [
2207
- /* @__PURE__ */ O("line", {
2208
- x1: i,
2209
- x2: i,
2210
- y1: a,
2211
- y2: r,
2212
- className: "xhq4mlf xnpr05h x1bpwu3k x13efnbd"
2213
- }),
2214
- /* @__PURE__ */ O("circle", {
2215
- cx: i,
2216
- cy: a,
2217
- r: un,
2218
- className: "xlrhuyr"
2219
- }),
2220
- /* @__PURE__ */ O("text", {
2221
- x: o,
2222
- y: a,
2223
- textAnchor: e.anchor,
2224
- dominantBaseline: "middle",
2225
- ...C.props(y.label, y.strongLabel, y.haloLabel),
2226
- children: e.label
2227
- }),
2228
- e.value !== void 0 && /* @__PURE__ */ O("circle", {
2229
- cx: i,
2230
- cy: n(e.value),
2231
- r: dn,
2232
- className: "x1fytgo2 x17y187c xvlca1e x13efnbd"
2233
- })
2234
- ] }, e.id);
2235
- })
2236
- });
2237
- }
2238
- // packages/charts/src/cartesian/time-series.tsx
2239
- var yn = {
2240
- timeAxis: {
2241
- k1xSpc: "x78zum5",
2242
- kjj79g: "x1qughib",
2243
- k1C7PZ: "x8zbtdt",
2244
- keoZOQ: "x1c87qhr",
2245
- kMv6JI: "xiard35",
2246
- kGuDYH: "xy8obcc",
2247
- kLWn49: "xas2l8k",
2248
- kMwMTN: "xbixft",
2249
- kcqcaj: "xss6m8b",
2250
- $$css: !0
2251
- },
2252
- timeAxisInset: (e, t) => [{
2253
- kZCmMZ: e == null ? e : "xnvo3vl",
2254
- kwRFfy: t == null ? t : "x120eax6",
2255
- $$css: !0
2256
- }, {
2257
- "--x-paddingInlineStart": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e),
2258
- "--x-paddingInlineEnd": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
2259
- }]
2260
- };
2261
- function bn({ bands: e, crossings: t }) {
2262
- return JSON.stringify([e.map((e) => [
2263
- e.id,
2264
- e.label,
2265
- e.rangeLabel,
2266
- e.tone,
2267
- e.points.map((e) => [
2268
- e.timestamp,
2269
- e.lower,
2270
- e.center,
2271
- e.upper
2272
- ])
2273
- ]), t.map((e) => [
2274
- e.id,
2275
- e.seriesId,
2276
- e.value,
2277
- e.label,
2278
- e.direction
2279
- ])]);
2280
- }
2281
- function xn({ bands: e, timestamp: t, formatValue: n }) {
2282
- return e.flatMap((e) => {
2283
- let r = e.points.find((e) => e.timestamp === t), i = r?.center ?? null, a = r?.lower !== null && r?.upper !== null && r !== void 0;
2284
- return [{
2285
- id: e.id,
2286
- label: e.label,
2287
- tone: e.tone,
2288
- shape: "band",
2289
- value: i === null ? "Unavailable" : n(i)
2290
- }, {
2291
- id: `${e.id}:range`,
2292
- label: e.rangeLabel,
2293
- tone: e.tone,
2294
- shape: "band",
2295
- value: a ? `${n(r.lower)} – ${n(r.upper)}` : "Unavailable"
2296
- }];
2297
- });
2298
- }
2299
- function Sn({ found: e, formatTimestamp: t }) {
2300
- return e.timestamp === void 0 ? `${e.crossing.label} · Not reached in this range` : `About ${t(e.timestamp)} · ${e.crossing.label}`;
2301
- }
2302
- function Cn(e) {
2303
- return /* @__PURE__ */ O(An, {
2304
- ...e,
2305
- kind: "line",
2306
- isStacked: !1
2307
- });
2308
- }
2309
- function wn({ isStacked: e = !1, ...t }) {
2310
- return /* @__PURE__ */ O(An, {
2311
- ...t,
2312
- kind: "area",
2313
- isStacked: e
2314
- });
2315
- }
2316
- function Tn(e) {
2317
- return /* @__PURE__ */ O(En, { ...e });
2318
- }
2319
- function En({ title: e, description: n, series: i, actions: a, report: o, height: s = 180, showTimeAxis: c = !0 }) {
2320
- let l = T(), u = Rt(i.map((e) => ({
2321
- ...e,
2322
- points: []
2323
- })), !1);
2324
- return !Number.isFinite(s) || s < 48 ? /* @__PURE__ */ O(_, {
2325
- title: e,
2326
- description: n,
2327
- report: o,
2328
- message: "Chart height must be at least 48 pixels."
2329
- }) : /* @__PURE__ */ O("div", {
2330
- "aria-hidden": !0,
2331
- inert: !0,
2332
- className: "xeuugli",
2333
- children: /* @__PURE__ */ O(m, {
2334
- title: e,
2335
- description: n,
2336
- report: o,
2337
- series: u,
2338
- actions: a,
2339
- children: /* @__PURE__ */ k("div", {
2340
- className: "xrvj5dj x1n8ia3y",
2341
- children: [/* @__PURE__ */ O(fe, {
2342
- id: l,
2343
- label: void 0,
2344
- legend: u,
2345
- rows: [],
2346
- x: 0,
2347
- width: 0,
2348
- source: void 0,
2349
- hasSeriesSummary: o?.seriesValues !== void 0
2350
- }), /* @__PURE__ */ k("div", {
2351
- ...C.props(y.plot),
2352
- children: [/* @__PURE__ */ O(t, { height: s - 16 }), c && /* @__PURE__ */ k("div", {
2353
- className: "x78zum5 x1qughib x8zbtdt x1c87qhr xiard35 xy8obcc xas2l8k xbixft xss6m8b",
2354
- children: [/* @__PURE__ */ O(r, { width: "8ch" }), /* @__PURE__ */ O(r, { width: "8ch" })]
2355
- })]
2356
- })]
2357
- })
2358
- })
2359
- });
2360
- }
2361
- function Dn({ charts: e, ...t }) {
2362
- let n = E(null), [r, i] = re(), a = JSON.stringify(e.map((e) => [
2363
- e.id,
2364
- e.title,
2365
- It({
2366
- series: e.series,
2367
- markers: e.markers ?? [],
2368
- timestampUnit: t.timestampUnit,
2369
- isStacked: !1
2370
- })
2371
- ])), o = JSON.stringify(e[0]?.series[0]?.points.map((e) => e.timestamp) ?? []), s = e.every((e) => JSON.stringify(e.series[0]?.points.map((e) => e.timestamp) ?? []) === o);
2372
- if (r !== void 0 && r.signature !== a && i(void 0), te(() => {
2373
- function e(e) {
2374
- e.target instanceof Node && n.current?.contains(e.target) !== !0 && i(void 0);
2375
- }
2376
- return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
2377
- }, []), !s || !h(e)) return /* @__PURE__ */ O(_, {
2378
- title: "Small multiples",
2379
- message: "Charts need unique identifiers and aligned observation timestamps."
2380
- });
2381
- if (e.length > $.panels) return /* @__PURE__ */ O(_, {
2382
- title: "Small multiples",
2383
- message: `Choose at most ${$.panels} panels.`
2384
- });
2385
- if (e.length === 0) return /* @__PURE__ */ O(m, {
2386
- title: "Small multiples",
2387
- children: /* @__PURE__ */ O("p", {
2388
- className: "x153jb6y",
2389
- children: "No charts"
2390
- })
2391
- });
2392
- let c = Math.max(52, ...e.flatMap((e) => e.series.flatMap((t) => t.points.flatMap((t) => t.value === null || !Number.isFinite(t.value) ? [] : [(e.formatTick ?? e.formatValue)(t.value).length * 7 + 12])))), l = e.every((e) => e.report !== void 0);
2393
- return /* @__PURE__ */ O("div", {
2394
- ref: n,
2395
- ...{
2396
- 0: { className: "xrvj5dj x1j825kq" },
2397
- 1: { className: "xrvj5dj xxhr3t" }
2398
- }[!!l | 0],
2399
- children: e.map((n, o) => /* @__PURE__ */ O("div", {
2400
- ...{
2401
- 0: {},
2402
- 1: { className: "x1y332i5" }
2403
- }[!!(l && o > 0) | 0],
2404
- children: /* @__PURE__ */ O(An, {
2405
- ...t,
2406
- title: n.title,
2407
- description: n.description,
2408
- report: n.report,
2409
- series: n.series,
2410
- formatValue: n.formatValue,
2411
- formatTick: n.formatTick,
2412
- markers: n.markers,
2413
- kind: "line",
2414
- isStacked: !1,
2415
- sharedInspection: {
2416
- value: r?.signature === a ? r : void 0,
2417
- isSource: r?.chartId === n.id,
2418
- onChange: (e) => i(e === void 0 ? void 0 : {
2419
- ...e,
2420
- signature: a,
2421
- chartId: n.id
2422
- })
2423
- },
2424
- axisWidth: c,
2425
- showTimeAxis: o === e.length - 1
2426
- })
2427
- }, n.id))
2428
- });
2429
- }
2430
- function On({ charts: e, height: t }) {
2431
- if (!h(e) || e.length > $.panels) return /* @__PURE__ */ O(_, {
2432
- title: "Small multiples",
2433
- message: `Choose at most ${$.panels} panels with unique identifiers.`
2434
- });
2435
- let n = e.every((e) => e.report !== void 0);
2436
- return /* @__PURE__ */ O("div", {
2437
- "aria-hidden": !0,
2438
- inert: !0,
2439
- ...{
2440
- 0: { className: "xrvj5dj x1j825kq" },
2441
- 1: { className: "xrvj5dj xxhr3t" }
2442
- }[!!n | 0],
2443
- children: e.map((r, i) => /* @__PURE__ */ O("div", {
2444
- ...{
2445
- 0: {},
2446
- 1: { className: "x1y332i5" }
2447
- }[!!(n && i > 0) | 0],
2448
- children: /* @__PURE__ */ O(En, {
2449
- ...r,
2450
- height: t,
2451
- showTimeAxis: i === e.length - 1
2452
- })
2453
- }, r.id))
2454
- });
2455
- }
2456
- var kn = {
2457
- "x-default-marker": "x-default-marker",
2458
- $$css: !0
2459
- };
2460
- function An({ title: t, description: n, series: r, timestampUnit: i, formatTimestamp: a, formatValue: o, formatTick: s = o, markers: l = [], height: d = 180, actions: f, report: p, kind: h, isStacked: g, sharedInspection: b, axisWidth: x, showTimeAxis: S = !0, bands: w = [], crossings: D = [] }) {
2461
- let A = w[0]?.points.map((e) => e.timestamp) ?? [], ie = r[0]?.points.map((e) => e.timestamp) ?? A, M = !Number.isFinite(d) || d < 48 ? "Chart height must be at least 48 pixels." : Pt({
2462
- series: r,
2463
- isStacked: g,
2464
- markers: l,
2465
- timeline: A
2466
- }) ?? Yt({
2467
- bands: w,
2468
- crossings: D,
2469
- series: r,
2470
- timestamps: ie
2471
- }), N = ne(() => M === void 0 ? Rt(r, g) : [], [
2472
- r,
2473
- g,
2474
- M
2475
- ]), P = ne(() => M === void 0 ? Xt({
2476
- series: r,
2477
- bands: w
2478
- }) : [], [
2479
- r,
2480
- w,
2481
- M
2482
- ]), F = N[0]?.points ?? P[0]?.points ?? [], { ref: se, width: ce, element: le } = ee(), I = E(null), [pe, L] = re(), R = ne(() => F.map(({ timestamp: e }) => ({
2483
- id: String(e),
2484
- label: a(e)
2485
- })), [F, a]), z = F.find((e) => e.timestamp === pe) ?? F[0], [B, me] = re(), V = `${It({
2486
- series: r,
2487
- markers: l,
2488
- timestampUnit: i,
2489
- isStacked: g
2490
- })}${bn({
2491
- bands: w,
2492
- crossings: D
2493
- })}`, H = [...N.map(({ id: e, label: t, tone: n }) => ({
2494
- id: e,
2495
- label: t,
2496
- tone: n
2497
- })), ...P.map(({ id: e, label: t, tone: n }) => ({
2498
- id: e,
2499
- label: t,
2500
- tone: n,
2501
- shape: "band"
2502
- }))], U = b === void 0 ? B?.signature === V ? B : void 0 : b.value, W = b === void 0 || b.isSource ? U : void 0, he = p?.seriesValues !== void 0, ge = T();
2503
- B !== void 0 && (B.signature !== V || M !== void 0) && me(void 0);
2504
- let G = b !== void 0;
2505
- if (te(() => {
2506
- if (G) return;
2507
- function e(e) {
2508
- e.target instanceof Node && I.current?.contains(e.target) !== !0 && me(void 0);
2509
- }
2510
- return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
2511
- }, [G]), M !== void 0) return /* @__PURE__ */ O(_, {
2512
- title: t,
2513
- description: n,
2514
- report: p,
2515
- message: M
2516
- });
2517
- if (F.length === 0) return /* @__PURE__ */ O(m, {
2518
- title: t,
2519
- description: n,
2520
- actions: f,
2521
- report: p,
2522
- series: H,
2523
- children: /* @__PURE__ */ O("p", {
2524
- className: "x153jb6y",
2525
- children: "No observations"
2526
- })
2527
- });
2528
- let _e = F.map((e) => e.timestamp), K = $t({
2529
- crossings: D,
2530
- series: r,
2531
- bands: w
2532
- }), ve = [...l.flatMap((e) => e.kind === "event" ? [e] : []), ...K.flatMap(({ crossing: e, timestamp: t }) => t === void 0 ? [] : [{
2533
- id: e.id,
2534
- timestamp: t,
2535
- label: e.label,
2536
- value: e.value
2537
- }])], ye = ve.filter((e) => en(_e, e.timestamp) === W?.timestamp).map((e) => `${e.label} · ${a(e.timestamp)}`), be = {
2538
- label: W === void 0 ? void 0 : a(W.timestamp),
2539
- rows: [...N.map((e) => {
2540
- let t = e.points.find((e) => e.timestamp === W?.timestamp);
2541
- return {
2542
- id: e.id,
2543
- label: e.label,
2544
- tone: e.tone,
2545
- value: t?.value === null || t === void 0 ? "Unavailable" : o(t.value)
2546
- };
2547
- }), ...xn({
2548
- bands: P,
2549
- timestamp: W?.timestamp,
2550
- formatValue: o
2551
- })],
2552
- notes: [...l.filter((e) => e.kind !== "event" && e.timestamp === W?.timestamp).map((e) => e.label), ...ye]
2553
- }, xe = d - 28, Se = xe + 12, Ce = F[0]?.timestamp ?? 0, we = F.at(-1)?.timestamp ?? Ce, Te = [
2554
- ...N.flatMap((e) => e.points.flatMap((e) => e.value === null ? [] : [e.value + e.base])),
2555
- ...tn(w),
2556
- ...D.map((e) => e.value)
2557
- ], Ee = h === "area" ? Math.min(0, ...Te) : Math.min(...Te), De = h === "area" ? Math.max(0, ...Te) : Math.max(...Te), Oe = Lt(Te.length === 0 ? 0 : Ee, Te.length === 0 ? 1 : De, h === "area"), q = j({
2558
- domain: [...Oe],
2559
- range: [xe, 0]
2560
- }), J = x ?? Math.max(44, ...q.ticks(3).map((e) => s(e).length * 7 + 12)), Y = Math.max(J + 1, ce - 16), X = j({
2561
- domain: [...Lt(Ce, we)],
2562
- range: [J, Y]
2563
- }), ke = mn({
2564
- instants: ve,
2565
- x: X,
2566
- right: Y
2567
- }), Z = hn(ke), Q = j({
2568
- domain: [...Oe],
2569
- range: [xe, Z]
2570
- }), Ae = Q.ticks(3);
2571
- function je(e) {
2572
- let t = le?.getBoundingClientRect();
2573
- if (t === void 0) return;
2574
- let n = X.invert(e - t.left), r = F.find((e, t) => {
2575
- let r = F[t + 1];
2576
- return r === void 0 || n <= e.timestamp + (r.timestamp - e.timestamp) / 2;
2577
- });
2578
- r !== void 0 && Me({
2579
- signature: V,
2580
- timestamp: r.timestamp,
2581
- source: "pointer"
2582
- });
2583
- }
2584
- function Me(e) {
2585
- b === void 0 ? me(e) : b.onChange(e);
2586
- }
2587
- return /* @__PURE__ */ O("div", {
2588
- ref: I,
2589
- className: "xeuugli",
2590
- children: /* @__PURE__ */ k(m, {
2591
- title: he ? t : /* @__PURE__ */ O(ue, {
2592
- title: t,
2593
- detail: W === void 0 ? void 0 : a(W.timestamp)
2594
- }),
2595
- description: n,
2596
- report: p,
2597
- series: H,
2598
- actions: f,
2599
- children: [/* @__PURE__ */ O(c, {
2600
- label: `${t} observations`,
2601
- columns: [
2602
- {
2603
- id: "time",
2604
- label: `Time (${i})`
2605
- },
2606
- ...N.map((e) => ({
2607
- id: `series:${e.id}`,
2608
- label: e.label
2609
- })),
2610
- ...P.flatMap((e) => [{
2611
- id: `band:${e.id}`,
2612
- label: e.label
2613
- }, {
2614
- id: `band-range:${e.id}`,
2615
- label: `${e.label}: ${e.rangeLabel}`
2616
- }])
2617
- ],
2618
- rows: F.map((e, t) => ({
2619
- id: e.timestamp,
2620
- values: [
2621
- a(e.timestamp),
2622
- ...N.map((e) => e.points[t]?.value === null || e.points[t]?.value === void 0 ? "Unavailable" : o(e.points[t].value)),
2623
- ...xn({
2624
- bands: P,
2625
- timestamp: e.timestamp,
2626
- formatValue: o
2627
- }).map((e) => e.value)
2628
- ]
2629
- }))
2630
- }), /* @__PURE__ */ k("div", {
2631
- className: "xrvj5dj x1n8ia3y",
2632
- children: [
2633
- /* @__PURE__ */ O(fe, {
2634
- id: ge,
2635
- label: be.label,
2636
- legend: H,
2637
- rows: be.rows,
2638
- x: X(U?.timestamp ?? Ce),
2639
- width: ce,
2640
- source: W?.source,
2641
- notes: be.notes,
2642
- hasSeriesSummary: he
2643
- }),
2644
- /* @__PURE__ */ k("div", {
2645
- ref: se,
2646
- ...C.props(y.plot),
2647
- children: [/* @__PURE__ */ k(u, {
2648
- role: "img",
2649
- "aria-label": `${t}. Use arrow keys to inspect observations.`,
2650
- "aria-describedby": ge,
2651
- tabIndex: 0,
2652
- viewBox: `0 0 ${ce} ${Se}`,
2653
- height: Se,
2654
- controls: {
2655
- items: R,
2656
- cursor: z === void 0 ? void 0 : String(z.timestamp),
2657
- inspected: W === void 0 ? void 0 : String(W.timestamp),
2658
- readout: de(be),
2659
- onInspect: (e) => {
2660
- let t = Number(e);
2661
- L(t), Me({
2662
- signature: V,
2663
- timestamp: t,
2664
- source: "keyboard"
2665
- });
2666
- },
2667
- onDismiss: () => Me(void 0)
2668
- },
2669
- onFocus: (e) => {
2670
- if (e.currentTarget.matches(":focus-visible")) {
2671
- let e = U?.timestamp ?? Ce;
2672
- L(e), Me({
2673
- signature: V,
2674
- timestamp: e,
2675
- source: "keyboard"
2676
- });
2677
- }
2678
- },
2679
- onPointerMove: (e) => {
2680
- e.pointerType === "mouse" && je(e.clientX);
2681
- },
2682
- onPointerDown: (e) => je(e.clientX),
2683
- onPointerLeave: (e) => {
2684
- e.pointerType === "mouse" && U?.source === "pointer" && Me(void 0);
2685
- },
2686
- onBlur: () => Me(void 0),
2687
- ...C.props(y.svg, y.inspectable, kn),
2688
- children: [
2689
- Ae.map((e) => /* @__PURE__ */ k("g", { children: [/* @__PURE__ */ O("line", {
2690
- x1: J,
2691
- x2: Y,
2692
- y1: Q(e),
2693
- y2: Q(e),
2694
- ...C.props(e === 0 ? y.baseline : y.grid)
2695
- }), /* @__PURE__ */ O("text", {
2696
- x: J - 8,
2697
- y: Q(e),
2698
- textAnchor: "end",
2699
- dominantBaseline: "middle",
2700
- ...C.props(y.label, y.tick),
2701
- children: s(e)
2702
- })] }, e)),
2703
- D.map((e) => /* @__PURE__ */ O("line", {
2704
- x1: J,
2705
- x2: Y,
2706
- y1: Q(e.value),
2707
- y2: Q(e.value),
2708
- ...C.props(y.baseline)
2709
- }, e.id)),
2710
- /* @__PURE__ */ O(_n, {
2711
- bands: P,
2712
- x: X,
2713
- y: Q
2714
- }),
2715
- N.map((t) => /* @__PURE__ */ k("g", { children: [h === "area" && /* @__PURE__ */ O(ae, {
2716
- data: [...t.points],
2717
- defined: (e) => e.value !== null,
2718
- x: (e) => X(e.timestamp),
2719
- y0: (e) => Q(e.base),
2720
- y1: (e) => Q((e.value ?? 0) + e.base),
2721
- yScale: Q,
2722
- fill: e[t.tone],
2723
- fillOpacity: g ? .65 : .12
2724
- }), /* @__PURE__ */ O(Bt, {
2725
- series: t,
2726
- x: X,
2727
- y: Q,
2728
- inspectedTimestamp: U?.timestamp
2729
- })] }, t.id)),
2730
- /* @__PURE__ */ O(vn, {
2731
- placed: ke,
2732
- x: X,
2733
- y: Q,
2734
- bottom: xe
2735
- }),
2736
- l.filter((e) => e.kind !== "event").map((e) => /* @__PURE__ */ k("g", { children: [e.kind === "time" ? /* @__PURE__ */ O("line", {
2737
- x1: X(e.timestamp),
2738
- x2: X(e.timestamp),
2739
- y1: Z,
2740
- y2: xe,
2741
- className: "xhq4mlf x1ntoi03 x13efnbd"
2742
- }) : /* @__PURE__ */ O("circle", {
2743
- cx: X(e.timestamp),
2744
- cy: Q(e.value + (N.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.base ?? 0)),
2745
- r: 4,
2746
- fill: v.surface,
2747
- ...C.props(y.selected)
2748
- }), /* @__PURE__ */ O("title", { children: e.kind === "point" ? `${e.label}: ${o(e.value)}` : e.label })] }, e.id)),
2749
- U !== void 0 && /* @__PURE__ */ O("line", {
2750
- x1: X(U.timestamp),
2751
- x2: X(U.timestamp),
2752
- y1: Z,
2753
- y2: xe,
2754
- className: "xhq4mlf x1ntoi03 x13efnbd"
2755
- }),
2756
- z !== void 0 && /* @__PURE__ */ O(oe, {
2757
- x: X(z.timestamp),
2758
- top: Z,
2759
- bottom: xe,
2760
- width: Math.min(16, (Y - J) / 2)
2761
- })
2762
- ]
2763
- }), S && /* @__PURE__ */ k("div", {
2764
- "aria-hidden": !0,
2765
- ...C.props(yn.timeAxis, yn.timeAxisInset(J, Math.max(0, ce - Y))),
2766
- children: [/* @__PURE__ */ O("span", {
2767
- className: "x1cqoux5 xeuugli xj0a0fe",
2768
- children: a(Ce)
2769
- }), we !== Ce && /* @__PURE__ */ O("span", {
2770
- className: "x1cqoux5 xeuugli xj0a0fe xp4054r",
2771
- children: a(we)
2772
- })]
2773
- })]
2774
- }),
2775
- l.length + K.length > 0 && /* @__PURE__ */ k("ul", {
2776
- className: "x78zum5 x1a02dak x1n8ia3y x1ghz6dp x1717udv xe8uvvx xy8obcc x153jb6y xj0a0fe",
2777
- children: [l.map((e) => /* @__PURE__ */ k("li", { children: [
2778
- a(e.timestamp),
2779
- " · ",
2780
- e.label,
2781
- e.kind === "point" && ` · ${o(e.value)}`
2782
- ] }, e.id)), K.map((e) => /* @__PURE__ */ O("li", { children: Sn({
2783
- found: e,
2784
- formatTimestamp: a
2785
- }) }, e.crossing.id))]
2786
- })
2787
- ]
2788
- })]
2789
- })
2790
- });
2791
- }
2792
- export { wn as AreaChart, Ke as BarChart, He as BarChartPlaceholder, Xe as BreakdownBar, vt as BridgeChart, Cn as LineChart, wt as MAX_SCATTER_POINTS, Dt as ScatterPlot, Dn as SmallMultiples, On as SmallMultiplesPlaceholder, Wt as Sparkline, Tn as TimeSeriesChartPlaceholder, Kt as timeSeriesBandLimits, $ as timeSeriesLimits };
1
+ export { t as AreaChart, p as BarChart, m as BarChartPlaceholder, f as BreakdownBar, d as BridgeChart, n as LineChart, l as ScatterPlot, r as SmallMultiples, i as SmallMultiplesPlaceholder, s as Sparkline, a as TimeSeriesChartPlaceholder, u as scatterLimits, o as timeSeriesBandLimits, c as timeSeriesLimits } from "../time-series-IB3CB93O.js";