@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,65 @@
1
+ /**
2
+ * Resolve legend-filter capability from host-only GuideLegend `filter` layers
3
+ * and the deprecated plot-level `legendFilter` prop.
4
+ *
5
+ * Interactions stay off PortableSpec: `filter` is stripped before guideLegend()
6
+ * and travels as registry layer kind `legendFilter`.
7
+ *
8
+ * Skeleton (off / children→channels / plot-alone→"all") lives in
9
+ * resolve-legend-capability.ts; this module owns only the filter-specific
10
+ * merge: last explicit `mode`/`multiple` wins (plot first, then children in
11
+ * registry order).
12
+ */
13
+ import type { LegendFilterInput } from "./filter.js";
14
+ import { type LegendChannelSet } from "./resolve-legend-capability.js";
15
+ /** Aesthetic channel a GuideLegend may enable for filter (non-position). */
16
+ type LegendFilterChannel = "color" | "fill" | "size" | "linewidth" | "alpha" | "shape" | "linetype";
17
+ /** One GuideLegend's host-only filter contribution (null when filter is off). */
18
+ export type LegendFilterLayerValue = {
19
+ readonly channel: LegendFilterChannel;
20
+ readonly input: Exclude<LegendFilterInput, false>;
21
+ } | null;
22
+ export type LegendFilterChannelSet = LegendChannelSet;
23
+ export type ResolvedLegendFilterCapability = {
24
+ /**
25
+ * Requested opt-in for wiring advisories (truthy when any child or plot
26
+ * prop enables filter).
27
+ */
28
+ readonly requested: LegendFilterInput | false;
29
+ /** Value fed to createLegendFilterState / capability resolve. */
30
+ readonly configInput: LegendFilterInput | false;
31
+ /**
32
+ * `"all"` = deprecated plot prop only (every discrete filterable legend).
33
+ * Otherwise only legends whose aesthetics intersect this set get checkboxes.
34
+ */
35
+ readonly channels: LegendFilterChannelSet;
36
+ };
37
+ /** Minimal entry shape for channel filtering (avoids importing .svelte.ts). */
38
+ type FilterableEntryLike = {
39
+ readonly legend: {
40
+ readonly scale: string;
41
+ readonly aesthetics?: readonly string[];
42
+ };
43
+ };
44
+ type LegendFilterLayerLike = {
45
+ readonly kind: string;
46
+ /** Live getter or plain field — only read when kind is legendFilter. */
47
+ readonly value?: unknown;
48
+ };
49
+ /**
50
+ * Combine deprecated plot prop + GuideLegend filter children into one capability.
51
+ * Children define per-channel enablement when present; plot prop alone is `"all"`.
52
+ */
53
+ export declare function resolveLegendFilterCapability(input: {
54
+ readonly plotProp: LegendFilterInput | undefined;
55
+ readonly layers: readonly LegendFilterLayerLike[];
56
+ }): ResolvedLegendFilterCapability;
57
+ /**
58
+ * Keep filterable targets whose scene legend aesthetics intersect the
59
+ * enabled channel set. Merged legends expose all aesthetics on
60
+ * `legend.aesthetics` (primary `scale` alone is not enough).
61
+ */
62
+ export declare function filterFilterableLegendEntries<T extends FilterableEntryLike>(entries: readonly T[], channels: LegendFilterChannelSet): T[];
63
+ /** True when `filter` is an active opt-in (boolean true or options object). */
64
+ export declare function isLegendFilterPropEnabled(filter: LegendFilterInput | undefined): filter is Exclude<LegendFilterInput, false>;
65
+ export {};
@@ -0,0 +1,54 @@
1
+ import { filterEntriesByChannels, resolveLegendChannelCapability, } from "./resolve-legend-capability.js";
2
+ function isEnabledInput(input) {
3
+ return input !== undefined && input !== false;
4
+ }
5
+ /**
6
+ * Merge mode/multiple from plot prop + children. Last explicit field wins
7
+ * (plot first, then children in registry order).
8
+ */
9
+ function resolveConfigInput(plotProp, children) {
10
+ let mode;
11
+ let multiple;
12
+ const consider = (input) => {
13
+ if (input === true)
14
+ return;
15
+ if (input.mode !== undefined)
16
+ mode = input.mode;
17
+ if (input.multiple !== undefined)
18
+ multiple = input.multiple;
19
+ };
20
+ if (isEnabledInput(plotProp))
21
+ consider(plotProp);
22
+ for (const child of children)
23
+ consider(child.input);
24
+ if (mode === undefined && multiple === undefined)
25
+ return true;
26
+ return {
27
+ ...(mode === undefined ? {} : { mode }),
28
+ ...(multiple === undefined ? {} : { multiple }),
29
+ };
30
+ }
31
+ /**
32
+ * Combine deprecated plot prop + GuideLegend filter children into one capability.
33
+ * Children define per-channel enablement when present; plot prop alone is `"all"`.
34
+ */
35
+ export function resolveLegendFilterCapability(input) {
36
+ return resolveLegendChannelCapability({
37
+ plotProp: input.plotProp,
38
+ layers: input.layers,
39
+ layerKind: "legendFilter",
40
+ mergeChildrenConfig: resolveConfigInput,
41
+ });
42
+ }
43
+ /**
44
+ * Keep filterable targets whose scene legend aesthetics intersect the
45
+ * enabled channel set. Merged legends expose all aesthetics on
46
+ * `legend.aesthetics` (primary `scale` alone is not enough).
47
+ */
48
+ export function filterFilterableLegendEntries(entries, channels) {
49
+ return filterEntriesByChannels(entries, channels);
50
+ }
51
+ /** True when `filter` is an active opt-in (boolean true or options object). */
52
+ export function isLegendFilterPropEnabled(filter) {
53
+ return isEnabledInput(filter);
54
+ }
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Resolve legend-focus capability from host-only GuideLegend `focus` layers
3
+ * and the deprecated plot-level `legendFocus` prop.
4
+ *
5
+ * Interactions stay off PortableSpec: `focus` is stripped before guideLegend()
6
+ * and travels as registry layer kind `legendFocus`.
7
+ *
8
+ * Skeleton (off / children→channels / plot-alone→"all") lives in
9
+ * resolve-legend-capability.ts; this module owns only the focus-specific
10
+ * merge: any explicit `preview: false` wins across prop and children.
11
+ */
12
+ import type { LegendFocusInput } from "../interaction/interaction.js";
13
+ import type { InteractiveLegendEntry } from "./focus.js";
14
+ import { type LegendChannelSet } from "./resolve-legend-capability.js";
15
+ /** Aesthetic channel a GuideLegend may enable for focus (non-position). */
16
+ type LegendFocusChannel = "color" | "fill" | "size" | "linewidth" | "alpha" | "shape" | "linetype";
17
+ /** One GuideLegend's host-only focus contribution (null when focus is off). */
18
+ export type LegendFocusLayerValue = {
19
+ readonly channel: LegendFocusChannel;
20
+ readonly input: Exclude<LegendFocusInput, false>;
21
+ } | null;
22
+ export type LegendFocusChannelSet = LegendChannelSet;
23
+ export type ResolvedLegendFocusCapability = {
24
+ /**
25
+ * Requested opt-in for wiring advisories (truthy even when keyless
26
+ * degradation later nulls the resolved config).
27
+ */
28
+ readonly requested: LegendFocusInput | false;
29
+ /** Value fed to normalizeInteractionConfig. */
30
+ readonly configInput: LegendFocusInput | false;
31
+ /**
32
+ * `"all"` = deprecated plot prop only (every discrete interactive legend).
33
+ * Otherwise only legends whose aesthetics intersect this set get targets.
34
+ */
35
+ readonly channels: LegendFocusChannelSet;
36
+ };
37
+ type LegendFocusLayerLike = {
38
+ readonly kind: string;
39
+ /** Live getter or plain field — only read when kind is legendFocus. */
40
+ readonly value?: unknown;
41
+ };
42
+ /**
43
+ * Combine deprecated plot prop + GuideLegend focus children into one capability.
44
+ * Children define per-channel enablement when present; plot prop alone is `"all"`.
45
+ */
46
+ export declare function resolveLegendFocusCapability(input: {
47
+ readonly plotProp: LegendFocusInput | undefined;
48
+ readonly layers: readonly LegendFocusLayerLike[];
49
+ }): ResolvedLegendFocusCapability;
50
+ /**
51
+ * Keep interactive targets whose scene legend aesthetics intersect the
52
+ * enabled channel set. Merged legends expose all aesthetics on
53
+ * `legend.aesthetics` (primary `scale` alone is not enough).
54
+ */
55
+ export declare const filterInteractiveLegendEntries: (entries: readonly InteractiveLegendEntry[], channels: LegendFocusChannelSet) => InteractiveLegendEntry[];
56
+ /** True when `focus` is an active opt-in (boolean true or options object). */
57
+ export declare function isLegendFocusPropEnabled(focus: LegendFocusInput | undefined): focus is Exclude<LegendFocusInput, false>;
58
+ export {};
@@ -0,0 +1,36 @@
1
+ import { filterEntriesByChannels, resolveLegendChannelCapability, } from "./resolve-legend-capability.js";
2
+ /** Merge preview flags: any explicit `preview: false` disables preview. */
3
+ function resolvePreview(plotProp, children) {
4
+ if (typeof plotProp === "object" && plotProp.preview === false)
5
+ return false;
6
+ for (const child of children) {
7
+ if (typeof child.input === "object" && child.input.preview === false)
8
+ return false;
9
+ }
10
+ return true;
11
+ }
12
+ function toConfigInput(preview) {
13
+ return preview ? true : { preview: false };
14
+ }
15
+ /**
16
+ * Combine deprecated plot prop + GuideLegend focus children into one capability.
17
+ * Children define per-channel enablement when present; plot prop alone is `"all"`.
18
+ */
19
+ export function resolveLegendFocusCapability(input) {
20
+ return resolveLegendChannelCapability({
21
+ plotProp: input.plotProp,
22
+ layers: input.layers,
23
+ layerKind: "legendFocus",
24
+ mergeChildrenConfig: (plotProp, children) => toConfigInput(resolvePreview(plotProp, children)),
25
+ });
26
+ }
27
+ /**
28
+ * Keep interactive targets whose scene legend aesthetics intersect the
29
+ * enabled channel set. Merged legends expose all aesthetics on
30
+ * `legend.aesthetics` (primary `scale` alone is not enough).
31
+ */
32
+ export const filterInteractiveLegendEntries = filterEntriesByChannels;
33
+ /** True when `focus` is an active opt-in (boolean true or options object). */
34
+ export function isLegendFocusPropEnabled(focus) {
35
+ return focus !== undefined && focus !== false;
36
+ }
@@ -0,0 +1,190 @@
1
+ /**
2
+ * Pure legend surface event decisions for GGPlot.
3
+ *
4
+ * Hosts own DOM handlers, suppress/touch index lifecycle, focus moves,
5
+ * commitLegend side effects, and announcements. This module owns only
6
+ * key routing, touch/click coordination, and commit/preview-dismiss priority.
7
+ */
8
+ import type { InteractionSource } from "../interaction/interaction.js";
9
+ import { type LegendEntryIdentity, type LegendInteractionSource } from "./focus.js";
10
+ export type LegendKeyInput = {
11
+ readonly key: string;
12
+ };
13
+ type LegendKeyAction = {
14
+ readonly type: "move";
15
+ readonly key: string;
16
+ } | {
17
+ readonly type: "commit";
18
+ } | {
19
+ readonly type: "clear";
20
+ } | {
21
+ readonly type: "none";
22
+ };
23
+ export type LegendKeyResolution = {
24
+ readonly action: LegendKeyAction;
25
+ readonly preventDefault: boolean;
26
+ };
27
+ /**
28
+ * Pure decision for a legend target `keydown` handler.
29
+ * Priority: roving arrows/Home/End → Enter/Space commit → Escape clear → none.
30
+ * Callers own preventDefault, focus move, commitLegend, and clearLegendFocus.
31
+ */
32
+ export declare function resolveLegendKeyAction(input: LegendKeyInput): LegendKeyResolution;
33
+ export type LegendPointerUpInput = {
34
+ readonly pointerType: string;
35
+ readonly index: number;
36
+ /** Host `legendTouchIndex` from pointerdown; -1 if none/cancelled. */
37
+ readonly touchIndex: number;
38
+ };
39
+ export type LegendPointerUpAction = {
40
+ readonly type: "touch-commit";
41
+ } | {
42
+ readonly type: "none";
43
+ };
44
+ /**
45
+ * Pure decision for legend target `pointerup`.
46
+ * Touch-commit only when pointerType is touch and touchIndex matches index.
47
+ * Host on touch-commit: clear touchIndex, set suppressLegendClick, then commit.
48
+ * Host on none: no suppress flag change (mismatched up after cancel stays quiet).
49
+ *
50
+ * `legendTouchIndex` is a single host slot (not pointerId-keyed). Multi-touch
51
+ * is not modeled; cancel resets the slot before this resolver runs.
52
+ */
53
+ export declare function resolveLegendPointerUpAction(input: LegendPointerUpInput): LegendPointerUpAction;
54
+ export type LegendClickInput = {
55
+ /** Host `suppressLegendClick` after a touch commit. */
56
+ readonly suppressClick: boolean;
57
+ /**
58
+ * MouseEvent.detail classification used by the host today.
59
+ * detail === 0 → source "keyboard" (also true for some programmatic clicks —
60
+ * this is current source classification, not an a11y guarantee).
61
+ */
62
+ readonly detail: number;
63
+ };
64
+ export type LegendClickAction = {
65
+ readonly type: "suppress";
66
+ } | {
67
+ readonly type: "commit";
68
+ readonly source: "keyboard" | "pointer";
69
+ };
70
+ /**
71
+ * Pure decision for legend target `click`.
72
+ * Priority: suppressClick → suppress; else commit with detail-classified source.
73
+ * Host on suppress: clear suppressLegendClick and return (exact-once touch).
74
+ * Host on commit: legendAction(index, source) + commitLegend when non-null.
75
+ */
76
+ export declare function resolveLegendClickAction(input: LegendClickInput): LegendClickAction;
77
+ export type LegendClearControlInput = {
78
+ /** MouseEvent.detail from the clear control click. */
79
+ readonly detail: number;
80
+ /**
81
+ * Host `legendClearPointerType` from pointerdown on the clear control
82
+ * (null when never set / after cancel).
83
+ */
84
+ readonly pointerType: string | null;
85
+ };
86
+ /**
87
+ * Pure InteractionSource for the legend clear control `click`.
88
+ * Priority: detail === 0 → keyboard; pointerType === "touch" → touch; else pointer.
89
+ * Host still clears `legendClearPointerType` after classification.
90
+ */
91
+ export declare function resolveLegendClearControlSource(input: LegendClearControlInput): InteractionSource;
92
+ export type LegendBlurInput = {
93
+ readonly relatedTarget: EventTarget | null;
94
+ /** Host plot root; null when unmounted. */
95
+ readonly root: ParentNode | null;
96
+ };
97
+ /**
98
+ * Whether blur should clear transient legend preview.
99
+ *
100
+ * Retain preview only when focus moves to another legend target **inside this
101
+ * plot's root**. Cross-plot moves to another `[data-gg-legend-target]` must
102
+ * clear, or the previous plot stays muted with a stale preview.
103
+ */
104
+ export declare function shouldClearLegendPreviewOnBlur(input: LegendBlurInput): boolean;
105
+ export type InteractionLiveRegionInput = {
106
+ readonly surfaceInteractive: boolean;
107
+ readonly legendFocusEnabled: boolean;
108
+ readonly legendFilterEnabled?: boolean;
109
+ };
110
+ /**
111
+ * Live region is required for surface tools, legend-only focus, **or** legend
112
+ * filtering so keyboard commits/clears and programmatic filter reconciliation
113
+ * still announce when inspect/select/zoom are off.
114
+ */
115
+ export declare function shouldRenderInteractionLiveRegion(input: InteractionLiveRegionInput): boolean;
116
+ export type LegendCommitAction = {
117
+ readonly type: "toggle-clear";
118
+ readonly source: InteractionSource;
119
+ } | {
120
+ readonly type: "ignore";
121
+ } | {
122
+ readonly type: "commit";
123
+ readonly source: InteractionSource;
124
+ };
125
+ /**
126
+ * Pure routing for host `commitLegend` after identity + key lookup.
127
+ *
128
+ * Priority (load-bearing):
129
+ * 1. toggle-clear — pressed identity matches action identity
130
+ * 2. ignore — keyCount === 0
131
+ * 3. commit
132
+ *
133
+ * Non-ignore actions carry mapped InteractionSource via `legendInteractionSource`
134
+ * so the host does not re-map `action.source` after routing.
135
+ *
136
+ * Host may compute `keysForLegend(action)` before this call (eager Map.get);
137
+ * keys are unused on toggle-clear but O(1). A pressed entry whose domain keys
138
+ * reshuffled empty still toggles clear (does not fall into ignore).
139
+ */
140
+ export declare function resolveLegendCommitAction(input: {
141
+ readonly pressed: LegendEntryIdentity | null;
142
+ readonly identity: LegendEntryIdentity;
143
+ readonly keyCount: number;
144
+ /** Host: `action.source` (legend entry interaction source). */
145
+ readonly entrySource: LegendInteractionSource;
146
+ }): LegendCommitAction;
147
+ export type LegendPreviewDismissAction = {
148
+ readonly type: "none";
149
+ } | {
150
+ readonly type: "clear-only";
151
+ readonly source: InteractionSource;
152
+ } | {
153
+ readonly type: "clear-and-emit";
154
+ readonly source: InteractionSource;
155
+ };
156
+ /**
157
+ * Pure routing for host `previewLegend(null)` (dismiss path only).
158
+ *
159
+ * none — `previewSource === null` (no active preview)
160
+ * clear-only — drop preview, no clear event; carries mapped source
161
+ * clear-and-emit — drop preview and emit legend-focus clear; carries mapped source
162
+ *
163
+ * `previewSource` is host `legendPreview?.action.source ?? null` — a single
164
+ * discriminant (no separate hasActivePreview boolean) so
165
+ * `hasActivePreview: true` with null source is unrepresentable.
166
+ *
167
+ * Emit gate uses **committed** emphasis (`interaction?.emphasized(scope) ??
168
+ * localEmphasisKeys`), not `effectiveEmphasisKeys` (which includes preview).
169
+ * That differs intentionally from `clearLegendFocus`, which ORs preview /
170
+ * committed / effective emphasis before emit.
171
+ */
172
+ export declare function resolveLegendPreviewDismissAction(input: {
173
+ /** Host: `legendPreview?.action.source ?? null`. */
174
+ readonly previewSource: LegendInteractionSource | null;
175
+ readonly committedEmphasisEmpty: boolean;
176
+ }): LegendPreviewDismissAction;
177
+ /**
178
+ * Whether `clearLegendFocus` should emit a legend-focus clear event.
179
+ *
180
+ * Unlike `resolveLegendPreviewDismissAction` (preview dismiss), this gate ORs
181
+ * active preview, committed legend entry, and **effective** emphasis key count
182
+ * (preview keys included when present). That matches the host clearing all
183
+ * focus surfaces, not only a transient preview leave.
184
+ */
185
+ export declare function shouldEmitLegendFocusClear(input: {
186
+ readonly hasPreview: boolean;
187
+ readonly hasCommitted: boolean;
188
+ readonly emphasisKeyCount: number;
189
+ }): boolean;
190
+ export {};
@@ -0,0 +1,158 @@
1
+ /**
2
+ * Pure legend surface event decisions for GGPlot.
3
+ *
4
+ * Hosts own DOM handlers, suppress/touch index lifecycle, focus moves,
5
+ * commitLegend side effects, and announcements. This module owns only
6
+ * key routing, touch/click coordination, and commit/preview-dismiss priority.
7
+ */
8
+ import { legendInteractionSource, } from "./focus.js";
9
+ const isRovingKey = (key) => key === "ArrowRight" ||
10
+ key === "ArrowDown" ||
11
+ key === "ArrowLeft" ||
12
+ key === "ArrowUp" ||
13
+ key === "Home" ||
14
+ key === "End";
15
+ /**
16
+ * Pure decision for a legend target `keydown` handler.
17
+ * Priority: roving arrows/Home/End → Enter/Space commit → Escape clear → none.
18
+ * Callers own preventDefault, focus move, commitLegend, and clearLegendFocus.
19
+ */
20
+ export function resolveLegendKeyAction(input) {
21
+ const { key } = input;
22
+ if (isRovingKey(key)) {
23
+ return { preventDefault: true, action: { type: "move", key } };
24
+ }
25
+ if (key === "Enter" || key === " ") {
26
+ return { preventDefault: true, action: { type: "commit" } };
27
+ }
28
+ if (key === "Escape") {
29
+ return { preventDefault: true, action: { type: "clear" } };
30
+ }
31
+ return { preventDefault: false, action: { type: "none" } };
32
+ }
33
+ /**
34
+ * Pure decision for legend target `pointerup`.
35
+ * Touch-commit only when pointerType is touch and touchIndex matches index.
36
+ * Host on touch-commit: clear touchIndex, set suppressLegendClick, then commit.
37
+ * Host on none: no suppress flag change (mismatched up after cancel stays quiet).
38
+ *
39
+ * `legendTouchIndex` is a single host slot (not pointerId-keyed). Multi-touch
40
+ * is not modeled; cancel resets the slot before this resolver runs.
41
+ */
42
+ export function resolveLegendPointerUpAction(input) {
43
+ if (input.pointerType !== "touch")
44
+ return { type: "none" };
45
+ if (input.touchIndex !== input.index)
46
+ return { type: "none" };
47
+ return { type: "touch-commit" };
48
+ }
49
+ /**
50
+ * Pure decision for legend target `click`.
51
+ * Priority: suppressClick → suppress; else commit with detail-classified source.
52
+ * Host on suppress: clear suppressLegendClick and return (exact-once touch).
53
+ * Host on commit: legendAction(index, source) + commitLegend when non-null.
54
+ */
55
+ export function resolveLegendClickAction(input) {
56
+ if (input.suppressClick)
57
+ return { type: "suppress" };
58
+ return {
59
+ type: "commit",
60
+ source: input.detail === 0 ? "keyboard" : "pointer",
61
+ };
62
+ }
63
+ /**
64
+ * Pure InteractionSource for the legend clear control `click`.
65
+ * Priority: detail === 0 → keyboard; pointerType === "touch" → touch; else pointer.
66
+ * Host still clears `legendClearPointerType` after classification.
67
+ */
68
+ export function resolveLegendClearControlSource(input) {
69
+ if (input.detail === 0)
70
+ return "keyboard";
71
+ if (input.pointerType === "touch")
72
+ return "touch";
73
+ return "pointer";
74
+ }
75
+ /**
76
+ * Whether blur should clear transient legend preview.
77
+ *
78
+ * Retain preview only when focus moves to another legend target **inside this
79
+ * plot's root**. Cross-plot moves to another `[data-gg-legend-target]` must
80
+ * clear, or the previous plot stays muted with a stale preview.
81
+ */
82
+ export function shouldClearLegendPreviewOnBlur(input) {
83
+ if (!(input.relatedTarget instanceof Element))
84
+ return true;
85
+ if (!input.relatedTarget.matches("[data-gg-legend-target]"))
86
+ return true;
87
+ if (input.root === null)
88
+ return true;
89
+ return !input.root.contains(input.relatedTarget);
90
+ }
91
+ /**
92
+ * Live region is required for surface tools, legend-only focus, **or** legend
93
+ * filtering so keyboard commits/clears and programmatic filter reconciliation
94
+ * still announce when inspect/select/zoom are off.
95
+ */
96
+ export function shouldRenderInteractionLiveRegion(input) {
97
+ return input.surfaceInteractive || input.legendFocusEnabled || input.legendFilterEnabled === true;
98
+ }
99
+ /**
100
+ * Pure routing for host `commitLegend` after identity + key lookup.
101
+ *
102
+ * Priority (load-bearing):
103
+ * 1. toggle-clear — pressed identity matches action identity
104
+ * 2. ignore — keyCount === 0
105
+ * 3. commit
106
+ *
107
+ * Non-ignore actions carry mapped InteractionSource via `legendInteractionSource`
108
+ * so the host does not re-map `action.source` after routing.
109
+ *
110
+ * Host may compute `keysForLegend(action)` before this call (eager Map.get);
111
+ * keys are unused on toggle-clear but O(1). A pressed entry whose domain keys
112
+ * reshuffled empty still toggles clear (does not fall into ignore).
113
+ */
114
+ export function resolveLegendCommitAction(input) {
115
+ const source = legendInteractionSource(input.entrySource);
116
+ if (input.pressed !== null &&
117
+ input.pressed.scale === input.identity.scale &&
118
+ input.pressed.entryIndex === input.identity.entryIndex)
119
+ return { type: "toggle-clear", source };
120
+ if (input.keyCount === 0)
121
+ return { type: "ignore" };
122
+ return { type: "commit", source };
123
+ }
124
+ /**
125
+ * Pure routing for host `previewLegend(null)` (dismiss path only).
126
+ *
127
+ * none — `previewSource === null` (no active preview)
128
+ * clear-only — drop preview, no clear event; carries mapped source
129
+ * clear-and-emit — drop preview and emit legend-focus clear; carries mapped source
130
+ *
131
+ * `previewSource` is host `legendPreview?.action.source ?? null` — a single
132
+ * discriminant (no separate hasActivePreview boolean) so
133
+ * `hasActivePreview: true` with null source is unrepresentable.
134
+ *
135
+ * Emit gate uses **committed** emphasis (`interaction?.emphasized(scope) ??
136
+ * localEmphasisKeys`), not `effectiveEmphasisKeys` (which includes preview).
137
+ * That differs intentionally from `clearLegendFocus`, which ORs preview /
138
+ * committed / effective emphasis before emit.
139
+ */
140
+ export function resolveLegendPreviewDismissAction(input) {
141
+ if (input.previewSource === null)
142
+ return { type: "none" };
143
+ const source = legendInteractionSource(input.previewSource);
144
+ if (input.committedEmphasisEmpty)
145
+ return { type: "clear-and-emit", source };
146
+ return { type: "clear-only", source };
147
+ }
148
+ /**
149
+ * Whether `clearLegendFocus` should emit a legend-focus clear event.
150
+ *
151
+ * Unlike `resolveLegendPreviewDismissAction` (preview dismiss), this gate ORs
152
+ * active preview, committed legend entry, and **effective** emphasis key count
153
+ * (preview keys included when present). That matches the host clearing all
154
+ * focus surfaces, not only a transient preview leave.
155
+ */
156
+ export function shouldEmitLegendFocusClear(input) {
157
+ return input.hasPreview || input.hasCommitted || input.emphasisKeyCount > 0;
158
+ }
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Plot-engine pure derivations — accessors only, no $state, no effects,
3
+ * no controller construction.
4
+ *
5
+ * Two factories, called synchronously while `createPlotEngine` runs during
6
+ * component init so every `$derived` lands in the component graph at the
7
+ * engine's original construction position:
8
+ *
9
+ * - `createPlotEngineDeriveds` — early host derivations (assembled spec,
10
+ * faceted intent, row-identity datum key, interaction scope, interaction
11
+ * config, capability enablement). All inputs exist before the interaction
12
+ * assembly; nothing here reads the runtime.
13
+ * - `createPlotEngineHostDeriveds` — late host derivations that need the
14
+ * runtime + assembled controllers (legend entry lists, hover glyph
15
+ * extents, crosshair gap obstacles). Registered at the engine's original
16
+ * position, after the interaction assembly and chrome state.
17
+ *
18
+ * All inputs are lazy getters over live engine references — never snapshots.
19
+ */
20
+ import type { PortableSpec } from "@ggts-sh/spec";
21
+ import type { LayerRegistry } from "./geoms/registry.svelte.js";
22
+ import { type PlotInteractionScope, type ResolvedInteractionConfig } from "./interaction/interaction.js";
23
+ import { type CapabilityResolution } from "./interaction/capability-resolution.svelte.js";
24
+ import type { InspectionState } from "./inspection/inspection-state.svelte.js";
25
+ import type { LegendFilterState, FilterableLegendEntry } from "./legend/filter-state.svelte.js";
26
+ import type { InteractiveLegendEntry, LegendEntryIdentity } from "./legend/focus.js";
27
+ import type { LegendFocusState } from "./legend/focus-state.svelte.js";
28
+ import type { ResolvedLegendFilterCapability } from "./legend/resolve-legend-filter.js";
29
+ import type { ResolvedLegendFocusCapability } from "./legend/resolve-legend-focus.js";
30
+ import { type EnginePlotProps } from "./plot-props.js";
31
+ import type { PlotRuntime } from "./runtime/runtime.svelte.js";
32
+ import type { DatumKey } from "./runtime/resolve-datum-key.js";
33
+ import { type CrosshairGapBox } from "./scene/geometry.js";
34
+ /** Structural host slice — the registry + live props proxy. */
35
+ export type PlotEngineDerivedsHost = {
36
+ registry: LayerRegistry;
37
+ props: EnginePlotProps;
38
+ };
39
+ /** Early host derivations, returned as live accessors (never snapshots). */
40
+ export type PlotEngineDeriveds = {
41
+ assembled: () => PortableSpec | null;
42
+ resolvedDatumKey: () => DatumKey;
43
+ resolvedInteractionScope: () => PlotInteractionScope;
44
+ interactionConfig: () => ResolvedInteractionConfig;
45
+ interactive: () => boolean;
46
+ surfaceInteractive: () => boolean;
47
+ inspectEnabled: () => boolean;
48
+ legendFocusEnabled: () => boolean;
49
+ coordFlipped: () => boolean;
50
+ };
51
+ export declare function createPlotEngineDeriveds(host: PlotEngineDerivedsHost, capabilityResolution: CapabilityResolution): PlotEngineDeriveds;
52
+ /** Lazy inputs for the late host derivations (runtime + controllers exist). */
53
+ export type PlotEngineHostDerivedsInput = {
54
+ runtime: PlotRuntime;
55
+ inspection: InspectionState;
56
+ legendFocusState: LegendFocusState;
57
+ legendFilterState: LegendFilterState;
58
+ legendFocusEnabled: () => boolean;
59
+ legendFocusChannels: () => ResolvedLegendFocusCapability["channels"];
60
+ legendFilterChannels: () => ResolvedLegendFilterCapability["channels"];
61
+ };
62
+ /** Late host derivations, returned as live accessors (never snapshots). */
63
+ export type PlotEngineHostDeriveds = {
64
+ interactiveLegendEntries: () => InteractiveLegendEntry[];
65
+ effectiveLegendPressed: () => LegendEntryIdentity | null;
66
+ legendClearActive: () => boolean;
67
+ filterableLegendEntries: () => FilterableLegendEntry[];
68
+ hoverGlyphExtents: () => {
69
+ readonly width: number;
70
+ readonly height: number;
71
+ readonly textAnchor: "start" | "middle" | "end";
72
+ } | null;
73
+ crosshairGapObstacles: () => readonly CrosshairGapBox[];
74
+ };
75
+ export declare function createPlotEngineHostDeriveds(input: PlotEngineHostDerivedsInput): PlotEngineHostDeriveds;