@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.
- package/LICENSE +21 -0
- package/README.md +97 -0
- package/bin/ggts-codemod.js +47 -0
- package/dist/GGPlot.svelte +491 -0
- package/dist/GGPlot.svelte.d.ts +67 -0
- package/dist/a11y/CanvasA11y.svelte +115 -0
- package/dist/a11y/CanvasA11y.svelte.d.ts +15 -0
- package/dist/a11y/canvas-a11y.d.ts +1 -0
- package/dist/a11y/canvas-a11y.js +2 -0
- package/dist/assembly/assemble.d.ts +1 -0
- package/dist/assembly/assemble.js +1 -0
- package/dist/assembly/labels.d.ts +43 -0
- package/dist/assembly/labels.js +126 -0
- package/dist/assembly/layout.d.ts +158 -0
- package/dist/assembly/layout.js +175 -0
- package/dist/chrome/StatusChrome.svelte +125 -0
- package/dist/chrome/StatusChrome.svelte.d.ts +16 -0
- package/dist/chrome/ToolRail.svelte +293 -0
- package/dist/chrome/ToolRail.svelte.d.ts +26 -0
- package/dist/chrome/chrome-state.svelte.d.ts +63 -0
- package/dist/chrome/chrome-state.svelte.js +158 -0
- package/dist/chrome/theme-css.d.ts +16 -0
- package/dist/chrome/theme-css.js +16 -0
- package/dist/codemod/cli.d.ts +16 -0
- package/dist/codemod/cli.js +150 -0
- package/dist/codemod/edits.d.ts +28 -0
- package/dist/codemod/edits.js +36 -0
- package/dist/codemod/index.d.ts +10 -0
- package/dist/codemod/index.js +10 -0
- package/dist/codemod/migrate-plot-props-rewrite.d.ts +86 -0
- package/dist/codemod/migrate-plot-props-rewrite.js +228 -0
- package/dist/codemod/migrate-plot-props.d.ts +38 -0
- package/dist/codemod/migrate-plot-props.js +159 -0
- package/dist/coord/Coord.svelte +21 -0
- package/dist/coord/Coord.svelte.d.ts +16 -0
- package/dist/coord/CoordCartesian.svelte +11 -0
- package/dist/coord/CoordCartesian.svelte.d.ts +18 -0
- package/dist/coord/CoordFixed.svelte +17 -0
- package/dist/coord/CoordFixed.svelte.d.ts +10 -0
- package/dist/coord/CoordFlip.svelte +11 -0
- package/dist/coord/CoordFlip.svelte.d.ts +18 -0
- package/dist/coord/CoordPolar.svelte +16 -0
- package/dist/coord/CoordPolar.svelte.d.ts +9 -0
- package/dist/coord/CoordRadial.svelte +16 -0
- package/dist/coord/CoordRadial.svelte.d.ts +9 -0
- package/dist/coord/CoordSf.svelte +16 -0
- package/dist/coord/CoordSf.svelte.d.ts +9 -0
- package/dist/coord/CoordTransform.svelte +16 -0
- package/dist/coord/CoordTransform.svelte.d.ts +9 -0
- package/dist/data/index.d.ts +1 -0
- package/dist/data/index.js +2 -0
- package/dist/diagnostics/composition.d.ts +112 -0
- package/dist/diagnostics/composition.js +203 -0
- package/dist/diagnostics/deprecation.d.ts +58 -0
- package/dist/diagnostics/deprecation.js +27 -0
- package/dist/diagnostics/plot-engine-diagnostics.svelte.d.ts +44 -0
- package/dist/diagnostics/plot-engine-diagnostics.svelte.js +193 -0
- package/dist/facet/Facet.svelte +23 -0
- package/dist/facet/Facet.svelte.d.ts +16 -0
- package/dist/facet/FacetGrid.svelte +32 -0
- package/dist/facet/FacetGrid.svelte.d.ts +16 -0
- package/dist/facet/FacetWrap.svelte +32 -0
- package/dist/facet/FacetWrap.svelte.d.ts +16 -0
- package/dist/fonts/RobotoCondensed-Bold.ttf +0 -0
- package/dist/fonts/RobotoCondensed-Light.ttf +0 -0
- package/dist/fonts/RobotoCondensed-Regular.ttf +0 -0
- package/dist/fonts/THIRD_PARTY_NOTICES.txt +416 -0
- package/dist/geoms/GeomAbline.svelte +25 -0
- package/dist/geoms/GeomAbline.svelte.d.ts +7 -0
- package/dist/geoms/GeomArea.svelte +12 -0
- package/dist/geoms/GeomArea.svelte.d.ts +7 -0
- package/dist/geoms/GeomBar.svelte +12 -0
- package/dist/geoms/GeomBar.svelte.d.ts +7 -0
- package/dist/geoms/GeomBin2d.svelte +21 -0
- package/dist/geoms/GeomBin2d.svelte.d.ts +7 -0
- package/dist/geoms/GeomBlank.svelte +12 -0
- package/dist/geoms/GeomBlank.svelte.d.ts +7 -0
- package/dist/geoms/GeomBoxplot.svelte +25 -0
- package/dist/geoms/GeomBoxplot.svelte.d.ts +7 -0
- package/dist/geoms/GeomCol.svelte +12 -0
- package/dist/geoms/GeomCol.svelte.d.ts +7 -0
- package/dist/geoms/GeomContour.svelte +25 -0
- package/dist/geoms/GeomContour.svelte.d.ts +7 -0
- package/dist/geoms/GeomCount.svelte +12 -0
- package/dist/geoms/GeomCount.svelte.d.ts +7 -0
- package/dist/geoms/GeomCrossbar.svelte +25 -0
- package/dist/geoms/GeomCrossbar.svelte.d.ts +7 -0
- package/dist/geoms/GeomCurve.svelte +21 -0
- package/dist/geoms/GeomCurve.svelte.d.ts +7 -0
- package/dist/geoms/GeomDensity.svelte +25 -0
- package/dist/geoms/GeomDensity.svelte.d.ts +7 -0
- package/dist/geoms/GeomDensity2d.svelte +25 -0
- package/dist/geoms/GeomDensity2d.svelte.d.ts +7 -0
- package/dist/geoms/GeomDensity2dFilled.svelte +25 -0
- package/dist/geoms/GeomDensity2dFilled.svelte.d.ts +7 -0
- package/dist/geoms/GeomDotplot.svelte +25 -0
- package/dist/geoms/GeomDotplot.svelte.d.ts +7 -0
- package/dist/geoms/GeomErrorbar.svelte +25 -0
- package/dist/geoms/GeomErrorbar.svelte.d.ts +7 -0
- package/dist/geoms/GeomFreqpoly.svelte +25 -0
- package/dist/geoms/GeomFreqpoly.svelte.d.ts +7 -0
- package/dist/geoms/GeomFunction.svelte +25 -0
- package/dist/geoms/GeomFunction.svelte.d.ts +7 -0
- package/dist/geoms/GeomHex.svelte +21 -0
- package/dist/geoms/GeomHex.svelte.d.ts +7 -0
- package/dist/geoms/GeomHistogram.svelte +25 -0
- package/dist/geoms/GeomHistogram.svelte.d.ts +7 -0
- package/dist/geoms/GeomHline.svelte +12 -0
- package/dist/geoms/GeomHline.svelte.d.ts +7 -0
- package/dist/geoms/GeomJitter.svelte +35 -0
- package/dist/geoms/GeomJitter.svelte.d.ts +13 -0
- package/dist/geoms/GeomLabel.svelte +12 -0
- package/dist/geoms/GeomLabel.svelte.d.ts +7 -0
- package/dist/geoms/GeomLine.svelte +12 -0
- package/dist/geoms/GeomLine.svelte.d.ts +7 -0
- package/dist/geoms/GeomLinerange.svelte +25 -0
- package/dist/geoms/GeomLinerange.svelte.d.ts +7 -0
- package/dist/geoms/GeomMap.svelte +21 -0
- package/dist/geoms/GeomMap.svelte.d.ts +7 -0
- package/dist/geoms/GeomPath.svelte +12 -0
- package/dist/geoms/GeomPath.svelte.d.ts +7 -0
- package/dist/geoms/GeomPoint.svelte +12 -0
- package/dist/geoms/GeomPoint.svelte.d.ts +7 -0
- package/dist/geoms/GeomPointrange.svelte +25 -0
- package/dist/geoms/GeomPointrange.svelte.d.ts +7 -0
- package/dist/geoms/GeomPolygon.svelte +25 -0
- package/dist/geoms/GeomPolygon.svelte.d.ts +7 -0
- package/dist/geoms/GeomQq.svelte +21 -0
- package/dist/geoms/GeomQq.svelte.d.ts +7 -0
- package/dist/geoms/GeomQqLine.svelte +25 -0
- package/dist/geoms/GeomQqLine.svelte.d.ts +7 -0
- package/dist/geoms/GeomQuantile.svelte +25 -0
- package/dist/geoms/GeomQuantile.svelte.d.ts +7 -0
- package/dist/geoms/GeomRaster.svelte +25 -0
- package/dist/geoms/GeomRaster.svelte.d.ts +7 -0
- package/dist/geoms/GeomRect.svelte +12 -0
- package/dist/geoms/GeomRect.svelte.d.ts +7 -0
- package/dist/geoms/GeomRibbon.svelte +16 -0
- package/dist/geoms/GeomRibbon.svelte.d.ts +7 -0
- package/dist/geoms/GeomRug.svelte +21 -0
- package/dist/geoms/GeomRug.svelte.d.ts +7 -0
- package/dist/geoms/GeomRule.svelte +12 -0
- package/dist/geoms/GeomRule.svelte.d.ts +7 -0
- package/dist/geoms/GeomSegment.svelte +16 -0
- package/dist/geoms/GeomSegment.svelte.d.ts +7 -0
- package/dist/geoms/GeomSf.svelte +21 -0
- package/dist/geoms/GeomSf.svelte.d.ts +7 -0
- package/dist/geoms/GeomSfLabel.svelte +25 -0
- package/dist/geoms/GeomSfLabel.svelte.d.ts +7 -0
- package/dist/geoms/GeomSfText.svelte +25 -0
- package/dist/geoms/GeomSfText.svelte.d.ts +7 -0
- package/dist/geoms/GeomSmooth.svelte +25 -0
- package/dist/geoms/GeomSmooth.svelte.d.ts +7 -0
- package/dist/geoms/GeomSpoke.svelte +21 -0
- package/dist/geoms/GeomSpoke.svelte.d.ts +7 -0
- package/dist/geoms/GeomStep.svelte +12 -0
- package/dist/geoms/GeomStep.svelte.d.ts +7 -0
- package/dist/geoms/GeomText.svelte +12 -0
- package/dist/geoms/GeomText.svelte.d.ts +7 -0
- package/dist/geoms/GeomTile.svelte +21 -0
- package/dist/geoms/GeomTile.svelte.d.ts +7 -0
- package/dist/geoms/GeomViolin.svelte +25 -0
- package/dist/geoms/GeomViolin.svelte.d.ts +7 -0
- package/dist/geoms/GeomVline.svelte +12 -0
- package/dist/geoms/GeomVline.svelte.d.ts +7 -0
- package/dist/geoms/factory.svelte.d.ts +41 -0
- package/dist/geoms/factory.svelte.js +60 -0
- package/dist/geoms/registry.svelte.d.ts +71 -0
- package/dist/geoms/registry.svelte.js +177 -0
- package/dist/guides/GuideAxis.svelte +20 -0
- package/dist/guides/GuideAxis.svelte.d.ts +14 -0
- package/dist/guides/GuideColorbar.svelte +22 -0
- package/dist/guides/GuideColorbar.svelte.d.ts +13 -0
- package/dist/guides/GuideColorsteps.svelte +22 -0
- package/dist/guides/GuideColorsteps.svelte.d.ts +13 -0
- package/dist/guides/GuideLegend.svelte +90 -0
- package/dist/guides/GuideLegend.svelte.d.ts +37 -0
- package/dist/guides/GuideNone.svelte +19 -0
- package/dist/guides/GuideNone.svelte.d.ts +7 -0
- package/dist/guides/Guides.svelte +14 -0
- package/dist/guides/Guides.svelte.d.ts +13 -0
- package/dist/guides/factory.svelte.d.ts +36 -0
- package/dist/guides/factory.svelte.js +15 -0
- package/dist/index.d.ts +418 -0
- package/dist/index.js +376 -0
- package/dist/inspection/Inspect.svelte +71 -0
- package/dist/inspection/Inspect.svelte.d.ts +36 -0
- package/dist/inspection/Tooltip.svelte +439 -0
- package/dist/inspection/Tooltip.svelte.d.ts +32 -0
- package/dist/inspection/apply.d.ts +120 -0
- package/dist/inspection/apply.js +99 -0
- package/dist/inspection/coordinator.d.ts +51 -0
- package/dist/inspection/coordinator.js +354 -0
- package/dist/inspection/display-members.d.ts +1 -0
- package/dist/inspection/display-members.js +2 -0
- package/dist/inspection/frame.d.ts +90 -0
- package/dist/inspection/frame.js +76 -0
- package/dist/inspection/group-total.d.ts +1 -0
- package/dist/inspection/group-total.js +2 -0
- package/dist/inspection/inspect-guide-axes.d.ts +10 -0
- package/dist/inspection/inspect-guide-axes.js +24 -0
- package/dist/inspection/inspection-reconcile.svelte.d.ts +37 -0
- package/dist/inspection/inspection-reconcile.svelte.js +33 -0
- package/dist/inspection/inspection-state.svelte.d.ts +86 -0
- package/dist/inspection/inspection-state.svelte.js +347 -0
- package/dist/inspection/inspection-traversal.svelte.d.ts +29 -0
- package/dist/inspection/inspection-traversal.svelte.js +52 -0
- package/dist/inspection/pointer-inspect.d.ts +74 -0
- package/dist/inspection/pointer-inspect.js +158 -0
- package/dist/inspection/resolver.d.ts +3 -0
- package/dist/inspection/resolver.js +4 -0
- package/dist/inspection/teardown.d.ts +199 -0
- package/dist/inspection/teardown.js +181 -0
- package/dist/inspection/tooltip-chrome.d.ts +19 -0
- package/dist/inspection/tooltip-chrome.js +17 -0
- package/dist/inspection/tooltip-motion.d.ts +25 -0
- package/dist/inspection/tooltip-motion.js +32 -0
- package/dist/inspection/tooltip-presence.svelte.d.ts +49 -0
- package/dist/inspection/tooltip-presence.svelte.js +110 -0
- package/dist/inspection/tooltip-total.d.ts +1 -0
- package/dist/inspection/tooltip-total.js +2 -0
- package/dist/interaction/capability-resolution.svelte.d.ts +42 -0
- package/dist/interaction/capability-resolution.svelte.js +40 -0
- package/dist/interaction/capability.d.ts +129 -0
- package/dist/interaction/capability.js +134 -0
- package/dist/interaction/controller.svelte.d.ts +4 -0
- package/dist/interaction/controller.svelte.js +43 -0
- package/dist/interaction/inspect-geom-advisories.d.ts +10 -0
- package/dist/interaction/inspect-geom-advisories.js +10 -0
- package/dist/interaction/interaction-context.svelte.d.ts +57 -0
- package/dist/interaction/interaction-context.svelte.js +4 -0
- package/dist/interaction/interaction-diagnostics.d.ts +11 -0
- package/dist/interaction/interaction-diagnostics.js +173 -0
- package/dist/interaction/interaction-states.svelte.d.ts +84 -0
- package/dist/interaction/interaction-states.svelte.js +55 -0
- package/dist/interaction/interaction.d.ts +304 -0
- package/dist/interaction/interaction.js +7 -0
- package/dist/interaction/normalize-interaction-config.d.ts +9 -0
- package/dist/interaction/normalize-interaction-config.js +112 -0
- package/dist/interaction/reducer.d.ts +97 -0
- package/dist/interaction/reducer.js +117 -0
- package/dist/interaction/resolve-inspect-capability.d.ts +40 -0
- package/dist/interaction/resolve-inspect-capability.js +50 -0
- package/dist/interaction/scoped-store.svelte.d.ts +73 -0
- package/dist/interaction/scoped-store.svelte.js +93 -0
- package/dist/interaction/target.d.ts +91 -0
- package/dist/interaction/target.js +68 -0
- package/dist/interaction/transition-owner.d.ts +19 -0
- package/dist/interaction/transition-owner.js +10 -0
- package/dist/interaction/wiring-advisories.d.ts +33 -0
- package/dist/interaction/wiring-advisories.js +46 -0
- package/dist/interval/BoundsEditor.svelte +332 -0
- package/dist/interval/BoundsEditor.svelte.d.ts +10 -0
- package/dist/interval/bounds-editor.d.ts +1 -0
- package/dist/interval/bounds-editor.js +2 -0
- package/dist/interval/consumption.d.ts +1 -0
- package/dist/interval/consumption.js +2 -0
- package/dist/interval/interval-bounds-state.svelte.d.ts +53 -0
- package/dist/interval/interval-bounds-state.svelte.js +117 -0
- package/dist/interval/interval-state-helpers.d.ts +10 -0
- package/dist/interval/interval-state-helpers.js +34 -0
- package/dist/interval/interval-state.svelte.d.ts +60 -0
- package/dist/interval/interval-state.svelte.js +360 -0
- package/dist/interval/interval.d.ts +1 -0
- package/dist/interval/interval.js +2 -0
- package/dist/interval/precise-bounds.d.ts +1 -0
- package/dist/interval/precise-bounds.js +2 -0
- package/dist/interval/query.d.ts +1 -0
- package/dist/interval/query.js +2 -0
- package/dist/labs/Labs.svelte +29 -0
- package/dist/labs/Labs.svelte.d.ts +16 -0
- package/dist/layers/fold.d.ts +2 -0
- package/dist/layers/fold.js +1 -0
- package/dist/layers/grammar-families.d.ts +2 -0
- package/dist/layers/grammar-families.js +1 -0
- package/dist/layers/plot-layer-contract.d.ts +1 -0
- package/dist/layers/plot-layer-contract.js +29 -0
- package/dist/layers/plot-layer.svelte.d.ts +42 -0
- package/dist/layers/plot-layer.svelte.js +34 -0
- package/dist/layers/types.d.ts +2 -0
- package/dist/layers/types.js +1 -0
- package/dist/legend/Legend.svelte +24 -0
- package/dist/legend/Legend.svelte.d.ts +5 -0
- package/dist/legend/LegendFilters.svelte +196 -0
- package/dist/legend/LegendFilters.svelte.d.ts +8 -0
- package/dist/legend/LegendTargets.svelte +393 -0
- package/dist/legend/LegendTargets.svelte.d.ts +31 -0
- package/dist/legend/entry-key-index.d.ts +1 -0
- package/dist/legend/entry-key-index.js +2 -0
- package/dist/legend/entry-key-index.svelte.d.ts +34 -0
- package/dist/legend/entry-key-index.svelte.js +35 -0
- package/dist/legend/filter-state.svelte.d.ts +66 -0
- package/dist/legend/filter-state.svelte.js +284 -0
- package/dist/legend/filter.d.ts +1 -0
- package/dist/legend/filter.js +2 -0
- package/dist/legend/focus-emphasis.d.ts +72 -0
- package/dist/legend/focus-emphasis.js +91 -0
- package/dist/legend/focus-plans.d.ts +89 -0
- package/dist/legend/focus-plans.js +72 -0
- package/dist/legend/focus-reconcile.svelte.d.ts +53 -0
- package/dist/legend/focus-reconcile.svelte.js +113 -0
- package/dist/legend/focus-state.svelte.d.ts +73 -0
- package/dist/legend/focus-state.svelte.js +338 -0
- package/dist/legend/focus.d.ts +1 -0
- package/dist/legend/focus.js +2 -0
- package/dist/legend/resolve-legend-capability.d.ts +52 -0
- package/dist/legend/resolve-legend-capability.js +68 -0
- package/dist/legend/resolve-legend-filter.d.ts +65 -0
- package/dist/legend/resolve-legend-filter.js +54 -0
- package/dist/legend/resolve-legend-focus.d.ts +58 -0
- package/dist/legend/resolve-legend-focus.js +36 -0
- package/dist/legend/surface.d.ts +190 -0
- package/dist/legend/surface.js +158 -0
- package/dist/plot-engine-deriveds.svelte.d.ts +75 -0
- package/dist/plot-engine-deriveds.svelte.js +166 -0
- package/dist/plot-engine.svelte.d.ts +116 -0
- package/dist/plot-engine.svelte.js +316 -0
- package/dist/plot-props.d.ts +144 -0
- package/dist/plot-props.js +81 -0
- package/dist/runtime/announcer.svelte.d.ts +17 -0
- package/dist/runtime/announcer.svelte.js +28 -0
- package/dist/runtime/paint.d.ts +38 -0
- package/dist/runtime/paint.js +45 -0
- package/dist/runtime/resolve-datum-key.d.ts +53 -0
- package/dist/runtime/resolve-datum-key.js +73 -0
- package/dist/runtime/runtime.svelte.d.ts +37 -0
- package/dist/runtime/runtime.svelte.js +233 -0
- package/dist/runtime/semantic-candidate-projection.svelte.d.ts +29 -0
- package/dist/runtime/semantic-candidate-projection.svelte.js +137 -0
- package/dist/runtime/semantic-data-identity.d.ts +64 -0
- package/dist/runtime/semantic-data-identity.js +153 -0
- package/dist/runtime/semantic-keys-projection.d.ts +22 -0
- package/dist/runtime/semantic-keys-projection.js +40 -0
- package/dist/runtime/semantic-keys-resolve.d.ts +69 -0
- package/dist/runtime/semantic-keys-resolve.js +122 -0
- package/dist/runtime/semantic-keys.svelte.d.ts +30 -0
- package/dist/runtime/semantic-keys.svelte.js +69 -0
- package/dist/runtime/semantic-source-identity.d.ts +9 -0
- package/dist/runtime/semantic-source-identity.js +16 -0
- package/dist/scale/Scale.svelte +26 -0
- package/dist/scale/Scale.svelte.d.ts +21 -0
- package/dist/scale/ScaleAlphaBinned.svelte +14 -0
- package/dist/scale/ScaleAlphaBinned.svelte.d.ts +4 -0
- package/dist/scale/ScaleAlphaContinuous.svelte +14 -0
- package/dist/scale/ScaleAlphaContinuous.svelte.d.ts +4 -0
- package/dist/scale/ScaleAlphaDate.svelte +15 -0
- package/dist/scale/ScaleAlphaDate.svelte.d.ts +5 -0
- package/dist/scale/ScaleAlphaDatetime.svelte +15 -0
- package/dist/scale/ScaleAlphaDatetime.svelte.d.ts +5 -0
- package/dist/scale/ScaleAlphaDiscrete.svelte +14 -0
- package/dist/scale/ScaleAlphaDiscrete.svelte.d.ts +4 -0
- package/dist/scale/ScaleAlphaIdentity.svelte +14 -0
- package/dist/scale/ScaleAlphaIdentity.svelte.d.ts +4 -0
- package/dist/scale/ScaleAlphaManual.svelte +14 -0
- package/dist/scale/ScaleAlphaManual.svelte.d.ts +4 -0
- package/dist/scale/ScaleColorBinned.svelte +14 -0
- package/dist/scale/ScaleColorBinned.svelte.d.ts +3 -0
- package/dist/scale/ScaleColorBrewer.svelte +14 -0
- package/dist/scale/ScaleColorBrewer.svelte.d.ts +4 -0
- package/dist/scale/ScaleColorContinuous.svelte +14 -0
- package/dist/scale/ScaleColorContinuous.svelte.d.ts +4 -0
- package/dist/scale/ScaleColorDate.svelte +15 -0
- package/dist/scale/ScaleColorDate.svelte.d.ts +5 -0
- package/dist/scale/ScaleColorDatetime.svelte +15 -0
- package/dist/scale/ScaleColorDatetime.svelte.d.ts +5 -0
- package/dist/scale/ScaleColorDiscrete.svelte +14 -0
- package/dist/scale/ScaleColorDiscrete.svelte.d.ts +4 -0
- package/dist/scale/ScaleColorDistiller.svelte +14 -0
- package/dist/scale/ScaleColorDistiller.svelte.d.ts +4 -0
- package/dist/scale/ScaleColorFermenter.svelte +14 -0
- package/dist/scale/ScaleColorFermenter.svelte.d.ts +4 -0
- package/dist/scale/ScaleColorGradient.svelte +11 -0
- package/dist/scale/ScaleColorGradient.svelte.d.ts +4 -0
- package/dist/scale/ScaleColorGradient2.svelte +14 -0
- package/dist/scale/ScaleColorGradient2.svelte.d.ts +4 -0
- package/dist/scale/ScaleColorGradientn.svelte +14 -0
- package/dist/scale/ScaleColorGradientn.svelte.d.ts +4 -0
- package/dist/scale/ScaleColorGrey.svelte +11 -0
- package/dist/scale/ScaleColorGrey.svelte.d.ts +4 -0
- package/dist/scale/ScaleColorHue.svelte +11 -0
- package/dist/scale/ScaleColorHue.svelte.d.ts +4 -0
- package/dist/scale/ScaleColorIdentity.svelte +14 -0
- package/dist/scale/ScaleColorIdentity.svelte.d.ts +4 -0
- package/dist/scale/ScaleColorLog10.svelte +14 -0
- package/dist/scale/ScaleColorLog10.svelte.d.ts +4 -0
- package/dist/scale/ScaleColorManual.svelte +14 -0
- package/dist/scale/ScaleColorManual.svelte.d.ts +4 -0
- package/dist/scale/ScaleColorOrdinal.svelte +14 -0
- package/dist/scale/ScaleColorOrdinal.svelte.d.ts +3 -0
- package/dist/scale/ScaleColorSqrt.svelte +14 -0
- package/dist/scale/ScaleColorSqrt.svelte.d.ts +4 -0
- package/dist/scale/ScaleColorSteps.svelte +11 -0
- package/dist/scale/ScaleColorSteps.svelte.d.ts +4 -0
- package/dist/scale/ScaleColorSteps2.svelte +11 -0
- package/dist/scale/ScaleColorSteps2.svelte.d.ts +4 -0
- package/dist/scale/ScaleColorStepsn.svelte +11 -0
- package/dist/scale/ScaleColorStepsn.svelte.d.ts +4 -0
- package/dist/scale/ScaleColorViridisB.svelte +11 -0
- package/dist/scale/ScaleColorViridisB.svelte.d.ts +4 -0
- package/dist/scale/ScaleColorViridisC.svelte +11 -0
- package/dist/scale/ScaleColorViridisC.svelte.d.ts +4 -0
- package/dist/scale/ScaleColorViridisD.svelte +11 -0
- package/dist/scale/ScaleColorViridisD.svelte.d.ts +4 -0
- package/dist/scale/ScaleFillBinned.svelte +11 -0
- package/dist/scale/ScaleFillBinned.svelte.d.ts +3 -0
- package/dist/scale/ScaleFillBrewer.svelte +11 -0
- package/dist/scale/ScaleFillBrewer.svelte.d.ts +4 -0
- package/dist/scale/ScaleFillContinuous.svelte +14 -0
- package/dist/scale/ScaleFillContinuous.svelte.d.ts +4 -0
- package/dist/scale/ScaleFillDate.svelte +12 -0
- package/dist/scale/ScaleFillDate.svelte.d.ts +5 -0
- package/dist/scale/ScaleFillDatetime.svelte +15 -0
- package/dist/scale/ScaleFillDatetime.svelte.d.ts +5 -0
- package/dist/scale/ScaleFillDiscrete.svelte +14 -0
- package/dist/scale/ScaleFillDiscrete.svelte.d.ts +4 -0
- package/dist/scale/ScaleFillDistiller.svelte +14 -0
- package/dist/scale/ScaleFillDistiller.svelte.d.ts +4 -0
- package/dist/scale/ScaleFillFermenter.svelte +14 -0
- package/dist/scale/ScaleFillFermenter.svelte.d.ts +4 -0
- package/dist/scale/ScaleFillGradient.svelte +11 -0
- package/dist/scale/ScaleFillGradient.svelte.d.ts +4 -0
- package/dist/scale/ScaleFillGradient2.svelte +14 -0
- package/dist/scale/ScaleFillGradient2.svelte.d.ts +4 -0
- package/dist/scale/ScaleFillGradientn.svelte +14 -0
- package/dist/scale/ScaleFillGradientn.svelte.d.ts +4 -0
- package/dist/scale/ScaleFillGrey.svelte +11 -0
- package/dist/scale/ScaleFillGrey.svelte.d.ts +4 -0
- package/dist/scale/ScaleFillHue.svelte +11 -0
- package/dist/scale/ScaleFillHue.svelte.d.ts +4 -0
- package/dist/scale/ScaleFillIdentity.svelte +14 -0
- package/dist/scale/ScaleFillIdentity.svelte.d.ts +4 -0
- package/dist/scale/ScaleFillLog10.svelte +14 -0
- package/dist/scale/ScaleFillLog10.svelte.d.ts +4 -0
- package/dist/scale/ScaleFillManual.svelte +11 -0
- package/dist/scale/ScaleFillManual.svelte.d.ts +4 -0
- package/dist/scale/ScaleFillOrdinal.svelte +14 -0
- package/dist/scale/ScaleFillOrdinal.svelte.d.ts +3 -0
- package/dist/scale/ScaleFillSqrt.svelte +14 -0
- package/dist/scale/ScaleFillSqrt.svelte.d.ts +4 -0
- package/dist/scale/ScaleFillSteps.svelte +11 -0
- package/dist/scale/ScaleFillSteps.svelte.d.ts +4 -0
- package/dist/scale/ScaleFillSteps2.svelte +11 -0
- package/dist/scale/ScaleFillSteps2.svelte.d.ts +4 -0
- package/dist/scale/ScaleFillStepsn.svelte +11 -0
- package/dist/scale/ScaleFillStepsn.svelte.d.ts +4 -0
- package/dist/scale/ScaleFillViridisB.svelte +11 -0
- package/dist/scale/ScaleFillViridisB.svelte.d.ts +4 -0
- package/dist/scale/ScaleFillViridisC.svelte +11 -0
- package/dist/scale/ScaleFillViridisC.svelte.d.ts +4 -0
- package/dist/scale/ScaleFillViridisD.svelte +11 -0
- package/dist/scale/ScaleFillViridisD.svelte.d.ts +4 -0
- package/dist/scale/ScaleLinetypeBinned.svelte +15 -0
- package/dist/scale/ScaleLinetypeBinned.svelte.d.ts +4 -0
- package/dist/scale/ScaleLinetypeDiscrete.svelte +15 -0
- package/dist/scale/ScaleLinetypeDiscrete.svelte.d.ts +4 -0
- package/dist/scale/ScaleLinetypeIdentity.svelte +15 -0
- package/dist/scale/ScaleLinetypeIdentity.svelte.d.ts +4 -0
- package/dist/scale/ScaleLinetypeManual.svelte +15 -0
- package/dist/scale/ScaleLinetypeManual.svelte.d.ts +4 -0
- package/dist/scale/ScaleLinewidthBinned.svelte +14 -0
- package/dist/scale/ScaleLinewidthBinned.svelte.d.ts +4 -0
- package/dist/scale/ScaleLinewidthContinuous.svelte +14 -0
- package/dist/scale/ScaleLinewidthContinuous.svelte.d.ts +4 -0
- package/dist/scale/ScaleLinewidthDate.svelte +15 -0
- package/dist/scale/ScaleLinewidthDate.svelte.d.ts +5 -0
- package/dist/scale/ScaleLinewidthDatetime.svelte +15 -0
- package/dist/scale/ScaleLinewidthDatetime.svelte.d.ts +5 -0
- package/dist/scale/ScaleLinewidthDiscrete.svelte +14 -0
- package/dist/scale/ScaleLinewidthDiscrete.svelte.d.ts +4 -0
- package/dist/scale/ScaleLinewidthIdentity.svelte +14 -0
- package/dist/scale/ScaleLinewidthIdentity.svelte.d.ts +4 -0
- package/dist/scale/ScaleLinewidthManual.svelte +14 -0
- package/dist/scale/ScaleLinewidthManual.svelte.d.ts +4 -0
- package/dist/scale/ScaleRadius.svelte +11 -0
- package/dist/scale/ScaleRadius.svelte.d.ts +4 -0
- package/dist/scale/ScaleShapeBinned.svelte +15 -0
- package/dist/scale/ScaleShapeBinned.svelte.d.ts +4 -0
- package/dist/scale/ScaleShapeDiscrete.svelte +15 -0
- package/dist/scale/ScaleShapeDiscrete.svelte.d.ts +4 -0
- package/dist/scale/ScaleShapeIdentity.svelte +15 -0
- package/dist/scale/ScaleShapeIdentity.svelte.d.ts +4 -0
- package/dist/scale/ScaleShapeManual.svelte +15 -0
- package/dist/scale/ScaleShapeManual.svelte.d.ts +4 -0
- package/dist/scale/ScaleSizeArea.svelte +11 -0
- package/dist/scale/ScaleSizeArea.svelte.d.ts +4 -0
- package/dist/scale/ScaleSizeBinned.svelte +14 -0
- package/dist/scale/ScaleSizeBinned.svelte.d.ts +4 -0
- package/dist/scale/ScaleSizeBinnedArea.svelte +14 -0
- package/dist/scale/ScaleSizeBinnedArea.svelte.d.ts +4 -0
- package/dist/scale/ScaleSizeContinuous.svelte +14 -0
- package/dist/scale/ScaleSizeContinuous.svelte.d.ts +4 -0
- package/dist/scale/ScaleSizeDate.svelte +15 -0
- package/dist/scale/ScaleSizeDate.svelte.d.ts +5 -0
- package/dist/scale/ScaleSizeDatetime.svelte +15 -0
- package/dist/scale/ScaleSizeDatetime.svelte.d.ts +5 -0
- package/dist/scale/ScaleSizeDiscrete.svelte +14 -0
- package/dist/scale/ScaleSizeDiscrete.svelte.d.ts +4 -0
- package/dist/scale/ScaleSizeIdentity.svelte +14 -0
- package/dist/scale/ScaleSizeIdentity.svelte.d.ts +4 -0
- package/dist/scale/ScaleSizeManual.svelte +14 -0
- package/dist/scale/ScaleSizeManual.svelte.d.ts +4 -0
- package/dist/scale/ScaleXBinned.svelte +14 -0
- package/dist/scale/ScaleXBinned.svelte.d.ts +4 -0
- package/dist/scale/ScaleXContinuous.svelte +14 -0
- package/dist/scale/ScaleXContinuous.svelte.d.ts +4 -0
- package/dist/scale/ScaleXDate.svelte +12 -0
- package/dist/scale/ScaleXDate.svelte.d.ts +5 -0
- package/dist/scale/ScaleXDatetime.svelte +12 -0
- package/dist/scale/ScaleXDatetime.svelte.d.ts +5 -0
- package/dist/scale/ScaleXDiscrete.svelte +14 -0
- package/dist/scale/ScaleXDiscrete.svelte.d.ts +4 -0
- package/dist/scale/ScaleXLog10.svelte +14 -0
- package/dist/scale/ScaleXLog10.svelte.d.ts +4 -0
- package/dist/scale/ScaleXMonthDay.svelte +12 -0
- package/dist/scale/ScaleXMonthDay.svelte.d.ts +5 -0
- package/dist/scale/ScaleXReverse.svelte +15 -0
- package/dist/scale/ScaleXReverse.svelte.d.ts +4 -0
- package/dist/scale/ScaleXSqrt.svelte +14 -0
- package/dist/scale/ScaleXSqrt.svelte.d.ts +4 -0
- package/dist/scale/ScaleXTime.svelte +12 -0
- package/dist/scale/ScaleXTime.svelte.d.ts +5 -0
- package/dist/scale/ScaleYBinned.svelte +14 -0
- package/dist/scale/ScaleYBinned.svelte.d.ts +4 -0
- package/dist/scale/ScaleYContinuous.svelte +14 -0
- package/dist/scale/ScaleYContinuous.svelte.d.ts +4 -0
- package/dist/scale/ScaleYDate.svelte +12 -0
- package/dist/scale/ScaleYDate.svelte.d.ts +5 -0
- package/dist/scale/ScaleYDatetime.svelte +12 -0
- package/dist/scale/ScaleYDatetime.svelte.d.ts +5 -0
- package/dist/scale/ScaleYDiscrete.svelte +14 -0
- package/dist/scale/ScaleYDiscrete.svelte.d.ts +4 -0
- package/dist/scale/ScaleYLog10.svelte +14 -0
- package/dist/scale/ScaleYLog10.svelte.d.ts +4 -0
- package/dist/scale/ScaleYMonthDay.svelte +12 -0
- package/dist/scale/ScaleYMonthDay.svelte.d.ts +5 -0
- package/dist/scale/ScaleYReverse.svelte +15 -0
- package/dist/scale/ScaleYReverse.svelte.d.ts +4 -0
- package/dist/scale/ScaleYSqrt.svelte +14 -0
- package/dist/scale/ScaleYSqrt.svelte.d.ts +4 -0
- package/dist/scale/ScaleYTime.svelte +12 -0
- package/dist/scale/ScaleYTime.svelte.d.ts +5 -0
- package/dist/scene/Axis.svelte +159 -0
- package/dist/scene/Axis.svelte.d.ts +12 -0
- package/dist/scene/Batch.svelte +252 -0
- package/dist/scene/Batch.svelte.d.ts +23 -0
- package/dist/scene/InteractionOverlay.svelte +402 -0
- package/dist/scene/InteractionOverlay.svelte.d.ts +44 -0
- package/dist/scene/Legend.svelte +278 -0
- package/dist/scene/Legend.svelte.d.ts +8 -0
- package/dist/scene/MarkStrata.svelte +129 -0
- package/dist/scene/MarkStrata.svelte.d.ts +15 -0
- package/dist/scene/SceneOverlays.svelte +118 -0
- package/dist/scene/SceneOverlays.svelte.d.ts +49 -0
- package/dist/scene/SceneView.svelte +478 -0
- package/dist/scene/SceneView.svelte.d.ts +32 -0
- package/dist/scene/batch-presentation.svelte.d.ts +111 -0
- package/dist/scene/batch-presentation.svelte.js +207 -0
- package/dist/scene/geometry.d.ts +2 -0
- package/dist/scene/geometry.js +3 -0
- package/dist/scene/stratum-paint.d.ts +25 -0
- package/dist/scene/stratum-paint.js +40 -0
- package/dist/selection/selection-state.svelte.d.ts +23 -0
- package/dist/selection/selection-state.svelte.js +73 -0
- package/dist/selection/selection.d.ts +1 -0
- package/dist/selection/selection.js +2 -0
- package/dist/surface/CaptureSurface.svelte +109 -0
- package/dist/surface/CaptureSurface.svelte.d.ts +27 -0
- package/dist/surface/area-brush.d.ts +48 -0
- package/dist/surface/area-brush.js +44 -0
- package/dist/surface/brush-finish.d.ts +49 -0
- package/dist/surface/brush-finish.js +44 -0
- package/dist/surface/keyboard.d.ts +97 -0
- package/dist/surface/keyboard.js +105 -0
- package/dist/surface/pointer.d.ts +241 -0
- package/dist/surface/pointer.js +179 -0
- package/dist/surface/surface-description.d.ts +10 -0
- package/dist/surface/surface-description.js +11 -0
- package/dist/surface/surface-handlers.svelte.d.ts +53 -0
- package/dist/surface/surface-handlers.svelte.js +418 -0
- package/dist/surface/surface-state.svelte.d.ts +90 -0
- package/dist/surface/surface-state.svelte.js +161 -0
- package/dist/theme/Theme.svelte +27 -0
- package/dist/theme/Theme.svelte.d.ts +23 -0
- package/dist/theme/ThemeBase.svelte +13 -0
- package/dist/theme/ThemeBase.svelte.d.ts +8 -0
- package/dist/theme/ThemeBw.svelte +13 -0
- package/dist/theme/ThemeBw.svelte.d.ts +8 -0
- package/dist/theme/ThemeClassic.svelte +13 -0
- package/dist/theme/ThemeClassic.svelte.d.ts +8 -0
- package/dist/theme/ThemeClean.svelte +13 -0
- package/dist/theme/ThemeClean.svelte.d.ts +8 -0
- package/dist/theme/ThemeDark.svelte +13 -0
- package/dist/theme/ThemeDark.svelte.d.ts +8 -0
- package/dist/theme/ThemeDefault.svelte +13 -0
- package/dist/theme/ThemeDefault.svelte.d.ts +8 -0
- package/dist/theme/ThemeEconomist.svelte +13 -0
- package/dist/theme/ThemeEconomist.svelte.d.ts +8 -0
- package/dist/theme/ThemeEconomistwhite.svelte +13 -0
- package/dist/theme/ThemeEconomistwhite.svelte.d.ts +8 -0
- package/dist/theme/ThemeFew.svelte +13 -0
- package/dist/theme/ThemeFew.svelte.d.ts +8 -0
- package/dist/theme/ThemeFivethirtyeight.svelte +14 -0
- package/dist/theme/ThemeFivethirtyeight.svelte.d.ts +9 -0
- package/dist/theme/ThemeGgplot2.svelte +13 -0
- package/dist/theme/ThemeGgplot2.svelte.d.ts +8 -0
- package/dist/theme/ThemeGray.svelte +13 -0
- package/dist/theme/ThemeGray.svelte.d.ts +8 -0
- package/dist/theme/ThemeGrey.svelte +13 -0
- package/dist/theme/ThemeGrey.svelte.d.ts +8 -0
- package/dist/theme/ThemeHc.svelte +13 -0
- package/dist/theme/ThemeHc.svelte.d.ts +8 -0
- package/dist/theme/ThemeHcdark.svelte +13 -0
- package/dist/theme/ThemeHcdark.svelte.d.ts +8 -0
- package/dist/theme/ThemeHrbr.svelte +13 -0
- package/dist/theme/ThemeHrbr.svelte.d.ts +8 -0
- package/dist/theme/ThemeIgray.svelte +13 -0
- package/dist/theme/ThemeIgray.svelte.d.ts +8 -0
- package/dist/theme/ThemeLight.svelte +13 -0
- package/dist/theme/ThemeLight.svelte.d.ts +8 -0
- package/dist/theme/ThemeLinedraw.svelte +13 -0
- package/dist/theme/ThemeLinedraw.svelte.d.ts +8 -0
- package/dist/theme/ThemeMap.svelte +13 -0
- package/dist/theme/ThemeMap.svelte.d.ts +8 -0
- package/dist/theme/ThemeMinimal.svelte +13 -0
- package/dist/theme/ThemeMinimal.svelte.d.ts +8 -0
- package/dist/theme/ThemePander.svelte +13 -0
- package/dist/theme/ThemePander.svelte.d.ts +8 -0
- package/dist/theme/ThemeSolarized.svelte +13 -0
- package/dist/theme/ThemeSolarized.svelte.d.ts +8 -0
- package/dist/theme/ThemeSolarized2.svelte +13 -0
- package/dist/theme/ThemeSolarized2.svelte.d.ts +8 -0
- package/dist/theme/ThemeSolarized2dark.svelte +13 -0
- package/dist/theme/ThemeSolarized2dark.svelte.d.ts +8 -0
- package/dist/theme/ThemeSolarizeddark.svelte +14 -0
- package/dist/theme/ThemeSolarizeddark.svelte.d.ts +9 -0
- package/dist/theme/ThemeSolid.svelte +13 -0
- package/dist/theme/ThemeSolid.svelte.d.ts +8 -0
- package/dist/theme/ThemeStata.svelte +13 -0
- package/dist/theme/ThemeStata.svelte.d.ts +8 -0
- package/dist/theme/ThemeStatas1color.svelte +13 -0
- package/dist/theme/ThemeStatas1color.svelte.d.ts +8 -0
- package/dist/theme/ThemeTest.svelte +14 -0
- package/dist/theme/ThemeTest.svelte.d.ts +9 -0
- package/dist/theme/ThemeTufte.svelte +13 -0
- package/dist/theme/ThemeTufte.svelte.d.ts +8 -0
- package/dist/theme/ThemeVoid.svelte +14 -0
- package/dist/theme/ThemeVoid.svelte.d.ts +9 -0
- package/dist/theme/ThemeWsj.svelte +13 -0
- package/dist/theme/ThemeWsj.svelte.d.ts +8 -0
- package/dist/theme/factory.svelte.d.ts +36 -0
- package/dist/theme/factory.svelte.js +100 -0
- package/dist/zoom/zoom-state.svelte.d.ts +44 -0
- package/dist/zoom/zoom-state.svelte.js +121 -0
- package/dist/zoom/zoom.d.ts +1 -0
- package/dist/zoom/zoom.js +2 -0
- package/package.json +83 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { CellValue } from "@ggts-sh/core";
|
|
2
|
+
import type { PlotInspectionChange } from "../interaction/interaction.js";
|
|
3
|
+
/** Inspection snapshot shape owned by the plot engine. */
|
|
4
|
+
type AnyInspection = PlotInspectionChange<Record<string, CellValue>, PropertyKey>;
|
|
5
|
+
/**
|
|
6
|
+
* Tooltip session/ghost/presence state, extracted from <GGPlot>.
|
|
7
|
+
*
|
|
8
|
+
* Owns three concerns that must stay in lockstep (GGPlan: "Tooltip presence"):
|
|
9
|
+
* the hover session (whether enter/exit motion is allowed), the exit-motion
|
|
10
|
+
* ghost (a frozen snapshot that keeps rendering while the real tooltip exits),
|
|
11
|
+
* and the pointer/explicit-close flags the capture layer feeds in. The
|
|
12
|
+
* inspection state itself stays with the engine — the factory reads it through
|
|
13
|
+
* a LIVE getter so a sync always sees the current value, never a snapshot
|
|
14
|
+
* taken at construction.
|
|
15
|
+
*
|
|
16
|
+
* SSR-safe: no `requestAnimationFrame` is touched on the server (a queued sync
|
|
17
|
+
* degrades to a synchronous call), and reduced-motion detection guards for the
|
|
18
|
+
* missing `matchMedia`.
|
|
19
|
+
*/
|
|
20
|
+
export type TooltipPresenceState = {
|
|
21
|
+
/** Reactive exit-motion snapshot, `null` when no ghost should render. */
|
|
22
|
+
readonly ghost: AnyInspection | null;
|
|
23
|
+
/** Monotonic ghost generation; captured at ghost mount for safe clearing. */
|
|
24
|
+
readonly ghostEpoch: number;
|
|
25
|
+
/** Record whether the pointer is currently over the capture surface. */
|
|
26
|
+
setPointerOnCapture(on: boolean): void;
|
|
27
|
+
/** Flag the next dismissal as explicit (blur, Escape, close button). */
|
|
28
|
+
markExplicitClose(): void;
|
|
29
|
+
/** Session-active flag for enter-motion gating (read at tooltip mount). */
|
|
30
|
+
sessionActive(): boolean;
|
|
31
|
+
/** Whether the user prefers reduced motion (SSR-safe). */
|
|
32
|
+
reducedMotion(): boolean;
|
|
33
|
+
/** Schedule a presence sync on the next frame (server: synchronous). */
|
|
34
|
+
queueSync(): void;
|
|
35
|
+
/** Recompute session/ghost/presence from the live inspection. */
|
|
36
|
+
sync(): void;
|
|
37
|
+
/** Clear the ghost unless a newer generation has replaced it. */
|
|
38
|
+
clearGhost(generation: number): void;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Create the tooltip presence state. Call synchronously during component
|
|
42
|
+
* init: the cleanup effect and every later sync assume they run inside the
|
|
43
|
+
* component's reactive context.
|
|
44
|
+
*/
|
|
45
|
+
export declare function createTooltipPresenceState(options: {
|
|
46
|
+
/** LIVE getter into the engine's inspection state — never a snapshot. */
|
|
47
|
+
getInspection: () => AnyInspection | null;
|
|
48
|
+
}): TooltipPresenceState;
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { TOOLTIP_MOTION_MS, prefersReducedMotion, resolveTooltipDismissReason, resolveTooltipMotion, } from "./tooltip-motion.js";
|
|
2
|
+
function reducedMotion() {
|
|
3
|
+
if (typeof matchMedia !== "function")
|
|
4
|
+
return false;
|
|
5
|
+
return prefersReducedMotion(matchMedia("(prefers-reduced-motion: reduce)"));
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Create the tooltip presence state. Call synchronously during component
|
|
9
|
+
* init: the cleanup effect and every later sync assume they run inside the
|
|
10
|
+
* component's reactive context.
|
|
11
|
+
*/
|
|
12
|
+
export function createTooltipPresenceState(options) {
|
|
13
|
+
const { getInspection } = options;
|
|
14
|
+
const session = { active: false };
|
|
15
|
+
let pointerOnCapture = false;
|
|
16
|
+
let pendingExplicitClose = false;
|
|
17
|
+
let lastLiveInspection = null;
|
|
18
|
+
let hadLiveInspection = false;
|
|
19
|
+
const ghostEpoch = { n: 0 };
|
|
20
|
+
let ghostTimer;
|
|
21
|
+
let ghost = $state(null);
|
|
22
|
+
let syncFrame = 0;
|
|
23
|
+
$effect(() => () => {
|
|
24
|
+
clearTimeout(ghostTimer);
|
|
25
|
+
cancelAnimationFrame(syncFrame);
|
|
26
|
+
});
|
|
27
|
+
function clearGhost(generation) {
|
|
28
|
+
if (generation !== ghostEpoch.n)
|
|
29
|
+
return;
|
|
30
|
+
ghost = null;
|
|
31
|
+
if (ghostTimer !== undefined) {
|
|
32
|
+
clearTimeout(ghostTimer);
|
|
33
|
+
ghostTimer = undefined;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function startGhost(snapshot) {
|
|
37
|
+
ghostEpoch.n += 1;
|
|
38
|
+
const generation = ghostEpoch.n;
|
|
39
|
+
ghost = snapshot;
|
|
40
|
+
clearTimeout(ghostTimer);
|
|
41
|
+
ghostTimer = setTimeout(() => {
|
|
42
|
+
clearGhost(generation);
|
|
43
|
+
}, TOOLTIP_MOTION_MS + 50);
|
|
44
|
+
}
|
|
45
|
+
function sync() {
|
|
46
|
+
const current = getInspection();
|
|
47
|
+
const present = current !== null;
|
|
48
|
+
if (current !== null)
|
|
49
|
+
lastLiveInspection = current;
|
|
50
|
+
if (present === hadLiveInspection)
|
|
51
|
+
return;
|
|
52
|
+
hadLiveInspection = present;
|
|
53
|
+
if (present) {
|
|
54
|
+
const next = resolveTooltipMotion({
|
|
55
|
+
reason: "hit",
|
|
56
|
+
sessionActive: session.active,
|
|
57
|
+
reducedMotion: reducedMotion(),
|
|
58
|
+
});
|
|
59
|
+
session.active = next.sessionActive;
|
|
60
|
+
clearGhost(ghostEpoch.n);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const reason = resolveTooltipDismissReason({
|
|
64
|
+
explicitClose: pendingExplicitClose,
|
|
65
|
+
pointerOnCapture,
|
|
66
|
+
});
|
|
67
|
+
pendingExplicitClose = false;
|
|
68
|
+
const next = resolveTooltipMotion({
|
|
69
|
+
reason,
|
|
70
|
+
sessionActive: session.active,
|
|
71
|
+
reducedMotion: reducedMotion(),
|
|
72
|
+
});
|
|
73
|
+
session.active = next.sessionActive;
|
|
74
|
+
if (next.phase === "exit" && lastLiveInspection !== null)
|
|
75
|
+
startGhost(lastLiveInspection);
|
|
76
|
+
}
|
|
77
|
+
function queueSync() {
|
|
78
|
+
if (syncFrame !== 0)
|
|
79
|
+
return;
|
|
80
|
+
if (typeof requestAnimationFrame !== "function") {
|
|
81
|
+
sync();
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
syncFrame = requestAnimationFrame(() => {
|
|
85
|
+
syncFrame = 0;
|
|
86
|
+
sync();
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
get ghost() {
|
|
91
|
+
return ghost;
|
|
92
|
+
},
|
|
93
|
+
get ghostEpoch() {
|
|
94
|
+
return ghostEpoch.n;
|
|
95
|
+
},
|
|
96
|
+
setPointerOnCapture(on) {
|
|
97
|
+
pointerOnCapture = on;
|
|
98
|
+
},
|
|
99
|
+
markExplicitClose() {
|
|
100
|
+
pendingExplicitClose = true;
|
|
101
|
+
},
|
|
102
|
+
sessionActive() {
|
|
103
|
+
return session.active;
|
|
104
|
+
},
|
|
105
|
+
reducedMotion,
|
|
106
|
+
queueSync,
|
|
107
|
+
sync,
|
|
108
|
+
clearGhost,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { tooltipTotalPlacement } from "@ggts-sh/core/interaction";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host capability resolution — the one seam between the layer registry /
|
|
3
|
+
* plot props and the engine for interaction capabilities (inspect from
|
|
4
|
+
* `<Inspect>` children + prop, legendFocus / legendFilter from GuideLegend
|
|
5
|
+
* layers + deprecated plot props).
|
|
6
|
+
*
|
|
7
|
+
* THREE independent deriveds — never one combined bag. The inspect resolve
|
|
8
|
+
* reads only `registry.capabilities("inspect")` (`#capabilityVersion`), so
|
|
9
|
+
* geom/mark layer churn must not re-run it: interactionConfig diagnostics
|
|
10
|
+
* re-deliver per recompute (registry contract). The legend resolves read
|
|
11
|
+
* `registry.layers` (`#version`).
|
|
12
|
+
*
|
|
13
|
+
* `interactionConfig` normalization stays in the engine — it must NOT read
|
|
14
|
+
* `caps()` (legendFilter is not a normalizeInteractionConfig input; reading
|
|
15
|
+
* it there re-delivered config diagnostics on every filter toggle).
|
|
16
|
+
*/
|
|
17
|
+
import type { LayerRegistry } from "../geoms/registry.svelte.js";
|
|
18
|
+
import { type ResolvedLegendFilterCapability } from "../legend/resolve-legend-filter.js";
|
|
19
|
+
import { type ResolvedLegendFocusCapability } from "../legend/resolve-legend-focus.js";
|
|
20
|
+
import { type EnginePlotProps, type ResolvedPlotCapabilities } from "../plot-props.js";
|
|
21
|
+
import { type ResolveInspectCapabilityResult } from "./resolve-inspect-capability.js";
|
|
22
|
+
/**
|
|
23
|
+
* SSR-safe derived: Svelte 5.33's one-pass SSR can cache a construction-time
|
|
24
|
+
* empty registry before declaration children initialize. The server branch
|
|
25
|
+
* recomputes on EVERY read (never caches); client reads keep normal rune
|
|
26
|
+
* dependency tracking. Call during component init (or an effect root) only.
|
|
27
|
+
*/
|
|
28
|
+
export declare function ssrSafeDerived<T>(compute: () => T): () => T;
|
|
29
|
+
export type CapabilityResolution = {
|
|
30
|
+
/** Inspect from prop + `<Inspect>` capability children (last child wins). */
|
|
31
|
+
readonly inspect: () => ResolveInspectCapabilityResult;
|
|
32
|
+
/** Legend focus from GuideLegend layers + deprecated plot prop. */
|
|
33
|
+
readonly legendFocus: () => ResolvedLegendFocusCapability;
|
|
34
|
+
/** Legend filter from GuideLegend layers + deprecated plot prop. */
|
|
35
|
+
readonly legendFilter: () => ResolvedLegendFilterCapability;
|
|
36
|
+
/** All five capability defaults for wiring advisories. */
|
|
37
|
+
readonly caps: () => ResolvedPlotCapabilities;
|
|
38
|
+
};
|
|
39
|
+
export declare function createCapabilityResolution(host: {
|
|
40
|
+
registry: LayerRegistry;
|
|
41
|
+
props: EnginePlotProps;
|
|
42
|
+
}): CapabilityResolution;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { resolveLegendFilterCapability, } from "../legend/resolve-legend-filter.js";
|
|
2
|
+
import { resolveLegendFocusCapability, } from "../legend/resolve-legend-focus.js";
|
|
3
|
+
import { readLegacyPlotLegendFilter, readLegacyPlotLegendFocus, resolveCapabilities, } from "../plot-props.js";
|
|
4
|
+
import { resolveInspectCapability, } from "./resolve-inspect-capability.js";
|
|
5
|
+
/**
|
|
6
|
+
* SSR-safe derived: Svelte 5.33's one-pass SSR can cache a construction-time
|
|
7
|
+
* empty registry before declaration children initialize. The server branch
|
|
8
|
+
* recomputes on EVERY read (never caches); client reads keep normal rune
|
|
9
|
+
* dependency tracking. Call during component init (or an effect root) only.
|
|
10
|
+
*/
|
|
11
|
+
export function ssrSafeDerived(compute) {
|
|
12
|
+
const derived = $derived.by(compute);
|
|
13
|
+
return () => (typeof window === "undefined" ? compute() : derived);
|
|
14
|
+
}
|
|
15
|
+
export function createCapabilityResolution(host) {
|
|
16
|
+
const inspect = ssrSafeDerived(() => resolveInspectCapability({
|
|
17
|
+
prop: host.props.inspect,
|
|
18
|
+
children: host.registry.capabilities("inspect"),
|
|
19
|
+
}));
|
|
20
|
+
const legendFocus = ssrSafeDerived(() => resolveLegendFocusCapability({
|
|
21
|
+
plotProp: readLegacyPlotLegendFocus(host.props),
|
|
22
|
+
layers: host.registry.layers,
|
|
23
|
+
}));
|
|
24
|
+
const legendFilter = ssrSafeDerived(() => resolveLegendFilterCapability({
|
|
25
|
+
plotProp: readLegacyPlotLegendFilter(host.props),
|
|
26
|
+
layers: host.registry.layers,
|
|
27
|
+
}));
|
|
28
|
+
const caps = () => {
|
|
29
|
+
const select = host.props.select;
|
|
30
|
+
const zoom = host.props.zoom;
|
|
31
|
+
return resolveCapabilities({
|
|
32
|
+
inspect: inspect().input,
|
|
33
|
+
legendFocus: legendFocus().requested,
|
|
34
|
+
legendFilter: legendFilter().requested,
|
|
35
|
+
...(select !== undefined && { select }),
|
|
36
|
+
...(zoom !== undefined && { zoom }),
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
return { inspect, legendFocus, legendFilter, caps };
|
|
40
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { type InteractionDiagnostic, type InteractionTool } from "./interaction.js";
|
|
2
|
+
export type ZoomAreaMode = "x" | "y" | "xy";
|
|
3
|
+
/**
|
|
4
|
+
* Drop zoom-area when no continuous channel supports brush zoom.
|
|
5
|
+
* Other tools pass through unchanged.
|
|
6
|
+
*/
|
|
7
|
+
export declare function filterAvailableTools(tools: readonly InteractionTool[], zoomHasSupportedChannel: boolean): InteractionTool[];
|
|
8
|
+
/**
|
|
9
|
+
* Filter configured tools using live zoom mode + model scales.
|
|
10
|
+
* When zoom or scales are not yet available, zoom-area is kept (same as
|
|
11
|
+
* chrome's pre-model construction path). Shared by plot-engine surface
|
|
12
|
+
* enablement and chrome-state so the two cannot drift (#1082).
|
|
13
|
+
*/
|
|
14
|
+
export declare function resolveFilteredAvailableTools(tools: readonly InteractionTool[], zoom: {
|
|
15
|
+
readonly mode: ZoomAreaMode;
|
|
16
|
+
} | null, scales: ScaleTypeRef | null): InteractionTool[];
|
|
17
|
+
/** True when select config publishes point selection. */
|
|
18
|
+
export declare function canPublishPointSelection(select: {
|
|
19
|
+
readonly type: string;
|
|
20
|
+
} | null | undefined): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Resolve the tool the host should sync into the reducer.
|
|
23
|
+
* Priority: requested if available → first available → `"inspect"`.
|
|
24
|
+
*
|
|
25
|
+
* Note: empty `available` still yields `"inspect"` (even when inspect is not
|
|
26
|
+
* listed). That matches the host `$effect` and intentionally diverges from
|
|
27
|
+
* `resolveChooseToolAction`, which rejects unavailable tools.
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveEffectiveTool(requested: InteractionTool, available: readonly InteractionTool[]): InteractionTool;
|
|
30
|
+
export type ChooseToolAction = {
|
|
31
|
+
readonly type: "ignore";
|
|
32
|
+
} | {
|
|
33
|
+
readonly type: "request";
|
|
34
|
+
} | {
|
|
35
|
+
readonly type: "apply";
|
|
36
|
+
};
|
|
37
|
+
export type ShowToolRailInput = {
|
|
38
|
+
readonly interactive: boolean;
|
|
39
|
+
readonly availableToolCount: number;
|
|
40
|
+
/** Host: `interactionConfig.select?.type === "point"`. */
|
|
41
|
+
readonly canPublishPointSelection: boolean;
|
|
42
|
+
readonly selectedKeyCount: number;
|
|
43
|
+
readonly hasIntervalSelection: boolean;
|
|
44
|
+
readonly hasZoomDomains: boolean;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* True when every batch has zero rows (including an empty batches list).
|
|
48
|
+
* Host still requires a live model before calling this.
|
|
49
|
+
*/
|
|
50
|
+
export declare function isEmptyPlotScene(batches: readonly {
|
|
51
|
+
readonly rowIndex: {
|
|
52
|
+
readonly length: number;
|
|
53
|
+
};
|
|
54
|
+
}[]): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Whether the tool rail chrome should mount.
|
|
57
|
+
* Multi-tool mode, or any recovery control (point clear / interval clear / zoom reset).
|
|
58
|
+
*/
|
|
59
|
+
export declare function shouldShowToolRail(input: ShowToolRailInput): boolean;
|
|
60
|
+
export type InertSelectionOverlayInput = {
|
|
61
|
+
/**
|
|
62
|
+
* Host chart-local `interactive` (tools or legend focus).
|
|
63
|
+
* Inert overlay is only for non-interactive emphasis/selection paint.
|
|
64
|
+
*/
|
|
65
|
+
readonly interactive: boolean;
|
|
66
|
+
readonly selectedAnchorCount: number;
|
|
67
|
+
readonly emphasizedAnchorCount: number;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Whether to paint the non-interactive selection/emphasis overlay.
|
|
71
|
+
* Host also must not be in surface-interactive mode; SceneOverlays
|
|
72
|
+
* enforces that with `{:else if}` so both never mount together.
|
|
73
|
+
*/
|
|
74
|
+
export declare function shouldShowInertSelectionOverlay(input: InertSelectionOverlayInput): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Pure routing for host `chooseTool`.
|
|
77
|
+
*
|
|
78
|
+
* Priority:
|
|
79
|
+
* 1. ignore — `next` not in `available` (wins over controlled; no callback)
|
|
80
|
+
* 2. request — controlled prop (`tool !== undefined`): callback only
|
|
81
|
+
* 3. apply — local: dispatch + clear draft/queue + callback
|
|
82
|
+
*/
|
|
83
|
+
export declare function resolveChooseToolAction(input: {
|
|
84
|
+
readonly next: InteractionTool;
|
|
85
|
+
readonly available: readonly InteractionTool[];
|
|
86
|
+
readonly isControlled: boolean;
|
|
87
|
+
}): ChooseToolAction;
|
|
88
|
+
export type ScaleTypeRef = {
|
|
89
|
+
readonly x: {
|
|
90
|
+
readonly type: string;
|
|
91
|
+
};
|
|
92
|
+
readonly y: {
|
|
93
|
+
readonly type: string;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
/** True when at least one channel requested by mode is non-band. */
|
|
97
|
+
export declare function zoomSupportsChannel(mode: ZoomAreaMode, scales: ScaleTypeRef): boolean;
|
|
98
|
+
/** Band channels that block zoom under the given mode. */
|
|
99
|
+
export declare function bandChannelsForZoom(mode: ZoomAreaMode, scales: ScaleTypeRef): Array<"x" | "y">;
|
|
100
|
+
/**
|
|
101
|
+
* Zoom-only band-scale diagnostics (not interval-select).
|
|
102
|
+
* `catalogEntry` is spread into each diagnostic with prop/actual filled.
|
|
103
|
+
*/
|
|
104
|
+
export declare function zoomScaleDiagnosticsFromChannels(channels: readonly ("x" | "y")[], catalogEntry: Omit<InteractionDiagnostic, "prop" | "actual"> & Partial<Pick<InteractionDiagnostic, "prop" | "actual">>): InteractionDiagnostic[];
|
|
105
|
+
export type CapabilityStatusInput = {
|
|
106
|
+
readonly facetUnavailableMessage?: string;
|
|
107
|
+
readonly areaDiagnostics: readonly InteractionDiagnostic[];
|
|
108
|
+
readonly zoomSupported: boolean;
|
|
109
|
+
readonly interactive: boolean;
|
|
110
|
+
readonly emptyPlot: boolean;
|
|
111
|
+
/** Null when no render model (preserves host `model !== null` guard). */
|
|
112
|
+
readonly candidateCount: number | null;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* User-facing capability status under the plot.
|
|
116
|
+
* Order: facet unavailable → zoom limited/unavailable → no inspectable marks → null.
|
|
117
|
+
*/
|
|
118
|
+
export declare function capabilityStatusText(input: CapabilityStatusInput): string | null;
|
|
119
|
+
/** Legend type surface for discrete-only advisory (host maps scene legends). */
|
|
120
|
+
export type LegendTypeRef = {
|
|
121
|
+
readonly type: string;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* When legend focus is enabled and the scene has legends but none are discrete,
|
|
125
|
+
* return the INTERACTION_LEGEND_DISCRETE_ONLY advisory with `actual` legend types.
|
|
126
|
+
* Empty when disabled, no legends, or any discrete legend is present.
|
|
127
|
+
* Contract is "not discrete" (ramps, unknown types, etc.), not ramp-only.
|
|
128
|
+
*/
|
|
129
|
+
export declare function legendFocusDiscreteOnlyDiagnostics(legendFocusEnabled: boolean, legends: readonly LegendTypeRef[]): InteractionDiagnostic[];
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { INTERACTION_DIAGNOSTIC_CATALOG, } from "./interaction.js";
|
|
2
|
+
/**
|
|
3
|
+
* Drop zoom-area when no continuous channel supports brush zoom.
|
|
4
|
+
* Other tools pass through unchanged.
|
|
5
|
+
*/
|
|
6
|
+
export function filterAvailableTools(tools, zoomHasSupportedChannel) {
|
|
7
|
+
return tools.filter((tool) => tool !== "zoom-area" || zoomHasSupportedChannel);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Filter configured tools using live zoom mode + model scales.
|
|
11
|
+
* When zoom or scales are not yet available, zoom-area is kept (same as
|
|
12
|
+
* chrome's pre-model construction path). Shared by plot-engine surface
|
|
13
|
+
* enablement and chrome-state so the two cannot drift (#1082).
|
|
14
|
+
*/
|
|
15
|
+
export function resolveFilteredAvailableTools(tools, zoom, scales) {
|
|
16
|
+
const zoomHasSupportedChannel = zoom === null || scales === null || zoomSupportsChannel(zoom.mode, scales);
|
|
17
|
+
return filterAvailableTools(tools, zoomHasSupportedChannel);
|
|
18
|
+
}
|
|
19
|
+
/** True when select config publishes point selection. */
|
|
20
|
+
export function canPublishPointSelection(select) {
|
|
21
|
+
return select?.type === "point";
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Resolve the tool the host should sync into the reducer.
|
|
25
|
+
* Priority: requested if available → first available → `"inspect"`.
|
|
26
|
+
*
|
|
27
|
+
* Note: empty `available` still yields `"inspect"` (even when inspect is not
|
|
28
|
+
* listed). That matches the host `$effect` and intentionally diverges from
|
|
29
|
+
* `resolveChooseToolAction`, which rejects unavailable tools.
|
|
30
|
+
*/
|
|
31
|
+
export function resolveEffectiveTool(requested, available) {
|
|
32
|
+
if (available.includes(requested))
|
|
33
|
+
return requested;
|
|
34
|
+
return available[0] ?? "inspect";
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* True when every batch has zero rows (including an empty batches list).
|
|
38
|
+
* Host still requires a live model before calling this.
|
|
39
|
+
*/
|
|
40
|
+
export function isEmptyPlotScene(batches) {
|
|
41
|
+
return batches.every((batch) => batch.rowIndex.length === 0);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Whether the tool rail chrome should mount.
|
|
45
|
+
* Multi-tool mode, or any recovery control (point clear / interval clear / zoom reset).
|
|
46
|
+
*/
|
|
47
|
+
export function shouldShowToolRail(input) {
|
|
48
|
+
return (input.interactive &&
|
|
49
|
+
(input.availableToolCount > 1 ||
|
|
50
|
+
(input.canPublishPointSelection && input.selectedKeyCount > 0) ||
|
|
51
|
+
input.hasIntervalSelection ||
|
|
52
|
+
input.hasZoomDomains));
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Whether to paint the non-interactive selection/emphasis overlay.
|
|
56
|
+
* Host also must not be in surface-interactive mode; SceneOverlays
|
|
57
|
+
* enforces that with `{:else if}` so both never mount together.
|
|
58
|
+
*/
|
|
59
|
+
export function shouldShowInertSelectionOverlay(input) {
|
|
60
|
+
return !input.interactive && (input.selectedAnchorCount > 0 || input.emphasizedAnchorCount > 0);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Pure routing for host `chooseTool`.
|
|
64
|
+
*
|
|
65
|
+
* Priority:
|
|
66
|
+
* 1. ignore — `next` not in `available` (wins over controlled; no callback)
|
|
67
|
+
* 2. request — controlled prop (`tool !== undefined`): callback only
|
|
68
|
+
* 3. apply — local: dispatch + clear draft/queue + callback
|
|
69
|
+
*/
|
|
70
|
+
export function resolveChooseToolAction(input) {
|
|
71
|
+
if (!input.available.includes(input.next))
|
|
72
|
+
return { type: "ignore" };
|
|
73
|
+
if (input.isControlled)
|
|
74
|
+
return { type: "request" };
|
|
75
|
+
return { type: "apply" };
|
|
76
|
+
}
|
|
77
|
+
/** True when at least one channel requested by mode is non-band. */
|
|
78
|
+
export function zoomSupportsChannel(mode, scales) {
|
|
79
|
+
return (mode !== "y" && scales.x.type !== "band") || (mode !== "x" && scales.y.type !== "band");
|
|
80
|
+
}
|
|
81
|
+
/** Band channels that block zoom under the given mode. */
|
|
82
|
+
export function bandChannelsForZoom(mode, scales) {
|
|
83
|
+
const channels = [];
|
|
84
|
+
if (mode !== "y" && scales.x.type === "band")
|
|
85
|
+
channels.push("x");
|
|
86
|
+
if (mode !== "x" && scales.y.type === "band")
|
|
87
|
+
channels.push("y");
|
|
88
|
+
return channels;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Zoom-only band-scale diagnostics (not interval-select).
|
|
92
|
+
* `catalogEntry` is spread into each diagnostic with prop/actual filled.
|
|
93
|
+
*/
|
|
94
|
+
export function zoomScaleDiagnosticsFromChannels(channels, catalogEntry) {
|
|
95
|
+
return channels.map((channel) => ({
|
|
96
|
+
...catalogEntry,
|
|
97
|
+
prop: `scales.${channel}`,
|
|
98
|
+
actual: "band",
|
|
99
|
+
}));
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* User-facing capability status under the plot.
|
|
103
|
+
* Order: facet unavailable → zoom limited/unavailable → no inspectable marks → null.
|
|
104
|
+
*/
|
|
105
|
+
export function capabilityStatusText(input) {
|
|
106
|
+
if (input.facetUnavailableMessage !== undefined)
|
|
107
|
+
return `Area interaction unavailable: ${input.facetUnavailableMessage}`;
|
|
108
|
+
if (input.areaDiagnostics.length > 0)
|
|
109
|
+
return `Zoom ${input.zoomSupported ? "limited" : "unavailable"}: ${input.areaDiagnostics[0].message}`;
|
|
110
|
+
if (input.interactive &&
|
|
111
|
+
!input.emptyPlot &&
|
|
112
|
+
input.candidateCount !== null &&
|
|
113
|
+
input.candidateCount === 0)
|
|
114
|
+
return "No inspectable marks";
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* When legend focus is enabled and the scene has legends but none are discrete,
|
|
119
|
+
* return the INTERACTION_LEGEND_DISCRETE_ONLY advisory with `actual` legend types.
|
|
120
|
+
* Empty when disabled, no legends, or any discrete legend is present.
|
|
121
|
+
* Contract is "not discrete" (ramps, unknown types, etc.), not ramp-only.
|
|
122
|
+
*/
|
|
123
|
+
export function legendFocusDiscreteOnlyDiagnostics(legendFocusEnabled, legends) {
|
|
124
|
+
if (!legendFocusEnabled || legends.length === 0)
|
|
125
|
+
return [];
|
|
126
|
+
if (legends.some((legend) => legend.type === "discrete"))
|
|
127
|
+
return [];
|
|
128
|
+
return [
|
|
129
|
+
{
|
|
130
|
+
...INTERACTION_DIAGNOSTIC_CATALOG.INTERACTION_LEGEND_DISCRETE_ONLY,
|
|
131
|
+
actual: legends.map((legend) => legend.type),
|
|
132
|
+
},
|
|
133
|
+
];
|
|
134
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CreatePlotInteractionOptions, PlotInteractionController } from "@ggts-sh/core/interaction";
|
|
2
|
+
export type { ControllerDatumIdentity, CreatePlotInteractionOptions, PlotInteractionController, PlotInteractionMutationOptions, PlotInteractionZoomOptions, } from "@ggts-sh/core/interaction";
|
|
3
|
+
/** Svelte reactivity over the shared framework-independent controller. */
|
|
4
|
+
export declare function createPlotInteraction<Key extends PropertyKey = PropertyKey>(options?: CreatePlotInteractionOptions<Key>): PlotInteractionController<Key>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { createPlotInteraction as createController } from "@ggts-sh/core/interaction";
|
|
2
|
+
/** Svelte reactivity over the shared framework-independent controller. */
|
|
3
|
+
export function createPlotInteraction(options = {}) {
|
|
4
|
+
let revision = $state(0);
|
|
5
|
+
const controller = createController({
|
|
6
|
+
...options,
|
|
7
|
+
onchange(transition) {
|
|
8
|
+
revision = transition.revision;
|
|
9
|
+
options.onchange?.(transition);
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
const reactiveController = {
|
|
13
|
+
...controller,
|
|
14
|
+
get revision() {
|
|
15
|
+
return revision;
|
|
16
|
+
},
|
|
17
|
+
get snapshot() {
|
|
18
|
+
void revision;
|
|
19
|
+
return controller.snapshot;
|
|
20
|
+
},
|
|
21
|
+
selected: (scope) => {
|
|
22
|
+
void revision;
|
|
23
|
+
return controller.selected(scope);
|
|
24
|
+
},
|
|
25
|
+
emphasized: (scope) => {
|
|
26
|
+
void revision;
|
|
27
|
+
return controller.emphasized(scope);
|
|
28
|
+
},
|
|
29
|
+
isSelected: (key, scope) => {
|
|
30
|
+
void revision;
|
|
31
|
+
return controller.isSelected(key, scope);
|
|
32
|
+
},
|
|
33
|
+
intervals: (scope) => {
|
|
34
|
+
void revision;
|
|
35
|
+
return controller.intervals(scope);
|
|
36
|
+
},
|
|
37
|
+
zoom: (scope) => {
|
|
38
|
+
void revision;
|
|
39
|
+
return controller.zoom(scope);
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
return Object.freeze(reactiveController);
|
|
43
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inspect-mode × geom advisories — re-export pure collectors from @ggts-sh/core
|
|
3
|
+
* so host plot-engine and the headless CLI share one implementation (#1531).
|
|
4
|
+
*
|
|
5
|
+
* Catalog messages for these codes also live in core
|
|
6
|
+
* (`INSPECT_GEOM_DIAGNOSTIC_CATALOG`); INTERACTION_DIAGNOSTIC_CATALOG spreads them.
|
|
7
|
+
* CLI-only helpers (`collectInspectIntentDiagnostics`, intent modes) stay on
|
|
8
|
+
* `@ggts-sh/core` — do not re-export them here (knip).
|
|
9
|
+
*/
|
|
10
|
+
export { discreteColorFillDomainSizes, HIGH_CARDINALITY_DISCRETE_THRESHOLD, inspectAxisOnBarColDiagnostics, inspectAxisOnDistributionDiagnostics, inspectHighCardinalityDiagnostics, layerGeomsFromSpecLayers, } from "@ggts-sh/core";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inspect-mode × geom advisories — re-export pure collectors from @ggts-sh/core
|
|
3
|
+
* so host plot-engine and the headless CLI share one implementation (#1531).
|
|
4
|
+
*
|
|
5
|
+
* Catalog messages for these codes also live in core
|
|
6
|
+
* (`INSPECT_GEOM_DIAGNOSTIC_CATALOG`); INTERACTION_DIAGNOSTIC_CATALOG spreads them.
|
|
7
|
+
* CLI-only helpers (`collectInspectIntentDiagnostics`, intent modes) stay on
|
|
8
|
+
* `@ggts-sh/core` — do not re-export them here (knip).
|
|
9
|
+
*/
|
|
10
|
+
export { discreteColorFillDomainSizes, HIGH_CARDINALITY_DISCRETE_THRESHOLD, inspectAxisOnBarColDiagnostics, inspectAxisOnDistributionDiagnostics, inspectHighCardinalityDiagnostics, layerGeomsFromSpecLayers, } from "@ggts-sh/core";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared interaction context — the single dep bag threaded through every
|
|
3
|
+
* interaction controller factory (zoom, selection, interval, surface,
|
|
4
|
+
* inspection).
|
|
5
|
+
*
|
|
6
|
+
* Before this module each factory declared its own 6–19-field deps type and
|
|
7
|
+
* plot-engine hand-wired ~60 fields, most of them the same model / config /
|
|
8
|
+
* handler / DOM getters re-typed per controller. One context replaces the
|
|
9
|
+
* shared bag; per-factory `options` now hold only what is genuinely
|
|
10
|
+
* controller-specific (sibling ports, host-derived enablement, narrow config
|
|
11
|
+
* slices).
|
|
12
|
+
*
|
|
13
|
+
* Every field is a deferred getter or stable sink: factories must not read
|
|
14
|
+
* reactive values at construction beyond what their own docs allow. The
|
|
15
|
+
* assembly (interaction-states.svelte.ts) owns construction order.
|
|
16
|
+
*/
|
|
17
|
+
import type { CellValue, RenderModel } from "@ggts-sh/core";
|
|
18
|
+
import type { CandidateFacts } from "@ggts-sh/core";
|
|
19
|
+
import type { PlotInteractionController } from "./controller.svelte.js";
|
|
20
|
+
import type { InteractionTool, PlotInspection, PlotInteractionEvent, PlotInteractionScope, PlotSelection, ResolvedInteractionConfig, ZoomEvent } from "./interaction.js";
|
|
21
|
+
/** Shared dep bag for all interaction controller factories. */
|
|
22
|
+
export type InteractionContext = {
|
|
23
|
+
/** Trained render model; null pre-model (SSR / first effect). */
|
|
24
|
+
readonly model: () => RenderModel | null;
|
|
25
|
+
/** Component DOM handles. */
|
|
26
|
+
readonly root: () => HTMLDivElement | null;
|
|
27
|
+
readonly captureSurface: () => HTMLDivElement | null;
|
|
28
|
+
/** External linked controller, when the plot is controller-driven. */
|
|
29
|
+
readonly interaction: () => PlotInteractionController | undefined;
|
|
30
|
+
readonly resolvedInteractionScope: () => PlotInteractionScope;
|
|
31
|
+
/** Narrow config slices over the resolved interaction config. */
|
|
32
|
+
readonly selectConfig: () => ResolvedInteractionConfig["select"];
|
|
33
|
+
readonly inspectConfig: () => ResolvedInteractionConfig["inspect"];
|
|
34
|
+
/** Component-held tooltip hover flag (markup handlers write via engine). */
|
|
35
|
+
readonly tooltipHovered: () => boolean;
|
|
36
|
+
/** Stable announcer sink. */
|
|
37
|
+
readonly announce: (message: string) => void;
|
|
38
|
+
/** Deferred handler getters (handler-only; never construction-time reads). */
|
|
39
|
+
readonly oninteraction: () => ((event: PlotInteractionEvent<Record<string, CellValue>>) => void) | undefined;
|
|
40
|
+
readonly oninspect: () => ((event: PlotInspection<Record<string, CellValue>>) => void) | undefined;
|
|
41
|
+
readonly onselect: () => ((event: PlotSelection) => void) | undefined;
|
|
42
|
+
readonly onzoom: () => ((event: ZoomEvent) => void) | undefined;
|
|
43
|
+
readonly ontoolchange: () => ((tool: InteractionTool) => void) | undefined;
|
|
44
|
+
/** Durable row identity service (semantic keys). */
|
|
45
|
+
readonly keyAt: (index: number) => PropertyKey | null;
|
|
46
|
+
readonly semanticKey: (row: Record<string, CellValue> | null, index: number | null) => PropertyKey | null;
|
|
47
|
+
readonly candidateSemanticKeys: (candidate: CandidateFacts) => PropertyKey[];
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Fields the host must supply to build an InteractionContext. Identical in
|
|
51
|
+
* shape to the context itself — resolveInteractionContext exists so the host
|
|
52
|
+
* has one explicit seam to widen later (defaults, SSR hatches) without
|
|
53
|
+
* touching five factories again.
|
|
54
|
+
*/
|
|
55
|
+
export type InteractionContextDeps = InteractionContext;
|
|
56
|
+
/** Build the shared interaction context from host-supplied getters. */
|
|
57
|
+
export declare function resolveInteractionContext(deps: InteractionContextDeps): InteractionContext;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type InteractionDiagnosticCode = "INTERACTION_INTERVAL_FACET_UNSUPPORTED" | "INTERACTION_INVALID_MAX_DISTANCE" | "INTERACTION_POINT_REQUIRES_KEY" | "INTERACTION_INTERVAL_PRESET_REQUIRES_KEY" | "INTERACTION_INVALID_KEY" | "INTERACTION_DUPLICATE_KEY" | "INTERACTION_UNSTABLE_KEY" | "INTERACTION_MISSING_LINEAGE" | "INTERACTION_LEGEND_REQUIRES_KEY" | "INTERACTION_LEGEND_DISCRETE_ONLY" | "INTERACTION_INTERVAL_SCALE_UNSUPPORTED" | "INTERACTION_TOOL_UNAVAILABLE" | "INTERACTION_SCOPE_WITHOUT_CONTROLLER" | "INTERACTION_HANDLER_WITHOUT_CAPABILITY" | "INTERACTION_INSPECT_X_ON_COL" | "INTERACTION_INSPECT_X_ON_BAR" | "INTERACTION_INSPECT_X_BISECTS_COL_LABELS" | "INTERACTION_INSPECT_X_BISECTS_BAR_LABELS" | "INTERACTION_INSPECT_AXIS_ON_VIOLIN" | "INTERACTION_INSPECT_AXIS_ON_BOXPLOT" | "INTERACTION_INSPECT_AXIS_ON_ERRORBAR" | "INTERACTION_INSPECT_AXIS_ON_LINERANGE" | "INTERACTION_INSPECT_AXIS_ON_POINTRANGE" | "INTERACTION_INSPECT_AXIS_ON_CROSSBAR" | "INTERACTION_INSPECT_IDENTITY_DROPPED" | "INTERACTION_DUPLICATE_INSPECT_CAPABILITY" | "INTERACTION_INSPECT_HIGH_CARDINALITY_DISCRETE";
|
|
2
|
+
export interface InteractionDiagnostic {
|
|
3
|
+
readonly severity: "error" | "warning" | "advisory";
|
|
4
|
+
readonly code: InteractionDiagnosticCode;
|
|
5
|
+
readonly message: string;
|
|
6
|
+
readonly prop: string;
|
|
7
|
+
readonly actual?: unknown;
|
|
8
|
+
readonly suggestions: ReadonlyArray<string>;
|
|
9
|
+
readonly docUrl: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const INTERACTION_DIAGNOSTIC_CATALOG: Readonly<Record<InteractionDiagnosticCode, Omit<InteractionDiagnostic, "actual">>>;
|