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