@ggts-sh/svelte 0.43.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 (656) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +97 -0
  3. package/bin/ggts-codemod.js +47 -0
  4. package/dist/GGPlot.svelte +491 -0
  5. package/dist/GGPlot.svelte.d.ts +67 -0
  6. package/dist/a11y/CanvasA11y.svelte +115 -0
  7. package/dist/a11y/CanvasA11y.svelte.d.ts +15 -0
  8. package/dist/a11y/canvas-a11y.d.ts +1 -0
  9. package/dist/a11y/canvas-a11y.js +2 -0
  10. package/dist/assembly/assemble.d.ts +1 -0
  11. package/dist/assembly/assemble.js +1 -0
  12. package/dist/assembly/labels.d.ts +43 -0
  13. package/dist/assembly/labels.js +126 -0
  14. package/dist/assembly/layout.d.ts +158 -0
  15. package/dist/assembly/layout.js +175 -0
  16. package/dist/chrome/StatusChrome.svelte +125 -0
  17. package/dist/chrome/StatusChrome.svelte.d.ts +16 -0
  18. package/dist/chrome/ToolRail.svelte +293 -0
  19. package/dist/chrome/ToolRail.svelte.d.ts +26 -0
  20. package/dist/chrome/chrome-state.svelte.d.ts +63 -0
  21. package/dist/chrome/chrome-state.svelte.js +158 -0
  22. package/dist/chrome/theme-css.d.ts +16 -0
  23. package/dist/chrome/theme-css.js +16 -0
  24. package/dist/codemod/cli.d.ts +16 -0
  25. package/dist/codemod/cli.js +150 -0
  26. package/dist/codemod/edits.d.ts +28 -0
  27. package/dist/codemod/edits.js +36 -0
  28. package/dist/codemod/index.d.ts +10 -0
  29. package/dist/codemod/index.js +10 -0
  30. package/dist/codemod/migrate-plot-props-rewrite.d.ts +86 -0
  31. package/dist/codemod/migrate-plot-props-rewrite.js +228 -0
  32. package/dist/codemod/migrate-plot-props.d.ts +38 -0
  33. package/dist/codemod/migrate-plot-props.js +159 -0
  34. package/dist/coord/Coord.svelte +21 -0
  35. package/dist/coord/Coord.svelte.d.ts +16 -0
  36. package/dist/coord/CoordCartesian.svelte +11 -0
  37. package/dist/coord/CoordCartesian.svelte.d.ts +18 -0
  38. package/dist/coord/CoordFixed.svelte +17 -0
  39. package/dist/coord/CoordFixed.svelte.d.ts +10 -0
  40. package/dist/coord/CoordFlip.svelte +11 -0
  41. package/dist/coord/CoordFlip.svelte.d.ts +18 -0
  42. package/dist/coord/CoordPolar.svelte +16 -0
  43. package/dist/coord/CoordPolar.svelte.d.ts +9 -0
  44. package/dist/coord/CoordRadial.svelte +16 -0
  45. package/dist/coord/CoordRadial.svelte.d.ts +9 -0
  46. package/dist/coord/CoordSf.svelte +16 -0
  47. package/dist/coord/CoordSf.svelte.d.ts +9 -0
  48. package/dist/coord/CoordTransform.svelte +16 -0
  49. package/dist/coord/CoordTransform.svelte.d.ts +9 -0
  50. package/dist/data/index.d.ts +1 -0
  51. package/dist/data/index.js +2 -0
  52. package/dist/diagnostics/composition.d.ts +112 -0
  53. package/dist/diagnostics/composition.js +203 -0
  54. package/dist/diagnostics/deprecation.d.ts +58 -0
  55. package/dist/diagnostics/deprecation.js +27 -0
  56. package/dist/diagnostics/plot-engine-diagnostics.svelte.d.ts +44 -0
  57. package/dist/diagnostics/plot-engine-diagnostics.svelte.js +193 -0
  58. package/dist/facet/Facet.svelte +23 -0
  59. package/dist/facet/Facet.svelte.d.ts +16 -0
  60. package/dist/facet/FacetGrid.svelte +32 -0
  61. package/dist/facet/FacetGrid.svelte.d.ts +16 -0
  62. package/dist/facet/FacetWrap.svelte +32 -0
  63. package/dist/facet/FacetWrap.svelte.d.ts +16 -0
  64. package/dist/fonts/RobotoCondensed-Bold.ttf +0 -0
  65. package/dist/fonts/RobotoCondensed-Light.ttf +0 -0
  66. package/dist/fonts/RobotoCondensed-Regular.ttf +0 -0
  67. package/dist/fonts/THIRD_PARTY_NOTICES.txt +416 -0
  68. package/dist/geoms/GeomAbline.svelte +25 -0
  69. package/dist/geoms/GeomAbline.svelte.d.ts +7 -0
  70. package/dist/geoms/GeomArea.svelte +12 -0
  71. package/dist/geoms/GeomArea.svelte.d.ts +7 -0
  72. package/dist/geoms/GeomBar.svelte +12 -0
  73. package/dist/geoms/GeomBar.svelte.d.ts +7 -0
  74. package/dist/geoms/GeomBin2d.svelte +21 -0
  75. package/dist/geoms/GeomBin2d.svelte.d.ts +7 -0
  76. package/dist/geoms/GeomBlank.svelte +12 -0
  77. package/dist/geoms/GeomBlank.svelte.d.ts +7 -0
  78. package/dist/geoms/GeomBoxplot.svelte +25 -0
  79. package/dist/geoms/GeomBoxplot.svelte.d.ts +7 -0
  80. package/dist/geoms/GeomCol.svelte +12 -0
  81. package/dist/geoms/GeomCol.svelte.d.ts +7 -0
  82. package/dist/geoms/GeomContour.svelte +25 -0
  83. package/dist/geoms/GeomContour.svelte.d.ts +7 -0
  84. package/dist/geoms/GeomCount.svelte +12 -0
  85. package/dist/geoms/GeomCount.svelte.d.ts +7 -0
  86. package/dist/geoms/GeomCrossbar.svelte +25 -0
  87. package/dist/geoms/GeomCrossbar.svelte.d.ts +7 -0
  88. package/dist/geoms/GeomCurve.svelte +21 -0
  89. package/dist/geoms/GeomCurve.svelte.d.ts +7 -0
  90. package/dist/geoms/GeomDensity.svelte +25 -0
  91. package/dist/geoms/GeomDensity.svelte.d.ts +7 -0
  92. package/dist/geoms/GeomDensity2d.svelte +25 -0
  93. package/dist/geoms/GeomDensity2d.svelte.d.ts +7 -0
  94. package/dist/geoms/GeomDensity2dFilled.svelte +25 -0
  95. package/dist/geoms/GeomDensity2dFilled.svelte.d.ts +7 -0
  96. package/dist/geoms/GeomDotplot.svelte +25 -0
  97. package/dist/geoms/GeomDotplot.svelte.d.ts +7 -0
  98. package/dist/geoms/GeomErrorbar.svelte +25 -0
  99. package/dist/geoms/GeomErrorbar.svelte.d.ts +7 -0
  100. package/dist/geoms/GeomFreqpoly.svelte +25 -0
  101. package/dist/geoms/GeomFreqpoly.svelte.d.ts +7 -0
  102. package/dist/geoms/GeomFunction.svelte +25 -0
  103. package/dist/geoms/GeomFunction.svelte.d.ts +7 -0
  104. package/dist/geoms/GeomHex.svelte +21 -0
  105. package/dist/geoms/GeomHex.svelte.d.ts +7 -0
  106. package/dist/geoms/GeomHistogram.svelte +25 -0
  107. package/dist/geoms/GeomHistogram.svelte.d.ts +7 -0
  108. package/dist/geoms/GeomHline.svelte +12 -0
  109. package/dist/geoms/GeomHline.svelte.d.ts +7 -0
  110. package/dist/geoms/GeomJitter.svelte +35 -0
  111. package/dist/geoms/GeomJitter.svelte.d.ts +13 -0
  112. package/dist/geoms/GeomLabel.svelte +12 -0
  113. package/dist/geoms/GeomLabel.svelte.d.ts +7 -0
  114. package/dist/geoms/GeomLine.svelte +12 -0
  115. package/dist/geoms/GeomLine.svelte.d.ts +7 -0
  116. package/dist/geoms/GeomLinerange.svelte +25 -0
  117. package/dist/geoms/GeomLinerange.svelte.d.ts +7 -0
  118. package/dist/geoms/GeomMap.svelte +21 -0
  119. package/dist/geoms/GeomMap.svelte.d.ts +7 -0
  120. package/dist/geoms/GeomPath.svelte +12 -0
  121. package/dist/geoms/GeomPath.svelte.d.ts +7 -0
  122. package/dist/geoms/GeomPoint.svelte +12 -0
  123. package/dist/geoms/GeomPoint.svelte.d.ts +7 -0
  124. package/dist/geoms/GeomPointrange.svelte +25 -0
  125. package/dist/geoms/GeomPointrange.svelte.d.ts +7 -0
  126. package/dist/geoms/GeomPolygon.svelte +25 -0
  127. package/dist/geoms/GeomPolygon.svelte.d.ts +7 -0
  128. package/dist/geoms/GeomQq.svelte +21 -0
  129. package/dist/geoms/GeomQq.svelte.d.ts +7 -0
  130. package/dist/geoms/GeomQqLine.svelte +25 -0
  131. package/dist/geoms/GeomQqLine.svelte.d.ts +7 -0
  132. package/dist/geoms/GeomQuantile.svelte +25 -0
  133. package/dist/geoms/GeomQuantile.svelte.d.ts +7 -0
  134. package/dist/geoms/GeomRaster.svelte +25 -0
  135. package/dist/geoms/GeomRaster.svelte.d.ts +7 -0
  136. package/dist/geoms/GeomRect.svelte +12 -0
  137. package/dist/geoms/GeomRect.svelte.d.ts +7 -0
  138. package/dist/geoms/GeomRibbon.svelte +16 -0
  139. package/dist/geoms/GeomRibbon.svelte.d.ts +7 -0
  140. package/dist/geoms/GeomRug.svelte +21 -0
  141. package/dist/geoms/GeomRug.svelte.d.ts +7 -0
  142. package/dist/geoms/GeomRule.svelte +12 -0
  143. package/dist/geoms/GeomRule.svelte.d.ts +7 -0
  144. package/dist/geoms/GeomSegment.svelte +16 -0
  145. package/dist/geoms/GeomSegment.svelte.d.ts +7 -0
  146. package/dist/geoms/GeomSf.svelte +21 -0
  147. package/dist/geoms/GeomSf.svelte.d.ts +7 -0
  148. package/dist/geoms/GeomSfLabel.svelte +25 -0
  149. package/dist/geoms/GeomSfLabel.svelte.d.ts +7 -0
  150. package/dist/geoms/GeomSfText.svelte +25 -0
  151. package/dist/geoms/GeomSfText.svelte.d.ts +7 -0
  152. package/dist/geoms/GeomSmooth.svelte +25 -0
  153. package/dist/geoms/GeomSmooth.svelte.d.ts +7 -0
  154. package/dist/geoms/GeomSpoke.svelte +21 -0
  155. package/dist/geoms/GeomSpoke.svelte.d.ts +7 -0
  156. package/dist/geoms/GeomStep.svelte +12 -0
  157. package/dist/geoms/GeomStep.svelte.d.ts +7 -0
  158. package/dist/geoms/GeomText.svelte +12 -0
  159. package/dist/geoms/GeomText.svelte.d.ts +7 -0
  160. package/dist/geoms/GeomTile.svelte +21 -0
  161. package/dist/geoms/GeomTile.svelte.d.ts +7 -0
  162. package/dist/geoms/GeomViolin.svelte +25 -0
  163. package/dist/geoms/GeomViolin.svelte.d.ts +7 -0
  164. package/dist/geoms/GeomVline.svelte +12 -0
  165. package/dist/geoms/GeomVline.svelte.d.ts +7 -0
  166. package/dist/geoms/factory.svelte.d.ts +41 -0
  167. package/dist/geoms/factory.svelte.js +60 -0
  168. package/dist/geoms/registry.svelte.d.ts +71 -0
  169. package/dist/geoms/registry.svelte.js +177 -0
  170. package/dist/guides/GuideAxis.svelte +20 -0
  171. package/dist/guides/GuideAxis.svelte.d.ts +14 -0
  172. package/dist/guides/GuideColorbar.svelte +22 -0
  173. package/dist/guides/GuideColorbar.svelte.d.ts +13 -0
  174. package/dist/guides/GuideColorsteps.svelte +22 -0
  175. package/dist/guides/GuideColorsteps.svelte.d.ts +13 -0
  176. package/dist/guides/GuideLegend.svelte +90 -0
  177. package/dist/guides/GuideLegend.svelte.d.ts +37 -0
  178. package/dist/guides/GuideNone.svelte +19 -0
  179. package/dist/guides/GuideNone.svelte.d.ts +7 -0
  180. package/dist/guides/Guides.svelte +14 -0
  181. package/dist/guides/Guides.svelte.d.ts +13 -0
  182. package/dist/guides/factory.svelte.d.ts +36 -0
  183. package/dist/guides/factory.svelte.js +15 -0
  184. package/dist/index.d.ts +418 -0
  185. package/dist/index.js +376 -0
  186. package/dist/inspection/Inspect.svelte +71 -0
  187. package/dist/inspection/Inspect.svelte.d.ts +36 -0
  188. package/dist/inspection/Tooltip.svelte +439 -0
  189. package/dist/inspection/Tooltip.svelte.d.ts +32 -0
  190. package/dist/inspection/apply.d.ts +120 -0
  191. package/dist/inspection/apply.js +99 -0
  192. package/dist/inspection/coordinator.d.ts +51 -0
  193. package/dist/inspection/coordinator.js +354 -0
  194. package/dist/inspection/display-members.d.ts +1 -0
  195. package/dist/inspection/display-members.js +2 -0
  196. package/dist/inspection/frame.d.ts +90 -0
  197. package/dist/inspection/frame.js +76 -0
  198. package/dist/inspection/group-total.d.ts +1 -0
  199. package/dist/inspection/group-total.js +2 -0
  200. package/dist/inspection/inspect-guide-axes.d.ts +10 -0
  201. package/dist/inspection/inspect-guide-axes.js +24 -0
  202. package/dist/inspection/inspection-reconcile.svelte.d.ts +37 -0
  203. package/dist/inspection/inspection-reconcile.svelte.js +33 -0
  204. package/dist/inspection/inspection-state.svelte.d.ts +86 -0
  205. package/dist/inspection/inspection-state.svelte.js +347 -0
  206. package/dist/inspection/inspection-traversal.svelte.d.ts +29 -0
  207. package/dist/inspection/inspection-traversal.svelte.js +52 -0
  208. package/dist/inspection/pointer-inspect.d.ts +74 -0
  209. package/dist/inspection/pointer-inspect.js +158 -0
  210. package/dist/inspection/resolver.d.ts +3 -0
  211. package/dist/inspection/resolver.js +4 -0
  212. package/dist/inspection/teardown.d.ts +199 -0
  213. package/dist/inspection/teardown.js +181 -0
  214. package/dist/inspection/tooltip-chrome.d.ts +19 -0
  215. package/dist/inspection/tooltip-chrome.js +17 -0
  216. package/dist/inspection/tooltip-motion.d.ts +25 -0
  217. package/dist/inspection/tooltip-motion.js +32 -0
  218. package/dist/inspection/tooltip-presence.svelte.d.ts +49 -0
  219. package/dist/inspection/tooltip-presence.svelte.js +110 -0
  220. package/dist/inspection/tooltip-total.d.ts +1 -0
  221. package/dist/inspection/tooltip-total.js +2 -0
  222. package/dist/interaction/capability-resolution.svelte.d.ts +42 -0
  223. package/dist/interaction/capability-resolution.svelte.js +40 -0
  224. package/dist/interaction/capability.d.ts +129 -0
  225. package/dist/interaction/capability.js +134 -0
  226. package/dist/interaction/controller.svelte.d.ts +4 -0
  227. package/dist/interaction/controller.svelte.js +43 -0
  228. package/dist/interaction/inspect-geom-advisories.d.ts +10 -0
  229. package/dist/interaction/inspect-geom-advisories.js +10 -0
  230. package/dist/interaction/interaction-context.svelte.d.ts +57 -0
  231. package/dist/interaction/interaction-context.svelte.js +4 -0
  232. package/dist/interaction/interaction-diagnostics.d.ts +11 -0
  233. package/dist/interaction/interaction-diagnostics.js +173 -0
  234. package/dist/interaction/interaction-states.svelte.d.ts +84 -0
  235. package/dist/interaction/interaction-states.svelte.js +55 -0
  236. package/dist/interaction/interaction.d.ts +304 -0
  237. package/dist/interaction/interaction.js +7 -0
  238. package/dist/interaction/normalize-interaction-config.d.ts +9 -0
  239. package/dist/interaction/normalize-interaction-config.js +112 -0
  240. package/dist/interaction/reducer.d.ts +97 -0
  241. package/dist/interaction/reducer.js +117 -0
  242. package/dist/interaction/resolve-inspect-capability.d.ts +40 -0
  243. package/dist/interaction/resolve-inspect-capability.js +50 -0
  244. package/dist/interaction/scoped-store.svelte.d.ts +73 -0
  245. package/dist/interaction/scoped-store.svelte.js +93 -0
  246. package/dist/interaction/target.d.ts +91 -0
  247. package/dist/interaction/target.js +68 -0
  248. package/dist/interaction/transition-owner.d.ts +19 -0
  249. package/dist/interaction/transition-owner.js +10 -0
  250. package/dist/interaction/wiring-advisories.d.ts +33 -0
  251. package/dist/interaction/wiring-advisories.js +46 -0
  252. package/dist/interval/BoundsEditor.svelte +332 -0
  253. package/dist/interval/BoundsEditor.svelte.d.ts +10 -0
  254. package/dist/interval/bounds-editor.d.ts +1 -0
  255. package/dist/interval/bounds-editor.js +2 -0
  256. package/dist/interval/consumption.d.ts +1 -0
  257. package/dist/interval/consumption.js +2 -0
  258. package/dist/interval/interval-bounds-state.svelte.d.ts +53 -0
  259. package/dist/interval/interval-bounds-state.svelte.js +117 -0
  260. package/dist/interval/interval-state-helpers.d.ts +10 -0
  261. package/dist/interval/interval-state-helpers.js +34 -0
  262. package/dist/interval/interval-state.svelte.d.ts +60 -0
  263. package/dist/interval/interval-state.svelte.js +360 -0
  264. package/dist/interval/interval.d.ts +1 -0
  265. package/dist/interval/interval.js +2 -0
  266. package/dist/interval/precise-bounds.d.ts +1 -0
  267. package/dist/interval/precise-bounds.js +2 -0
  268. package/dist/interval/query.d.ts +1 -0
  269. package/dist/interval/query.js +2 -0
  270. package/dist/labs/Labs.svelte +29 -0
  271. package/dist/labs/Labs.svelte.d.ts +16 -0
  272. package/dist/layers/fold.d.ts +2 -0
  273. package/dist/layers/fold.js +1 -0
  274. package/dist/layers/grammar-families.d.ts +2 -0
  275. package/dist/layers/grammar-families.js +1 -0
  276. package/dist/layers/plot-layer-contract.d.ts +1 -0
  277. package/dist/layers/plot-layer-contract.js +29 -0
  278. package/dist/layers/plot-layer.svelte.d.ts +42 -0
  279. package/dist/layers/plot-layer.svelte.js +34 -0
  280. package/dist/layers/types.d.ts +2 -0
  281. package/dist/layers/types.js +1 -0
  282. package/dist/legend/Legend.svelte +24 -0
  283. package/dist/legend/Legend.svelte.d.ts +5 -0
  284. package/dist/legend/LegendFilters.svelte +196 -0
  285. package/dist/legend/LegendFilters.svelte.d.ts +8 -0
  286. package/dist/legend/LegendTargets.svelte +393 -0
  287. package/dist/legend/LegendTargets.svelte.d.ts +31 -0
  288. package/dist/legend/entry-key-index.d.ts +1 -0
  289. package/dist/legend/entry-key-index.js +2 -0
  290. package/dist/legend/entry-key-index.svelte.d.ts +34 -0
  291. package/dist/legend/entry-key-index.svelte.js +35 -0
  292. package/dist/legend/filter-state.svelte.d.ts +66 -0
  293. package/dist/legend/filter-state.svelte.js +284 -0
  294. package/dist/legend/filter.d.ts +1 -0
  295. package/dist/legend/filter.js +2 -0
  296. package/dist/legend/focus-emphasis.d.ts +72 -0
  297. package/dist/legend/focus-emphasis.js +91 -0
  298. package/dist/legend/focus-plans.d.ts +89 -0
  299. package/dist/legend/focus-plans.js +72 -0
  300. package/dist/legend/focus-reconcile.svelte.d.ts +53 -0
  301. package/dist/legend/focus-reconcile.svelte.js +113 -0
  302. package/dist/legend/focus-state.svelte.d.ts +73 -0
  303. package/dist/legend/focus-state.svelte.js +338 -0
  304. package/dist/legend/focus.d.ts +1 -0
  305. package/dist/legend/focus.js +2 -0
  306. package/dist/legend/resolve-legend-capability.d.ts +52 -0
  307. package/dist/legend/resolve-legend-capability.js +68 -0
  308. package/dist/legend/resolve-legend-filter.d.ts +65 -0
  309. package/dist/legend/resolve-legend-filter.js +54 -0
  310. package/dist/legend/resolve-legend-focus.d.ts +58 -0
  311. package/dist/legend/resolve-legend-focus.js +36 -0
  312. package/dist/legend/surface.d.ts +190 -0
  313. package/dist/legend/surface.js +158 -0
  314. package/dist/plot-engine-deriveds.svelte.d.ts +75 -0
  315. package/dist/plot-engine-deriveds.svelte.js +166 -0
  316. package/dist/plot-engine.svelte.d.ts +116 -0
  317. package/dist/plot-engine.svelte.js +316 -0
  318. package/dist/plot-props.d.ts +144 -0
  319. package/dist/plot-props.js +81 -0
  320. package/dist/runtime/announcer.svelte.d.ts +17 -0
  321. package/dist/runtime/announcer.svelte.js +28 -0
  322. package/dist/runtime/paint.d.ts +38 -0
  323. package/dist/runtime/paint.js +45 -0
  324. package/dist/runtime/resolve-datum-key.d.ts +53 -0
  325. package/dist/runtime/resolve-datum-key.js +73 -0
  326. package/dist/runtime/runtime.svelte.d.ts +37 -0
  327. package/dist/runtime/runtime.svelte.js +233 -0
  328. package/dist/runtime/semantic-candidate-projection.svelte.d.ts +29 -0
  329. package/dist/runtime/semantic-candidate-projection.svelte.js +137 -0
  330. package/dist/runtime/semantic-data-identity.d.ts +64 -0
  331. package/dist/runtime/semantic-data-identity.js +153 -0
  332. package/dist/runtime/semantic-keys-projection.d.ts +22 -0
  333. package/dist/runtime/semantic-keys-projection.js +40 -0
  334. package/dist/runtime/semantic-keys-resolve.d.ts +69 -0
  335. package/dist/runtime/semantic-keys-resolve.js +122 -0
  336. package/dist/runtime/semantic-keys.svelte.d.ts +30 -0
  337. package/dist/runtime/semantic-keys.svelte.js +69 -0
  338. package/dist/runtime/semantic-source-identity.d.ts +9 -0
  339. package/dist/runtime/semantic-source-identity.js +16 -0
  340. package/dist/scale/Scale.svelte +26 -0
  341. package/dist/scale/Scale.svelte.d.ts +21 -0
  342. package/dist/scale/ScaleAlphaBinned.svelte +14 -0
  343. package/dist/scale/ScaleAlphaBinned.svelte.d.ts +4 -0
  344. package/dist/scale/ScaleAlphaContinuous.svelte +14 -0
  345. package/dist/scale/ScaleAlphaContinuous.svelte.d.ts +4 -0
  346. package/dist/scale/ScaleAlphaDate.svelte +15 -0
  347. package/dist/scale/ScaleAlphaDate.svelte.d.ts +5 -0
  348. package/dist/scale/ScaleAlphaDatetime.svelte +15 -0
  349. package/dist/scale/ScaleAlphaDatetime.svelte.d.ts +5 -0
  350. package/dist/scale/ScaleAlphaDiscrete.svelte +14 -0
  351. package/dist/scale/ScaleAlphaDiscrete.svelte.d.ts +4 -0
  352. package/dist/scale/ScaleAlphaIdentity.svelte +14 -0
  353. package/dist/scale/ScaleAlphaIdentity.svelte.d.ts +4 -0
  354. package/dist/scale/ScaleAlphaManual.svelte +14 -0
  355. package/dist/scale/ScaleAlphaManual.svelte.d.ts +4 -0
  356. package/dist/scale/ScaleColorBinned.svelte +14 -0
  357. package/dist/scale/ScaleColorBinned.svelte.d.ts +3 -0
  358. package/dist/scale/ScaleColorBrewer.svelte +14 -0
  359. package/dist/scale/ScaleColorBrewer.svelte.d.ts +4 -0
  360. package/dist/scale/ScaleColorContinuous.svelte +14 -0
  361. package/dist/scale/ScaleColorContinuous.svelte.d.ts +4 -0
  362. package/dist/scale/ScaleColorDate.svelte +15 -0
  363. package/dist/scale/ScaleColorDate.svelte.d.ts +5 -0
  364. package/dist/scale/ScaleColorDatetime.svelte +15 -0
  365. package/dist/scale/ScaleColorDatetime.svelte.d.ts +5 -0
  366. package/dist/scale/ScaleColorDiscrete.svelte +14 -0
  367. package/dist/scale/ScaleColorDiscrete.svelte.d.ts +4 -0
  368. package/dist/scale/ScaleColorDistiller.svelte +14 -0
  369. package/dist/scale/ScaleColorDistiller.svelte.d.ts +4 -0
  370. package/dist/scale/ScaleColorFermenter.svelte +14 -0
  371. package/dist/scale/ScaleColorFermenter.svelte.d.ts +4 -0
  372. package/dist/scale/ScaleColorGradient.svelte +11 -0
  373. package/dist/scale/ScaleColorGradient.svelte.d.ts +4 -0
  374. package/dist/scale/ScaleColorGradient2.svelte +14 -0
  375. package/dist/scale/ScaleColorGradient2.svelte.d.ts +4 -0
  376. package/dist/scale/ScaleColorGradientn.svelte +14 -0
  377. package/dist/scale/ScaleColorGradientn.svelte.d.ts +4 -0
  378. package/dist/scale/ScaleColorGrey.svelte +11 -0
  379. package/dist/scale/ScaleColorGrey.svelte.d.ts +4 -0
  380. package/dist/scale/ScaleColorHue.svelte +11 -0
  381. package/dist/scale/ScaleColorHue.svelte.d.ts +4 -0
  382. package/dist/scale/ScaleColorIdentity.svelte +14 -0
  383. package/dist/scale/ScaleColorIdentity.svelte.d.ts +4 -0
  384. package/dist/scale/ScaleColorLog10.svelte +14 -0
  385. package/dist/scale/ScaleColorLog10.svelte.d.ts +4 -0
  386. package/dist/scale/ScaleColorManual.svelte +14 -0
  387. package/dist/scale/ScaleColorManual.svelte.d.ts +4 -0
  388. package/dist/scale/ScaleColorOrdinal.svelte +14 -0
  389. package/dist/scale/ScaleColorOrdinal.svelte.d.ts +3 -0
  390. package/dist/scale/ScaleColorSqrt.svelte +14 -0
  391. package/dist/scale/ScaleColorSqrt.svelte.d.ts +4 -0
  392. package/dist/scale/ScaleColorSteps.svelte +11 -0
  393. package/dist/scale/ScaleColorSteps.svelte.d.ts +4 -0
  394. package/dist/scale/ScaleColorSteps2.svelte +11 -0
  395. package/dist/scale/ScaleColorSteps2.svelte.d.ts +4 -0
  396. package/dist/scale/ScaleColorStepsn.svelte +11 -0
  397. package/dist/scale/ScaleColorStepsn.svelte.d.ts +4 -0
  398. package/dist/scale/ScaleColorViridisB.svelte +11 -0
  399. package/dist/scale/ScaleColorViridisB.svelte.d.ts +4 -0
  400. package/dist/scale/ScaleColorViridisC.svelte +11 -0
  401. package/dist/scale/ScaleColorViridisC.svelte.d.ts +4 -0
  402. package/dist/scale/ScaleColorViridisD.svelte +11 -0
  403. package/dist/scale/ScaleColorViridisD.svelte.d.ts +4 -0
  404. package/dist/scale/ScaleFillBinned.svelte +11 -0
  405. package/dist/scale/ScaleFillBinned.svelte.d.ts +3 -0
  406. package/dist/scale/ScaleFillBrewer.svelte +11 -0
  407. package/dist/scale/ScaleFillBrewer.svelte.d.ts +4 -0
  408. package/dist/scale/ScaleFillContinuous.svelte +14 -0
  409. package/dist/scale/ScaleFillContinuous.svelte.d.ts +4 -0
  410. package/dist/scale/ScaleFillDate.svelte +12 -0
  411. package/dist/scale/ScaleFillDate.svelte.d.ts +5 -0
  412. package/dist/scale/ScaleFillDatetime.svelte +15 -0
  413. package/dist/scale/ScaleFillDatetime.svelte.d.ts +5 -0
  414. package/dist/scale/ScaleFillDiscrete.svelte +14 -0
  415. package/dist/scale/ScaleFillDiscrete.svelte.d.ts +4 -0
  416. package/dist/scale/ScaleFillDistiller.svelte +14 -0
  417. package/dist/scale/ScaleFillDistiller.svelte.d.ts +4 -0
  418. package/dist/scale/ScaleFillFermenter.svelte +14 -0
  419. package/dist/scale/ScaleFillFermenter.svelte.d.ts +4 -0
  420. package/dist/scale/ScaleFillGradient.svelte +11 -0
  421. package/dist/scale/ScaleFillGradient.svelte.d.ts +4 -0
  422. package/dist/scale/ScaleFillGradient2.svelte +14 -0
  423. package/dist/scale/ScaleFillGradient2.svelte.d.ts +4 -0
  424. package/dist/scale/ScaleFillGradientn.svelte +14 -0
  425. package/dist/scale/ScaleFillGradientn.svelte.d.ts +4 -0
  426. package/dist/scale/ScaleFillGrey.svelte +11 -0
  427. package/dist/scale/ScaleFillGrey.svelte.d.ts +4 -0
  428. package/dist/scale/ScaleFillHue.svelte +11 -0
  429. package/dist/scale/ScaleFillHue.svelte.d.ts +4 -0
  430. package/dist/scale/ScaleFillIdentity.svelte +14 -0
  431. package/dist/scale/ScaleFillIdentity.svelte.d.ts +4 -0
  432. package/dist/scale/ScaleFillLog10.svelte +14 -0
  433. package/dist/scale/ScaleFillLog10.svelte.d.ts +4 -0
  434. package/dist/scale/ScaleFillManual.svelte +11 -0
  435. package/dist/scale/ScaleFillManual.svelte.d.ts +4 -0
  436. package/dist/scale/ScaleFillOrdinal.svelte +14 -0
  437. package/dist/scale/ScaleFillOrdinal.svelte.d.ts +3 -0
  438. package/dist/scale/ScaleFillSqrt.svelte +14 -0
  439. package/dist/scale/ScaleFillSqrt.svelte.d.ts +4 -0
  440. package/dist/scale/ScaleFillSteps.svelte +11 -0
  441. package/dist/scale/ScaleFillSteps.svelte.d.ts +4 -0
  442. package/dist/scale/ScaleFillSteps2.svelte +11 -0
  443. package/dist/scale/ScaleFillSteps2.svelte.d.ts +4 -0
  444. package/dist/scale/ScaleFillStepsn.svelte +11 -0
  445. package/dist/scale/ScaleFillStepsn.svelte.d.ts +4 -0
  446. package/dist/scale/ScaleFillViridisB.svelte +11 -0
  447. package/dist/scale/ScaleFillViridisB.svelte.d.ts +4 -0
  448. package/dist/scale/ScaleFillViridisC.svelte +11 -0
  449. package/dist/scale/ScaleFillViridisC.svelte.d.ts +4 -0
  450. package/dist/scale/ScaleFillViridisD.svelte +11 -0
  451. package/dist/scale/ScaleFillViridisD.svelte.d.ts +4 -0
  452. package/dist/scale/ScaleLinetypeBinned.svelte +15 -0
  453. package/dist/scale/ScaleLinetypeBinned.svelte.d.ts +4 -0
  454. package/dist/scale/ScaleLinetypeDiscrete.svelte +15 -0
  455. package/dist/scale/ScaleLinetypeDiscrete.svelte.d.ts +4 -0
  456. package/dist/scale/ScaleLinetypeIdentity.svelte +15 -0
  457. package/dist/scale/ScaleLinetypeIdentity.svelte.d.ts +4 -0
  458. package/dist/scale/ScaleLinetypeManual.svelte +15 -0
  459. package/dist/scale/ScaleLinetypeManual.svelte.d.ts +4 -0
  460. package/dist/scale/ScaleLinewidthBinned.svelte +14 -0
  461. package/dist/scale/ScaleLinewidthBinned.svelte.d.ts +4 -0
  462. package/dist/scale/ScaleLinewidthContinuous.svelte +14 -0
  463. package/dist/scale/ScaleLinewidthContinuous.svelte.d.ts +4 -0
  464. package/dist/scale/ScaleLinewidthDate.svelte +15 -0
  465. package/dist/scale/ScaleLinewidthDate.svelte.d.ts +5 -0
  466. package/dist/scale/ScaleLinewidthDatetime.svelte +15 -0
  467. package/dist/scale/ScaleLinewidthDatetime.svelte.d.ts +5 -0
  468. package/dist/scale/ScaleLinewidthDiscrete.svelte +14 -0
  469. package/dist/scale/ScaleLinewidthDiscrete.svelte.d.ts +4 -0
  470. package/dist/scale/ScaleLinewidthIdentity.svelte +14 -0
  471. package/dist/scale/ScaleLinewidthIdentity.svelte.d.ts +4 -0
  472. package/dist/scale/ScaleLinewidthManual.svelte +14 -0
  473. package/dist/scale/ScaleLinewidthManual.svelte.d.ts +4 -0
  474. package/dist/scale/ScaleRadius.svelte +11 -0
  475. package/dist/scale/ScaleRadius.svelte.d.ts +4 -0
  476. package/dist/scale/ScaleShapeBinned.svelte +15 -0
  477. package/dist/scale/ScaleShapeBinned.svelte.d.ts +4 -0
  478. package/dist/scale/ScaleShapeDiscrete.svelte +15 -0
  479. package/dist/scale/ScaleShapeDiscrete.svelte.d.ts +4 -0
  480. package/dist/scale/ScaleShapeIdentity.svelte +15 -0
  481. package/dist/scale/ScaleShapeIdentity.svelte.d.ts +4 -0
  482. package/dist/scale/ScaleShapeManual.svelte +15 -0
  483. package/dist/scale/ScaleShapeManual.svelte.d.ts +4 -0
  484. package/dist/scale/ScaleSizeArea.svelte +11 -0
  485. package/dist/scale/ScaleSizeArea.svelte.d.ts +4 -0
  486. package/dist/scale/ScaleSizeBinned.svelte +14 -0
  487. package/dist/scale/ScaleSizeBinned.svelte.d.ts +4 -0
  488. package/dist/scale/ScaleSizeBinnedArea.svelte +14 -0
  489. package/dist/scale/ScaleSizeBinnedArea.svelte.d.ts +4 -0
  490. package/dist/scale/ScaleSizeContinuous.svelte +14 -0
  491. package/dist/scale/ScaleSizeContinuous.svelte.d.ts +4 -0
  492. package/dist/scale/ScaleSizeDate.svelte +15 -0
  493. package/dist/scale/ScaleSizeDate.svelte.d.ts +5 -0
  494. package/dist/scale/ScaleSizeDatetime.svelte +15 -0
  495. package/dist/scale/ScaleSizeDatetime.svelte.d.ts +5 -0
  496. package/dist/scale/ScaleSizeDiscrete.svelte +14 -0
  497. package/dist/scale/ScaleSizeDiscrete.svelte.d.ts +4 -0
  498. package/dist/scale/ScaleSizeIdentity.svelte +14 -0
  499. package/dist/scale/ScaleSizeIdentity.svelte.d.ts +4 -0
  500. package/dist/scale/ScaleSizeManual.svelte +14 -0
  501. package/dist/scale/ScaleSizeManual.svelte.d.ts +4 -0
  502. package/dist/scale/ScaleXBinned.svelte +14 -0
  503. package/dist/scale/ScaleXBinned.svelte.d.ts +4 -0
  504. package/dist/scale/ScaleXContinuous.svelte +14 -0
  505. package/dist/scale/ScaleXContinuous.svelte.d.ts +4 -0
  506. package/dist/scale/ScaleXDate.svelte +12 -0
  507. package/dist/scale/ScaleXDate.svelte.d.ts +5 -0
  508. package/dist/scale/ScaleXDatetime.svelte +12 -0
  509. package/dist/scale/ScaleXDatetime.svelte.d.ts +5 -0
  510. package/dist/scale/ScaleXDiscrete.svelte +14 -0
  511. package/dist/scale/ScaleXDiscrete.svelte.d.ts +4 -0
  512. package/dist/scale/ScaleXLog10.svelte +14 -0
  513. package/dist/scale/ScaleXLog10.svelte.d.ts +4 -0
  514. package/dist/scale/ScaleXMonthDay.svelte +12 -0
  515. package/dist/scale/ScaleXMonthDay.svelte.d.ts +5 -0
  516. package/dist/scale/ScaleXReverse.svelte +15 -0
  517. package/dist/scale/ScaleXReverse.svelte.d.ts +4 -0
  518. package/dist/scale/ScaleXSqrt.svelte +14 -0
  519. package/dist/scale/ScaleXSqrt.svelte.d.ts +4 -0
  520. package/dist/scale/ScaleXTime.svelte +12 -0
  521. package/dist/scale/ScaleXTime.svelte.d.ts +5 -0
  522. package/dist/scale/ScaleYBinned.svelte +14 -0
  523. package/dist/scale/ScaleYBinned.svelte.d.ts +4 -0
  524. package/dist/scale/ScaleYContinuous.svelte +14 -0
  525. package/dist/scale/ScaleYContinuous.svelte.d.ts +4 -0
  526. package/dist/scale/ScaleYDate.svelte +12 -0
  527. package/dist/scale/ScaleYDate.svelte.d.ts +5 -0
  528. package/dist/scale/ScaleYDatetime.svelte +12 -0
  529. package/dist/scale/ScaleYDatetime.svelte.d.ts +5 -0
  530. package/dist/scale/ScaleYDiscrete.svelte +14 -0
  531. package/dist/scale/ScaleYDiscrete.svelte.d.ts +4 -0
  532. package/dist/scale/ScaleYLog10.svelte +14 -0
  533. package/dist/scale/ScaleYLog10.svelte.d.ts +4 -0
  534. package/dist/scale/ScaleYMonthDay.svelte +12 -0
  535. package/dist/scale/ScaleYMonthDay.svelte.d.ts +5 -0
  536. package/dist/scale/ScaleYReverse.svelte +15 -0
  537. package/dist/scale/ScaleYReverse.svelte.d.ts +4 -0
  538. package/dist/scale/ScaleYSqrt.svelte +14 -0
  539. package/dist/scale/ScaleYSqrt.svelte.d.ts +4 -0
  540. package/dist/scale/ScaleYTime.svelte +12 -0
  541. package/dist/scale/ScaleYTime.svelte.d.ts +5 -0
  542. package/dist/scene/Axis.svelte +159 -0
  543. package/dist/scene/Axis.svelte.d.ts +12 -0
  544. package/dist/scene/Batch.svelte +252 -0
  545. package/dist/scene/Batch.svelte.d.ts +23 -0
  546. package/dist/scene/InteractionOverlay.svelte +402 -0
  547. package/dist/scene/InteractionOverlay.svelte.d.ts +44 -0
  548. package/dist/scene/Legend.svelte +278 -0
  549. package/dist/scene/Legend.svelte.d.ts +8 -0
  550. package/dist/scene/MarkStrata.svelte +129 -0
  551. package/dist/scene/MarkStrata.svelte.d.ts +15 -0
  552. package/dist/scene/SceneOverlays.svelte +118 -0
  553. package/dist/scene/SceneOverlays.svelte.d.ts +49 -0
  554. package/dist/scene/SceneView.svelte +478 -0
  555. package/dist/scene/SceneView.svelte.d.ts +32 -0
  556. package/dist/scene/batch-presentation.svelte.d.ts +111 -0
  557. package/dist/scene/batch-presentation.svelte.js +207 -0
  558. package/dist/scene/geometry.d.ts +2 -0
  559. package/dist/scene/geometry.js +3 -0
  560. package/dist/scene/stratum-paint.d.ts +25 -0
  561. package/dist/scene/stratum-paint.js +40 -0
  562. package/dist/selection/selection-state.svelte.d.ts +23 -0
  563. package/dist/selection/selection-state.svelte.js +73 -0
  564. package/dist/selection/selection.d.ts +1 -0
  565. package/dist/selection/selection.js +2 -0
  566. package/dist/surface/CaptureSurface.svelte +109 -0
  567. package/dist/surface/CaptureSurface.svelte.d.ts +27 -0
  568. package/dist/surface/area-brush.d.ts +48 -0
  569. package/dist/surface/area-brush.js +44 -0
  570. package/dist/surface/brush-finish.d.ts +49 -0
  571. package/dist/surface/brush-finish.js +44 -0
  572. package/dist/surface/keyboard.d.ts +97 -0
  573. package/dist/surface/keyboard.js +105 -0
  574. package/dist/surface/pointer.d.ts +241 -0
  575. package/dist/surface/pointer.js +179 -0
  576. package/dist/surface/surface-description.d.ts +10 -0
  577. package/dist/surface/surface-description.js +11 -0
  578. package/dist/surface/surface-handlers.svelte.d.ts +53 -0
  579. package/dist/surface/surface-handlers.svelte.js +418 -0
  580. package/dist/surface/surface-state.svelte.d.ts +90 -0
  581. package/dist/surface/surface-state.svelte.js +161 -0
  582. package/dist/theme/Theme.svelte +27 -0
  583. package/dist/theme/Theme.svelte.d.ts +23 -0
  584. package/dist/theme/ThemeBase.svelte +13 -0
  585. package/dist/theme/ThemeBase.svelte.d.ts +8 -0
  586. package/dist/theme/ThemeBw.svelte +13 -0
  587. package/dist/theme/ThemeBw.svelte.d.ts +8 -0
  588. package/dist/theme/ThemeClassic.svelte +13 -0
  589. package/dist/theme/ThemeClassic.svelte.d.ts +8 -0
  590. package/dist/theme/ThemeClean.svelte +13 -0
  591. package/dist/theme/ThemeClean.svelte.d.ts +8 -0
  592. package/dist/theme/ThemeDark.svelte +13 -0
  593. package/dist/theme/ThemeDark.svelte.d.ts +8 -0
  594. package/dist/theme/ThemeDefault.svelte +13 -0
  595. package/dist/theme/ThemeDefault.svelte.d.ts +8 -0
  596. package/dist/theme/ThemeEconomist.svelte +13 -0
  597. package/dist/theme/ThemeEconomist.svelte.d.ts +8 -0
  598. package/dist/theme/ThemeEconomistwhite.svelte +13 -0
  599. package/dist/theme/ThemeEconomistwhite.svelte.d.ts +8 -0
  600. package/dist/theme/ThemeFew.svelte +13 -0
  601. package/dist/theme/ThemeFew.svelte.d.ts +8 -0
  602. package/dist/theme/ThemeFivethirtyeight.svelte +14 -0
  603. package/dist/theme/ThemeFivethirtyeight.svelte.d.ts +9 -0
  604. package/dist/theme/ThemeGgplot2.svelte +13 -0
  605. package/dist/theme/ThemeGgplot2.svelte.d.ts +8 -0
  606. package/dist/theme/ThemeGray.svelte +13 -0
  607. package/dist/theme/ThemeGray.svelte.d.ts +8 -0
  608. package/dist/theme/ThemeGrey.svelte +13 -0
  609. package/dist/theme/ThemeGrey.svelte.d.ts +8 -0
  610. package/dist/theme/ThemeHc.svelte +13 -0
  611. package/dist/theme/ThemeHc.svelte.d.ts +8 -0
  612. package/dist/theme/ThemeHcdark.svelte +13 -0
  613. package/dist/theme/ThemeHcdark.svelte.d.ts +8 -0
  614. package/dist/theme/ThemeHrbr.svelte +13 -0
  615. package/dist/theme/ThemeHrbr.svelte.d.ts +8 -0
  616. package/dist/theme/ThemeIgray.svelte +13 -0
  617. package/dist/theme/ThemeIgray.svelte.d.ts +8 -0
  618. package/dist/theme/ThemeLight.svelte +13 -0
  619. package/dist/theme/ThemeLight.svelte.d.ts +8 -0
  620. package/dist/theme/ThemeLinedraw.svelte +13 -0
  621. package/dist/theme/ThemeLinedraw.svelte.d.ts +8 -0
  622. package/dist/theme/ThemeMap.svelte +13 -0
  623. package/dist/theme/ThemeMap.svelte.d.ts +8 -0
  624. package/dist/theme/ThemeMinimal.svelte +13 -0
  625. package/dist/theme/ThemeMinimal.svelte.d.ts +8 -0
  626. package/dist/theme/ThemePander.svelte +13 -0
  627. package/dist/theme/ThemePander.svelte.d.ts +8 -0
  628. package/dist/theme/ThemeSolarized.svelte +13 -0
  629. package/dist/theme/ThemeSolarized.svelte.d.ts +8 -0
  630. package/dist/theme/ThemeSolarized2.svelte +13 -0
  631. package/dist/theme/ThemeSolarized2.svelte.d.ts +8 -0
  632. package/dist/theme/ThemeSolarized2dark.svelte +13 -0
  633. package/dist/theme/ThemeSolarized2dark.svelte.d.ts +8 -0
  634. package/dist/theme/ThemeSolarizeddark.svelte +14 -0
  635. package/dist/theme/ThemeSolarizeddark.svelte.d.ts +9 -0
  636. package/dist/theme/ThemeSolid.svelte +13 -0
  637. package/dist/theme/ThemeSolid.svelte.d.ts +8 -0
  638. package/dist/theme/ThemeStata.svelte +13 -0
  639. package/dist/theme/ThemeStata.svelte.d.ts +8 -0
  640. package/dist/theme/ThemeStatas1color.svelte +13 -0
  641. package/dist/theme/ThemeStatas1color.svelte.d.ts +8 -0
  642. package/dist/theme/ThemeTest.svelte +14 -0
  643. package/dist/theme/ThemeTest.svelte.d.ts +9 -0
  644. package/dist/theme/ThemeTufte.svelte +13 -0
  645. package/dist/theme/ThemeTufte.svelte.d.ts +8 -0
  646. package/dist/theme/ThemeVoid.svelte +14 -0
  647. package/dist/theme/ThemeVoid.svelte.d.ts +9 -0
  648. package/dist/theme/ThemeWsj.svelte +13 -0
  649. package/dist/theme/ThemeWsj.svelte.d.ts +8 -0
  650. package/dist/theme/factory.svelte.d.ts +36 -0
  651. package/dist/theme/factory.svelte.js +100 -0
  652. package/dist/zoom/zoom-state.svelte.d.ts +44 -0
  653. package/dist/zoom/zoom-state.svelte.js +121 -0
  654. package/dist/zoom/zoom.d.ts +1 -0
  655. package/dist/zoom/zoom.js +2 -0
  656. package/package.json +83 -0
