@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,166 @@
1
+ import { assemblePortableSpec, isFacetedPlotIntent, resolveInteractionScope, toLayerInput, } from "./assembly/assemble.js";
2
+ import { normalizeInteractionConfig, } from "./interaction/interaction.js";
3
+ import { ssrSafeDerived, } from "./interaction/capability-resolution.svelte.js";
4
+ import { filterFilterableLegendEntries } from "./legend/resolve-legend-filter.js";
5
+ import { filterInteractiveLegendEntries } from "./legend/resolve-legend-focus.js";
6
+ import { isHostPlotLayer } from "./layers/types.js";
7
+ import { readLegacyPlotKey } from "./plot-props.js";
8
+ import { identityFromSelectInput, pickExplicitDatumKey, resolveDatumKey, } from "./runtime/resolve-datum-key.js";
9
+ import { crosshairGlyphObstacles, glyphExtentsFromBatch, } from "./scene/geometry.js";
10
+ export function createPlotEngineDeriveds(host, capabilityResolution) {
11
+ const inspectResolved = capabilityResolution.inspect;
12
+ const legendFocusResolved = capabilityResolution.legendFocus;
13
+ // Reading descriptors through toLayerInput goes through live getters, so
14
+ // geom prop changes flow into this $derived without re-registration.
15
+ // Explicit `spec` short-circuits before registry/children so ignored props
16
+ // do not become reactive dependencies of the assembled plot.
17
+ function assembleCurrentSpec() {
18
+ const spec = host.props.spec;
19
+ if (spec !== undefined)
20
+ return assemblePortableSpec({ spec, layers: [] });
21
+ const data = host.props.data;
22
+ const mapping = host.props.aes;
23
+ const layers = host.props.layers;
24
+ const a11y = host.props.a11y;
25
+ return assemblePortableSpec({
26
+ ...(data !== undefined && { data }),
27
+ ...(mapping !== undefined && { aes: mapping }),
28
+ // Mark layers only: a `layers={[…]}` prop suppresses registry marks, not
29
+ // non-mark plot layers (theme/scale/coord/facet/labs/guides/legend).
30
+ layers: layers ?? host.registry.markLayers.map(toLayerInput),
31
+ // Grammar only — host-only kinds (legendFocus) never fold into PortableSpec.
32
+ plotLayers: host.registry.layers.filter((layer) => layer.kind !== "mark" && !isHostPlotLayer(layer)),
33
+ ...(a11y !== undefined && { a11y }),
34
+ });
35
+ }
36
+ // SSR one-pass recompute rationale lives on ssrSafeDerived (#982).
37
+ const assembled = ssrSafeDerived(assembleCurrentSpec);
38
+ // Facet intent: registry facet plot layer (<FacetWrap/> / <FacetGrid/> / <Facet/>),
39
+ // OR assembled.facet (portable-spec embeds). Grammar props removed in 0.13.0 (#704).
40
+ const facetedPlot = $derived(isFacetedPlotIntent({
41
+ plotLayers: host.registry.layers,
42
+ assembled: assembled(),
43
+ }));
44
+ /**
45
+ * Durable row identity: Inspect / Select / controller `identity` first,
46
+ * then deprecated GGPlot `key`, else auto `id` column, else row index.
47
+ * Always defined — ordinary charts need no custom identity.
48
+ */
49
+ function resolvedDatumKeyNow() {
50
+ const data = host.props.data;
51
+ const embedded = assembled()?.data;
52
+ // The capability seam resolves this — do not re-read it off `input`, which
53
+ // cannot tell a dropped prop identity from one that was never set.
54
+ const inspectIdentity = inspectResolved().identity;
55
+ const selectIdentity = identityFromSelectInput(host.props.select);
56
+ const controllerIdentity = host.props.interaction?.identity;
57
+ const legacyKey = readLegacyPlotKey(host.props);
58
+ // exactOptionalPropertyTypes: omit keys rather than pass `undefined`.
59
+ const explicit = pickExplicitDatumKey({
60
+ ...(inspectIdentity !== undefined && { inspect: inspectIdentity }),
61
+ ...(selectIdentity !== undefined && { select: selectIdentity }),
62
+ ...(controllerIdentity !== undefined && { controller: controllerIdentity }),
63
+ ...(legacyKey !== undefined && { legacy: legacyKey }),
64
+ });
65
+ return resolveDatumKey({
66
+ ...(explicit !== undefined && { explicit }),
67
+ data: data ?? embedded,
68
+ });
69
+ }
70
+ const resolvedDatumKey = ssrSafeDerived(resolvedDatumKeyNow);
71
+ const resolvedInteractionScope = $derived((() => {
72
+ const interaction = host.props.interaction;
73
+ const interactionScope = host.props.interactionScope;
74
+ const datumKey = resolvedDatumKey();
75
+ return resolveInteractionScope({
76
+ interaction,
77
+ ...(interactionScope !== undefined && { interactionScope }),
78
+ // Single-field default — do not call caps() (would subscribe all five).
79
+ zoom: host.props.zoom ?? false,
80
+ faceted: facetedPlot,
81
+ datumKey,
82
+ assembled: assembled(),
83
+ });
84
+ })());
85
+ // interactionConfig: inspect from prop + <Inspect> children; legendFocus from
86
+ // GuideLegend (host registry). SSR hatch matches assembled / inspectResolved.
87
+ function interactionConfigCurrent() {
88
+ const tool = host.props.tool;
89
+ // Four fields only — legendFilter is not part of normalizeInteractionConfig.
90
+ // Reading it via caps() re-delivered config diagnostics on every filter toggle.
91
+ return normalizeInteractionConfig({
92
+ inspect: inspectResolved().input,
93
+ select: host.props.select ?? false,
94
+ zoom: host.props.zoom ?? false,
95
+ legendFocus: legendFocusResolved().configInput,
96
+ ...(tool !== undefined && { tool }),
97
+ }, {
98
+ faceted: facetedPlot,
99
+ // Defaults always resolve a datum key (id column or row index).
100
+ hasKey: true,
101
+ });
102
+ }
103
+ const interactionConfig = ssrSafeDerived(interactionConfigCurrent);
104
+ // ------------------------------------------------- interaction deriveds
105
+ // Shared enablement predicates (avoid re-typing the same config gates).
106
+ const interactive = $derived(interactionConfig().interactive);
107
+ const surfaceInteractive = $derived(interactionConfig().availableTools.length > 0);
108
+ const inspectEnabled = $derived(interactionConfig().inspect !== null);
109
+ const legendFocusEnabled = $derived(interactionConfig().legendFocus !== null);
110
+ const coordFlipped = $derived(assembled()?.coord?.type === "flip");
111
+ return {
112
+ assembled,
113
+ resolvedDatumKey,
114
+ resolvedInteractionScope: () => resolvedInteractionScope,
115
+ interactionConfig,
116
+ interactive: () => interactive,
117
+ surfaceInteractive: () => surfaceInteractive,
118
+ inspectEnabled: () => inspectEnabled,
119
+ legendFocusEnabled: () => legendFocusEnabled,
120
+ coordFlipped: () => coordFlipped,
121
+ };
122
+ }
123
+ export function createPlotEngineHostDeriveds(input) {
124
+ // Host-side deriveds kept outside the engine factory (construction-time free of
125
+ // the model read). Channel filter: only aesthetics with GuideLegend focus
126
+ // (merged legends match via aesthetics[], not primary scale alone).
127
+ const interactiveLegendEntries = $derived(filterInteractiveLegendEntries(input.legendFocusState.computeInteractiveEntries(input.runtime.model), input.legendFocusChannels()));
128
+ const effectiveLegendPressed = $derived(input.legendFocusState.computeLegendPressed(input.runtime.model));
129
+ // Signal that the legend clear control is visible (right of the scene).
130
+ // No longer couples to a bottom-row layout margin.
131
+ const legendClearActive = $derived(input.legendFocusEnabled() && effectiveLegendPressed !== null);
132
+ // Host-side derived for catalog reconcile (closes over runtime.model).
133
+ // Channel filter: only aesthetics with GuideLegend filter (merged legends
134
+ // match via aesthetics[], not primary scale alone).
135
+ const filterableLegendEntries = $derived(filterFilterableLegendEntries(input.legendFilterState.computeEntries(input.runtime.model), input.legendFilterChannels()));
136
+ function hoverGlyphExtents() {
137
+ const seed = input.inspection.inspectionSeed;
138
+ const model = input.runtime.model;
139
+ if (seed === null || model === null || seed.kind !== "glyphs")
140
+ return null;
141
+ const batch = model.scene.batches[seed.batchIndex];
142
+ if (batch === undefined || batch.kind !== "glyphs")
143
+ return null;
144
+ return glyphExtentsFromBatch(batch, seed.primitiveIndex);
145
+ }
146
+ // Scene walk (not candidate store): uninspectable label layers still paint
147
+ // and still need guide gaps (#1065 / #1207). Depends on (scene, panelId)
148
+ // only — not the focus anchor — so this is a real $derived, not a per-read
149
+ // getter like hoverGlyphExtents.
150
+ const EMPTY_CROSSHAIR_GAP_OBSTACLES = Object.freeze([]);
151
+ const crosshairGapObstacles = $derived.by(() => {
152
+ const model = input.runtime.model;
153
+ const panel = input.inspection.inspectionPanel;
154
+ if (model === null || panel === null)
155
+ return EMPTY_CROSSHAIR_GAP_OBSTACLES;
156
+ return crosshairGlyphObstacles(model.scene.batches, model.scene.panels, panel.id);
157
+ });
158
+ return {
159
+ interactiveLegendEntries: () => interactiveLegendEntries,
160
+ effectiveLegendPressed: () => effectiveLegendPressed,
161
+ legendClearActive: () => legendClearActive,
162
+ filterableLegendEntries: () => filterableLegendEntries,
163
+ hoverGlyphExtents,
164
+ crosshairGapObstacles: () => crosshairGapObstacles,
165
+ };
166
+ }
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Plot engine — controller wiring + host-level deriveds for <GGPlot>.
3
+ *
4
+ * Ownership: GGPlot owns root, captureSurface, a11yTableOpen, plotId (component
5
+ * runes / bind:this / $props.id / markup-only state); context
6
+ * (`provideRegistry`) and `$props()` stay in the component. The engine owns
7
+ * tooltipHovered, all controller construction, and phased effect registration.
8
+ * Pure host derivations (assembled spec, datum key, interaction config,
9
+ * capability enablement, legend entry lists, hover/crosshair geometry) live in
10
+ * plot-engine-deriveds.svelte.ts; diagnostic orchestration (config delivery +
11
+ * once-only advisories) lives in diagnostics/plot-engine-diagnostics.svelte.ts
12
+ * — both invoked from this factory so every `$derived`/`$effect` lands in the
13
+ * component effect tree at the original construction position.
14
+ *
15
+ * Construction / effect-order contract: the five interaction controllers
16
+ * (zoom / selection / interval / surface / inspection) are built by the
17
+ * two-phase interaction assembly (interaction/interaction-states.svelte.ts) —
18
+ * phase 1 builds zoom before the legend-filter / runtime chain; phase 2
19
+ * (`complete`) builds the model-reading controllers after the runtime +
20
+ * semantic-key service, because SSR evaluates $derived eagerly at
21
+ * construction. The assembly owns sibling ports; shared deps flow through one
22
+ * InteractionContext (interaction/interaction-context.svelte.ts). Leaf modules
23
+ * register their own effects at construction; the engine only wires
24
+ * host-held deriveds into catalog reconcile where data is not available at
25
+ * leaf construction time.
26
+ *
27
+ * Residual late bindings (definite-assignment / late hooks only where the
28
+ * cycle is real): `semanticCandidateProjection!` — interval
29
+ * consumptionCandidates close over the projection, which reads the assembled
30
+ * states; `legendFocusState.installHostDerivedEffects()` — host $derived
31
+ * entry lists require this factory's compute* methods (#627). Surface tool
32
+ * enablement (`availableTools`, point-select) is host-derived before the
33
+ * assembly so chrome is not a surface construction-time dep (#1082).
34
+ *
35
+ * Call `createPlotEngine` once during component init so every `$effect`
36
+ * registers in the component effect tree. No `$props`, `$props.id()`, or
37
+ * context calls live here.
38
+ */
39
+ import type { BatchInteractionMask } from "@ggts-sh/core";
40
+ import type { PortableSpec } from "@ggts-sh/spec";
41
+ import type { ResolvedInteractionConfig } from "./interaction/interaction.js";
42
+ import type { InspectionState } from "./inspection/inspection-state.svelte.js";
43
+ import type { IntervalState } from "./interval/interval-state.svelte.js";
44
+ import { type LegendFilterState } from "./legend/filter-state.svelte.js";
45
+ import type { FilterableLegendEntry } from "./legend/filter-state.svelte.js";
46
+ import type { InteractiveLegendEntry, LegendEntryIdentity } from "./legend/focus.js";
47
+ import { type LegendFocusState } from "./legend/focus-state.svelte.js";
48
+ import { type PlotChromeState } from "./chrome/chrome-state.svelte.js";
49
+ import type { LayerRegistry } from "./geoms/registry.svelte.js";
50
+ import type { EnginePlotProps } from "./plot-props.js";
51
+ import { type PlotAnnouncer } from "./runtime/announcer.svelte.js";
52
+ import { type PlotRuntime } from "./runtime/runtime.svelte.js";
53
+ import type { SelectionState } from "./selection/selection-state.svelte.js";
54
+ import { type PresentationAnchor, type PresentationChrome } from "./selection/selection.js";
55
+ import type { CrosshairGapBox } from "./scene/geometry.js";
56
+ import type { SurfaceState } from "./surface/surface-state.svelte.js";
57
+ import type { PlotZoomState } from "./zoom/zoom-state.svelte.js";
58
+ /**
59
+ * Host binding for the plot engine (#1040). Props are a single lazy
60
+ * `EnginePlotProps` surface (GGPlotProps with PublicKey fields widened) —
61
+ * not a per-field thunk bag. Capability defaults live in `resolveCapabilities`.
62
+ */
63
+ export type PlotEngineHost = {
64
+ /** Value — created by `provideRegistry()` in GGPlot (context stays there). */
65
+ registry: LayerRegistry;
66
+ /** Plain string from `$props.id()` in GGPlot. */
67
+ plotId: string;
68
+ root: () => HTMLDivElement | null;
69
+ captureSurface: () => HTMLDivElement | null;
70
+ /** Live props proxy (or widenPlotProps view). Grammar is children-only (#704). */
71
+ props: EnginePlotProps;
72
+ };
73
+ /**
74
+ * Non-generic return surface. Controllers are stable object refs; deriveds
75
+ * that markup reads are `get` accessors. Internal wiring (deliverDiagnostic,
76
+ * inspectEnabled, facetedPlot, …) is not exposed. Defined once next to the
77
+ * factory that builds it — not hand-mirrored from a second module (#982).
78
+ */
79
+ export type PlotEngine = {
80
+ readonly zoomState: PlotZoomState;
81
+ readonly legendFilterState: LegendFilterState;
82
+ readonly runtime: PlotRuntime;
83
+ readonly inspectionState: InspectionState;
84
+ readonly surfaceState: SurfaceState;
85
+ readonly selectionState: SelectionState;
86
+ readonly legendFocusState: LegendFocusState;
87
+ readonly intervalState: IntervalState;
88
+ readonly chromeState: PlotChromeState;
89
+ readonly announcer: PlotAnnouncer;
90
+ readonly assembled: PortableSpec | null;
91
+ readonly interactionConfig: ResolvedInteractionConfig;
92
+ readonly interactive: boolean;
93
+ readonly surfaceInteractive: boolean;
94
+ readonly coordFlipped: boolean;
95
+ readonly legendFocusEnabled: boolean;
96
+ readonly selectedAnchors: PresentationAnchor[];
97
+ readonly emphasizedAnchors: PresentationAnchor[];
98
+ readonly hoverChrome: PresentationChrome;
99
+ /** Measured glyph box when hoverChrome is `"box"`. */
100
+ readonly hoverBoxWidth: number | undefined;
101
+ readonly hoverBoxHeight: number | undefined;
102
+ readonly hoverBoxAnchor: "start" | "middle" | "end" | undefined;
103
+ /**
104
+ * Sibling GeomText AABBs in the focus panel for crosshair hard-gaps (#1207).
105
+ * Derived from scene batches (not candidate store) so uninspectable labels
106
+ * still clear the guide.
107
+ */
108
+ readonly crosshairGapObstacles: readonly CrosshairGapBox[];
109
+ readonly interactionMasks: readonly (BatchInteractionMask | null)[];
110
+ readonly interactiveLegendEntries: InteractiveLegendEntry[];
111
+ readonly effectiveLegendPressed: LegendEntryIdentity | null;
112
+ readonly legendClearActive: boolean;
113
+ readonly filterableLegendEntries: FilterableLegendEntry[];
114
+ tooltipHovered: boolean;
115
+ };
116
+ export declare function createPlotEngine(host: PlotEngineHost): PlotEngine;
@@ -0,0 +1,316 @@
1
+ import { canPublishPointSelection, resolveFilteredAvailableTools, } from "./interaction/capability.js";
2
+ import { createCapabilityResolution } from "./interaction/capability-resolution.svelte.js";
3
+ import { resolveInteractionContext } from "./interaction/interaction-context.svelte.js";
4
+ import { createInteractionAssembly } from "./interaction/interaction-states.svelte.js";
5
+ import { createLegendEntryKeyIndex } from "./legend/entry-key-index.svelte.js";
6
+ import { createLegendFilterState } from "./legend/filter-state.svelte.js";
7
+ import { createLegendFocusState } from "./legend/focus-state.svelte.js";
8
+ import { createPlotChromeState } from "./chrome/chrome-state.svelte.js";
9
+ import { createPlotAnnouncer } from "./runtime/announcer.svelte.js";
10
+ import { createPlotRuntime } from "./runtime/runtime.svelte.js";
11
+ import { createSemanticCandidateProjection } from "./runtime/semantic-candidate-projection.svelte.js";
12
+ import { buildDataIdentityEpochInput, dataIdentityEpochToken, } from "./runtime/semantic-data-identity.js";
13
+ import { createSourceIdentityTracker } from "./runtime/semantic-source-identity.js";
14
+ import { createSemanticKeyService } from "./runtime/semantic-keys.svelte.js";
15
+ import { hoverChromeForKind, } from "./selection/selection.js";
16
+ import { createPlotEngineDiagnostics } from "./diagnostics/plot-engine-diagnostics.svelte.js";
17
+ import { createPlotEngineDeriveds, createPlotEngineHostDeriveds, } from "./plot-engine-deriveds.svelte.js";
18
+ // ---------------------------------------------------------------------------
19
+ // Factory
20
+ export function createPlotEngine(host) {
21
+ // Capability resolution seam (inspect / legendFocus / legendFilter / caps):
22
+ // three independent SSR-safe deriveds behind one factory — see
23
+ // capability-resolution.svelte.ts for the capabilityVersion-vs-version
24
+ // isolation contract and the SSR one-pass recompute rationale.
25
+ const capabilityResolution = createCapabilityResolution(host);
26
+ // Early host derivations (assembled spec, datum key, interaction config,
27
+ // capability enablement) — pure accessors, construction order preserved.
28
+ const { assembled, interactionConfig, resolvedDatumKey, resolvedInteractionScope, interactive, surfaceInteractive, inspectEnabled, legendFocusEnabled, coordFlipped, } = createPlotEngineDeriveds(host, capabilityResolution);
29
+ // Diagnostic orchestration: config delivery + once-only advisory effects,
30
+ // registered here (during init) at the engine's original positions.
31
+ const { deliverDiagnostic, registerChromeDiagnostics, registerInspectDiagnostics } = createPlotEngineDiagnostics({
32
+ props: host.props,
33
+ registry: host.registry,
34
+ interactionConfig,
35
+ capabilityResolution,
36
+ });
37
+ // PublicKey → PropertyKey widening lives in widenPlotProps (plot-props.ts);
38
+ // controllers read host.props handlers directly (already widened). The sink
39
+ // is handler-only — announcer is declared later, never read at construction.
40
+ const announceSink = (message) => {
41
+ announcer.announce(message);
42
+ };
43
+ // Leaf effects register at construction (#627); the assembly owns order.
44
+ let tooltipHovered = $state(false);
45
+ // ------------------------------------------------- interaction context
46
+ // One shared bag replaces the ~60 hand-wired dep fields the five controller
47
+ // factories used to declare individually. Model / semantic-key getters are
48
+ // handler-only deferred closures — never read at construction.
49
+ const interactionContext = resolveInteractionContext({
50
+ model: () => runtime.model,
51
+ root: host.root,
52
+ captureSurface: host.captureSurface,
53
+ interaction: () => host.props.interaction,
54
+ resolvedInteractionScope,
55
+ selectConfig: () => interactionConfig().select,
56
+ inspectConfig: () => interactionConfig().inspect,
57
+ tooltipHovered: () => tooltipHovered,
58
+ announce: announceSink,
59
+ oninteraction: () => host.props.oninteraction,
60
+ oninspect: () => host.props.oninspect,
61
+ onselect: () => host.props.onselect,
62
+ onzoom: () => host.props.onzoom,
63
+ ontoolchange: () => host.props.ontoolchange,
64
+ keyAt: (index) => semanticKeys.keyAt(index),
65
+ semanticKey: (row, index) => semanticKeys.semanticKey(row, index),
66
+ candidateSemanticKeys: (candidate) => semanticKeys.candidateSemanticKeys(candidate),
67
+ });
68
+ // ------------------------------------------------- interaction assembly (phase 1)
69
+ // Zoom is the only controller the legend-filter / runtime chain reads. SSR
70
+ // evaluates $derived eagerly at construction, so the model-reading
71
+ // controllers wait for the runtime — phase 2 runs after semanticKeys below.
72
+ const interactionAssembly = createInteractionAssembly(interactionContext, {
73
+ zoom: {
74
+ zoomConfig: () => interactionConfig().zoom,
75
+ assembled,
76
+ },
77
+ });
78
+ // Source identity/order epoch: O(R) row-ref order over data/spec *props*
79
+ // (not assembled shells) — tracker owned for the component lifetime; pure
80
+ // fingerprint assembly lives in buildDataIdentityEpochInput (#852).
81
+ const identityTracker = createSourceIdentityTracker();
82
+ const dataIdentityEpoch = $derived.by(() => dataIdentityEpochToken(buildDataIdentityEpochInput({
83
+ data: host.props.data,
84
+ spec: host.props.spec,
85
+ layers: host.props.layers,
86
+ // Declaration children: markLayers only (not registry.layers) — #609.
87
+ registryMarkLayers: host.registry.markLayers,
88
+ sourceIdentity: (value) => identityTracker.sourceIdentity(value),
89
+ })));
90
+ // Live-region announcer (owned early so legend-reset effects can call it).
91
+ const announcer = createPlotAnnouncer();
92
+ // ------------------------------------------------- legend filter
93
+ // Construction-time deriveds read legendFilter/effectiveSpec only — model /
94
+ // catalogEntries close over later bindings (effect-only, never construction).
95
+ const legendFilterState = createLegendFilterState({
96
+ effectiveSpec: () => interactionAssembly.zoom.effectiveSpec,
97
+ // GuideLegend children (or deprecated plot prop) — not plot prop alone.
98
+ legendFilterProp: () => capabilityResolution.legendFilter().configInput,
99
+ onlegendfilter: () => host.props.onlegendfilter,
100
+ oninteraction: () => host.props.oninteraction,
101
+ announce: announceSink,
102
+ model: () => runtime.model,
103
+ catalogEntries: () => hostDeriveds.filterableLegendEntries(),
104
+ });
105
+ // ------------------------------------------------- plot runtime (after the
106
+ // interaction assembly + legend-filter, so construction-time deps are set).
107
+ const runtime = createPlotRuntime({
108
+ widthProp: () => host.props.width,
109
+ heightProp: () => host.props.height,
110
+ assembled,
111
+ effectiveSpec: () => interactionAssembly.zoom.effectiveSpec,
112
+ effectiveZoomDomains: () => interactionAssembly.zoom.effectiveZoomDomains,
113
+ effectiveLegendFilters: () => legendFilterState.filters,
114
+ root: host.root,
115
+ resetZoom: () => {
116
+ interactionAssembly.zoom.resetForScales();
117
+ },
118
+ onrender: () => host.props.onrender,
119
+ });
120
+ // Semantic resolution as soon as the runtime model exists — early
121
+ // construction keeps interval projection safe with shared controllers (#165).
122
+ const semanticKeys = createSemanticKeyService({
123
+ model: () => runtime.model,
124
+ assembled,
125
+ datumKey: () => resolvedDatumKey(),
126
+ data: () => host.props.data,
127
+ spec: () => host.props.spec,
128
+ sourceIdentity: (value) => identityTracker.sourceIdentity(value),
129
+ deliverDiagnostic,
130
+ });
131
+ // Legend entry → key index (lifted from semantic-keys in S16) — after
132
+ // semanticKeys, before inspection, so the construction DAG is unchanged.
133
+ const legendEntryKeys = createLegendEntryKeyIndex({
134
+ model: () => runtime.model,
135
+ keyAt: (i) => semanticKeys.keyAt(i),
136
+ });
137
+ // source rows/spec -> pipeline/scene + CandidateStore -> semantic resolver
138
+ // -> tooltip/crosshair/tools/callbacks.
139
+ // Surface tool enablement is host-derived (#1082) — same formulas as chrome.
140
+ const surfaceAvailableTools = $derived(resolveFilteredAvailableTools(interactionConfig().availableTools, interactionConfig().zoom, runtime.model?.scales ?? null));
141
+ const surfacePointSelectEnabled = $derived(canPublishPointSelection(interactionConfig().select));
142
+ // ------------------------------------------------- interaction assembly (phase 2)
143
+ // selection → interval → surface → inspection; sibling ports wired inside
144
+ // the assembly. The projection is the one remaining late binding (#165).
145
+ let semanticCandidateProjection;
146
+ const states = interactionAssembly.complete({
147
+ interval: {
148
+ consumptionCandidates: () => semanticCandidateProjection.intervalConsumptionCandidates,
149
+ },
150
+ surface: {
151
+ toolProp: () => host.props.tool,
152
+ initialTool: () => interactionConfig().initialTool,
153
+ availableTools: () => surfaceAvailableTools,
154
+ pointSelectEnabled: () => surfacePointSelectEnabled,
155
+ surfaceInteractive,
156
+ },
157
+ inspection: {
158
+ inspectEnabled,
159
+ dataIdentityEpoch: () => dataIdentityEpoch,
160
+ plotId: () => host.plotId,
161
+ clearTooltipHovered: () => {
162
+ tooltipHovered = false;
163
+ },
164
+ clearAnnouncement: () => {
165
+ announcer.clear();
166
+ },
167
+ },
168
+ });
169
+ // ------------------------------------------------- legend focus
170
+ // Host-held entry lists install via installHostDerivedEffects — irreducible
171
+ // late data, not a sibling-controller cycle (#627).
172
+ const legendFocusState = createLegendFocusState({
173
+ interaction: () => host.props.interaction,
174
+ resolvedInteractionScope,
175
+ legendFocusEnabled,
176
+ legendFocusPreviewEnabled: () => interactionConfig().legendFocus?.preview === true,
177
+ root: host.root,
178
+ entryKeys: () => legendEntryKeys,
179
+ entries: () => hostDeriveds.interactiveLegendEntries(),
180
+ pressed: () => hostDeriveds.effectiveLegendPressed(),
181
+ onlegendfocus: () => host.props.onlegendfocus,
182
+ oninteraction: () => host.props.oninteraction,
183
+ announce: announceSink,
184
+ });
185
+ semanticCandidateProjection = createSemanticCandidateProjection({
186
+ model: () => runtime.model,
187
+ candidateSemanticKeys: (candidate) => semanticKeys.candidateSemanticKeys(candidate),
188
+ selectedKeys: () => states.selection.effectiveSelectedKeys,
189
+ intervalKeys: () => states.interval.effectiveIntervalKeys,
190
+ intervals: () => states.interval.effectiveIntervals,
191
+ emphasisKeys: () => legendFocusState.effectiveEmphasisKeys,
192
+ muteSiblingsOnInspect: () => interactionConfig().inspect?.muteSiblings === true,
193
+ // Inspection owns the projection (#1080); wiring no longer re-assembles it.
194
+ inspectionFocus: () => states.inspection.presentationFocus,
195
+ });
196
+ // ------------------------------------------------- plot chrome
197
+ // All host bindings earlier-declared; pure construction-time deriveds. Tools
198
+ // stay chrome-owned for UI (#1082), same helpers as surfaceAvailableTools.
199
+ const chromeState = createPlotChromeState({
200
+ model: () => runtime.model,
201
+ zoomConfig: () => interactionConfig().zoom,
202
+ selectConfig: () => interactionConfig().select,
203
+ configuredAvailableTools: () => interactionConfig().availableTools,
204
+ interactionDiagnostics: () => interactionConfig().diagnostics,
205
+ interactive,
206
+ effectiveZoomDomains: () => states.zoom.effectiveZoomDomains,
207
+ effectiveIntervals: () => states.interval.effectiveIntervals,
208
+ effectiveSelectedKeys: () => states.selection.effectiveSelectedKeys,
209
+ effectiveEmphasisKeys: () => legendFocusState.effectiveEmphasisKeys,
210
+ legendFocusEnabled,
211
+ hasCanvas: () => runtime.hasCanvas,
212
+ width: () => host.props.width,
213
+ resolvedWidth: () => runtime.resolvedWidth,
214
+ resolvedHeight: () => runtime.resolvedHeight,
215
+ });
216
+ // Chrome area-scale / legend diagnostics re-deliver per recompute.
217
+ registerChromeDiagnostics(chromeState);
218
+ // Runtime-gated inspect advisories — original position, after the runtime.
219
+ registerInspectDiagnostics({
220
+ assembled,
221
+ model: () => runtime.model,
222
+ });
223
+ // Late host derivations — original position, after the controllers they read.
224
+ const hostDeriveds = createPlotEngineHostDeriveds({
225
+ runtime,
226
+ inspection: states.inspection,
227
+ legendFocusState,
228
+ legendFilterState,
229
+ legendFocusEnabled,
230
+ legendFocusChannels: () => capabilityResolution.legendFocus().channels,
231
+ legendFilterChannels: () => capabilityResolution.legendFilter().channels,
232
+ });
233
+ // After host entry deriveds exist (irreducible late data for legend focus).
234
+ legendFocusState.installHostDerivedEffects();
235
+ return {
236
+ zoomState: states.zoom,
237
+ legendFilterState,
238
+ runtime,
239
+ inspectionState: states.inspection,
240
+ surfaceState: states.surface,
241
+ selectionState: states.selection,
242
+ legendFocusState,
243
+ intervalState: states.interval,
244
+ chromeState,
245
+ announcer,
246
+ get assembled() {
247
+ return assembled();
248
+ },
249
+ get interactionConfig() {
250
+ return interactionConfig();
251
+ },
252
+ get interactive() {
253
+ return interactive();
254
+ },
255
+ get surfaceInteractive() {
256
+ return surfaceInteractive();
257
+ },
258
+ get coordFlipped() {
259
+ return coordFlipped();
260
+ },
261
+ get legendFocusEnabled() {
262
+ return legendFocusEnabled();
263
+ },
264
+ get selectedAnchors() {
265
+ return semanticCandidateProjection.selectedAnchors;
266
+ },
267
+ get emphasizedAnchors() {
268
+ return semanticCandidateProjection.emphasizedAnchors;
269
+ },
270
+ get hoverChrome() {
271
+ // Hover chrome is separate from selection/emphasis anchor rings: open
272
+ // path strokes still gap the crosshair; rects and closed path fills
273
+ // (areas) mute (#1270). Null inspection → default ring.
274
+ const focus = states.inspection.presentationFocus;
275
+ if (focus === null)
276
+ return "ring";
277
+ const seed = states.inspection.inspectionSeed;
278
+ const batch = seed === null ? undefined : runtime.model?.scene.batches[seed.batchIndex];
279
+ const closedPath = batch?.kind === "paths" && batch.closed === true;
280
+ return hoverChromeForKind(focus.kind, closedPath);
281
+ },
282
+ get hoverBoxWidth() {
283
+ return hostDeriveds.hoverGlyphExtents()?.width;
284
+ },
285
+ get hoverBoxHeight() {
286
+ return hostDeriveds.hoverGlyphExtents()?.height;
287
+ },
288
+ get hoverBoxAnchor() {
289
+ return hostDeriveds.hoverGlyphExtents()?.textAnchor;
290
+ },
291
+ get crosshairGapObstacles() {
292
+ return hostDeriveds.crosshairGapObstacles();
293
+ },
294
+ get interactionMasks() {
295
+ return semanticCandidateProjection.interactionMasks;
296
+ },
297
+ get interactiveLegendEntries() {
298
+ return hostDeriveds.interactiveLegendEntries();
299
+ },
300
+ get effectiveLegendPressed() {
301
+ return hostDeriveds.effectiveLegendPressed();
302
+ },
303
+ get legendClearActive() {
304
+ return hostDeriveds.legendClearActive();
305
+ },
306
+ get filterableLegendEntries() {
307
+ return hostDeriveds.filterableLegendEntries();
308
+ },
309
+ get tooltipHovered() {
310
+ return tooltipHovered;
311
+ },
312
+ set tooltipHovered(value) {
313
+ tooltipHovered = value;
314
+ },
315
+ };
316
+ }