@kanzo-tech/ui 0.11.0 → 0.13.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 (104) hide show
  1. package/dist/analytics.d.ts +1 -0
  2. package/dist/analytics.d.ts.map +1 -1
  3. package/dist/charts/chart-inputs.d.ts +6 -5
  4. package/dist/charts/chart-inputs.d.ts.map +1 -1
  5. package/dist/charts/chart-inputs.js +78 -77
  6. package/dist/charts/chart-inputs.js.map +1 -1
  7. package/dist/charts/chart-marks.d.ts +2 -1
  8. package/dist/charts/chart-marks.d.ts.map +1 -1
  9. package/dist/charts/chart-marks.js.map +1 -1
  10. package/dist/charts/chart-root.d.ts +8 -3
  11. package/dist/charts/chart-root.d.ts.map +1 -1
  12. package/dist/charts/chart-root.js +60 -60
  13. package/dist/charts/chart-root.js.map +1 -1
  14. package/dist/charts/chart-spec.d.ts +11 -4
  15. package/dist/charts/chart-spec.d.ts.map +1 -1
  16. package/dist/charts/chart-spec.js +44 -40
  17. package/dist/charts/chart-spec.js.map +1 -1
  18. package/dist/charts/chart-stat.d.ts +3 -2
  19. package/dist/charts/chart-stat.d.ts.map +1 -1
  20. package/dist/charts/chart-stat.js +10 -9
  21. package/dist/charts/chart-stat.js.map +1 -1
  22. package/dist/composites/language-picker.d.ts +51 -0
  23. package/dist/composites/language-picker.d.ts.map +1 -0
  24. package/dist/composites/language-picker.js +165 -0
  25. package/dist/composites/language-picker.js.map +1 -0
  26. package/dist/index.d.ts +8 -1
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +687 -677
  29. package/dist/index.js.map +1 -1
  30. package/dist/lib/control-size.d.ts +26 -0
  31. package/dist/lib/control-size.d.ts.map +1 -0
  32. package/dist/lib/control-size.js +11 -0
  33. package/dist/lib/control-size.js.map +1 -0
  34. package/dist/lib/use-async-collection.d.ts +57 -0
  35. package/dist/lib/use-async-collection.d.ts.map +1 -0
  36. package/dist/lib/use-async-collection.js +43 -0
  37. package/dist/lib/use-async-collection.js.map +1 -0
  38. package/dist/lib/use-debounced-commit.d.ts +28 -0
  39. package/dist/lib/use-debounced-commit.d.ts.map +1 -0
  40. package/dist/lib/use-debounced-commit.js +26 -0
  41. package/dist/lib/use-debounced-commit.js.map +1 -0
  42. package/dist/shark-parity.divergences.d.ts.map +1 -1
  43. package/dist/simples/button.d.ts.map +1 -1
  44. package/dist/simples/button.js +34 -33
  45. package/dist/simples/button.js.map +1 -1
  46. package/dist/simples/checkbox.d.ts.map +1 -1
  47. package/dist/simples/checkbox.js +42 -42
  48. package/dist/simples/checkbox.js.map +1 -1
  49. package/dist/simples/combobox.d.ts.map +1 -1
  50. package/dist/simples/combobox.js +48 -49
  51. package/dist/simples/combobox.js.map +1 -1
  52. package/dist/simples/date-picker.d.ts +58 -2
  53. package/dist/simples/date-picker.d.ts.map +1 -1
  54. package/dist/simples/date-picker.js +210 -73
  55. package/dist/simples/date-picker.js.map +1 -1
  56. package/dist/simples/field.d.ts +35 -2
  57. package/dist/simples/field.d.ts.map +1 -1
  58. package/dist/simples/field.js +146 -116
  59. package/dist/simples/field.js.map +1 -1
  60. package/dist/simples/input-group.d.ts +9 -9
  61. package/dist/simples/input-group.d.ts.map +1 -1
  62. package/dist/simples/input-group.js +68 -78
  63. package/dist/simples/input-group.js.map +1 -1
  64. package/dist/simples/input.d.ts +9 -9
  65. package/dist/simples/input.d.ts.map +1 -1
  66. package/dist/simples/input.js +13 -14
  67. package/dist/simples/input.js.map +1 -1
  68. package/dist/simples/locale.d.ts +4 -0
  69. package/dist/simples/locale.d.ts.map +1 -0
  70. package/dist/simples/locale.js +8 -0
  71. package/dist/simples/locale.js.map +1 -0
  72. package/dist/simples/native-select.d.ts +9 -9
  73. package/dist/simples/native-select.d.ts.map +1 -1
  74. package/dist/simples/native-select.js +29 -28
  75. package/dist/simples/native-select.js.map +1 -1
  76. package/dist/simples/number-input.d.ts +9 -9
  77. package/dist/simples/number-input.d.ts.map +1 -1
  78. package/dist/simples/number-input.js +27 -27
  79. package/dist/simples/number-input.js.map +1 -1
  80. package/dist/simples/password-input.d.ts.map +1 -1
  81. package/dist/simples/password-input.js +24 -20
  82. package/dist/simples/password-input.js.map +1 -1
  83. package/dist/simples/pin-input.d.ts +9 -9
  84. package/dist/simples/pin-input.d.ts.map +1 -1
  85. package/dist/simples/pin-input.js +30 -29
  86. package/dist/simples/pin-input.js.map +1 -1
  87. package/dist/simples/radio-group.d.ts.map +1 -1
  88. package/dist/simples/radio-group.js +44 -43
  89. package/dist/simples/radio-group.js.map +1 -1
  90. package/dist/simples/segment-group.d.ts +8 -0
  91. package/dist/simples/segment-group.d.ts.map +1 -1
  92. package/dist/simples/segment-group.js +66 -52
  93. package/dist/simples/segment-group.js.map +1 -1
  94. package/dist/simples/switch.d.ts.map +1 -1
  95. package/dist/simples/switch.js +18 -12
  96. package/dist/simples/switch.js.map +1 -1
  97. package/dist/simples/tags-input.d.ts.map +1 -1
  98. package/dist/simples/tags-input.js +44 -39
  99. package/dist/simples/tags-input.js.map +1 -1
  100. package/dist/simples/toggle.d.ts +9 -9
  101. package/dist/simples/toggle.d.ts.map +1 -1
  102. package/dist/simples/toggle.js +24 -23
  103. package/dist/simples/toggle.js.map +1 -1
  104. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"chart-marks.d.ts","sourceRoot":"","sources":["../../src/charts/chart-marks.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAEL,KAAK,eAAe,EAIrB,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,IAAI,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAC1B,w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,CAAC;AAC/D,eAAO,MAAM,aAAa,iCAAoC,CAAC;AAC/D,eAAO,MAAM,WAAW,iCAAgC,CAAC;AACzD,eAAO,MAAM,gBAAgB,iCAA0C,CAAC;AACxE,eAAO,MAAM,cAAc,iCAAsC,CAAC;AAClE,eAAO,MAAM,cAAc,iCAAsC,CAAC;AAElE,eAAO,MAAM,YAAY,iCAAkC,CAAC;AAC5D,eAAO,MAAM,gBAAgB,iCAA0C,CAAC;AACxE,eAAO,MAAM,iBAAiB,iCAA4C,CAAC;AAC3E,eAAO,MAAM,iBAAiB,iCAA4C,CAAC;AAC3E,eAAO,MAAM,SAAS,iCAA4B,CAAC;AACnD,eAAO,MAAM,QAAQ,iCAA0B,CAAC;AAGhD,eAAO,MAAM,UAAU,iCAAoC,CAAC;AAC5D,eAAO,MAAM,UAAU,iCAAoC,CAAC;AAC5D,eAAO,MAAM,UAAU,iCAAoC,CAAC;AAC5D,eAAO,MAAM,YAAY,iCAAwC,CAAC;AAClE,eAAO,MAAM,WAAW,iCAAsC,CAAC;AAC/D,eAAO,MAAM,cAAc,iCAA4C,CAAC;AAExE,MAAM,WAAW,aAAa;IAC5B,uEAAuE;IACvE,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,gCAIpB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"chart-marks.js","sources":["../../src/charts/chart-marks.tsx"],"sourcesContent":["import type { Selection } from \"@uwdata/mosaic-core\";\nimport { isColorToken, isColorValue } from \"./chart-config.js\";\nimport {\n chartDescriptor,\n type ChartDescriptor,\n type ChartMarkDirective,\n type ChartMarkSource,\n type ChartSpecContext,\n} from \"./chart-spec.js\";\n\n/**\n * The mark vocabulary. Every component here renders `null` — `ChartRoot` reads the `__chart`\n * static off the element type and compiles it.\n *\n * This file carries no `\"use client\"`, and the docblock claimed the opposite for as long as it\n * existed: \"load-bearing even though nothing here uses a hook\". The rule the repo actually\n * enforces is in `client-boundary.test.ts` — a file declares the directive **iff it is itself\n * stateful** — and nothing here is, so the guard would reject it. The claim and the code were\n * never both true.\n *\n * What the claim got right is the mechanism, and it is worth keeping: a descriptor rendered on the\n * server DOES collapse to `null` before `ChartRoot` sees the element, because the `__chart` static\n * lives on the element *type* and a Server Component is invoked before serialisation. What it got\n * wrong is what prevents it. Not a directive here — the consumer. Every chart is written inside a\n * client component, necessarily: `MosaicProvider` is one, and there is no coordinator without it.\n * All 38 chart examples in `docs/examples` open with `\"use client\"`.\n *\n * So the trap is real and it belongs to a CONSUMER who writes a chart in a Server Component: the\n * marks vanish and the plot renders empty, with no error anywhere. Nothing catches that today —\n * `client-boundary.test.ts` matches shape and this file's shape is pure, and the docs RSC build only exercises the client path our own\n * examples take. Fixing it properly means either the directive plus an exception in that guard for\n * descriptor modules, or a check that a `chartDescriptor` element type survives the boundary. Both\n * are decisions rather than edits, so this says what is true instead of pretending it is handled.\n */\n\nexport interface ChartMarkProps {\n /**\n * The selection this mark filters by. Defaults to `ChartRoot`'s; `null` draws the full relation\n * — the dimmed background layer of a crossfilter pair.\n */\n filterBy?: Selection | null;\n /**\n * A different relation for this mark alone. The root's `table` is the default, which is right\n * until a plot needs two — a node-link view draws nodes from one relation and edges from\n * another, and both still filter by the same selection.\n */\n table?: string;\n /** Literal rows instead of the root's table. */\n data?: readonly unknown[];\n /** Positions a rule/tick without a table: `at={0}` is the zero line. */\n at?: unknown;\n /** Observable Plot's per-mark hover tooltip. */\n tip?: boolean;\n x?: unknown;\n y?: unknown;\n z?: unknown;\n r?: unknown;\n /** Facet the plot horizontally by this column — one panel per distinct value. */\n fx?: unknown;\n /** Facet the plot vertically by this column. */\n fy?: unknown;\n /** A column name, or a colour — `var(--chart-1)` / `--primary` tokens are resolved for Plot. */\n fill?: unknown;\n /** A column name, or a colour; tokens are resolved the same way. */\n stroke?: unknown;\n opacity?: unknown;\n fillOpacity?: unknown;\n strokeOpacity?: unknown;\n strokeWidth?: unknown;\n sort?: unknown;\n reverse?: boolean;\n limit?: number;\n inset?: number;\n /** Any other vgplot / Observable Plot mark option. */\n [option: string]: unknown;\n}\n\n/** Only these two channels can hold a colour; everything else keeps its column name. */\nconst COLOR_CHANNELS = [\"fill\", \"stroke\"] as const;\n\n/**\n * Marks that stack, and therefore need a series key.\n *\n * In Observable Plot `z` defaults to `fill`, so a stacked bar coloured by a column just works.\n * Through Mosaic it does not: the fill arrives as `{ value, scale: \"color\" }`, `maybeZ` cannot\n * pull a series name out of that object, and `stackY` silently stacks every row on the previous\n * one — a chart that renders, looks plausible and is wrong, which is worse than one that throws.\n * So we restore Plot's own default: a column-valued `fill`/`stroke` becomes `z` unless the caller\n * set one. `z={null}` opts out (Plot's own way of saying \"do not group\").\n */\nconst STACKING_MARKS = new Set([\n \"barY\", \"barX\", \"areaY\", \"areaX\", \"area\", \"rectY\", \"rectX\", \"rect\", \"waffleY\", \"waffleX\",\n]);\n\nfunction markSource(props: ChartMarkProps, ctx: ChartSpecContext, decorator: boolean): ChartMarkSource {\n if (decorator) return null;\n if (props.data !== undefined) return { kind: \"values\", values: props.data };\n if (props.at !== undefined) return { kind: \"values\", values: Array.isArray(props.at) ? props.at : [props.at] };\n const table = props.table ?? ctx.table;\n if (table === undefined) return { kind: \"values\", values: [{}] };\n return {\n kind: \"table\",\n table,\n filterBy: props.filterBy === undefined ? ctx.filterBy : props.filterBy,\n };\n}\n\nfunction markDirective(mark: string, props: ChartMarkProps, ctx: ChartSpecContext, decorator: boolean): ChartMarkDirective {\n const channels: Record<string, unknown> = { ...props };\n // `filterBy` / `data` / `at` are our sugar; they choose the source, they are never mark options.\n delete channels.filterBy;\n delete channels.data;\n delete channels.at;\n delete channels.table;\n // Read the series key before the colour channels are resolved to `rgb(...)` strings.\n if (STACKING_MARKS.has(mark) && !(\"z\" in channels)) {\n const series = [channels.fill, channels.stroke].find(\n (v) => typeof v === \"string\" && !isColorValue(v),\n );\n if (series !== undefined) channels.z = series;\n }\n for (const channel of COLOR_CHANNELS) {\n const value = channels[channel];\n // `fill=\"host\"` is the *column* host; only a token reference is a colour we must resolve.\n if (typeof value === \"string\" && isColorToken(value)) channels[channel] = ctx.resolveColor(value);\n }\n return { kind: \"mark\", mark, source: markSource(props, ctx, decorator), options: channels };\n}\n\nfunction mark(displayName: string, type: string, decorator = false): ChartDescriptor<ChartMarkProps> {\n return chartDescriptor<ChartMarkProps>(displayName, (props, ctx) => markDirective(type, props, ctx, decorator));\n}\n\nexport const ChartBarY = mark(\"ChartBarY\", \"barY\");\nexport const ChartBarX = mark(\"ChartBarX\", \"barX\");\nexport const ChartWaffleY = mark(\"ChartWaffleY\", \"waffleY\");\nexport const ChartWaffleX = mark(\"ChartWaffleX\", \"waffleX\");\n\nexport const ChartLine = mark(\"ChartLine\", \"line\");\nexport const ChartLineY = mark(\"ChartLineY\", \"lineY\");\nexport const ChartLineX = mark(\"ChartLineX\", \"lineX\");\nexport const ChartArea = mark(\"ChartArea\", \"area\");\nexport const ChartAreaY = mark(\"ChartAreaY\", \"areaY\");\nexport const ChartAreaX = mark(\"ChartAreaX\", \"areaX\");\n\nexport const ChartDot = mark(\"ChartDot\", \"dot\");\nexport const ChartDotX = mark(\"ChartDotX\", \"dotX\");\nexport const ChartDotY = mark(\"ChartDotY\", \"dotY\");\nexport const ChartCircle = mark(\"ChartCircle\", \"circle\");\nexport const ChartHexagon = mark(\"ChartHexagon\", \"hexagon\");\nexport const ChartImage = mark(\"ChartImage\", \"image\");\n\nexport const ChartRect = mark(\"ChartRect\", \"rect\");\nexport const ChartRectY = mark(\"ChartRectY\", \"rectY\");\nexport const ChartRectX = mark(\"ChartRectX\", \"rectX\");\nexport const ChartCell = mark(\"ChartCell\", \"cell\");\nexport const ChartCellX = mark(\"ChartCellX\", \"cellX\");\nexport const ChartCellY = mark(\"ChartCellY\", \"cellY\");\n\nexport const ChartRuleY = mark(\"ChartRuleY\", \"ruleY\");\nexport const ChartRuleX = mark(\"ChartRuleX\", \"ruleX\");\nexport const ChartTickX = mark(\"ChartTickX\", \"tickX\");\nexport const ChartTickY = mark(\"ChartTickY\", \"tickY\");\nexport const ChartText = mark(\"ChartText\", \"text\");\nexport const ChartTextX = mark(\"ChartTextX\", \"textX\");\nexport const ChartTextY = mark(\"ChartTextY\", \"textY\");\n\nexport const ChartVector = mark(\"ChartVector\", \"vector\");\n// vgplot 0.29.2 builds this one with the mark type `vectoX`, which Observable Plot has no\n// function for. Wrapped for symmetry; use `<ChartVector>` until upstream fixes the typo.\nexport const ChartVectorX = mark(\"ChartVectorX\", \"vectorX\");\nexport const ChartVectorY = mark(\"ChartVectorY\", \"vectorY\");\nexport const ChartSpike = mark(\"ChartSpike\", \"spike\");\nexport const ChartArrow = mark(\"ChartArrow\", \"arrow\");\nexport const ChartLink = mark(\"ChartLink\", \"link\");\n\nexport const ChartHeatmap = mark(\"ChartHeatmap\", \"heatmap\");\nexport const ChartRaster = mark(\"ChartRaster\", \"raster\");\nexport const ChartRasterTile = mark(\"ChartRasterTile\", \"rasterTile\");\nexport const ChartContour = mark(\"ChartContour\", \"contour\");\nexport const ChartDenseLine = mark(\"ChartDenseLine\", \"denseLine\");\nexport const ChartDensity = mark(\"ChartDensity\", \"density\");\nexport const ChartDensityY = mark(\"ChartDensityY\", \"densityY\");\nexport const ChartDensityX = mark(\"ChartDensityX\", \"densityX\");\nexport const ChartHexbin = mark(\"ChartHexbin\", \"hexbin\");\nexport const ChartRegressionY = mark(\"ChartRegressionY\", \"regressionY\");\nexport const ChartErrorbarY = mark(\"ChartErrorbarY\", \"errorbarY\");\nexport const ChartErrorbarX = mark(\"ChartErrorbarX\", \"errorbarX\");\n\nexport const ChartVoronoi = mark(\"ChartVoronoi\", \"voronoi\");\nexport const ChartVoronoiMesh = mark(\"ChartVoronoiMesh\", \"voronoiMesh\");\nexport const ChartDelaunayLink = mark(\"ChartDelaunayLink\", \"delaunayLink\");\nexport const ChartDelaunayMesh = mark(\"ChartDelaunayMesh\", \"delaunayMesh\");\nexport const ChartHull = mark(\"ChartHull\", \"hull\");\nexport const ChartGeo = mark(\"ChartGeo\", \"geo\");\n\n// Decorators: they draw the frame, not the data, so vgplot gives them options and no source.\nexport const ChartFrame = mark(\"ChartFrame\", \"frame\", true);\nexport const ChartGridX = mark(\"ChartGridX\", \"gridX\", true);\nexport const ChartGridY = mark(\"ChartGridY\", \"gridY\", true);\nexport const ChartHexgrid = mark(\"ChartHexgrid\", \"hexgrid\", true);\nexport const ChartSphere = mark(\"ChartSphere\", \"sphere\", true);\nexport const ChartGraticule = mark(\"ChartGraticule\", \"graticule\", true);\n\nexport interface ChartRawProps {\n /** A `vg.*` directive, or several — `vg.axisFx({ anchor: \"top\" })`. */\n spec: unknown;\n}\n\n/**\n * The escape hatch. The wrappers above cover vgplot's mark vocabulary, but not its ~250 attributes\n * nor the `axisX`/`axisFy` decorator marks the axis descriptors deliberately compile away from.\n * Anything unwrapped goes in here, in source order, with the same interactor-binding semantics as\n * a wrapped mark:\n *\n * ```tsx\n * <ChartRaw spec={vg.axisFy({ anchor: \"right\", tickRotate: 45 })} />\n * ```\n */\nexport const ChartRaw = chartDescriptor<ChartRawProps>(\"ChartRaw\", (props) =>\n Array.isArray(props.spec)\n ? props.spec.map((value: unknown) => ({ kind: \"raw\" as const, value }))\n : { kind: \"raw\", value: props.spec },\n);\n"],"names":["COLOR_CHANNELS","STACKING_MARKS","markSource","props","ctx","decorator","table","markDirective","mark","channels","series","v","isColorValue","channel","value","isColorToken","displayName","type","chartDescriptor","ChartBarY","ChartBarX","ChartWaffleY","ChartWaffleX","ChartLine","ChartLineY","ChartLineX","ChartArea","ChartAreaY","ChartAreaX","ChartDot","ChartDotX","ChartDotY","ChartCircle","ChartHexagon","ChartImage","ChartRect","ChartRectY","ChartRectX","ChartCell","ChartCellX","ChartCellY","ChartRuleY","ChartRuleX","ChartTickX","ChartTickY","ChartText","ChartTextX","ChartTextY","ChartVector","ChartVectorX","ChartVectorY","ChartSpike","ChartArrow","ChartLink","ChartHeatmap","ChartRaster","ChartRasterTile","ChartContour","ChartDenseLine","ChartDensity","ChartDensityY","ChartDensityX","ChartHexbin","ChartRegressionY","ChartErrorbarY","ChartErrorbarX","ChartVoronoi","ChartVoronoiMesh","ChartDelaunayLink","ChartDelaunayMesh","ChartHull","ChartGeo","ChartFrame","ChartGridX","ChartGridY","ChartHexgrid","ChartSphere","ChartGraticule","ChartRaw"],"mappings":";;AA8EA,MAAMA,IAAiB,CAAC,QAAQ,QAAQ,GAYlCC,wBAAqB,IAAI;AAAA,EAC7B;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAS;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAS;AAAA,EAAQ;AAAA,EAAW;AACjF,CAAC;AAED,SAASC,EAAWC,GAAuBC,GAAuBC,GAAqC;AACrG,MAAIA,EAAW,QAAO;AACtB,MAAIF,EAAM,SAAS,OAAW,QAAO,EAAE,MAAM,UAAU,QAAQA,EAAM,KAAA;AACrE,MAAIA,EAAM,OAAO,eAAkB,EAAE,MAAM,UAAU,QAAQ,MAAM,QAAQA,EAAM,EAAE,IAAIA,EAAM,KAAK,CAACA,EAAM,EAAE,EAAA;AAC3G,QAAMG,IAAQH,EAAM,SAASC,EAAI;AACjC,SAAIE,MAAU,SAAkB,EAAE,MAAM,UAAU,QAAQ,CAAC,CAAA,CAAE,EAAA,IACtD;AAAA,IACL,MAAM;AAAA,IACN,OAAAA;AAAA,IACA,UAAUH,EAAM,aAAa,SAAYC,EAAI,WAAWD,EAAM;AAAA,EAAA;AAElE;AAEA,SAASI,EAAcC,GAAcL,GAAuBC,GAAuBC,GAAwC;AACzH,QAAMI,IAAoC,EAAE,GAAGN,EAAA;AAO/C,MALA,OAAOM,EAAS,UAChB,OAAOA,EAAS,MAChB,OAAOA,EAAS,IAChB,OAAOA,EAAS,OAEZR,EAAe,IAAIO,CAAI,KAAK,EAAE,OAAOC,IAAW;AAClD,UAAMC,IAAS,CAACD,EAAS,MAAMA,EAAS,MAAM,EAAE;AAAA,MAC9C,CAACE,MAAM,OAA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GAC7CiE,KAAajE,EAAK,cAAc,SAAS,EAAI,GAC7CkE,KAAalE,EAAK,cAAc,SAAS,EAAI,GAC7CmE,KAAenE,EAAK,gBAAgB,WAAW,EAAI,GACnDoE,KAAcpE,EAAK,eAAe,UAAU,EAAI,GAChDqE,KAAiBrE,EAAK,kBAAkB,aAAa,EAAI,GAiBzDsE,KAAW5D;AAAA,EAA+B;AAAA,EAAY,CAACf,MAClE,MAAM,QAAQA,EAAM,IAAI,IACpBA,EAAM,KAAK,IAAI,CAACW,OAAoB,EAAE,MAAM,OAAgB,OAAAA,EAAA,EAAQ,IACpE,EAAE,MAAM,OAAO,OAAOX,EAAM,KAAA;AAClC;"}