@@ -0,0 +1,9 @@
1
+ /**
2
+ * <CoordTransform> — declaration-only post-stat coordinate transform for
3
+ * <GGPlot> (#659 slice 5). Accepts the same options as `coordTransform(…)`.
4
+ * Emits NO markup.
5
+ */
6
+ import { type CoordTransformOptions } from "@ggts-sh/spec";
7
+ declare const CoordTransform: import("svelte").Component<CoordTransformOptions, {}, "">;
8
+ type CoordTransform = ReturnType<typeof CoordTransform>;
9
+ export default CoordTransform;
@@ -0,0 +1 @@
1
+ export * from "@ggts-sh/core/data";
@@ -0,0 +1,2 @@
1
+ // Compatibility subpath; the teaching data has one framework-neutral home.
2
+ export * from "@ggts-sh/core/data";
@@ -0,0 +1,112 @@
1
+ /**
2
+ * Plot-level composition advisories (ADR 0013 / #659).
3
+ *
4
+ * Sibling union to InteractionDiagnostic and DeprecationDiagnostic, delivered
5
+ * through the existing `ondiagnostic` channel as PlotDiagnostic.
6
+ *
7
+ * Three families:
8
+ * - keyed MERGE, scales (`kind: "scale"`): duplicate aesthetic channels after
9
+ * shallow per-key merge → `DUPLICATE_SCALE_CHANNEL`
10
+ * - keyed MERGE, everything else (`kind: "labs" | "guides" | "legend"`, #659
11
+ * slice 6): duplicate keys in the same shallow merge → `DUPLICATE_MERGE_KEY`
12
+ * - REPLACE (`kind: "coord" | "facet" | "theme"`): two children of the same
13
+ * kind → one silently wins → `DUPLICATE_PLOT_LAYER`
14
+ *
15
+ * The scale family keeps its own code rather than folding into
16
+ * DUPLICATE_MERGE_KEY: it shipped in 0.11.0, its `channel` field and its
17
+ * spelling-alias suggestion are scale-specific, and renaming a live advisory
18
+ * code would break consumer `switch`es for no behavioural gain.
19
+ *
20
+ * Kind sets and doc anchors come from GRAMMAR_FAMILIES (#785).
21
+ */
22
+ import { type MergeByKeyKind, type ReplaceKind } from "../layers/grammar-families.js";
23
+ import type { PlotLayerLike } from "../layers/types.js";
24
+ export type CompositionDiagnosticCode = "DUPLICATE_SCALE_CHANNEL" | "DUPLICATE_MERGE_KEY" | "DUPLICATE_PLOT_LAYER";
25
+ /**
26
+ * `suggestions` and `docUrl` are NOT optional: both sibling members of
27
+ * PlotDiagnostic (InteractionDiagnostic, DeprecationDiagnostic) carry them, so
28
+ * a consumer rendering `d.docUrl` / `d.suggestions` over the union must not
29
+ * break on this variant. An advisory whose whole job is "your chart is
30
+ * silently wrong" is also the last place to omit the fix link.
31
+ */
32
+ export interface DuplicateScaleChannelDiagnostic {
33
+ readonly severity: "advisory";
34
+ readonly code: "DUPLICATE_SCALE_CHANNEL";
35
+ readonly message: string;
36
+ readonly channel: string;
37
+ readonly kind: "scale";
38
+ readonly suggestions: ReadonlyArray<string>;
39
+ readonly docUrl: string;
40
+ }
41
+ /** Keyed-MERGE families other than scales (#659 slice 6 / #785). */
42
+ export type DuplicateMergeKeyKind = MergeByKeyKind;
43
+ /**
44
+ * Two children of one keyed-MERGE family wrote the same key. Unlike the
45
+ * REPLACE families nothing is wholesale lost — only that one key, where the
46
+ * later child's value silently overwrites the earlier one's.
47
+ */
48
+ export interface DuplicateMergeKeyDiagnostic {
49
+ readonly severity: "advisory";
50
+ readonly code: "DUPLICATE_MERGE_KEY";
51
+ readonly message: string;
52
+ readonly kind: DuplicateMergeKeyKind;
53
+ /** The colliding key: a labs/legend option name, or a guides channel. */
54
+ readonly key: string;
55
+ readonly suggestions: ReadonlyArray<string>;
56
+ readonly docUrl: string;
57
+ }
58
+ export type DuplicatePlotLayerKind = ReplaceKind;
59
+ export interface DuplicatePlotLayerDiagnostic {
60
+ readonly severity: "advisory";
61
+ readonly code: "DUPLICATE_PLOT_LAYER";
62
+ readonly message: string;
63
+ readonly kind: DuplicatePlotLayerKind;
64
+ readonly suggestions: ReadonlyArray<string>;
65
+ readonly docUrl: string;
66
+ }
67
+ export type CompositionDiagnostic = DuplicateScaleChannelDiagnostic | DuplicateMergeKeyDiagnostic | DuplicatePlotLayerDiagnostic;
68
+ export declare function isCompositionDiagnostic(d: {
69
+ readonly code: string;
70
+ }): d is CompositionDiagnostic;
71
+ /** Narrow to the scale variant so `.channel` consumers stay type-safe. */
72
+ export declare function isDuplicateScaleChannelDiagnostic(d: CompositionDiagnostic | {
73
+ readonly code: string;
74
+ }): d is DuplicateScaleChannelDiagnostic;
75
+ /** Narrow to the non-scale keyed-MERGE variant so `.key` consumers stay safe. */
76
+ export declare function isDuplicateMergeKeyDiagnostic(d: CompositionDiagnostic | {
77
+ readonly code: string;
78
+ }): d is DuplicateMergeKeyDiagnostic;
79
+ /** Narrow to the REPLACE-family plot-layer variant. */
80
+ export declare function isDuplicatePlotLayerDiagnostic(d: CompositionDiagnostic | {
81
+ readonly code: string;
82
+ }): d is DuplicatePlotLayerDiagnostic;
83
+ /**
84
+ * Frozen catalog entry for composition codes. Per-emission fields are filled
85
+ * by {@link duplicateScaleChannelDiagnostic} / {@link duplicatePlotLayerDiagnostic}.
86
+ */
87
+ export declare const COMPOSITION_DIAGNOSTIC_CATALOG: Readonly<Record<CompositionDiagnosticCode, Pick<CompositionDiagnostic, "severity" | "code"> & {
88
+ readonly messageTemplate: (subject: string) => string;
89
+ }>>;
90
+ /** Build a fully-populated duplicate-channel advisory. */
91
+ export declare function duplicateScaleChannelDiagnostic(channel: string): DuplicateScaleChannelDiagnostic;
92
+ /** Build a fully-populated duplicate merge-key advisory (labs/guides/legend). */
93
+ export declare function duplicateMergeKeyDiagnostic(kind: DuplicateMergeKeyKind, key: string): DuplicateMergeKeyDiagnostic;
94
+ /** Build a fully-populated duplicate REPLACE-family plot-layer advisory. */
95
+ export declare function duplicatePlotLayerDiagnostic(kind: DuplicatePlotLayerKind): DuplicatePlotLayerDiagnostic;
96
+ /**
97
+ * Scan plot layers for composition collisions (duplicate scale channels,
98
+ * keyed-MERGE key collisions, REPLACE multi-children). Pure — safe to call
99
+ * from a `$derived` that only re-reads `registry.layers`.
100
+ *
101
+ * Emission order: scale channels, then MERGE_KEY_EMIT_ORDER, then
102
+ * REPLACE_EMIT_ORDER. Mark layers are ignored.
103
+ */
104
+ export declare function collectCompositionDiagnostics(layers: readonly PlotLayerLike[]): CompositionDiagnostic[];
105
+ /**
106
+ * Once-per-instance advisory dedup key for composition diagnostics.
107
+ * Shape matches the assembly deliveredAdvisories Set:
108
+ * - scale: `${code}:${channel}`
109
+ * - merge-key: `${code}:${kind}:${key}`
110
+ * - replace: `${code}:${kind}`
111
+ */
112
+ export declare function compositionAdvisoryDedupKey(diagnostic: CompositionDiagnostic): string;
@@ -0,0 +1,203 @@
1
+ /**
2
+ * Plot-level composition advisories (ADR 0013 / #659).
3
+ *
4
+ * Sibling union to InteractionDiagnostic and DeprecationDiagnostic, delivered
5
+ * through the existing `ondiagnostic` channel as PlotDiagnostic.
6
+ *
7
+ * Three families:
8
+ * - keyed MERGE, scales (`kind: "scale"`): duplicate aesthetic channels after
9
+ * shallow per-key merge → `DUPLICATE_SCALE_CHANNEL`
10
+ * - keyed MERGE, everything else (`kind: "labs" | "guides" | "legend"`, #659
11
+ * slice 6): duplicate keys in the same shallow merge → `DUPLICATE_MERGE_KEY`
12
+ * - REPLACE (`kind: "coord" | "facet" | "theme"`): two children of the same
13
+ * kind → one silently wins → `DUPLICATE_PLOT_LAYER`
14
+ *
15
+ * The scale family keeps its own code rather than folding into
16
+ * DUPLICATE_MERGE_KEY: it shipped in 0.11.0, its `channel` field and its
17
+ * spelling-alias suggestion are scale-specific, and renaming a live advisory
18
+ * code would break consumer `switch`es for no behavioural gain.
19
+ *
20
+ * Kind sets and doc anchors come from GRAMMAR_FAMILIES (#785).
21
+ */
22
+ import { GRAMMAR_FAMILIES, MERGE_KEY_EMIT_ORDER, REPLACE_EMIT_ORDER, grammarDocUrl, } from "../layers/grammar-families.js";
23
+ export function isCompositionDiagnostic(d) {
24
+ return (d.code === "DUPLICATE_SCALE_CHANNEL" ||
25
+ d.code === "DUPLICATE_MERGE_KEY" ||
26
+ d.code === "DUPLICATE_PLOT_LAYER");
27
+ }
28
+ /** Narrow to the scale variant so `.channel` consumers stay type-safe. */
29
+ export function isDuplicateScaleChannelDiagnostic(d) {
30
+ return d.code === "DUPLICATE_SCALE_CHANNEL";
31
+ }
32
+ /** Narrow to the non-scale keyed-MERGE variant so `.key` consumers stay safe. */
33
+ export function isDuplicateMergeKeyDiagnostic(d) {
34
+ return d.code === "DUPLICATE_MERGE_KEY";
35
+ }
36
+ /** Narrow to the REPLACE-family plot-layer variant. */
37
+ export function isDuplicatePlotLayerDiagnostic(d) {
38
+ return d.code === "DUPLICATE_PLOT_LAYER";
39
+ }
40
+ function mergeKeyNoun(kind) {
41
+ return GRAMMAR_FAMILIES[kind].mergeKeyNoun ?? "key";
42
+ }
43
+ function mergeKeyChild(kind) {
44
+ return GRAMMAR_FAMILIES[kind].mergeKeyChild ?? `<${kind}>`;
45
+ }
46
+ /**
47
+ * Frozen catalog entry for composition codes. Per-emission fields are filled
48
+ * by {@link duplicateScaleChannelDiagnostic} / {@link duplicatePlotLayerDiagnostic}.
49
+ */
50
+ export const COMPOSITION_DIAGNOSTIC_CATALOG = Object.freeze({
51
+ DUPLICATE_SCALE_CHANNEL: {
52
+ severity: "advisory",
53
+ code: "DUPLICATE_SCALE_CHANNEL",
54
+ messageTemplate: (channel) => `Multiple scale children configure channel "${channel}"; later children overwrite earlier ones.`,
55
+ },
56
+ DUPLICATE_MERGE_KEY: {
57
+ severity: "advisory",
58
+ code: "DUPLICATE_MERGE_KEY",
59
+ messageTemplate: (key) => `Multiple children set "${key}"; later children overwrite earlier ones.`,
60
+ },
61
+ DUPLICATE_PLOT_LAYER: {
62
+ severity: "advisory",
63
+ code: "DUPLICATE_PLOT_LAYER",
64
+ messageTemplate: (kind) => `Multiple ${kind} children are registered; the last one replaces earlier ones.`,
65
+ },
66
+ });
67
+ /** Build a fully-populated duplicate-channel advisory. */
68
+ export function duplicateScaleChannelDiagnostic(channel) {
69
+ const entry = COMPOSITION_DIAGNOSTIC_CATALOG.DUPLICATE_SCALE_CHANNEL;
70
+ return {
71
+ severity: entry.severity,
72
+ code: "DUPLICATE_SCALE_CHANNEL",
73
+ message: entry.messageTemplate(channel),
74
+ channel,
75
+ kind: "scale",
76
+ suggestions: [
77
+ `Keep one scale child per channel — remove all but the intended "${channel}" scale`,
78
+ `British and American spellings write the same channel: <ScaleColorDiscrete/> and <ScaleColourContinuous/> both configure "color"`,
79
+ ],
80
+ docUrl: grammarDocUrl("scale"),
81
+ };
82
+ }
83
+ /** Build a fully-populated duplicate merge-key advisory (labs/guides/legend). */
84
+ export function duplicateMergeKeyDiagnostic(kind, key) {
85
+ const entry = COMPOSITION_DIAGNOSTIC_CATALOG.DUPLICATE_MERGE_KEY;
86
+ const noun = mergeKeyNoun(kind);
87
+ const child = mergeKeyChild(kind);
88
+ return {
89
+ severity: entry.severity,
90
+ code: "DUPLICATE_MERGE_KEY",
91
+ message: entry.messageTemplate(key),
92
+ kind,
93
+ key,
94
+ suggestions: [
95
+ `Set the ${noun} "${key}" on exactly one ${child} child`,
96
+ `${kind} is a MERGE family: siblings that touch different ${noun}s all survive — only "${key}" is overwritten`,
97
+ ],
98
+ docUrl: grammarDocUrl(kind),
99
+ };
100
+ }
101
+ /** Build a fully-populated duplicate REPLACE-family plot-layer advisory. */
102
+ export function duplicatePlotLayerDiagnostic(kind) {
103
+ const entry = COMPOSITION_DIAGNOSTIC_CATALOG.DUPLICATE_PLOT_LAYER;
104
+ const shell = kind === "theme" ? "Theme" : kind === "coord" ? "Coord" : kind === "facet" ? "Facet" : kind;
105
+ return {
106
+ severity: entry.severity,
107
+ code: "DUPLICATE_PLOT_LAYER",
108
+ message: entry.messageTemplate(kind),
109
+ kind,
110
+ suggestions: [
111
+ `Keep one <${shell}*> child — remove earlier ${kind} children so the intended one is the only registration`,
112
+ `${kind} is a REPLACE family: the last child fully replaces earlier ones (and any ${kind} prop)`,
113
+ ],
114
+ docUrl: grammarDocUrl(kind),
115
+ };
116
+ }
117
+ function isMergeKeyLayer(layer) {
118
+ return MERGE_KEY_EMIT_ORDER.includes(layer.kind);
119
+ }
120
+ function isReplaceLayer(layer) {
121
+ return REPLACE_EMIT_ORDER.includes(layer.kind);
122
+ }
123
+ /**
124
+ * Scan plot layers for composition collisions (duplicate scale channels,
125
+ * keyed-MERGE key collisions, REPLACE multi-children). Pure — safe to call
126
+ * from a `$derived` that only re-reads `registry.layers`.
127
+ *
128
+ * Emission order: scale channels, then MERGE_KEY_EMIT_ORDER, then
129
+ * REPLACE_EMIT_ORDER. Mark layers are ignored.
130
+ */
131
+ export function collectCompositionDiagnostics(layers) {
132
+ const list = [];
133
+ const seenChannels = new Set();
134
+ const duplicateChannels = new Set();
135
+ // Kind membership and emit order come from GRAMMAR_FAMILIES (#785).
136
+ // Scales keep their own advisory code (0.11.0 surface); labs/guides/legend
137
+ // share DUPLICATE_MERGE_KEY.
138
+ const mergeSeen = Object.fromEntries(MERGE_KEY_EMIT_ORDER.map((k) => [k, new Set()]));
139
+ const mergeDuplicates = Object.fromEntries(MERGE_KEY_EMIT_ORDER.map((k) => [k, new Set()]));
140
+ const replaceCounts = Object.fromEntries(REPLACE_EMIT_ORDER.map((k) => [k, 0]));
141
+ for (const layer of layers) {
142
+ if (layer.kind === "scale") {
143
+ for (const channel of Object.keys(layer.value)) {
144
+ if (seenChannels.has(channel)) {
145
+ duplicateChannels.add(channel);
146
+ }
147
+ else {
148
+ seenChannels.add(channel);
149
+ }
150
+ }
151
+ continue;
152
+ }
153
+ if (isMergeKeyLayer(layer)) {
154
+ const kind = layer.kind;
155
+ for (const key of Object.keys(layer.value)) {
156
+ if (mergeSeen[kind].has(key)) {
157
+ mergeDuplicates[kind].add(key);
158
+ }
159
+ else {
160
+ mergeSeen[kind].add(key);
161
+ }
162
+ }
163
+ continue;
164
+ }
165
+ if (isReplaceLayer(layer)) {
166
+ replaceCounts[layer.kind] += 1;
167
+ }
168
+ }
169
+ for (const channel of duplicateChannels) {
170
+ list.push(duplicateScaleChannelDiagnostic(channel));
171
+ }
172
+ for (const kind of MERGE_KEY_EMIT_ORDER) {
173
+ for (const key of mergeDuplicates[kind]) {
174
+ list.push(duplicateMergeKeyDiagnostic(kind, key));
175
+ }
176
+ }
177
+ for (const kind of REPLACE_EMIT_ORDER) {
178
+ if (replaceCounts[kind] > 1) {
179
+ list.push(duplicatePlotLayerDiagnostic(kind));
180
+ }
181
+ }
182
+ return list;
183
+ }
184
+ /**
185
+ * Once-per-instance advisory dedup key for composition diagnostics.
186
+ * Shape matches the assembly deliveredAdvisories Set:
187
+ * - scale: `${code}:${channel}`
188
+ * - merge-key: `${code}:${kind}:${key}`
189
+ * - replace: `${code}:${kind}`
190
+ */
191
+ export function compositionAdvisoryDedupKey(diagnostic) {
192
+ if (isDuplicateScaleChannelDiagnostic(diagnostic)) {
193
+ return `${diagnostic.code}:${diagnostic.channel}`;
194
+ }
195
+ if (isDuplicateMergeKeyDiagnostic(diagnostic)) {
196
+ return `${diagnostic.code}:${diagnostic.kind}:${diagnostic.key}`;
197
+ }
198
+ if (isDuplicatePlotLayerDiagnostic(diagnostic)) {
199
+ return `${diagnostic.code}:${diagnostic.kind}`;
200
+ }
201
+ // Exhaustiveness: CompositionDiagnostic has only the three variants above.
202
+ return ((x) => x)(diagnostic);
203
+ }
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Plot-level deprecation advisories (ADR 0013).
3
+ *
4
+ * Sibling union to InteractionDiagnostic, delivered through the existing
5
+ * `ondiagnostic` channel as PlotDiagnostic. One code (`DEPRECATED_PLOT_PROP`)
6
+ * covers every deprecated grammar prop — `prop` carries the name.
7
+ *
8
+ * Runtime emission left in 0.13.0 (#704) when the seven grammar props were
9
+ * removed. Types + catalog + builder stay for union typing, upgrade-guide
10
+ * anchors, and codemod consumers. Discriminate with
11
+ * `d.code === "DEPRECATED_PLOT_PROP"` (no type-guard export).
12
+ *
13
+ * Deliberately NOT merged into INTERACTION_DIAGNOSTIC_CATALOG / the
14
+ * interaction-reference guide page: a deprecated grammar prop is not an
15
+ * interaction concern, and migration guidance belongs on /guide/upgrading
16
+ * (docUrl below). Omitting it from the interaction catalog is a decision,
17
+ * not an oversight.
18
+ */
19
+ import type { InteractionDiagnostic } from "../interaction/interaction-diagnostics.js";
20
+ import type { CompositionDiagnostic } from "./composition.js";
21
+ export type DeprecationDiagnosticCode = "DEPRECATED_PLOT_PROP";
22
+ export interface DeprecationDiagnostic {
23
+ readonly severity: "advisory";
24
+ readonly code: DeprecationDiagnosticCode;
25
+ readonly message: string;
26
+ readonly prop: string;
27
+ readonly since: string;
28
+ readonly removeIn: string;
29
+ readonly suggestions: ReadonlyArray<string>;
30
+ readonly docUrl: string;
31
+ }
32
+ /**
33
+ * Union of every diagnostic the plot may deliver through `ondiagnostic`.
34
+ * Interaction capability/key/lineage checks, grammar-prop deprecations, and
35
+ * composition collisions (duplicate scale channels). Additive: handlers
36
+ * annotated `PlotDiagnostic` (the 0.11 form) remain valid. Exhaustive
37
+ * `switch` on `.code` needs arms for `DUPLICATE_SCALE_CHANNEL` and
38
+ * `DUPLICATE_PLOT_LAYER`.
39
+ */
40
+ export type PlotDiagnostic = InteractionDiagnostic | DeprecationDiagnostic | CompositionDiagnostic;
41
+ /**
42
+ * Frozen catalog entry for the single deprecation code. Message / prop /
43
+ * since / removeIn / docUrl are filled per emission by
44
+ * {@link deprecatedPropDiagnostic}.
45
+ */
46
+ export declare const DEPRECATION_DIAGNOSTIC_CATALOG: Readonly<Record<DeprecationDiagnosticCode, Pick<DeprecationDiagnostic, "severity" | "code"> & {
47
+ readonly messageTemplate: (prop: string, since: string, removeIn: string) => string;
48
+ }>>;
49
+ export type DeprecatedPropDiagnosticInput = {
50
+ readonly prop: string;
51
+ readonly since: string;
52
+ readonly removeIn: string;
53
+ readonly suggestions: ReadonlyArray<string>;
54
+ /** Heading anchor on /guide/upgrading (without the leading `#`). */
55
+ readonly anchor: string;
56
+ };
57
+ /** Build a fully-populated deprecation advisory for one prop. */
58
+ export declare function deprecatedPropDiagnostic(input: DeprecatedPropDiagnosticInput): DeprecationDiagnostic;
@@ -0,0 +1,27 @@
1
+ const GUIDE_UPGRADING = "https://ggts.sh/guide/upgrading";
2
+ /**
3
+ * Frozen catalog entry for the single deprecation code. Message / prop /
4
+ * since / removeIn / docUrl are filled per emission by
5
+ * {@link deprecatedPropDiagnostic}.
6
+ */
7
+ export const DEPRECATION_DIAGNOSTIC_CATALOG = Object.freeze({
8
+ DEPRECATED_PLOT_PROP: {
9
+ severity: "advisory",
10
+ code: "DEPRECATED_PLOT_PROP",
11
+ messageTemplate: (prop, since, removeIn) => `GGPlot prop "${prop}" is deprecated since ${since} and will be removed in ${removeIn}. Prefer the matching declaration-only child layer.`,
12
+ },
13
+ });
14
+ /** Build a fully-populated deprecation advisory for one prop. */
15
+ export function deprecatedPropDiagnostic(input) {
16
+ const entry = DEPRECATION_DIAGNOSTIC_CATALOG.DEPRECATED_PLOT_PROP;
17
+ return {
18
+ severity: entry.severity,
19
+ code: entry.code,
20
+ message: entry.messageTemplate(input.prop, input.since, input.removeIn),
21
+ prop: input.prop,
22
+ since: input.since,
23
+ removeIn: input.removeIn,
24
+ suggestions: input.suggestions,
25
+ docUrl: `${GUIDE_UPGRADING}#${input.anchor}`,
26
+ };
27
+ }
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Plot-engine diagnostic orchestration — config delivery plus the once-only
3
+ * advisory effects (wiring, multi-Inspect, dropped identity, deprecations,
4
+ * composition, inspect-geom, high-cardinality) and the chrome re-delivery
5
+ * effects.
6
+ *
7
+ * Extraction contract (S5): inputs are lazy getters / stable service refs over
8
+ * the engine's live deriveds — never snapshots. `deliverDiagnostic` is one
9
+ * stable closure per engine (shared dedup Set included), so late
10
+ * registrations (chrome re-delivery, semantic-keys) deliver through the same
11
+ * sink.
12
+ *
13
+ * Call `createPlotEngineDiagnostics` synchronously while `createPlotEngine`
14
+ * runs during component init: every `$effect` here must land in the component
15
+ * effect tree. Runtime-gated advisories (inspect-geom, high-cardinality) and
16
+ * the chrome re-delivery effects register later via the register* functions —
17
+ * still during init, at the engine's original registration positions.
18
+ */
19
+ import type { PortableSpec } from "@ggts-sh/spec";
20
+ import { type PlotDiagnostic } from "./deprecation.js";
21
+ import type { LayerRegistry } from "../geoms/registry.svelte.js";
22
+ import { type ResolvedInteractionConfig } from "../interaction/interaction.js";
23
+ import type { CapabilityResolution } from "../interaction/capability-resolution.svelte.js";
24
+ import { type EnginePlotProps } from "../plot-props.js";
25
+ import type { PlotChromeState } from "../chrome/chrome-state.svelte.js";
26
+ import type { PlotRuntime } from "../runtime/runtime.svelte.js";
27
+ /**
28
+ * Inputs: live props proxy + registry (reactive reads) and the engine's
29
+ * capability-resolution / interaction-config accessors.
30
+ */
31
+ export type PlotEngineDiagnosticsInput = {
32
+ readonly props: EnginePlotProps;
33
+ readonly registry: LayerRegistry;
34
+ readonly interactionConfig: () => ResolvedInteractionConfig;
35
+ readonly capabilityResolution: CapabilityResolution;
36
+ };
37
+ export declare function createPlotEngineDiagnostics(input: PlotEngineDiagnosticsInput): {
38
+ deliverDiagnostic: (diagnostic: PlotDiagnostic) => void;
39
+ registerChromeDiagnostics: (chrome: PlotChromeState) => void;
40
+ registerInspectDiagnostics: (opts: {
41
+ assembled: () => PortableSpec | null;
42
+ model: () => PlotRuntime["model"];
43
+ }) => void;
44
+ };
@@ -0,0 +1,193 @@
1
+ import { collectCompositionDiagnostics, compositionAdvisoryDedupKey, } from "./composition.js";
2
+ import { deprecatedPropDiagnostic } from "./deprecation.js";
3
+ import { discreteColorFillDomainSizes, inspectAxisOnBarColDiagnostics, inspectAxisOnDistributionDiagnostics, inspectHighCardinalityDiagnostics, layerGeomsFromSpecLayers, } from "../interaction/interaction.js";
4
+ import { droppedInspectIdentityDiagnostics, duplicateInspectCapabilityDiagnostics, } from "../interaction/resolve-inspect-capability.js";
5
+ import { collectWiringDiagnostics } from "../interaction/wiring-advisories.js";
6
+ import { readLegacyPlotKey, readLegacyPlotLegendFilter, readLegacyPlotLegendFocus, } from "../plot-props.js";
7
+ export function createPlotEngineDiagnostics(input) {
8
+ const capabilityResolution = input.capabilityResolution;
9
+ function deliverDiagnostic(diagnostic) {
10
+ const ondiagnostic = input.props.ondiagnostic;
11
+ ondiagnostic?.(diagnostic);
12
+ const nodeEnvironment = globalThis.process
13
+ ?.env?.NODE_ENV;
14
+ if (nodeEnvironment !== "production" && ondiagnostic === undefined)
15
+ console.warn(`[ggts:${diagnostic.code}] ${diagnostic.message}`);
16
+ }
17
+ $effect(() => {
18
+ for (const diagnostic of input.interactionConfig().diagnostics)
19
+ deliverDiagnostic(diagnostic);
20
+ });
21
+ // Wiring advisories (ADR 0013 audit): prop combinations that silently do
22
+ // nothing. Unlike config diagnostics (re-delivered per recompute), these
23
+ // fire once per prop per plot instance — a later capability toggle must
24
+ // not re-advise. Pure collect lives in wiring-advisories.ts; snapshot is
25
+ // taken inside this derived so late-bound handlers still recompute.
26
+ // capabilities.inspect is resolved (prop + <Inspect> children), not raw prop.
27
+ const wiringDiagnostics = $derived.by(() => {
28
+ const capabilities = capabilityResolution.caps();
29
+ // legendFocus "requested" is the GuideLegend/child (or deprecated prop)
30
+ // opt-in — not the post-key-check resolved config — so keyless focus does
31
+ // not double-advise HANDLER_WITHOUT_CAPABILITY + LEGEND_REQUIRES_KEY.
32
+ return collectWiringDiagnostics({
33
+ interactionScope: input.props.interactionScope,
34
+ interaction: input.props.interaction,
35
+ handlers: {
36
+ oninspect: input.props.oninspect,
37
+ onselect: input.props.onselect,
38
+ onzoom: input.props.onzoom,
39
+ onlegendfocus: input.props.onlegendfocus,
40
+ onlegendfilter: input.props.onlegendfilter,
41
+ },
42
+ capabilities: {
43
+ inspect: capabilities.inspect,
44
+ select: capabilities.select,
45
+ zoom: capabilities.zoom,
46
+ legendFocus: capabilityResolution.legendFocus().requested,
47
+ // legendFilter "requested" is GuideLegend/child (or deprecated prop)
48
+ // opt-in — not resolveCapabilities(plot prop alone).
49
+ legendFilter: capabilityResolution.legendFilter().requested,
50
+ },
51
+ });
52
+ });
53
+ // Shared once-per-dedup-key Set for wiring + multi-Inspect + deprecations +
54
+ // composition + inspect-geom. Each deliverAdvisoriesOnce call registers ONE
55
+ // $effect; call order below is the registration (and first-flush delivery)
56
+ // order. Re-delivering effects (config diagnostics above, chrome
57
+ // re-delivery via registerChromeDiagnostics) stay outside this helper by
58
+ // design.
59
+ const deliveredAdvisories = new Set();
60
+ function deliverAdvisoriesOnce(get, dedupKeyOf = (diagnostic) => `${diagnostic.code}:${diagnostic.prop}`) {
61
+ $effect(() => {
62
+ for (const diagnostic of get()) {
63
+ const dedupKey = dedupKeyOf(diagnostic);
64
+ if (deliveredAdvisories.has(dedupKey))
65
+ continue;
66
+ deliveredAdvisories.add(dedupKey);
67
+ deliverDiagnostic(diagnostic);
68
+ }
69
+ });
70
+ }
71
+ deliverAdvisoriesOnce(() => wiringDiagnostics);
72
+ // Multiple <Inspect> children: last wins; advisory once per mount.
73
+ const multiInspectDiagnostics = $derived.by(() => duplicateInspectCapabilityDiagnostics(capabilityResolution.inspect().multiChild));
74
+ deliverAdvisoriesOnce(() => multiInspectDiagnostics);
75
+ // <Inspect> replaced an inspect prop that named `identity`: rows silently
76
+ // fell back to id column / row index before #1305's follow-up.
77
+ const droppedIdentityDiagnostics = $derived.by(() => droppedInspectIdentityDiagnostics(capabilityResolution.inspect().droppedPropIdentity));
78
+ deliverAdvisoriesOnce(() => droppedIdentityDiagnostics);
79
+ // Deprecated plot-level key → Inspect / Select / controller identity.
80
+ const deprecatedKeyDiagnostics = $derived.by(() => {
81
+ const plotProp = readLegacyPlotKey(input.props);
82
+ if (plotProp === undefined)
83
+ return [];
84
+ return [
85
+ deprecatedPropDiagnostic({
86
+ prop: "key",
87
+ since: "0.21.0",
88
+ removeIn: "0.22.0",
89
+ suggestions: [
90
+ 'Use <Inspect identity="year" /> (or inspect={{ identity: "year" }})',
91
+ 'Use select={{ type: "point", identity: "year" }} when selection owns the key',
92
+ 'Use createPlotInteraction({ identity: "year" }) for linked controllers',
93
+ ],
94
+ anchor: "row-identity-on-interaction",
95
+ }),
96
+ ];
97
+ });
98
+ deliverAdvisoriesOnce(() => deprecatedKeyDiagnostics);
99
+ // Deprecated plot-level legendFocus → GuideLegend.focus (one minor window).
100
+ const deprecatedLegendFocusDiagnostics = $derived.by(() => {
101
+ const plotProp = readLegacyPlotLegendFocus(input.props);
102
+ if (plotProp === undefined || plotProp === false)
103
+ return [];
104
+ return [
105
+ deprecatedPropDiagnostic({
106
+ prop: "legendFocus",
107
+ since: "0.19.0",
108
+ removeIn: "0.20.0",
109
+ suggestions: [
110
+ 'Use <GuideLegend channel="color" focus /> (or the aesthetic that owns the discrete legend)',
111
+ "focus={{ preview: false }} on GuideLegend replaces legendFocus={{ preview: false }}",
112
+ ],
113
+ anchor: "legend-focus-on-guidelegend",
114
+ }),
115
+ ];
116
+ });
117
+ deliverAdvisoriesOnce(() => deprecatedLegendFocusDiagnostics);
118
+ // Deprecated plot-level legendFilter → GuideLegend.filter (one minor window).
119
+ const deprecatedLegendFilterDiagnostics = $derived.by(() => {
120
+ const plotProp = readLegacyPlotLegendFilter(input.props);
121
+ if (plotProp === undefined || plotProp === false)
122
+ return [];
123
+ return [
124
+ deprecatedPropDiagnostic({
125
+ prop: "legendFilter",
126
+ since: "0.19.0",
127
+ removeIn: "0.20.0",
128
+ suggestions: [
129
+ 'Use <GuideLegend channel="color" filter /> (or the aesthetic that owns the discrete legend)',
130
+ 'filter={{ mode: "include", multiple: false }} on GuideLegend replaces legendFilter={{ … }}',
131
+ ],
132
+ anchor: "legend-filter-on-guidelegend",
133
+ }),
134
+ ];
135
+ });
136
+ deliverAdvisoriesOnce(() => deprecatedLegendFilterDiagnostics);
137
+ // Composition advisories (#659 slices 3+5+6): pure collect over
138
+ // registry.layers. Last child still wins (shallow merge / last write);
139
+ // delivery is once-per-dedup-key via compositionAdvisoryDedupKey.
140
+ const compositionDiagnostics = $derived.by(() => collectCompositionDiagnostics(input.registry.layers));
141
+ deliverAdvisoriesOnce(() => compositionDiagnostics, compositionAdvisoryDedupKey);
142
+ // Chrome area-scale / legend diagnostics re-deliver per recompute (outside
143
+ // the once-only helper by design). Register after chromeState exists.
144
+ function registerChromeDiagnostics(chrome) {
145
+ $effect(() => {
146
+ for (const diagnostic of chrome.areaScaleDiagnostics)
147
+ deliverDiagnostic(diagnostic);
148
+ });
149
+ $effect(() => {
150
+ for (const diagnostic of chrome.legendDiagnostics)
151
+ deliverDiagnostic(diagnostic);
152
+ });
153
+ }
154
+ // Runtime-gated inspect advisories — register after the plot runtime exists
155
+ // (trained scales gate both). Still during init, at the engine's original
156
+ // registration position.
157
+ function registerInspectDiagnostics(opts) {
158
+ // Inspect axis guides that fight bar/col geometry (or bisect on-bar labels)
159
+ // and freescrolling guides through distribution/interval band geoms (#1528).
160
+ // After runtime so trained scales gate interval-geom advisories (continuous
161
+ // shared-x line+errorbar with mode="x" stays silent). Mode x/xy still fire
162
+ // under coord_flip (#1409): the band-axis guide remains.
163
+ const inspectGeomDiagnostics = $derived.by(() => {
164
+ const mode = input.interactionConfig().inspect?.mode;
165
+ if (mode === undefined)
166
+ return [];
167
+ const geoms = layerGeomsFromSpecLayers(opts.assembled()?.layers);
168
+ const scales = opts.model()?.scales;
169
+ const discreteBandAxis = scales !== undefined && (scales.x.type === "band" || scales.y.type === "band");
170
+ return [
171
+ ...inspectAxisOnBarColDiagnostics(mode, geoms),
172
+ ...inspectAxisOnDistributionDiagnostics(mode, geoms, { discreteBandAxis }),
173
+ ];
174
+ });
175
+ deliverAdvisoriesOnce(() => inspectGeomDiagnostics);
176
+ // High-cardinality discrete color/fill + inspect: default tooltip policy
177
+ // advisory (#1274). Needs trained scales (runtime.model); once-per-channel.
178
+ const inspectHighCardinality = $derived.by(() => {
179
+ // Resolved inspect is null when off (never undefined) — see normalizeInteractionConfig.
180
+ if (input.interactionConfig().inspect === null)
181
+ return [];
182
+ const model = opts.model();
183
+ if (model === null)
184
+ return [];
185
+ return inspectHighCardinalityDiagnostics({
186
+ inspectEnabled: true,
187
+ domainSizes: discreteColorFillDomainSizes(model.scales),
188
+ });
189
+ });
190
+ deliverAdvisoriesOnce(() => inspectHighCardinality);
191
+ }
192
+ return { deliverDiagnostic, registerChromeDiagnostics, registerInspectDiagnostics };
193
+ }