@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,112 @@
|
|
|
1
|
+
import { INTERACTION_DIAGNOSTIC_CATALOG, } from "./interaction-diagnostics.js";
|
|
2
|
+
function resolveInspect(input, diagnostics) {
|
|
3
|
+
if (input === undefined || input === false)
|
|
4
|
+
return null;
|
|
5
|
+
const value = input === true ? {} : input;
|
|
6
|
+
const maxDistance = value.maxDistance ?? 24;
|
|
7
|
+
if (!Number.isFinite(maxDistance) || maxDistance < 0) {
|
|
8
|
+
diagnostics.push({
|
|
9
|
+
...INTERACTION_DIAGNOSTIC_CATALOG.INTERACTION_INVALID_MAX_DISTANCE,
|
|
10
|
+
actual: maxDistance,
|
|
11
|
+
});
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
return Object.freeze({
|
|
15
|
+
mode: value.mode ?? "auto",
|
|
16
|
+
pin: value.pin ?? true,
|
|
17
|
+
maxDistance,
|
|
18
|
+
contentMode: value.contentMode ?? "informational",
|
|
19
|
+
muteSiblings: value.muteSiblings ?? false,
|
|
20
|
+
tooltipTotal: value.tooltipTotal ?? "auto",
|
|
21
|
+
...(value.content !== undefined && { content: value.content }),
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function resolveSelect(input, hasKey, diagnostics) {
|
|
25
|
+
if (input === undefined || input === false)
|
|
26
|
+
return null;
|
|
27
|
+
const value = typeof input === "string" ? { type: input } : input;
|
|
28
|
+
const select = Object.freeze({
|
|
29
|
+
type: value.type,
|
|
30
|
+
mode: value.mode ?? "xy",
|
|
31
|
+
multiple: value.multiple ?? false,
|
|
32
|
+
persistent: value.persistent ?? true,
|
|
33
|
+
preset: value.preset ?? "independent",
|
|
34
|
+
});
|
|
35
|
+
if (value.type === "point" && hasKey === false) {
|
|
36
|
+
diagnostics.push({
|
|
37
|
+
...INTERACTION_DIAGNOSTIC_CATALOG.INTERACTION_POINT_REQUIRES_KEY,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
if (value.type === "interval" && select.preset !== "independent" && hasKey === false) {
|
|
41
|
+
diagnostics.push({
|
|
42
|
+
...INTERACTION_DIAGNOSTIC_CATALOG.INTERACTION_INTERVAL_PRESET_REQUIRES_KEY,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return select;
|
|
46
|
+
}
|
|
47
|
+
function availableInteractionTools(inspect, select, zoom) {
|
|
48
|
+
const tools = [];
|
|
49
|
+
if (inspect !== null || select?.type === "interval" || zoom !== null)
|
|
50
|
+
tools.push("inspect");
|
|
51
|
+
if (select?.type === "point")
|
|
52
|
+
tools.push("point");
|
|
53
|
+
if (select?.type === "interval")
|
|
54
|
+
tools.push("select-area");
|
|
55
|
+
if (zoom !== null)
|
|
56
|
+
tools.push("zoom-area");
|
|
57
|
+
return tools;
|
|
58
|
+
}
|
|
59
|
+
function resolveZoom(input) {
|
|
60
|
+
if (input === undefined || input === false)
|
|
61
|
+
return null;
|
|
62
|
+
const value = input === true ? {} : input;
|
|
63
|
+
return Object.freeze({
|
|
64
|
+
mode: value.mode ?? "xy",
|
|
65
|
+
trigger: value.trigger ?? "brush",
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function resolveLegendFocus(input, hasKey, diagnostics) {
|
|
69
|
+
if (input === undefined || input === false)
|
|
70
|
+
return null;
|
|
71
|
+
if (hasKey === false) {
|
|
72
|
+
diagnostics.push({
|
|
73
|
+
...INTERACTION_DIAGNOSTIC_CATALOG.INTERACTION_LEGEND_REQUIRES_KEY,
|
|
74
|
+
});
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
const value = input === true ? {} : input;
|
|
78
|
+
return Object.freeze({ preview: value.preview ?? true });
|
|
79
|
+
}
|
|
80
|
+
export function normalizeInteractionConfig(input, context = {}) {
|
|
81
|
+
const diagnostics = [];
|
|
82
|
+
const inspect = resolveInspect(input.inspect, diagnostics);
|
|
83
|
+
const select = resolveSelect(input.select, context.hasKey, diagnostics);
|
|
84
|
+
let zoom = resolveZoom(input.zoom);
|
|
85
|
+
const legendFocus = resolveLegendFocus(input.legendFocus, context.hasKey, diagnostics);
|
|
86
|
+
if (context.faceted === true && zoom !== null) {
|
|
87
|
+
diagnostics.push({
|
|
88
|
+
...INTERACTION_DIAGNOSTIC_CATALOG.INTERACTION_INTERVAL_FACET_UNSUPPORTED,
|
|
89
|
+
});
|
|
90
|
+
zoom = null;
|
|
91
|
+
}
|
|
92
|
+
const availableTools = availableInteractionTools(inspect, select, zoom);
|
|
93
|
+
const fallbackTool = select?.type === "point" && inspect === null ? "point" : "inspect";
|
|
94
|
+
const requestedTool = input.tool ?? fallbackTool;
|
|
95
|
+
const initialTool = availableTools.includes(requestedTool) ? requestedTool : fallbackTool;
|
|
96
|
+
if (input.tool !== undefined && !availableTools.includes(input.tool)) {
|
|
97
|
+
diagnostics.push({
|
|
98
|
+
...INTERACTION_DIAGNOSTIC_CATALOG.INTERACTION_TOOL_UNAVAILABLE,
|
|
99
|
+
actual: input.tool,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
return Object.freeze({
|
|
103
|
+
interactive: availableTools.length > 0 || legendFocus !== null,
|
|
104
|
+
inspect,
|
|
105
|
+
select,
|
|
106
|
+
zoom,
|
|
107
|
+
legendFocus,
|
|
108
|
+
initialTool,
|
|
109
|
+
availableTools: Object.freeze(availableTools),
|
|
110
|
+
diagnostics: Object.freeze(diagnostics),
|
|
111
|
+
});
|
|
112
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { InteractionSource, InteractionTool } from "./interaction.js";
|
|
2
|
+
/** Candidate identity carried on inspect pointer-frame payloads (not reducer state). */
|
|
3
|
+
export interface InteractionCandidateRef {
|
|
4
|
+
readonly epoch: number;
|
|
5
|
+
readonly id: number;
|
|
6
|
+
readonly panelId: string | null;
|
|
7
|
+
readonly x: number;
|
|
8
|
+
readonly y: number;
|
|
9
|
+
}
|
|
10
|
+
type AreaState = Readonly<{
|
|
11
|
+
kind: "idle";
|
|
12
|
+
}> | Readonly<{
|
|
13
|
+
kind: "first-corner" | "dragging";
|
|
14
|
+
tool: "select-area" | "zoom-area";
|
|
15
|
+
panelId: string | null;
|
|
16
|
+
start: Readonly<{
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
}>;
|
|
20
|
+
current: Readonly<{
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
}>;
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Reducer owns tool + area brush + frame epoch/revision.
|
|
27
|
+
* Inspection lifecycle lives solely in InspectionState (single authority).
|
|
28
|
+
*/
|
|
29
|
+
export interface InteractionReducerState {
|
|
30
|
+
readonly revision: number;
|
|
31
|
+
readonly epoch: number;
|
|
32
|
+
readonly tool: InteractionTool;
|
|
33
|
+
readonly area: AreaState;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Actions. `inspect` is a **pointer-frame payload only** — delivered to
|
|
37
|
+
* `onPointerFrame` and never stored on reducer state.
|
|
38
|
+
*/
|
|
39
|
+
export type InteractionAction = {
|
|
40
|
+
type: "inspect";
|
|
41
|
+
candidate: InteractionCandidateRef | null;
|
|
42
|
+
source: InteractionSource;
|
|
43
|
+
} | {
|
|
44
|
+
type: "escape";
|
|
45
|
+
source: InteractionSource;
|
|
46
|
+
} | {
|
|
47
|
+
type: "set-tool";
|
|
48
|
+
tool: InteractionTool;
|
|
49
|
+
} | {
|
|
50
|
+
type: "begin-area";
|
|
51
|
+
point: Readonly<{
|
|
52
|
+
x: number;
|
|
53
|
+
y: number;
|
|
54
|
+
}>;
|
|
55
|
+
panelId: string | null;
|
|
56
|
+
} | {
|
|
57
|
+
type: "move-area";
|
|
58
|
+
point: Readonly<{
|
|
59
|
+
x: number;
|
|
60
|
+
y: number;
|
|
61
|
+
}>;
|
|
62
|
+
} | {
|
|
63
|
+
type: "cancel-area";
|
|
64
|
+
} | {
|
|
65
|
+
type: "invalidate";
|
|
66
|
+
reason: "resize" | "data" | "scene" | "dispose";
|
|
67
|
+
};
|
|
68
|
+
export interface InteractionFrameToken {
|
|
69
|
+
readonly epoch: number;
|
|
70
|
+
readonly revision: number;
|
|
71
|
+
}
|
|
72
|
+
export type PointerScheduleKind = "inspect" | "move-area";
|
|
73
|
+
export declare function createInteractionReducer(options?: {
|
|
74
|
+
initialTool?: InteractionTool;
|
|
75
|
+
onChange?: (state: InteractionReducerState) => void;
|
|
76
|
+
/**
|
|
77
|
+
* Continuous pointer-frame sink.
|
|
78
|
+
* - inspect: InspectionState only (never reducer-dispatched)
|
|
79
|
+
* - move-area: may return false to skip dispatch (unused today)
|
|
80
|
+
*/
|
|
81
|
+
onPointerFrame?: (action: Extract<InteractionAction, {
|
|
82
|
+
type: "inspect" | "move-area";
|
|
83
|
+
}>) => boolean | void;
|
|
84
|
+
scheduleFrame?: (callback: () => void) => unknown;
|
|
85
|
+
cancelFrame?: (handle: unknown) => void;
|
|
86
|
+
}): {
|
|
87
|
+
readonly state: InteractionReducerState;
|
|
88
|
+
dispatch: (action: InteractionAction) => void;
|
|
89
|
+
/** Coalesce continuous pointer coordinates to the latest action per frame. */
|
|
90
|
+
queuePointer(action: Extract<InteractionAction, {
|
|
91
|
+
type: "inspect" | "move-area";
|
|
92
|
+
}>): void;
|
|
93
|
+
cancelScheduledPointer: (kind?: PointerScheduleKind) => void;
|
|
94
|
+
frameToken(): InteractionFrameToken;
|
|
95
|
+
accepts(token: InteractionFrameToken): boolean;
|
|
96
|
+
};
|
|
97
|
+
export {};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
export function createInteractionReducer(options = {}) {
|
|
2
|
+
let state = {
|
|
3
|
+
revision: 0,
|
|
4
|
+
epoch: 0,
|
|
5
|
+
tool: options.initialTool ?? "inspect",
|
|
6
|
+
area: { kind: "idle" },
|
|
7
|
+
};
|
|
8
|
+
let scheduledPointerAction = null;
|
|
9
|
+
let frameHandle = null;
|
|
10
|
+
/**
|
|
11
|
+
* Cancel the coalesced pointer schedule. With `kind`, cancel only when the
|
|
12
|
+
* queued action matches (inspect cancel must not kill move-area).
|
|
13
|
+
*/
|
|
14
|
+
const cancelScheduledPointer = (kind) => {
|
|
15
|
+
if (kind !== undefined &&
|
|
16
|
+
(scheduledPointerAction === null || scheduledPointerAction.type !== kind))
|
|
17
|
+
return;
|
|
18
|
+
if (frameHandle !== null)
|
|
19
|
+
options.cancelFrame?.(frameHandle);
|
|
20
|
+
frameHandle = null;
|
|
21
|
+
scheduledPointerAction = null;
|
|
22
|
+
};
|
|
23
|
+
const commit = (patch) => {
|
|
24
|
+
state = Object.freeze({ ...state, ...patch, revision: state.revision + 1 });
|
|
25
|
+
options.onChange?.(state);
|
|
26
|
+
};
|
|
27
|
+
const dispatch = (action) => {
|
|
28
|
+
// Discrete boundaries always win over queued pointer coordinates.
|
|
29
|
+
if (action.type === "escape" ||
|
|
30
|
+
action.type === "set-tool" ||
|
|
31
|
+
action.type === "cancel-area" ||
|
|
32
|
+
action.type === "invalidate")
|
|
33
|
+
cancelScheduledPointer();
|
|
34
|
+
switch (action.type) {
|
|
35
|
+
case "inspect":
|
|
36
|
+
// Inspect payloads are frame-only; never mutate reducer state.
|
|
37
|
+
return;
|
|
38
|
+
case "escape":
|
|
39
|
+
// Area cancel + epoch only. Inspection dismiss is InspectionState-owned.
|
|
40
|
+
if (state.area.kind === "idle") {
|
|
41
|
+
commit({ epoch: state.epoch + 1 });
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
commit({ area: { kind: "idle" }, epoch: state.epoch + 1 });
|
|
45
|
+
}
|
|
46
|
+
return;
|
|
47
|
+
case "set-tool":
|
|
48
|
+
if (state.tool !== action.tool || state.area.kind !== "idle") {
|
|
49
|
+
commit({ tool: action.tool, area: { kind: "idle" }, epoch: state.epoch + 1 });
|
|
50
|
+
}
|
|
51
|
+
return;
|
|
52
|
+
case "begin-area":
|
|
53
|
+
if (state.tool !== "select-area" && state.tool !== "zoom-area")
|
|
54
|
+
return;
|
|
55
|
+
commit({
|
|
56
|
+
area: {
|
|
57
|
+
kind: "first-corner",
|
|
58
|
+
tool: state.tool,
|
|
59
|
+
panelId: action.panelId,
|
|
60
|
+
start: action.point,
|
|
61
|
+
current: action.point,
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
return;
|
|
65
|
+
case "move-area":
|
|
66
|
+
if (state.area.kind === "idle")
|
|
67
|
+
return;
|
|
68
|
+
commit({ area: { ...state.area, kind: "dragging", current: action.point } });
|
|
69
|
+
return;
|
|
70
|
+
case "cancel-area":
|
|
71
|
+
if (state.area.kind !== "idle")
|
|
72
|
+
commit({ area: { kind: "idle" }, epoch: state.epoch + 1 });
|
|
73
|
+
return;
|
|
74
|
+
case "invalidate":
|
|
75
|
+
commit({ area: { kind: "idle" }, epoch: state.epoch + 1 });
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
return {
|
|
79
|
+
get state() {
|
|
80
|
+
return state;
|
|
81
|
+
},
|
|
82
|
+
dispatch,
|
|
83
|
+
/** Coalesce continuous pointer coordinates to the latest action per frame. */
|
|
84
|
+
queuePointer(action) {
|
|
85
|
+
scheduledPointerAction = action;
|
|
86
|
+
if (frameHandle !== null)
|
|
87
|
+
return;
|
|
88
|
+
const schedule = options.scheduleFrame ??
|
|
89
|
+
((callback) => {
|
|
90
|
+
queueMicrotask(callback);
|
|
91
|
+
return 1;
|
|
92
|
+
});
|
|
93
|
+
frameHandle = schedule(() => {
|
|
94
|
+
frameHandle = null;
|
|
95
|
+
const latest = scheduledPointerAction;
|
|
96
|
+
scheduledPointerAction = null;
|
|
97
|
+
if (latest === null)
|
|
98
|
+
return;
|
|
99
|
+
// Inspect frames are owned by InspectionState — never reducer-dispatched.
|
|
100
|
+
if (latest.type === "inspect") {
|
|
101
|
+
options.onPointerFrame?.(latest);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const shouldDispatch = options.onPointerFrame?.(latest);
|
|
105
|
+
if (shouldDispatch !== false)
|
|
106
|
+
dispatch(latest);
|
|
107
|
+
});
|
|
108
|
+
},
|
|
109
|
+
cancelScheduledPointer,
|
|
110
|
+
frameToken() {
|
|
111
|
+
return { epoch: state.epoch, revision: state.revision };
|
|
112
|
+
},
|
|
113
|
+
accepts(token) {
|
|
114
|
+
return token.epoch === state.epoch && token.revision === state.revision;
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve host inspect capability from the GGPlot prop and registered
|
|
3
|
+
* capability children (declaration-only `<Inspect>`). Pure — no registry I/O.
|
|
4
|
+
*
|
|
5
|
+
* Child presence enables inspect; empty child bag ≡ `inspect={true}`.
|
|
6
|
+
* When any child is registered, the last child's options replace the prop
|
|
7
|
+
* whole (no deep-merge). Multiple children set `multiChild` for diagnostics.
|
|
8
|
+
*/
|
|
9
|
+
import type { DatumKey } from "../runtime/resolve-datum-key.js";
|
|
10
|
+
import type { InspectInput, InspectOptions } from "./interaction.js";
|
|
11
|
+
import { type InteractionDiagnostic } from "./interaction-diagnostics.js";
|
|
12
|
+
/** Options bag registered by one `<Inspect>` (empty object = defaults). */
|
|
13
|
+
export type InspectCapabilityChild = InspectOptions;
|
|
14
|
+
export type ResolveInspectCapabilityInput = {
|
|
15
|
+
readonly prop?: InspectInput | undefined;
|
|
16
|
+
readonly children?: readonly InspectCapabilityChild[] | undefined;
|
|
17
|
+
};
|
|
18
|
+
export type ResolveInspectCapabilityResult = {
|
|
19
|
+
/** Value for normalizeInteractionConfig / resolveCapabilities override. */
|
|
20
|
+
readonly input: InspectInput;
|
|
21
|
+
/** True when more than one inspect capability child is registered. */
|
|
22
|
+
readonly multiChild: boolean;
|
|
23
|
+
/** Row identity the winning source asks for; undefined means "use the default". */
|
|
24
|
+
readonly identity: DatumKey | undefined;
|
|
25
|
+
/** True when the prop named an identity that the winning child replaced away. */
|
|
26
|
+
readonly droppedPropIdentity: boolean;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Prefer the last capability child over the prop. No children → prop ?? false.
|
|
30
|
+
*
|
|
31
|
+
* Resolving `identity` here (rather than leaving callers to re-read it off
|
|
32
|
+
* `input`) is what makes the REPLACE rule visible: an `<Inspect>` child that
|
|
33
|
+
* names no identity drops one the prop asked for, and `droppedPropIdentity`
|
|
34
|
+
* says so instead of the identity vanishing into a row-index default.
|
|
35
|
+
*/
|
|
36
|
+
export declare function resolveInspectCapability(input: ResolveInspectCapabilityInput): ResolveInspectCapabilityResult;
|
|
37
|
+
/** Zero or one multi-Inspect advisory from a resolve result. */
|
|
38
|
+
export declare function duplicateInspectCapabilityDiagnostics(multiChild: boolean): InteractionDiagnostic[];
|
|
39
|
+
/** Zero or one advisory for a prop identity a child replaced away. */
|
|
40
|
+
export declare function droppedInspectIdentityDiagnostics(droppedPropIdentity: boolean): InteractionDiagnostic[];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { INTERACTION_DIAGNOSTIC_CATALOG, } from "./interaction-diagnostics.js";
|
|
2
|
+
function childToInput(child) {
|
|
3
|
+
return Object.keys(child).length === 0 ? true : child;
|
|
4
|
+
}
|
|
5
|
+
/** Read `identity` off an inspect input; boolean forms carry none. */
|
|
6
|
+
function identityOf(input) {
|
|
7
|
+
if (input === undefined || input === true || input === false)
|
|
8
|
+
return undefined;
|
|
9
|
+
return input.identity;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Prefer the last capability child over the prop. No children → prop ?? false.
|
|
13
|
+
*
|
|
14
|
+
* Resolving `identity` here (rather than leaving callers to re-read it off
|
|
15
|
+
* `input`) is what makes the REPLACE rule visible: an `<Inspect>` child that
|
|
16
|
+
* names no identity drops one the prop asked for, and `droppedPropIdentity`
|
|
17
|
+
* says so instead of the identity vanishing into a row-index default.
|
|
18
|
+
*/
|
|
19
|
+
export function resolveInspectCapability(input) {
|
|
20
|
+
const children = input.children ?? [];
|
|
21
|
+
if (children.length === 0) {
|
|
22
|
+
return {
|
|
23
|
+
input: input.prop ?? false,
|
|
24
|
+
multiChild: false,
|
|
25
|
+
identity: identityOf(input.prop),
|
|
26
|
+
droppedPropIdentity: false,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const last = children.at(-1);
|
|
30
|
+
const resolved = childToInput(last);
|
|
31
|
+
const identity = identityOf(resolved);
|
|
32
|
+
return {
|
|
33
|
+
input: resolved,
|
|
34
|
+
multiChild: children.length > 1,
|
|
35
|
+
identity,
|
|
36
|
+
droppedPropIdentity: identity === undefined && identityOf(input.prop) !== undefined,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** Zero or one multi-Inspect advisory from a resolve result. */
|
|
40
|
+
export function duplicateInspectCapabilityDiagnostics(multiChild) {
|
|
41
|
+
if (!multiChild)
|
|
42
|
+
return [];
|
|
43
|
+
return [{ ...INTERACTION_DIAGNOSTIC_CATALOG.INTERACTION_DUPLICATE_INSPECT_CAPABILITY }];
|
|
44
|
+
}
|
|
45
|
+
/** Zero or one advisory for a prop identity a child replaced away. */
|
|
46
|
+
export function droppedInspectIdentityDiagnostics(droppedPropIdentity) {
|
|
47
|
+
if (!droppedPropIdentity)
|
|
48
|
+
return [];
|
|
49
|
+
return [{ ...INTERACTION_DIAGNOSTIC_CATALOG.INTERACTION_INSPECT_IDENTITY_DROPPED }];
|
|
50
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Channel state that lives either in the shared interaction controller or
|
|
3
|
+
* locally in this plot. Callers never learn which. Subscribes to the
|
|
4
|
+
* controller revision internally (#1079).
|
|
5
|
+
*/
|
|
6
|
+
import type { PlotInteractionController } from "./controller.svelte.js";
|
|
7
|
+
import type { InteractionSource, PlotInteractionInterval, PlotInteractionScope } from "./interaction.js";
|
|
8
|
+
/**
|
|
9
|
+
* Successful write result. Wrapped so a committed `null` (e.g. cleared zoom)
|
|
10
|
+
* is not confused with a no-op rejection.
|
|
11
|
+
*/
|
|
12
|
+
type ScopedStoreWrite<T> = {
|
|
13
|
+
readonly value: T;
|
|
14
|
+
};
|
|
15
|
+
export interface ScopedStore<T> {
|
|
16
|
+
readonly value: T;
|
|
17
|
+
/**
|
|
18
|
+
* Replace the value. Returns `{ value }` on commit, or `null` when the write
|
|
19
|
+
* was a no-op (same local value, or controller rejected the transition).
|
|
20
|
+
*/
|
|
21
|
+
set(next: T, source: InteractionSource): ScopedStoreWrite<T> | null;
|
|
22
|
+
/**
|
|
23
|
+
* Clear to the store's empty value. Returns `false` when already empty
|
|
24
|
+
* (or the controller rejected a no-op clear).
|
|
25
|
+
*/
|
|
26
|
+
clear(source: InteractionSource): boolean;
|
|
27
|
+
}
|
|
28
|
+
export type CreateScopedStoreInput<T> = {
|
|
29
|
+
readonly initial: T;
|
|
30
|
+
readonly controller: () => PlotInteractionController | undefined;
|
|
31
|
+
readonly scope: () => PlotInteractionScope;
|
|
32
|
+
/** Read channel state from a live controller. */
|
|
33
|
+
readonly read: (controller: PlotInteractionController, scope: PlotInteractionScope) => T;
|
|
34
|
+
/**
|
|
35
|
+
* Write channel state to a live controller. Return `{ value }` on commit, or
|
|
36
|
+
* `null` when the controller treated the write as a no-op.
|
|
37
|
+
*/
|
|
38
|
+
readonly write: (controller: PlotInteractionController, next: T, scope: PlotInteractionScope, source: InteractionSource) => ScopedStoreWrite<T> | null;
|
|
39
|
+
/**
|
|
40
|
+
* Clear channel state on a live controller. Return `false` when the clear
|
|
41
|
+
* was a no-op.
|
|
42
|
+
*/
|
|
43
|
+
readonly clearShared: (controller: PlotInteractionController, scope: PlotInteractionScope, source: InteractionSource) => boolean;
|
|
44
|
+
/** Equality for local no-op detection. Defaults to `Object.is`. */
|
|
45
|
+
readonly same?: (a: T, b: T) => boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Value after `clear` in local mode. Defaults to `initial`.
|
|
48
|
+
* (e.g. zoom uses `null`; key lists use `[]`.)
|
|
49
|
+
*/
|
|
50
|
+
readonly empty?: T;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Create a scoped store. Construction registers a `$derived` that tracks the
|
|
54
|
+
* controller revision when shared mode is active.
|
|
55
|
+
*/
|
|
56
|
+
export declare function createScopedStore<T>(input: CreateScopedStoreInput<T>): ScopedStore<T>;
|
|
57
|
+
/**
|
|
58
|
+
* Interval channel store. The controller exposes upsert/remove/clear-all
|
|
59
|
+
* rather than whole-array replace, so this surface mirrors those ops while
|
|
60
|
+
* still hiding local vs shared storage.
|
|
61
|
+
*/
|
|
62
|
+
export interface IntervalScopedStore {
|
|
63
|
+
readonly value: readonly PlotInteractionInterval<PropertyKey>[];
|
|
64
|
+
upsert(record: PlotInteractionInterval<PropertyKey>, source: InteractionSource): void;
|
|
65
|
+
remove(panelId: string, source: InteractionSource): boolean;
|
|
66
|
+
clear(source: InteractionSource): boolean;
|
|
67
|
+
}
|
|
68
|
+
export type CreateIntervalScopedStoreInput = {
|
|
69
|
+
readonly controller: () => PlotInteractionController | undefined;
|
|
70
|
+
readonly scope: () => PlotInteractionScope;
|
|
71
|
+
};
|
|
72
|
+
export declare function createIntervalScopedStore(input: CreateIntervalScopedStoreInput): IntervalScopedStore;
|
|
73
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { nextLocalIntervalRecords } from "../interval/consumption.js";
|
|
2
|
+
/**
|
|
3
|
+
* Create a scoped store. Construction registers a `$derived` that tracks the
|
|
4
|
+
* controller revision when shared mode is active.
|
|
5
|
+
*/
|
|
6
|
+
export function createScopedStore(input) {
|
|
7
|
+
let local = $state.raw(input.initial);
|
|
8
|
+
const same = input.same ?? ((a, b) => Object.is(a, b));
|
|
9
|
+
// `empty` may be null (zoom); hasOwn keeps null distinct from "not provided".
|
|
10
|
+
const empty = Object.hasOwn(input, "empty") ? input.empty : input.initial;
|
|
11
|
+
const value = $derived.by(() => {
|
|
12
|
+
const controller = input.controller();
|
|
13
|
+
if (controller === undefined)
|
|
14
|
+
return local;
|
|
15
|
+
// Subscribe to revision so external controller writes invalidate readers.
|
|
16
|
+
void controller.revision;
|
|
17
|
+
return input.read(controller, input.scope());
|
|
18
|
+
});
|
|
19
|
+
function set(next, source) {
|
|
20
|
+
const controller = input.controller();
|
|
21
|
+
if (controller === undefined) {
|
|
22
|
+
if (same(local, next))
|
|
23
|
+
return null;
|
|
24
|
+
local = next;
|
|
25
|
+
return { value: local };
|
|
26
|
+
}
|
|
27
|
+
return input.write(controller, next, input.scope(), source);
|
|
28
|
+
}
|
|
29
|
+
function clear(source) {
|
|
30
|
+
const controller = input.controller();
|
|
31
|
+
if (controller === undefined) {
|
|
32
|
+
if (same(local, empty))
|
|
33
|
+
return false;
|
|
34
|
+
local = empty;
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
return input.clearShared(controller, input.scope(), source);
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
get value() {
|
|
41
|
+
return value;
|
|
42
|
+
},
|
|
43
|
+
set,
|
|
44
|
+
clear,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export function createIntervalScopedStore(input) {
|
|
48
|
+
let local = $state.raw([]);
|
|
49
|
+
const value = $derived.by(() => {
|
|
50
|
+
const controller = input.controller();
|
|
51
|
+
if (controller === undefined)
|
|
52
|
+
return local;
|
|
53
|
+
void controller.revision;
|
|
54
|
+
return controller.intervals(input.scope());
|
|
55
|
+
});
|
|
56
|
+
function upsert(record, source) {
|
|
57
|
+
const controller = input.controller();
|
|
58
|
+
if (controller === undefined) {
|
|
59
|
+
local = [...nextLocalIntervalRecords(local, record)];
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
controller.setInterval(record, { scope: input.scope(), source });
|
|
63
|
+
}
|
|
64
|
+
function remove(panelId, source) {
|
|
65
|
+
const controller = input.controller();
|
|
66
|
+
if (controller === undefined) {
|
|
67
|
+
const next = local.filter((interval) => interval.panelId !== panelId);
|
|
68
|
+
if (next.length === local.length)
|
|
69
|
+
return false;
|
|
70
|
+
local = next;
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
return controller.clearInterval(panelId, { scope: input.scope(), source }) !== null;
|
|
74
|
+
}
|
|
75
|
+
function clear(source) {
|
|
76
|
+
const controller = input.controller();
|
|
77
|
+
if (controller === undefined) {
|
|
78
|
+
if (local.length === 0)
|
|
79
|
+
return false;
|
|
80
|
+
local = [];
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
return controller.clearIntervals({ scope: input.scope(), source }) !== null;
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
get value() {
|
|
87
|
+
return value;
|
|
88
|
+
},
|
|
89
|
+
upsert,
|
|
90
|
+
remove,
|
|
91
|
+
clear,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolved target ownership (#1080).
|
|
3
|
+
*
|
|
4
|
+
* One module owns panel-scoped nearest (#787), the per-intent distance policy,
|
|
5
|
+
* and the candidate match that hover / tap / point-select all need. Callers
|
|
6
|
+
* stop each carrying their own `panelAtOrOnly().nearest()` and maxDistance.
|
|
7
|
+
*
|
|
8
|
+
* Does not own hit geometry (core) or the inspect pin lifecycle. Semantic
|
|
9
|
+
* keys stay on the host (`candidateSemanticKeys`). Reducer inspect payloads
|
|
10
|
+
* are built from CandidateMatch / CandidateFacts in inspection/frame.ts.
|
|
11
|
+
*/
|
|
12
|
+
import type { CandidateInspectMode, CandidateMatch, RenderModel, ResolvedCandidateInspectMode } from "@ggts-sh/core";
|
|
13
|
+
import { type PanelBounds } from "../scene/geometry.js";
|
|
14
|
+
import type { PlotPoint } from "../surface/area-brush.js";
|
|
15
|
+
/**
|
|
16
|
+
* Why we are resolving. Selects the distance policy so callers stop each
|
|
17
|
+
* carrying their own maxDistance.
|
|
18
|
+
*/
|
|
19
|
+
export type TargetIntent = "hover" | "tap" | "point-select";
|
|
20
|
+
/**
|
|
21
|
+
* Inspect fields that feed hover/tap distance policy.
|
|
22
|
+
* Host: resolved `interactionConfig.inspect` (mode + maxDistance), or the
|
|
23
|
+
* pure-table snapshot already taken for the gesture.
|
|
24
|
+
*/
|
|
25
|
+
export type TargetInspectPolicy = {
|
|
26
|
+
readonly mode: CandidateInspectMode;
|
|
27
|
+
readonly maxDistance: number;
|
|
28
|
+
} | null;
|
|
29
|
+
/**
|
|
30
|
+
* Nearest-candidate radius (plot px) for point-tool click.
|
|
31
|
+
* Deliberate constant — distinct from inspect.maxDistance (default also 24,
|
|
32
|
+
* but hover/tap read config; point-select does not).
|
|
33
|
+
*/
|
|
34
|
+
export declare const POINT_SELECT_NEAREST_MAX_DISTANCE_PX = 24;
|
|
35
|
+
/** Resolved nearest-search params for one intent. */
|
|
36
|
+
export type TargetSearch = {
|
|
37
|
+
readonly mode: CandidateInspectMode;
|
|
38
|
+
readonly maxDistance: number;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Intent → nearest search params.
|
|
42
|
+
*
|
|
43
|
+
* | intent | mode | maxDistance |
|
|
44
|
+
* |--------------|-------------------|--------------------------------------|
|
|
45
|
+
* | hover | inspect.mode | inspect.maxDistance |
|
|
46
|
+
* | tap | inspect.mode | inspect.maxDistance |
|
|
47
|
+
* | point-select | always `"xy"` | `POINT_SELECT_NEAREST_MAX_DISTANCE_PX` |
|
|
48
|
+
*
|
|
49
|
+
* Returns null when hover/tap has no inspect snapshot (nothing to resolve).
|
|
50
|
+
*/
|
|
51
|
+
export declare function targetSearch(intent: TargetIntent, inspect: TargetInspectPolicy): TargetSearch | null;
|
|
52
|
+
/**
|
|
53
|
+
* The one representation of "the thing under the pointer" at resolve time.
|
|
54
|
+
* `match` is the full CandidateMatch so setInspection / semantic-keys keep
|
|
55
|
+
* working without a second store lookup. Panel bounds come from the same
|
|
56
|
+
* viewport panel that scoped the nearest call.
|
|
57
|
+
*/
|
|
58
|
+
export type ResolvedTarget = {
|
|
59
|
+
readonly epoch: number;
|
|
60
|
+
readonly candidateId: number;
|
|
61
|
+
readonly panelId: string;
|
|
62
|
+
readonly point: PlotPoint;
|
|
63
|
+
readonly mode: ResolvedCandidateInspectMode;
|
|
64
|
+
readonly distance: number;
|
|
65
|
+
readonly match: CandidateMatch;
|
|
66
|
+
readonly panel: PanelBounds & {
|
|
67
|
+
readonly id: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export type ResolveTargetInput = {
|
|
71
|
+
readonly model: RenderModel;
|
|
72
|
+
readonly point: PlotPoint;
|
|
73
|
+
readonly intent: TargetIntent;
|
|
74
|
+
/**
|
|
75
|
+
* Inspect policy for hover/tap. Ignored for point-select (uses the table).
|
|
76
|
+
* Pass the pure-table snapshot when the gesture already captured mode /
|
|
77
|
+
* maxDistance so callers do not re-read live config.
|
|
78
|
+
*/
|
|
79
|
+
readonly inspect: TargetInspectPolicy;
|
|
80
|
+
/**
|
|
81
|
+
* Optional explicit search override. When set, skips `targetSearch` and
|
|
82
|
+
* uses these params — for callers that already snapshotted mode/maxDistance
|
|
83
|
+
* onto a pure action payload.
|
|
84
|
+
*/
|
|
85
|
+
readonly search?: TargetSearch;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Panel-scoped nearest for one intent. Sole call site of
|
|
89
|
+
* `panelAtOrOnly().nearest()` for hover / tap / point-select.
|
|
90
|
+
*/
|
|
91
|
+
export declare function resolveTarget(input: ResolveTargetInput): ResolvedTarget | null;
|