1
+ {"version":3,"file":"chart-marks.js","sources":["../../src/charts/chart-marks.tsx"],"sourcesContent":["import type { Selection } from \"@uwdata/mosaic-core\";\nimport type { TableExpr } from \"@kanzo-tech/mosaic\";\nimport { isColorToken, isColorValue } from \"./chart-config.js\";\nimport {\n chartDescriptor,\n type ChartDescriptor,\n type ChartMarkDirective,\n type ChartMarkSource,\n type ChartSpecContext,\n} from \"./chart-spec.js\";\n\n/**\n * The mark vocabulary. Every component here renders `null` — `ChartRoot` reads the `__chart`\n * static off the element type and compiles it.\n *\n * This file carries no `\"use client\"`, and the docblock claimed the opposite for as long as it\n * existed: \"load-bearing even though nothing here uses a hook\". The rule the repo actually\n * enforces is in `client-boundary.test.ts` — a file declares the directive **iff it is itself\n * stateful** — and nothing here is, so the guard would reject it. The claim and the code were\n * never both true.\n *\n * What the claim got right is the mechanism, and it is worth keeping: a descriptor rendered on the\n * server DOES collapse to `null` before `ChartRoot` sees the element, because the `__chart` static\n * lives on the element *type* and a Server Component is invoked before serialisation. What it got\n * wrong is what prevents it. Not a directive here — the consumer. Every chart is written inside a\n * client component, necessarily: `MosaicProvider` is one, and there is no coordinator without it.\n * All 38 chart examples in `docs/examples` open with `\"use client\"`.\n *\n * So the trap is real and it belongs to a CONSUMER who writes a chart in a Server Component: the\n * marks vanish and the plot renders empty, with no error anywhere. Nothing catches that today —\n * `client-boundary.test.ts` matches shape and this file's shape is pure, and the docs RSC build only exercises the client path our own\n * examples take. Fixing it properly means either the directive plus an exception in that guard for\n * descriptor modules, or a check that a `chartDescriptor` element type survives the boundary. Both\n * are decisions rather than edits, so this says what is true instead of pretending it is handled.\n */\n\nexport interface ChartMarkProps {\n /**\n * The selection this mark filters by. Defaults to `ChartRoot`'s; `null` draws the full relation\n * — the dimmed background layer of a crossfilter pair.\n */\n filterBy?: Selection | null;\n /**\n * A different relation for this mark alone. The root's `table` is the default, which is right\n * until a plot needs two — a node-link view draws nodes from one relation and edges from\n * another, and both still filter by the same selection.\n */\n table?: TableExpr;\n /** Literal rows instead of the root's table. */\n data?: readonly unknown[];\n /** Positions a rule/tick without a table: `at={0}` is the zero line. */\n at?: unknown;\n /** Observable Plot's per-mark hover tooltip. */\n tip?: boolean;\n x?: unknown;\n y?: unknown;\n z?: unknown;\n r?: unknown;\n /** Facet the plot horizontally by this column — one panel per distinct value. */\n fx?: unknown;\n /** Facet the plot vertically by this column. */\n fy?: unknown;\n /** A column name, or a colour — `var(--chart-1)` / `--primary` tokens are resolved for Plot. */\n fill?: unknown;\n /** A column name, or a colour; tokens are resolved the same way. */\n stroke?: unknown;\n opacity?: unknown;\n fillOpacity?: unknown;\n strokeOpacity?: unknown;\n strokeWidth?: unknown;\n sort?: unknown;\n reverse?: boolean;\n limit?: number;\n inset?: number;\n /** Any other vgplot / Observable Plot mark option. */\n [option: string]: unknown;\n}\n\n/** Only these two channels can hold a colour; everything else keeps its column name. */\nconst COLOR_CHANNELS = [\"fill\", \"stroke\"] as const;\n\n/**\n * Marks that stack, and therefore need a series key.\n *\n * In Observable Plot `z` defaults to `fill`, so a stacked bar coloured by a column just works.\n * Through Mosaic it does not: the fill arrives as `{ value, scale: \"color\" }`, `maybeZ` cannot\n * pull a series name out of that object, and `stackY` silently stacks every row on the previous\n * one — a chart that renders, looks plausible and is wrong, which is worse than one that throws.\n * So we restore Plot's own default: a column-valued `fill`/`stroke` becomes `z` unless the caller\n * set one. `z={null}` opts out (Plot's own way of saying \"do not group\").\n */\nconst STACKING_MARKS = new Set([\n \"barY\", \"barX\", \"areaY\", \"areaX\", \"area\", \"rectY\", \"rectX\", \"rect\", \"waffleY\", \"waffleX\",\n]);\n\nfunction markSource(props: ChartMarkProps, ctx: ChartSpecContext, decorator: boolean): ChartMarkSource {\n if (decorator) return null;\n if (props.data !== undefined) return { kind: \"values\", values: props.data };\n if (props.at !== undefined) return { kind: \"values\", values: Array.isArray(props.at) ? props.at : [props.at] };\n const table = props.table ?? ctx.table;\n if (table === undefined) return { kind: \"values\", values: [{}] };\n return {\n kind: \"table\",\n table,\n filterBy: props.filterBy === undefined ? ctx.filterBy : props.filterBy,\n };\n}\n\nfunction markDirective(mark: string, props: ChartMarkProps, ctx: ChartSpecContext, decorator: boolean): ChartMarkDirective {\n const channels: Record<string, unknown> = { ...props };\n // `filterBy` / `data` / `at` are our sugar; they choose the source, they are never mark options.\n delete channels.filterBy;\n delete channels.data;\n delete channels.at;\n delete channels.table;\n // Read the series key before the colour channels are resolved to `rgb(...)` strings.\n if (STACKING_MARKS.has(mark) && !(\"z\" in channels)) {\n const series = [channels.fill, channels.stroke].find(\n (v) => typeof v === \"string\" && !isColorValue(v),\n );\n if (series !== undefined) channels.z = series;\n }\n for (const channel of COLOR_CHANNELS) {\n const value = channels[channel];\n // `fill=\"host\"` is the *column* host; only a token reference is a colour we must resolve.\n if (typeof value === \"string\" && isColorToken(value)) channels[channel] = ctx.resolveColor(value);\n }\n return { kind: \"mark\", mark, source: markSource(props, ctx, decorator), options: channels };\n}\n\nfunction mark(displayName: string, type: string, decorator = false): ChartDescriptor<ChartMarkProps> {\n return chartDescriptor<ChartMarkProps>(displayName, (props, ctx) => markDirective(type, props, ctx, decorator));\n}\n\nexport const ChartBarY = mark(\"ChartBarY\", \"barY\");\nexport const ChartBarX = mark(\"ChartBarX\", \"barX\");\nexport const ChartWaffleY = mark(\"ChartWaffleY\", \"waffleY\");\nexport const ChartWaffleX = mark(\"ChartWaffleX\", \"waffleX\");\n\nexport const ChartLine = mark(\"ChartLine\", \"line\");\nexport const ChartLineY = mark(\"ChartLineY\", \"lineY\");\nexport const ChartLineX = mark(\"ChartLineX\", \"lineX\");\nexport const ChartArea = mark(\"ChartArea\", \"area\");\nexport const ChartAreaY = mark(\"ChartAreaY\", \"areaY\");\nexport const ChartAreaX = mark(\"ChartAreaX\", \"areaX\");\n\nexport const ChartDot = mark(\"ChartDot\", \"dot\");\nexport const ChartDotX = mark(\"ChartDotX\", \"dotX\");\nexport const ChartDotY = mark(\"ChartDotY\", \"dotY\");\nexport const ChartCircle = mark(\"ChartCircle\", \"circle\");\nexport const ChartHexagon = mark(\"ChartHexagon\", \"hexagon\");\nexport const ChartImage = mark(\"ChartImage\", \"image\");\n\nexport const ChartRect = mark(\"ChartRect\", \"rect\");\nexport const ChartRectY = mark(\"ChartRectY\", \"rectY\");\nexport const ChartRectX = mark(\"ChartRectX\", \"rectX\");\nexport const ChartCell = mark(\"ChartCell\", \"cell\");\nexport const ChartCellX = mark(\"ChartCellX\", \"cellX\");\nexport const ChartCellY = mark(\"ChartCellY\", \"cellY\");\n\nexport const ChartRuleY = mark(\"ChartRuleY\", \"ruleY\");\nexport const ChartRuleX = mark(\"ChartRuleX\", \"ruleX\");\nexport const ChartTickX = mark(\"ChartTickX\", \"tickX\");\nexport const ChartTickY = mark(\"ChartTickY\", \"tickY\");\nexport const ChartText = mark(\"ChartText\", \"text\");\nexport const ChartTextX = mark(\"ChartTextX\", \"textX\");\nexport const ChartTextY = mark(\"ChartTextY\", \"textY\");\n\nexport const ChartVector = mark(\"ChartVector\", \"vector\");\n// vgplot 0.29.2 builds this one with the mark type `vectoX`, which Observable Plot has no\n// function for. Wrapped for symmetry; use `<ChartVector>` until upstream fixes the typo.\nexport const ChartVectorX = mark(\"ChartVectorX\", \"vectorX\");\nexport const ChartVectorY = mark(\"ChartVectorY\", \"vectorY\");\nexport const ChartSpike = mark(\"ChartSpike\", \"spike\");\nexport const ChartArrow = mark(\"ChartArrow\", \"arrow\");\nexport const ChartLink = mark(\"ChartLink\", \"link\");\n\nexport const ChartHeatmap = mark(\"ChartHeatmap\", \"heatmap\");\nexport const ChartRaster = mark(\"ChartRaster\", \"raster\");\nexport const ChartRasterTile = mark(\"ChartRasterTile\", \"rasterTile\");\nexport const ChartContour = mark(\"ChartContour\", \"contour\");\nexport const ChartDenseLine = mark(\"ChartDenseLine\", \"denseLine\");\nexport const ChartDensity = mark(\"ChartDensity\", \"density\");\nexport const ChartDensityY = mark(\"ChartDensityY\", \"densityY\");\nexport const ChartDensityX = mark(\"ChartDensityX\", \"densityX\");\nexport const ChartHexbin = mark(\"ChartHexbin\", \"hexbin\");\nexport const ChartRegressionY = mark(\"ChartRegressionY\", \"regressionY\");\nexport const ChartErrorbarY = mark(\"ChartErrorbarY\", \"errorbarY\");\nexport const ChartErrorbarX = mark(\"ChartErrorbarX\", \"errorbarX\");\n\nexport const ChartVoronoi = mark(\"ChartVoronoi\", \"voronoi\");\nexport const ChartVoronoiMesh = mark(\"ChartVoronoiMesh\", \"voronoiMesh\");\nexport const ChartDelaunayLink = mark(\"ChartDelaunayLink\", \"delaunayLink\");\nexport const ChartDelaunayMesh = mark(\"ChartDelaunayMesh\", \"delaunayMesh\");\nexport const ChartHull = mark(\"ChartHull\", \"hull\");\nexport const ChartGeo = mark(\"ChartGeo\", \"geo\");\n\n// Decorators: they draw the frame, not the data, so vgplot gives them options and no source.\nexport const ChartFrame = mark(\"ChartFrame\", \"frame\", true);\nexport const ChartGridX = mark(\"ChartGridX\", \"gridX\", true);\nexport const ChartGridY = mark(\"ChartGridY\", \"gridY\", true);\nexport const ChartHexgrid = mark(\"ChartHexgrid\", \"hexgrid\", true);\nexport const ChartSphere = mark(\"ChartSphere\", \"sphere\", true);\nexport const ChartGraticule = mark(\"ChartGraticule\", \"graticule\", true);\n\nexport interface ChartRawProps {\n /** A `vg.*` directive, or several — `vg.axisFx({ anchor: \"top\" })`. */\n spec: unknown;\n}\n\n/**\n * The escape hatch. The wrappers above cover vgplot's mark vocabulary, but not its ~250 attributes\n * nor the `axisX`/`axisFy` decorator marks the axis descriptors deliberately compile away from.\n * Anything unwrapped goes in here, in source order, with the same interactor-binding semantics as\n * a wrapped mark:\n *\n * ```tsx\n * <ChartRaw spec={vg.axisFy({ anchor: \"right\", tickRotate: 45 })} />\n * ```\n */\nexport const ChartRaw = chartDescriptor<ChartRawProps>(\"ChartRaw\", (props) =>\n Array.isArray(props.spec)\n ? props.spec.map((value: unknown) => ({ kind: \"raw\" as const, value }))\n : { kind: \"raw\", value: props.spec },\n);\n"],"names":["COLOR_CHANNELS","STACKING_MARKS","markSource","props","ctx","decorator","table","markDirective","mark","channels","series","v","isColorValue","channel","value","isColorToken","displayName","type","chartDescriptor","ChartBarY","ChartBarX","ChartWaffleY","ChartWaffleX","ChartLine","ChartLineY","ChartLineX","ChartArea","ChartAreaY","ChartAreaX","ChartDot","ChartDotX","ChartDotY","ChartCircle","ChartHexagon","ChartImage","ChartRect","ChartRectY","ChartRectX","ChartCell","ChartCellX","ChartCellY","ChartRuleY","ChartRuleX","ChartTickX","ChartTickY","ChartText","ChartTextX","ChartTextY","ChartVector","ChartVectorX","ChartVectorY","ChartSpike","ChartArrow","ChartLink","ChartHeatmap","ChartRaster","ChartRasterTile","ChartContour","ChartDenseLine","ChartDensity","ChartDensityY","ChartDensityX","ChartHexbin","ChartRegressionY","ChartErrorbarY","ChartErrorbarX","ChartVoronoi","ChartVoronoiMesh","ChartDelaunayLink","ChartDelaunayMesh","ChartHull","ChartGeo","ChartFrame","ChartGridX","ChartGridY","ChartHexgrid","ChartSphere","ChartGraticule","ChartRaw"],"mappings":";;AA+EA,MAAMA,IAAiB,CAAC,QAAQ,QAAQ,GAYlCC,wBAAqB,IAAI;AAAA,EAC7B;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAS;AAAA,EAAQ;AAAA,E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,IACpE,EAAE,MAAM,OAAO,OAAOX,EAAM,KAAA;AAClC;"}
@@ -1,3 +1,4 @@
1
+ import { TableExpr } from '@kanzo-tech/mosaic';
1
2
  import { ReactNode, default as React } from 'react';
2
3
  import { ark } from '@ark-ui/react/factory';
3
4
  import { Selection, Coordinator } from '@uwdata/mosaic-core';
@@ -7,7 +8,7 @@ export interface ChartContextValue {
7
8
  /** The active Mosaic coordinator, for a consumer that queries alongside the plot. */
8
9
  coordinator: Coordinator;
9
10
  config: ChartConfig;
10
- table?: string;
11
+ table?: TableExpr;
11
12
  /** What the marks filter by; `null` = the full relation. */
12
13
  filterBy: Selection | null;
13
14
  /** Where the interactors publish. */
@@ -39,8 +40,12 @@ export declare function useChartContext(): ChartContextValue;
39
40
  /** The chart context, or `null` — for parts that also work standalone, like `ChartLegend`. */
40
41
  export declare function useChartContextOptional(): ChartContextValue | null;
41
42
  export interface ChartRootProps extends Omit<React.ComponentProps<typeof ark.div>, "children">, ChartFacetOptions {
42
- /** The relation registered in the coordinator. Omit it when every mark carries its own `data`. */
43
- table?: string;
43
+ /**
44
+ * The relation the marks read. A string is one identifier in the default catalog; a relation in
45
+ * another catalog is a mosaic-sql node — `verbatim(relation.sql)`, `asTableRef([catalog, name])`.
46
+ * Omit it when every mark carries its own `data`.
47
+ */
48
+ table?: TableExpr;
44
49
  /** What the marks filter by. Defaults to the `<MosaicProvider>` crossfilter; `null` = unfiltered. */
45
50
  filterBy?: Selection | null;
46
51
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"chart-root.d.ts","sourceRoot":"","sources":["../../src/charts/chart-root.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAmE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAClH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGl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OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,KAAK,MAAM,CAAC;CAC7E;AAID;;;;;;;GAOG;AACH,wBAAgB,eAAe,IAAI,iBAAiB,CAInD;AAED,8FAA8F;AAC9F,wBAAgB,uBAAuB,IAAI,iBAAiB,GAAG,IAAI,CAElE;AAED,MAAM,WAAW,cACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,EAC5D,iBAAiB;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,qGAAqG;IACrG,QAAQ,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5B;;;;OAIG;IACH,EAAE,CAAC,EAAE,SAAS,CAAC;IACf,8FAA8F;IAC9F,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAChC,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uFAAuF;IACvF,YAAY,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC;IACxC,wFAAwF;IACxF,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,uDAAuD;IACvD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAID;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,qBAmI9C"}
@@ -1,17 +1,17 @@
1
1
  "use client";
2
- import { jsx as v, jsxs as Q } from "react/jsx-runtime";
3
- import { useState as U, useRef as D, useEffect as X, useMemo as Z, useContext as K, createContext as tt } from "react";
4
- import { ark as ot } from "@ark-ui/react/factory";
5
- import { Selection as rt } from "@uwdata/mosaic-core";
2
+ import { jsx as v, jsxs as U } from "react/jsx-runtime";
3
+ import { useState as X, useRef as D, useEffect as Z, useMemo as tt, useContext as V, createContext as ot } from "react";
4
+ import { ark as rt } from "@ark-ui/react/factory";
5
+ import { Selection as nt } from "@uwdata/mosaic-core";
6
6
  import * as C from "@uwdata/vgplot";
7
- import { cn as nt } from "../lib/cn.js";
8
- import { chartSeriesColor as et, isColorToken as st, colorTokenName as G, chartColorScale as at } from "./chart-config.js";
9
- import { compileChartSpec as ct, chartSpecSignature as lt, chartSpecWarnings as ut, buildChartSpec as it } from "./chart-spec.js";
10
- import { useMosaic as ft } from "./mosaic-provider.js";
7
+ import { cn as et } from "../lib/cn.js";
8
+ import { chartSeriesColor as st, isColorToken as at, colorTokenName as G, chartColorScale as ct } from "./chart-config.js";
9
+ import { chartTableKey as lt, compileChartSpec as ut, chartSpecSignature as it, chartSpecWarnings as ft, buildChartSpec as mt } from "./chart-spec.js";
10
+ import { useMosaic as pt } from "./mosaic-provider.js";
11
11
  import { resolveTokenColor as I } from "../lib/token-color.js";
12
- import { TokenizedPlot as mt } from "./tokenized-plot.js";
12
+ import { TokenizedPlot as ht } from "./tokenized-plot.js";
13
13
  const a = C;
14
- function pt(t) {
14
+ function Ct(t) {
15
15
  var o, c;
16
16
  switch (t.kind) {
17
17
  case "mark": {
@@ -29,45 +29,45 @@ function pt(t) {
29
29
  return t.value;
30
30
  }
31
31
  }
32
- const g = tt(null);
33
- function Rt() {
34
- const t = K(g);
32
+ const g = ot(null);
33
+ function Mt() {
34
+ const t = V(g);
35
35
  if (!t) throw new Error("useChartContext must be used within a <ChartRoot>.");
36
36
  return t;
37
37
  }
38
- function Mt() {
39
- return K(g);
38
+ function Jt() {
39
+ return V(g);
40
40
  }
41
- const ht = {};
42
- function Tt(t) {
41
+ const gt = {};
42
+ function Kt(t) {
43
43
  const {
44
44
  table: o,
45
45
  filterBy: c,
46
46
  as: l,
47
- config: e = ht,
47
+ config: e = gt,
48
48
  height: y = 200,
49
49
  margin: x,
50
50
  aspectRatio: N,
51
51
  facetMargin: S,
52
- facetGrid: d,
53
- facetLabel: w,
54
- attributes: b,
52
+ facetGrid: b,
53
+ facetLabel: d,
54
+ attributes: w,
55
55
  locale: k,
56
56
  numberFormat: B,
57
57
  children: i,
58
- className: V,
59
- plotClassName: _,
60
- ref: z,
61
- slot: L,
62
- ...W
63
- } = t, { coordinator: O, crossfilter: E, selected: Y, registerSelection: R } = ft(), [f] = U(() => rt.union()), s = l ?? f, u = c === void 0 ? E : c, M = D(null);
64
- X(
58
+ className: _,
59
+ plotClassName: z,
60
+ ref: L,
61
+ slot: W,
62
+ ...Y
63
+ } = t, { coordinator: O, crossfilter: E, selected: $, registerSelection: R } = pt(), [f] = X(() => nt.union()), s = l ?? f, u = c === void 0 ? E : c, T = D(null);
64
+ Z(
65
65
  // Only the selection this root minted is relayed: a caller-supplied `as` was wired by the
66
66
  // caller (`include`, or another root), and relaying it again would double every clause.
67
67
  () => R(s, { relay: s === f }),
68
68
  [R, s, f]
69
69
  );
70
- const $ = JSON.stringify(B ?? null), q = Z(
70
+ const q = JSON.stringify(B ?? null), M = lt(o), A = tt(
71
71
  () => ({
72
72
  coordinator: O,
73
73
  config: e,
@@ -75,57 +75,57 @@ function Tt(t) {
75
75
  filterBy: u,
76
76
  as: s,
77
77
  color: (r) => {
78
- const n = et(e, r);
79
- return n === void 0 || !st(n) || typeof document > "u" ? n : I(M.current ?? document.documentElement, G(n));
78
+ const n = st(e, r);
79
+ return n === void 0 || !at(n) || typeof document > "u" ? n : I(T.current ?? document.documentElement, G(n));
80
80
  },
81
81
  formatNumber: (r, n) => new Intl.NumberFormat(k, n ?? B).format(r)
82
82
  }),
83
- // `numberKey` stands in for the options object's identity; `numberFormat` itself is read fresh.
83
+ // `numberKey` and `tableKey` stand in for their objects' identities; both are read fresh.
84
84
  // eslint-disable-next-line react-hooks/exhaustive-deps
85
- [O, e, o, u, s, k, $]
86
- ), T = ct(i, {
85
+ [O, e, M, u, s, k, q]
86
+ ), J = ut(i, {
87
87
  table: o,
88
88
  filterBy: u,
89
89
  as: s,
90
90
  config: e,
91
- resolveColor: Ct
92
- }), m = lt(T), A = JSON.stringify(at(e)), J = D(null);
93
- if (process.env.NODE_ENV !== "production" && J.current !== m) {
94
- J.current = m;
95
- const r = { shared: [E, Y] };
96
- for (const n of ut(T, r)) console.warn(`[ChartRoot] ${n}`);
91
+ resolveColor: yt
92
+ }), m = it(J), H = JSON.stringify(ct(e)), K = D(null);
93
+ if (process.env.NODE_ENV !== "production" && K.current !== m) {
94
+ K.current = m;
95
+ const r = { shared: [E, $] };
96
+ for (const n of ft(J, r)) console.warn(`[ChartRoot] ${n}`);
97
97
  }
98
- return /* @__PURE__ */ v(g.Provider, { value: q, children: /* @__PURE__ */ Q(
99
- ot.div,
98
+ return /* @__PURE__ */ v(g.Provider, { value: A, children: /* @__PURE__ */ U(
99
+ rt.div,
100
100
  {
101
- className: nt("flex w-full flex-col gap-2", V),
101
+ className: et("flex w-full flex-col gap-2", _),
102
102
  ref: (r) => {
103
- M.current = r, gt(z, r);
103
+ T.current = r, xt(L, r);
104
104
  },
105
- ...W,
106
- "data-slot": L ?? "chart-root",
105
+ ...Y,
106
+ "data-slot": W ?? "chart-root",
107
107
  children: [
108
108
  /* @__PURE__ */ v(
109
- mt,
109
+ ht,
110
110
  {
111
- className: _,
111
+ className: z,
112
112
  deps: [
113
113
  m,
114
- A,
115
- o,
114
+ H,
115
+ M,
116
116
  u,
117
117
  s,
118
118
  y,
119
119
  N,
120
120
  JSON.stringify(x ?? null),
121
121
  JSON.stringify(S ?? null),
122
+ b,
122
123
  d,
123
- w,
124
- b
124
+ w
125
125
  ],
126
126
  render: (r, n) => {
127
- const F = /* @__PURE__ */ new Map(), H = it(
128
- { children: i, width: r, height: y, margin: x, aspectRatio: N, facetMargin: S, facetGrid: d, facetLabel: w, attributes: b },
127
+ const F = /* @__PURE__ */ new Map(), Q = mt(
128
+ { children: i, width: r, height: y, margin: x, aspectRatio: N, facetMargin: S, facetGrid: b, facetLabel: d, attributes: w },
129
129
  {
130
130
  table: o,
131
131
  filterBy: u,
@@ -139,7 +139,7 @@ function Tt(t) {
139
139
  }
140
140
  }
141
141
  );
142
- return C.plot(...H.map(pt).filter((p) => p !== null));
142
+ return C.plot(...Q.map(Ct).filter((p) => p !== null));
143
143
  }
144
144
  }
145
145
  ),
@@ -148,15 +148,15 @@ function Tt(t) {
148
148
  }
149
149
  ) });
150
150
  }
151
- function Ct(t) {
151
+ function yt(t) {
152
152
  return t;
153
153
  }
154
- function gt(t, o) {
154
+ function xt(t, o) {
155
155
  typeof t == "function" ? t(o) : t && (t.current = o);
156
156
  }
157
157
  export {
158
- Tt as ChartRoot,
159
- Rt as useChartContext,
160
- Mt as useChartContextOptional
158
+ Kt as ChartRoot,
159
+ Mt as useChartContext,
160
+ Jt as useChartContextOptional
161
161
  };
162
162
  //# sourceMappingURL=chart-root.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chart-root.js","sources":["../../src/charts/chart-root.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext, useEffect, useMemo, useRef, useState, type ReactNode, type Ref } from \"react\";\nimport type React from \"react\";\nimport { ark } from \"@ark-ui/react/factory\";\nimport { Selection, type Coordinator } from \"@uwdata/mosaic-core\";\nimport * as vg from \"@uwdata/vgplot\";\nimport { cn } from \"../lib/cn.js\";\nimport { chartColorScale, chartSeriesColor, colorTokenName, isColorToken, type ChartConfig } from \"./chart-config.js\";\nimport {\n buildChartSpec,\n chartSpecSignature,\n chartSpecWarnings,\n compileChartSpec,\n type ChartDirective,\n type ChartFacetOptions,\n type ChartMargin,\n type ChartSpecContext,\n} from \"./chart-spec.js\";\nimport { useMosaic } from \"./mosaic-provider.js\";\nimport { resolveTokenColor } from \"../lib/token-color.js\";\nimport { TokenizedPlot } from \"./tokenized-plot.js\";\n\n/** vgplot ships `any` for every directive; this is the one place we pin a shape to it. */\ntype VgDirective = (plot: unknown) => void;\nconst directives = vg as unknown as Record<string, ((...args: unknown[]) => VgDirective) | undefined>;\n\nfunction toVgDirective(directive: ChartDirective): VgDirective | null {\n switch (directive.kind) {\n case \"mark\": {\n const fn = directives[directive.mark];\n if (!fn) return null;\n // A decorator takes options only; everything else takes (data, options).\n if (directive.source === null) return fn(directive.options);\n const data =\n directive.source.kind === \"values\"\n ? [...directive.source.values]\n : vg.from(directive.source.table, directive.source.filterBy ? { filterBy: directive.source.filterBy } : undefined);\n return fn(data, directive.options);\n }\n case \"interactor\":\n return directives[directive.interactor]?.(directive.options) ?? null;\n case \"attribute\":\n return directives[directive.name]?.(directive.value) ?? null;\n case \"raw\":\n return directive.value as VgDirective;\n }\n}\n\nexport interface ChartContextValue {\n /** The active Mosaic coordinator, for a consumer that queries alongside the plot. */\n coordinator: Coordinator;\n config: ChartConfig;\n table?: string;\n /** What the marks filter by; `null` = the full relation. */\n filterBy: Selection | null;\n /** Where the interactors publish. */\n as: Selection;\n /**\n * The series colour, normalised to `rgb(...)` so it is safe for both CSS and Plot. `undefined`\n * for a key the config does not name.\n *\n * Normalising is what makes it dual-purpose and is also what makes it a **snapshot**: the answer\n * is read off the DOM when you call it, and nothing re-calls it when the theme or the scheme\n * changes. `ChartLegend` deliberately does not use this — its only sink is a `style`, so it\n * passes `var(--chart-N)` through and lets the browser follow the theme for free. Take the same\n * route for anything that only ends up in CSS; pair this with `useThemeTick` when you need the\n * literal, which is to say when you are handing it to Plot.\n */\n color: (key: string) => string | undefined;\n /** The chart's locale number formatter — one vocabulary for axes, legend and tooltip. */\n formatNumber: (value: number, options?: Intl.NumberFormatOptions) => string;\n}\n\nconst ChartContext = createContext<ChartContextValue | null>(null);\n\n/**\n * The chart context — config, selections, coordinator, and the `color` / `formatNumber` helpers\n * that keep a series' identity in one place. Throws outside a `<ChartRoot>`.\n *\n * Available to DOM parts (`ChartLegend`, a custom tooltip, a readout). **Not** to descriptors:\n * `ChartRoot` reads their props off the element before React renders them, so a mark cannot pull\n * anything out of context — pass the value down from the component that owns the `<ChartRoot>`.\n */\nexport function useChartContext(): ChartContextValue {\n const ctx = useContext(ChartContext);\n if (!ctx) throw new Error(\"useChartContext must be used within a <ChartRoot>.\");\n return ctx;\n}\n\n/** The chart context, or `null` — for parts that also work standalone, like `ChartLegend`. */\nexport function useChartContextOptional(): ChartContextValue | null {\n return useContext(ChartContext);\n}\n\nexport interface ChartRootProps\n extends Omit<React.ComponentProps<typeof ark.div>, \"children\">,\n ChartFacetOptions {\n /** The relation registered in the coordinator. Omit it when every mark carries its own `data`. */\n table?: string;\n /** What the marks filter by. Defaults to the `<MosaicProvider>` crossfilter; `null` = unfiltered. */\n filterBy?: Selection | null;\n /**\n * Where the child interactors publish, and what `ChartHighlight` reads back. Defaults to a\n * selection this root owns, relayed into the provider — see the note on `ChartRoot`. Pass one and\n * you own its wiring: nothing is relayed for you, though the provider's `reset()` still clears it.\n */\n as?: Selection;\n /** Series key → `{ label, color, icon }`. A non-empty config pins the plot's colour scale. */\n config?: ChartConfig;\n /** Plot height in px; the width is measured from the container. Default 200. */\n height?: number;\n margin?: number | ChartMargin;\n aspectRatio?: number;\n /**\n * Raw `vg.*` directives for anything the layer does not wrap. Applied last, so they win.\n * Keep the array referentially stable — a new array rebuilds the plot.\n */\n attributes?: readonly unknown[];\n /** BCP-47 tag for `formatNumber`. Defaults to the runtime locale. */\n locale?: string;\n /** Default options for `formatNumber` — the chart's number vocabulary in one place. */\n numberFormat?: Intl.NumberFormatOptions;\n /** Descriptors (marks, interactors, axes) plus real DOM parts such as `ChartLegend`. */\n children?: ReactNode;\n /** Class for the plot host itself, inside the root. */\n plotClassName?: string;\n}\n\nconst EMPTY_CONFIG: ChartConfig = {};\n\n/**\n * Why every chart owns a selection instead of sharing the page's.\n *\n * `ChartHighlight` does not filter — it asks the mark's **own** query which rows are selected, by\n * appending the predicate as an extra output column: `q._groupby.length ? q.select({__: pred})`.\n * On an aggregating mark that query has a `GROUP BY`, so a predicate naming a column this plot does\n * not group by is `Binder Error: column \"provider\" must appear in the GROUP BY clause`. The query\n * dies, vgplot swallows it, and **the plot keeps its previous render** — no error, no empty state,\n * nothing but a console line. It costs hours to find, because the symptom looks like a broken\n * crossfilter three components away.\n *\n * A page-wide publish target guarantees that failure the moment a second chart filters by a second\n * column. So each root publishes into a union of its own: those clauses, by construction, name only\n * columns this plot's own interactors could produce — which are the columns its marks group by. The\n * clauses are relayed on into the provider (`selected` → `crossfilter`) with `source` and `clients`\n * intact, so every other chart filters exactly as before and this one still does not filter itself.\n */\nexport function ChartRoot(props: ChartRootProps) {\n const {\n table,\n filterBy,\n as,\n config = EMPTY_CONFIG,\n height = 200,\n margin,\n aspectRatio,\n facetMargin,\n facetGrid,\n facetLabel,\n attributes,\n locale,\n numberFormat,\n children,\n className,\n plotClassName,\n ref,\n slot,\n ...rest\n } = props;\n const { coordinator, crossfilter, selected, registerSelection } = useMosaic();\n // A plain union, so it hides nothing from its own publisher — a crossfilter would, and\n // `ChartHighlight` would read an empty predicate and dim nothing.\n const [own] = useState(() => Selection.union());\n const target = as ?? own;\n const source = filterBy === undefined ? crossfilter : filterBy;\n const host = useRef<HTMLDivElement | null>(null);\n\n useEffect(\n // Only the selection this root minted is relayed: a caller-supplied `as` was wired by the\n // caller (`include`, or another root), and relaying it again would double every clause.\n () => registerSelection(target, { relay: target === own }),\n [registerSelection, target, own],\n );\n\n const numberKey = JSON.stringify(numberFormat ?? null);\n const context = useMemo<ChartContextValue>(\n () => ({\n coordinator,\n config,\n table,\n filterBy: source,\n as: target,\n color: (key) => {\n const value = chartSeriesColor(config, key);\n if (value === undefined || !isColorToken(value) || typeof document === \"undefined\") return value;\n // Resolve against the element the chart lives in, so a scoped theme override wins.\n return resolveTokenColor(host.current ?? document.documentElement, colorTokenName(value));\n },\n formatNumber: (value, options) =>\n new Intl.NumberFormat(locale, options ?? numberFormat).format(value),\n }),\n // `numberKey` stands in for the options object's identity; `numberFormat` itself is read fresh.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [coordinator, config, table, source, target, locale, numberKey],\n );\n\n // Compiled twice on purpose: once here with an identity colour resolver, purely to fingerprint\n // the grammar for `deps`, and once inside the render below against the live DOM. The pure pass\n // is what keeps a re-render from re-running every query.\n const pure = compileChartSpec(children, {\n table, filterBy: source, as: target, config, resolveColor: identity,\n });\n const signature = chartSpecSignature(pure);\n const colorKey = JSON.stringify(chartColorScale(config));\n\n // Keyed by signature so an unchanged chart warns once, not on every render.\n const warned = useRef<string | null>(null);\n if (process.env.NODE_ENV !== \"production\" && warned.current !== signature) {\n warned.current = signature;\n const context = { shared: [crossfilter, selected] };\n for (const warning of chartSpecWarnings(pure, context)) console.warn(`[ChartRoot] ${warning}`);\n }\n\n return (\n <ChartContext.Provider value={context}>\n <ark.div\n className={cn(\"flex w-full flex-col gap-2\", className)}\n ref={(node: HTMLDivElement | null) => {\n host.current = node;\n assignRef(ref, node);\n }}\n {...rest}\n data-slot={slot ?? \"chart-root\"}\n >\n <TokenizedPlot\n className={plotClassName}\n deps={[\n signature,\n colorKey,\n table,\n source,\n target,\n height,\n aspectRatio,\n JSON.stringify(margin ?? null),\n JSON.stringify(facetMargin ?? null),\n facetGrid,\n facetLabel,\n attributes,\n ]}\n render={(width, plotHost) => {\n const cache = new Map<string, string>();\n const ctx: ChartSpecContext = {\n table,\n filterBy: source,\n as: target,\n config,\n resolveColor: (token) => {\n const name = colorTokenName(token);\n const hit = cache.get(name);\n if (hit !== undefined) return hit;\n const resolved = resolveTokenColor(plotHost, name);\n cache.set(name, resolved);\n return resolved;\n },\n };\n const spec = buildChartSpec(\n { children, width, height, margin, aspectRatio, facetMargin, facetGrid, facetLabel, attributes },\n ctx,\n );\n return vg.plot(...spec.map(toVgDirective).filter((d): d is VgDirective => d !== null));\n }}\n />\n {children}\n </ark.div>\n </ChartContext.Provider>\n );\n}\n\nfunction identity(token: string): string {\n return token;\n}\n\n/** The root keeps its own handle on the host (for token resolution) without stealing the caller's. */\nfunction assignRef(ref: Ref<HTMLDivElement> | undefined, node: HTMLDivElement | null): void {\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAyBA;AAEA;;AACE;AAAkB;AAEd;AACA;AAEA;AACA;AAIA;AAAiC;AACnC;AAEE;AAAgE;AAEhE;AAAwD;AAExD;AAAiB;AAEvB;AA2BA;AAUO;AACL;AACA;AACA;AACF;AAGO;AACL;AACF;AAoCA;AAmBO;AACL;AAAM;AACJ;AACA;AACA;AACS;AACA;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACG;AAUL;AAAA;AAAA;AAAA;AAG2D;AAC1B;AAGjC;AACgB;AACP;AACL;AACA;AACA;AACU;AACN;AAEF;AACA;AAEwF;AAC1F;AAEqE;AAAA;AAAA;AAAA;AAIT;AAMxB;AACtC;AAAiB;AAAY;AAAQ;AAAsB;AAO7D;AACE;AACA;AACA;AAA6F;AAG/F;AAEI;AAAK;AAAJ;AACsD;AAEnD;AACmB;AACrB;AACI;AACe;AAEnB;AAAA;AAAC;AAAA;AACY;AACL;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AAC6B;AACK;AAClC;AACA;AACA;AAAA;AAGA;AAea;AACyE;AAfxD;AAC5B;AACU;AACN;AACJ;AAEE;AAEA;AACA;AACA;AACO;AACT;AAAA;AAMF;AAAqF;AACvF;AAAA;AAAA;AAED;AAAA;AAAA;AAIT;AAEA;AACE;AACF;AAGA;AACE;AAEF;;;;;;"}
1
+ {"version":3,"file":"chart-root.js","sources":["../../src/charts/chart-root.tsx"],"sourcesContent":["\"use client\";\n\nimport type { TableExpr } from \"@kanzo-tech/mosaic\";\nimport { createContext, useContext, useEffect, useMemo, useRef, useState, type ReactNode, type Ref } from \"react\";\nimport type React from \"react\";\nimport { ark } from \"@ark-ui/react/factory\";\nimport { Selection, type Coordinator } from \"@uwdata/mosaic-core\";\nimport * as vg from \"@uwdata/vgplot\";\nimport { cn } from \"../lib/cn.js\";\nimport { chartColorScale, chartSeriesColor, colorTokenName, isColorToken, type ChartConfig } from \"./chart-config.js\";\nimport {\n buildChartSpec,\n chartSpecSignature,\n chartSpecWarnings,\n chartTableKey,\n compileChartSpec,\n type ChartDirective,\n type ChartFacetOptions,\n type ChartMargin,\n type ChartSpecContext,\n} from \"./chart-spec.js\";\nimport { useMosaic } from \"./mosaic-provider.js\";\nimport { resolveTokenColor } from \"../lib/token-color.js\";\nimport { TokenizedPlot } from \"./tokenized-plot.js\";\n\n/** vgplot ships `any` for every directive; this is the one place we pin a shape to it. */\ntype VgDirective = (plot: unknown) => void;\nconst directives = vg as unknown as Record<string, ((...args: unknown[]) => VgDirective) | undefined>;\n\nfunction toVgDirective(directive: ChartDirective): VgDirective | null {\n switch (directive.kind) {\n case \"mark\": {\n const fn = directives[directive.mark];\n if (!fn) return null;\n // A decorator takes options only; everything else takes (data, options).\n if (directive.source === null) return fn(directive.options);\n const data =\n directive.source.kind === \"values\"\n ? [...directive.source.values]\n : vg.from(directive.source.table, directive.source.filterBy ? { filterBy: directive.source.filterBy } : undefined);\n return fn(data, directive.options);\n }\n case \"interactor\":\n return directives[directive.interactor]?.(directive.options) ?? null;\n case \"attribute\":\n return directives[directive.name]?.(directive.value) ?? null;\n case \"raw\":\n return directive.value as VgDirective;\n }\n}\n\nexport interface ChartContextValue {\n /** The active Mosaic coordinator, for a consumer that queries alongside the plot. */\n coordinator: Coordinator;\n config: ChartConfig;\n table?: TableExpr;\n /** What the marks filter by; `null` = the full relation. */\n filterBy: Selection | null;\n /** Where the interactors publish. */\n as: Selection;\n /**\n * The series colour, normalised to `rgb(...)` so it is safe for both CSS and Plot. `undefined`\n * for a key the config does not name.\n *\n * Normalising is what makes it dual-purpose and is also what makes it a **snapshot**: the answer\n * is read off the DOM when you call it, and nothing re-calls it when the theme or the scheme\n * changes. `ChartLegend` deliberately does not use this — its only sink is a `style`, so it\n * passes `var(--chart-N)` through and lets the browser follow the theme for free. Take the same\n * route for anything that only ends up in CSS; pair this with `useThemeTick` when you need the\n * literal, which is to say when you are handing it to Plot.\n */\n color: (key: string) => string | undefined;\n /** The chart's locale number formatter — one vocabulary for axes, legend and tooltip. */\n formatNumber: (value: number, options?: Intl.NumberFormatOptions) => string;\n}\n\nconst ChartContext = createContext<ChartContextValue | null>(null);\n\n/**\n * The chart context — config, selections, coordinator, and the `color` / `formatNumber` helpers\n * that keep a series' identity in one place. Throws outside a `<ChartRoot>`.\n *\n * Available to DOM parts (`ChartLegend`, a custom tooltip, a readout). **Not** to descriptors:\n * `ChartRoot` reads their props off the element before React renders them, so a mark cannot pull\n * anything out of context — pass the value down from the component that owns the `<ChartRoot>`.\n */\nexport function useChartContext(): ChartContextValue {\n const ctx = useContext(ChartContext);\n if (!ctx) throw new Error(\"useChartContext must be used within a <ChartRoot>.\");\n return ctx;\n}\n\n/** The chart context, or `null` — for parts that also work standalone, like `ChartLegend`. */\nexport function useChartContextOptional(): ChartContextValue | null {\n return useContext(ChartContext);\n}\n\nexport interface ChartRootProps\n extends Omit<React.ComponentProps<typeof ark.div>, \"children\">,\n ChartFacetOptions {\n /**\n * The relation the marks read. A string is one identifier in the default catalog; a relation in\n * another catalog is a mosaic-sql node — `verbatim(relation.sql)`, `asTableRef([catalog, name])`.\n * Omit it when every mark carries its own `data`.\n */\n table?: TableExpr;\n /** What the marks filter by. Defaults to the `<MosaicProvider>` crossfilter; `null` = unfiltered. */\n filterBy?: Selection | null;\n /**\n * Where the child interactors publish, and what `ChartHighlight` reads back. Defaults to a\n * selection this root owns, relayed into the provider — see the note on `ChartRoot`. Pass one and\n * you own its wiring: nothing is relayed for you, though the provider's `reset()` still clears it.\n */\n as?: Selection;\n /** Series key → `{ label, color, icon }`. A non-empty config pins the plot's colour scale. */\n config?: ChartConfig;\n /** Plot height in px; the width is measured from the container. Default 200. */\n height?: number;\n margin?: number | ChartMargin;\n aspectRatio?: number;\n /**\n * Raw `vg.*` directives for anything the layer does not wrap. Applied last, so they win.\n * Keep the array referentially stable — a new array rebuilds the plot.\n */\n attributes?: readonly unknown[];\n /** BCP-47 tag for `formatNumber`. Defaults to the runtime locale. */\n locale?: string;\n /** Default options for `formatNumber` — the chart's number vocabulary in one place. */\n numberFormat?: Intl.NumberFormatOptions;\n /** Descriptors (marks, interactors, axes) plus real DOM parts such as `ChartLegend`. */\n children?: ReactNode;\n /** Class for the plot host itself, inside the root. */\n plotClassName?: string;\n}\n\nconst EMPTY_CONFIG: ChartConfig = {};\n\n/**\n * Why every chart owns a selection instead of sharing the page's.\n *\n * `ChartHighlight` does not filter — it asks the mark's **own** query which rows are selected, by\n * appending the predicate as an extra output column: `q._groupby.length ? q.select({__: pred})`.\n * On an aggregating mark that query has a `GROUP BY`, so a predicate naming a column this plot does\n * not group by is `Binder Error: column \"provider\" must appear in the GROUP BY clause`. The query\n * dies, vgplot swallows it, and **the plot keeps its previous render** — no error, no empty state,\n * nothing but a console line. It costs hours to find, because the symptom looks like a broken\n * crossfilter three components away.\n *\n * A page-wide publish target guarantees that failure the moment a second chart filters by a second\n * column. So each root publishes into a union of its own: those clauses, by construction, name only\n * columns this plot's own interactors could produce — which are the columns its marks group by. The\n * clauses are relayed on into the provider (`selected` → `crossfilter`) with `source` and `clients`\n * intact, so every other chart filters exactly as before and this one still does not filter itself.\n */\nexport function ChartRoot(props: ChartRootProps) {\n const {\n table,\n filterBy,\n as,\n config = EMPTY_CONFIG,\n height = 200,\n margin,\n aspectRatio,\n facetMargin,\n facetGrid,\n facetLabel,\n attributes,\n locale,\n numberFormat,\n children,\n className,\n plotClassName,\n ref,\n slot,\n ...rest\n } = props;\n const { coordinator, crossfilter, selected, registerSelection } = useMosaic();\n // A plain union, so it hides nothing from its own publisher — a crossfilter would, and\n // `ChartHighlight` would read an empty predicate and dim nothing.\n const [own] = useState(() => Selection.union());\n const target = as ?? own;\n const source = filterBy === undefined ? crossfilter : filterBy;\n const host = useRef<HTMLDivElement | null>(null);\n\n useEffect(\n // Only the selection this root minted is relayed: a caller-supplied `as` was wired by the\n // caller (`include`, or another root), and relaying it again would double every clause.\n () => registerSelection(target, { relay: target === own }),\n [registerSelection, target, own],\n );\n\n const numberKey = JSON.stringify(numberFormat ?? null);\n const tableKey = chartTableKey(table);\n const context = useMemo<ChartContextValue>(\n () => ({\n coordinator,\n config,\n table,\n filterBy: source,\n as: target,\n color: (key) => {\n const value = chartSeriesColor(config, key);\n if (value === undefined || !isColorToken(value) || typeof document === \"undefined\") return value;\n // Resolve against the element the chart lives in, so a scoped theme override wins.\n return resolveTokenColor(host.current ?? document.documentElement, colorTokenName(value));\n },\n formatNumber: (value, options) =>\n new Intl.NumberFormat(locale, options ?? numberFormat).format(value),\n }),\n // `numberKey` and `tableKey` stand in for their objects' identities; both are read fresh.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [coordinator, config, tableKey, source, target, locale, numberKey],\n );\n\n // Compiled twice on purpose: once here with an identity colour resolver, purely to fingerprint\n // the grammar for `deps`, and once inside the render below against the live DOM. The pure pass\n // is what keeps a re-render from re-running every query.\n const pure = compileChartSpec(children, {\n table, filterBy: source, as: target, config, resolveColor: identity,\n });\n const signature = chartSpecSignature(pure);\n const colorKey = JSON.stringify(chartColorScale(config));\n\n // Keyed by signature so an unchanged chart warns once, not on every render.\n const warned = useRef<string | null>(null);\n if (process.env.NODE_ENV !== \"production\" && warned.current !== signature) {\n warned.current = signature;\n const context = { shared: [crossfilter, selected] };\n for (const warning of chartSpecWarnings(pure, context)) console.warn(`[ChartRoot] ${warning}`);\n }\n\n return (\n <ChartContext.Provider value={context}>\n <ark.div\n className={cn(\"flex w-full flex-col gap-2\", className)}\n ref={(node: HTMLDivElement | null) => {\n host.current = node;\n assignRef(ref, node);\n }}\n {...rest}\n data-slot={slot ?? \"chart-root\"}\n >\n <TokenizedPlot\n className={plotClassName}\n deps={[\n signature,\n colorKey,\n tableKey,\n source,\n target,\n height,\n aspectRatio,\n JSON.stringify(margin ?? null),\n JSON.stringify(facetMargin ?? null),\n facetGrid,\n facetLabel,\n attributes,\n ]}\n render={(width, plotHost) => {\n const cache = new Map<string, string>();\n const ctx: ChartSpecContext = {\n table,\n filterBy: source,\n as: target,\n config,\n resolveColor: (token) => {\n const name = colorTokenName(token);\n const hit = cache.get(name);\n if (hit !== undefined) return hit;\n const resolved = resolveTokenColor(plotHost, name);\n cache.set(name, resolved);\n return resolved;\n },\n };\n const spec = buildChartSpec(\n { children, width, height, margin, aspectRatio, facetMargin, facetGrid, facetLabel, attributes },\n ctx,\n );\n return vg.plot(...spec.map(toVgDirective).filter((d): d is VgDirective => d !== null));\n }}\n />\n {children}\n </ark.div>\n </ChartContext.Provider>\n );\n}\n\nfunction identity(token: string): string {\n return token;\n}\n\n/** The root keeps its own handle on the host (for token resolution) without stealing the caller's. */\nfunction assignRef(ref: Ref<HTMLDivElement> | undefined, node: HTMLDivElement | null): void {\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AA2BA;AAEA;;AACE;AAAkB;AAEd;AACA;AAEA;AACA;AAIA;AAAiC;AACnC;AAEE;AAAgE;AAEhE;AAAwD;AAExD;AAAiB;AAEvB;AA2BA;AAUO;AACL;AACA;AACA;AACF;AAGO;AACL;AACF;AAwCA;AAmBO;AACL;AAAM;AACJ;AACA;AACA;AACS;AACA;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACG;AAUL;AAAA;AAAA;AAAA;AAG2D;AAC1B;AAGjC;AAEgB;AACP;AACL;AACA;AACA;AACU;AACN;AAEF;AACA;AAEwF;AAC1F;AAEqE;AAAA;AAAA;AAAA;AAIN;AAM3B;AACtC;AAAiB;AAAY;AAAQ;AAAsB;AAO7D;AACE;AACA;AACA;AAA6F;AAG/F;AAEI;AAAK;AAAJ;AACsD;AAEnD;AACmB;AACrB;AACI;AACe;AAEnB;AAAA;AAAC;AAAA;AACY;AACL;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AAC6B;AACK;AAClC;AACA;AACA;AAAA;AAGA;AAea;AACyE;AAfxD;AAC5B;AACU;AACN;AACJ;AAEE;AAEA;AACA;AACA;AACO;AACT;AAAA;AAMF;AAAqF;AACvF;AAAA;AAAA;AAED;AAAA;AAAA;AAIT;AAEA;AACE;AACF;AAGA;AACE;AAEF;;;;;;"}
@@ -1,17 +1,24 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { Selection } from '@uwdata/mosaic-core';
3
+ import { TableExpr } from '@kanzo-tech/mosaic';
3
4
  import { ChartConfig } from './chart-config.js';
4
5
  /**
5
6
  * The plot spec as plain data.
6
7
  *
7
8
  * `ChartRoot` compiles its descriptor children to this list and only then maps it onto `vg.*`.
8
9
  * The indirection is what makes the compiler pure: no coordinator, no DOM, no vgplot — so the
9
- * grammar is unit-testable and the vgplot binding is a single switch. (`isAggregateExpression` is
10
- * the one import, a pure AST predicate mosaic-sql exports for exactly this question.)
10
+ * grammar is unit-testable and the vgplot binding is a single switch. (mosaic-sql is the one
11
+ * engine import: `isAggregateExpression` and `asTableRef`, both pure AST.)
11
12
  */
13
+ /**
14
+ * A relation's SQL, which is also its identity. A host that writes `verbatim(sql)` inline builds a
15
+ * new node every render and still names the same relation, so the plot and every query key on this
16
+ * and not on the node.
17
+ */
18
+ export declare function chartTableKey(table: TableExpr | undefined): string | undefined;
12
19
  export type ChartMarkSource = {
13
20
  readonly kind: "table";
14
- readonly table: string;
21
+ readonly table: TableExpr;
15
22
  readonly filterBy: Selection | null;
16
23
  } | {
17
24
  readonly kind: "values";
@@ -43,7 +50,7 @@ export interface ChartRawDirective {
43
50
  export type ChartDirective = ChartMarkDirective | ChartInteractorDirective | ChartAttributeDirective | ChartRawDirective;
44
51
  export interface ChartSpecContext {
45
52
  /** The relation every table-backed mark reads from. */
46
- readonly table?: string;
53
+ readonly table?: TableExpr;
47
54
  /** What marks filter by; `null` means "the full relation". */
48
55
  readonly filterBy: Selection | null;
49
56
  /** Where interactors publish. */
@@ -1 +1 @@
1
- {"version":3,"file":"chart-spec.d.ts","sourceRoot":"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