@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,117 @@
|
|
|
1
|
+
import { boundsEditorInputForScale } from "./precise-bounds.js";
|
|
2
|
+
function temporalKindForAxis(model, axis) {
|
|
3
|
+
for (const plan of model.guidePlans) {
|
|
4
|
+
if (plan.type === "axis" && plan.aesthetic === axis)
|
|
5
|
+
return plan.temporalKind;
|
|
6
|
+
}
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
function zoomBoundsEditorInput(deps, model, editor, temporalKind) {
|
|
10
|
+
const viewportPanel = model.viewport.panels[0];
|
|
11
|
+
if (viewportPanel === undefined)
|
|
12
|
+
return null;
|
|
13
|
+
const scale = viewportPanel.axisEditModel(editor.axis);
|
|
14
|
+
if (scale.kind === "band")
|
|
15
|
+
return null;
|
|
16
|
+
const bounds = deps.effectiveZoomDomains()?.[editor.axis] ?? scale.domain;
|
|
17
|
+
return boundsEditorInputForScale({
|
|
18
|
+
axis: editor.axis,
|
|
19
|
+
action: "zoom",
|
|
20
|
+
scale,
|
|
21
|
+
bounds,
|
|
22
|
+
temporalKind,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function selectionBoundsEditorInput(deps, model, editor, temporalKind) {
|
|
26
|
+
const record = deps.currentIntervalRecord();
|
|
27
|
+
const targetPanelId = record?.panelId ?? editor.panelId;
|
|
28
|
+
if (targetPanelId === undefined)
|
|
29
|
+
return null;
|
|
30
|
+
const viewportPanel = model.viewport.panel(targetPanelId);
|
|
31
|
+
if (viewportPanel === null)
|
|
32
|
+
return null;
|
|
33
|
+
const scale = viewportPanel.axisEditModel(editor.axis);
|
|
34
|
+
const semantic = record?.domains[editor.axis];
|
|
35
|
+
const bounds = semantic?.kind === "band"
|
|
36
|
+
? [semantic.values[0] ?? "", semantic.values.at(-1) ?? ""]
|
|
37
|
+
: semantic?.domain;
|
|
38
|
+
return boundsEditorInputForScale({
|
|
39
|
+
axis: editor.axis,
|
|
40
|
+
action: "select",
|
|
41
|
+
scale,
|
|
42
|
+
temporalKind,
|
|
43
|
+
...(bounds !== undefined && { bounds }),
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function resolveBoundsEditorInput(deps, editor) {
|
|
47
|
+
const model = deps.model();
|
|
48
|
+
if (editor === null || model === null)
|
|
49
|
+
return null;
|
|
50
|
+
const temporalKind = temporalKindForAxis(model, editor.axis);
|
|
51
|
+
return editor.action === "zoom"
|
|
52
|
+
? zoomBoundsEditorInput(deps, model, editor, temporalKind)
|
|
53
|
+
: selectionBoundsEditorInput(deps, model, editor, temporalKind);
|
|
54
|
+
}
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
// Factory
|
|
57
|
+
// ---------------------------------------------------------------------------
|
|
58
|
+
export function createIntervalBoundsEditor(deps) {
|
|
59
|
+
let boundsEditor = $state(null);
|
|
60
|
+
let boundsReturnFocus = $state(null);
|
|
61
|
+
const boundsEditorInput = $derived.by(() => resolveBoundsEditorInput(deps, boundsEditor));
|
|
62
|
+
$effect(() => {
|
|
63
|
+
if (boundsEditor === null || boundsEditorInput !== null)
|
|
64
|
+
return;
|
|
65
|
+
const target = boundsEditor.panelLabel ?? "the target panel";
|
|
66
|
+
boundsEditor = null;
|
|
67
|
+
boundsReturnFocus = null;
|
|
68
|
+
// The original button may have been reused for a different panel. The
|
|
69
|
+
// capture surface is the stable recovery target for reactive cancellation;
|
|
70
|
+
// explicit Apply/Cancel still restores the initiating button.
|
|
71
|
+
queueMicrotask(() => {
|
|
72
|
+
deps.captureSurface()?.focus();
|
|
73
|
+
deps.announce(`Bounds editing cancelled because ${target} is no longer available.`);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
function openBoundsEditor(action, axis, trigger) {
|
|
77
|
+
boundsReturnFocus = trigger;
|
|
78
|
+
if (action === "select") {
|
|
79
|
+
const model = deps.model();
|
|
80
|
+
const panel = deps.currentIntervalRecord() === null
|
|
81
|
+
? (() => {
|
|
82
|
+
const inspectionTarget = deps.inspectionPanel();
|
|
83
|
+
if (inspectionTarget !== null && model !== null) {
|
|
84
|
+
return model.scene.panels.find((candidate) => candidate.id === inspectionTarget.id);
|
|
85
|
+
}
|
|
86
|
+
return model?.scene.panels[0];
|
|
87
|
+
})()
|
|
88
|
+
: deps.currentIntervalPanel();
|
|
89
|
+
if (panel === undefined || panel === null)
|
|
90
|
+
return;
|
|
91
|
+
boundsEditor = {
|
|
92
|
+
action,
|
|
93
|
+
axis,
|
|
94
|
+
panelId: panel.id,
|
|
95
|
+
panelLabel: deps.intervalPanelLabel(panel),
|
|
96
|
+
};
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
boundsEditor = { action, axis };
|
|
100
|
+
}
|
|
101
|
+
function cancel() {
|
|
102
|
+
boundsEditor = null;
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
get boundsEditor() {
|
|
106
|
+
return boundsEditor;
|
|
107
|
+
},
|
|
108
|
+
get boundsEditorInput() {
|
|
109
|
+
return boundsEditorInput;
|
|
110
|
+
},
|
|
111
|
+
get boundsReturnFocus() {
|
|
112
|
+
return boundsReturnFocus;
|
|
113
|
+
},
|
|
114
|
+
openBoundsEditor,
|
|
115
|
+
cancel,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure helpers extracted from interval-state for S5.
|
|
3
|
+
*
|
|
4
|
+
* No factory capture: every function takes its inputs as arguments and reads
|
|
5
|
+
* no reactive state. Consumed by interval-state.svelte.ts.
|
|
6
|
+
*/
|
|
7
|
+
import { type SemanticViewportSelection } from "@ggts-sh/core";
|
|
8
|
+
import type { ReadonlyIntervalDomains } from "../interaction/interaction.js";
|
|
9
|
+
export declare function facetIdentityValueLabel(encodedValue: string): string;
|
|
10
|
+
export declare function viewportSelection(domains: ReadonlyIntervalDomains): SemanticViewportSelection;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure helpers extracted from interval-state for S5.
|
|
3
|
+
*
|
|
4
|
+
* No factory capture: every function takes its inputs as arguments and reads
|
|
5
|
+
* no reactive state. Consumed by interval-state.svelte.ts.
|
|
6
|
+
*/
|
|
7
|
+
import { decodeKey } from "@ggts-sh/core";
|
|
8
|
+
export function facetIdentityValueLabel(encodedValue) {
|
|
9
|
+
const value = decodeKey(encodedValue);
|
|
10
|
+
const kind = value instanceof Date
|
|
11
|
+
? "date"
|
|
12
|
+
: value === null
|
|
13
|
+
? "null"
|
|
14
|
+
: typeof value === "string"
|
|
15
|
+
? "text"
|
|
16
|
+
: typeof value;
|
|
17
|
+
const display = value instanceof Date ? value.toISOString() : String(value);
|
|
18
|
+
return `${kind} ${display}`;
|
|
19
|
+
}
|
|
20
|
+
function semanticViewportAxisSelection(semantic) {
|
|
21
|
+
return semantic === undefined
|
|
22
|
+
? undefined
|
|
23
|
+
: semantic.kind === "band"
|
|
24
|
+
? { kind: "band", keys: semantic.values }
|
|
25
|
+
: { kind: "continuous", domain: semantic.domain };
|
|
26
|
+
}
|
|
27
|
+
export function viewportSelection(domains) {
|
|
28
|
+
const x = semanticViewportAxisSelection(domains.x);
|
|
29
|
+
const y = semanticViewportAxisSelection(domains.y);
|
|
30
|
+
return {
|
|
31
|
+
...(x !== undefined && { x }),
|
|
32
|
+
...(y !== undefined && { y }),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { InteractionContext } from "../interaction/interaction-context.svelte.js";
|
|
2
|
+
import type { InteractionSource, IntervalSelection, PlotInteractionInterval, PlotSelection } from "../interaction/interaction.js";
|
|
3
|
+
import type { BoundsEditorInput, PreciseBoundsApplyEvent } from "./bounds-editor.js";
|
|
4
|
+
import { type ContinuousZoomDomains } from "../scene/geometry.js";
|
|
5
|
+
import { type IntervalConsumptionCandidate } from "./consumption.js";
|
|
6
|
+
/**
|
|
7
|
+
* Interval-specific ports beyond the shared InteractionContext. Sibling
|
|
8
|
+
* controllers are wired by the assembly (interaction-states.svelte.ts).
|
|
9
|
+
*/
|
|
10
|
+
export type IntervalStateOptions = {
|
|
11
|
+
/** Alias over the zoom controller (construction-safe). */
|
|
12
|
+
readonly effectiveZoomDomains: () => ContinuousZoomDomains | null;
|
|
13
|
+
/** Zoom controller write path for the bounds-editor zoom branch (stable fn). */
|
|
14
|
+
readonly commitZoom: (domains: ContinuousZoomDomains | null, source: InteractionSource) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Deferred semantic Candidate view for non-union interval consumption.
|
|
17
|
+
* Projection ownership stays outside interval behavior.
|
|
18
|
+
*/
|
|
19
|
+
readonly consumptionCandidates: () => readonly IntervalConsumptionCandidate<PropertyKey>[];
|
|
20
|
+
/**
|
|
21
|
+
* Handler-only: `openBoundsEditor` select branch reads the inspection
|
|
22
|
+
* controller's panel id as its fallback target.
|
|
23
|
+
*/
|
|
24
|
+
readonly inspectionPanel: () => Readonly<{
|
|
25
|
+
id: string;
|
|
26
|
+
}> | null;
|
|
27
|
+
/** Selection controller write path (stable fn). */
|
|
28
|
+
readonly emitSelection: (event: PlotSelection) => void;
|
|
29
|
+
};
|
|
30
|
+
export type IntervalState = {
|
|
31
|
+
readonly committedInterval: IntervalSelection | null;
|
|
32
|
+
readonly effectiveIntervals: readonly PlotInteractionInterval<PropertyKey>[];
|
|
33
|
+
readonly effectiveIntervalKeys: readonly PropertyKey[];
|
|
34
|
+
readonly currentIntervalTargetLabel: string | undefined;
|
|
35
|
+
readonly boundsEditorInput: BoundsEditorInput | null;
|
|
36
|
+
readonly boundsReturnFocus: HTMLElement | null;
|
|
37
|
+
/**
|
|
38
|
+
* Narrow boolean for ToolRail `canSetIntervalBounds` — equivalent to
|
|
39
|
+
* `currentIntervalRecord === null || currentIntervalPanel !== undefined`.
|
|
40
|
+
* Does NOT expose the private record/panel deriveds.
|
|
41
|
+
*/
|
|
42
|
+
readonly intervalBoundsTargetAvailable: boolean;
|
|
43
|
+
clearIntervalSelection(source: InteractionSource): void;
|
|
44
|
+
clearCurrentPanelInterval(source: InteractionSource): void;
|
|
45
|
+
/**
|
|
46
|
+
* Brush select-end: commit writes (committedInterval + conditional record)
|
|
47
|
+
* then emit. Snapshots `selectConfig()?.persistent` once. Always emits the
|
|
48
|
+
* end event (including non-persistent) so callers need no post-hook emit.
|
|
49
|
+
*/
|
|
50
|
+
finishBrushSelect(eventValue: IntervalSelection, source: InteractionSource): void;
|
|
51
|
+
openBoundsEditor(action: "select" | "zoom", axis: "x" | "y", trigger: HTMLElement): void;
|
|
52
|
+
applyPreciseBounds(event: PreciseBoundsApplyEvent): void;
|
|
53
|
+
cancelBoundsEditor(): void;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Create the interval-selection controller. Both effects register at
|
|
57
|
+
* construction (original host positions relative to the runtime model effects
|
|
58
|
+
* and the later semantic-key diagnostics effects).
|
|
59
|
+
*/
|
|
60
|
+
export declare function createIntervalState(context: InteractionContext, options: IntervalStateOptions): IntervalState;
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interval-selection controller extracted from GGPlot for S5.
|
|
3
|
+
*
|
|
4
|
+
* Owns committedInterval / committedIntervalRecord, the interval ScopedStore
|
|
5
|
+
* (local vs controller records), construction-time deriveds
|
|
6
|
+
* (effectiveIntervals, effectiveIntervalKeys, currentInterval* family,
|
|
7
|
+
* intervalBoundsTargetAvailable), the interval-reconcile effect, private
|
|
8
|
+
* helpers, and the public clear/commit/bounds methods. The bounds-editor
|
|
9
|
+
* state machine (boundsEditor, boundsReturnFocus, boundsEditorInput, cancel
|
|
10
|
+
* effect, open/cancel actions) lives in interval-bounds-state.svelte.ts;
|
|
11
|
+
* pure helpers live in interval-state-helpers.ts.
|
|
12
|
+
*
|
|
13
|
+
* Construction-time deriveds may legitimately read model / effectiveZoomDomains
|
|
14
|
+
* (factory sits after the runtime). Armed later-declared / handler-only deps
|
|
15
|
+
* for the construction guard: emitSelection, commitZoom, announce,
|
|
16
|
+
* inspectionPanel, candidateSemanticKeys.
|
|
17
|
+
*
|
|
18
|
+
* The host constructs semantic-key resolution before this factory
|
|
19
|
+
* (construction-order convention; deriveds are lazy at the 5.33.1 floor, so
|
|
20
|
+
* interval projection evaluates on first read, not at construction).
|
|
21
|
+
* Semantic diagnostics retain their later effect-registration position
|
|
22
|
+
* through the service's phased `registerEffects()` API (#165).
|
|
23
|
+
*/
|
|
24
|
+
import { encodeKey } from "@ggts-sh/core";
|
|
25
|
+
import { createIntervalScopedStore } from "../interaction/scoped-store.svelte.js";
|
|
26
|
+
import { frozenZoomDomains } from "../scene/geometry.js";
|
|
27
|
+
import { buildIntervalSelection, clearIntervalSelectionEvent, persistentSelectionOrNull, } from "./interval.js";
|
|
28
|
+
import { consumeIntervalKeys, recomputePanelIntervalFromLookup, sameIntervalRecord, } from "./consumption.js";
|
|
29
|
+
import { semanticAxisFromBounds } from "./precise-bounds.js";
|
|
30
|
+
import { facetIdentityValueLabel, viewportSelection } from "./interval-state-helpers.js";
|
|
31
|
+
import { createIntervalBoundsEditor } from "./interval-bounds-state.svelte.js";
|
|
32
|
+
// ---------------------------------------------------------------------------
|
|
33
|
+
// Factory
|
|
34
|
+
// ---------------------------------------------------------------------------
|
|
35
|
+
/**
|
|
36
|
+
* Create the interval-selection controller. Both effects register at
|
|
37
|
+
* construction (original host positions relative to the runtime model effects
|
|
38
|
+
* and the later semantic-key diagnostics effects).
|
|
39
|
+
*/
|
|
40
|
+
export function createIntervalState(context, options) {
|
|
41
|
+
let committedInterval = $state(null);
|
|
42
|
+
// Semantic snapshot of the record backing `committedInterval`, so external
|
|
43
|
+
// same-panel replacements are detected by content, not just presence.
|
|
44
|
+
let committedIntervalRecord = $state(null);
|
|
45
|
+
const committedIntervals = createIntervalScopedStore({
|
|
46
|
+
controller: context.interaction,
|
|
47
|
+
scope: context.resolvedInteractionScope,
|
|
48
|
+
});
|
|
49
|
+
const effectiveIntervals = $derived(committedIntervals.value);
|
|
50
|
+
const effectiveIntervalKeys = $derived.by(() => {
|
|
51
|
+
const model = context.model();
|
|
52
|
+
if (model === null || effectiveIntervals.length === 0)
|
|
53
|
+
return [];
|
|
54
|
+
// Union consumes only stored record keys, and this derived re-runs on
|
|
55
|
+
// every controller revision — skip the O(candidates) semantic projection
|
|
56
|
+
// whenever the preset never reads it.
|
|
57
|
+
const preset = effectiveIntervals[0]?.preset;
|
|
58
|
+
if (preset === "union")
|
|
59
|
+
return consumeIntervalKeys({
|
|
60
|
+
records: effectiveIntervals,
|
|
61
|
+
panels: model.scene.panels,
|
|
62
|
+
candidates: [],
|
|
63
|
+
});
|
|
64
|
+
return consumeIntervalKeys({
|
|
65
|
+
records: effectiveIntervals,
|
|
66
|
+
panels: model.scene.panels,
|
|
67
|
+
candidates: options.consumptionCandidates(),
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
const currentIntervalRecord = $derived.by(() => {
|
|
71
|
+
const intervalPanelId = committedInterval?.panelId;
|
|
72
|
+
return ((intervalPanelId === null || intervalPanelId === undefined
|
|
73
|
+
? undefined
|
|
74
|
+
: effectiveIntervals.find((record) => record.panelId === intervalPanelId)) ??
|
|
75
|
+
effectiveIntervals[0] ??
|
|
76
|
+
null);
|
|
77
|
+
});
|
|
78
|
+
const currentIntervalPanel = $derived.by(() => {
|
|
79
|
+
const model = context.model();
|
|
80
|
+
if (currentIntervalRecord === null || model === null) {
|
|
81
|
+
// Explicit undefined keeps consistent-return happy on the .ts surface
|
|
82
|
+
// (host .svelte used bare `return`; type-aware lint only runs on .ts).
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
return model.scene.panels.find((candidate) => candidate.id === currentIntervalRecord.panelId);
|
|
86
|
+
});
|
|
87
|
+
// A shared controller can clear or replace this chart's interval from
|
|
88
|
+
// outside (a linked plot, programmatic reconcile). The local pixel
|
|
89
|
+
// rectangle must not outlive its semantic record — including a same-panel
|
|
90
|
+
// record whose domains or keys were replaced under it.
|
|
91
|
+
$effect(() => {
|
|
92
|
+
const current = committedInterval;
|
|
93
|
+
if (current === null)
|
|
94
|
+
return;
|
|
95
|
+
const record = effectiveIntervals.find((candidate) => candidate.panelId === current.panelId);
|
|
96
|
+
if (record !== undefined &&
|
|
97
|
+
(committedIntervalRecord === null || sameIntervalRecord(committedIntervalRecord, record)))
|
|
98
|
+
return;
|
|
99
|
+
committedInterval = null;
|
|
100
|
+
committedIntervalRecord = null;
|
|
101
|
+
});
|
|
102
|
+
function intervalPanelLabel(panel) {
|
|
103
|
+
const display = panel.strip.trim() || "panel";
|
|
104
|
+
const model = context.model();
|
|
105
|
+
if (model === null ||
|
|
106
|
+
model.scene.panels.filter((candidate) => candidate.strip.trim() === panel.strip.trim())
|
|
107
|
+
.length < 2)
|
|
108
|
+
return display;
|
|
109
|
+
const identity = panel.identity.values
|
|
110
|
+
.map((value) => `${value.field}: ${facetIdentityValueLabel(value.encodedValue)}`)
|
|
111
|
+
.join(", ");
|
|
112
|
+
return identity.length > 0 ? `${display} (${identity})` : display;
|
|
113
|
+
}
|
|
114
|
+
const currentIntervalTargetLabel = $derived.by(() => {
|
|
115
|
+
if (currentIntervalRecord === null || context.model() === null) {
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
if (currentIntervalPanel === undefined)
|
|
119
|
+
return "unavailable panel";
|
|
120
|
+
if (currentIntervalPanel.strip.trim().length === 0 &&
|
|
121
|
+
currentIntervalPanel.identity.values.length === 0) {
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
return intervalPanelLabel(currentIntervalPanel);
|
|
125
|
+
});
|
|
126
|
+
const intervalBoundsTargetAvailable = $derived(currentIntervalRecord === null || currentIntervalPanel !== undefined);
|
|
127
|
+
const bounds = createIntervalBoundsEditor({
|
|
128
|
+
model: context.model,
|
|
129
|
+
captureSurface: context.captureSurface,
|
|
130
|
+
announce: context.announce,
|
|
131
|
+
effectiveZoomDomains: options.effectiveZoomDomains,
|
|
132
|
+
currentIntervalRecord: () => currentIntervalRecord,
|
|
133
|
+
currentIntervalPanel: () => currentIntervalPanel,
|
|
134
|
+
inspectionPanel: options.inspectionPanel,
|
|
135
|
+
intervalPanelLabel,
|
|
136
|
+
});
|
|
137
|
+
function clearIntervalSelection(source) {
|
|
138
|
+
const current = committedInterval;
|
|
139
|
+
if (current === null && effectiveIntervals.length === 0)
|
|
140
|
+
return;
|
|
141
|
+
committedIntervals.clear(source);
|
|
142
|
+
const event = clearIntervalSelectionEvent(current ?? {
|
|
143
|
+
mode: context.selectConfig()?.mode ?? "xy",
|
|
144
|
+
panelId: null,
|
|
145
|
+
pixels: { x0: 0, y0: 0, x1: 0, y1: 0 },
|
|
146
|
+
}, source);
|
|
147
|
+
committedInterval = null;
|
|
148
|
+
committedIntervalRecord = null;
|
|
149
|
+
options.emitSelection(event);
|
|
150
|
+
}
|
|
151
|
+
function clearCurrentPanelInterval(source) {
|
|
152
|
+
const intervalPanelId = committedInterval?.panelId ?? currentIntervalRecord?.panelId;
|
|
153
|
+
if (intervalPanelId === null || intervalPanelId === undefined)
|
|
154
|
+
return;
|
|
155
|
+
committedIntervals.remove(intervalPanelId, source);
|
|
156
|
+
const event = clearIntervalSelectionEvent(committedInterval ?? {
|
|
157
|
+
mode: context.selectConfig()?.mode ?? "xy",
|
|
158
|
+
panelId: intervalPanelId,
|
|
159
|
+
pixels: { x0: 0, y0: 0, x1: 0, y1: 0 },
|
|
160
|
+
}, source);
|
|
161
|
+
committedInterval = null;
|
|
162
|
+
committedIntervalRecord = null;
|
|
163
|
+
options.emitSelection(event);
|
|
164
|
+
}
|
|
165
|
+
function semanticAxis(panelId, axis, axisBounds) {
|
|
166
|
+
if (axisBounds === undefined || context.model() === null)
|
|
167
|
+
return undefined;
|
|
168
|
+
const viewportPanel = context.model().viewport.panel(panelId);
|
|
169
|
+
if (viewportPanel === null)
|
|
170
|
+
return undefined;
|
|
171
|
+
const scale = viewportPanel.axisEditModel(axis);
|
|
172
|
+
if (scale.kind === "band") {
|
|
173
|
+
const values = scale.slice(axisBounds);
|
|
174
|
+
if (values === undefined)
|
|
175
|
+
return undefined;
|
|
176
|
+
return Object.freeze({
|
|
177
|
+
kind: "band",
|
|
178
|
+
values: Object.freeze(values.map((value) => encodeKey(value))),
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
return semanticAxisFromBounds(scale.type, scale.transform, [
|
|
182
|
+
Number(axisBounds[0]),
|
|
183
|
+
Number(axisBounds[1]),
|
|
184
|
+
]);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* One full-store pass for precise-bounds apply: semantic keys + lineage row
|
|
188
|
+
* count for the target panel/domains. Domain-filters before lineage
|
|
189
|
+
* expansion and expands each lineage id once among matches (shared smooth /
|
|
190
|
+
* aggregate bags — not once per mark).
|
|
191
|
+
*/
|
|
192
|
+
function recomputePanelIntervalSelection(targetPanelId, domains) {
|
|
193
|
+
const model = context.model();
|
|
194
|
+
if (model === null)
|
|
195
|
+
return { keys: Object.freeze([]), lineageCount: 0 };
|
|
196
|
+
return recomputePanelIntervalFromLookup({
|
|
197
|
+
panelId: targetPanelId,
|
|
198
|
+
domains,
|
|
199
|
+
size: model.candidates.size,
|
|
200
|
+
candidate: (id) => {
|
|
201
|
+
const candidate = model.candidates.candidate(id);
|
|
202
|
+
if (candidate === null)
|
|
203
|
+
return null;
|
|
204
|
+
return {
|
|
205
|
+
panelId: candidate.panelId,
|
|
206
|
+
xValue: candidate.xValue,
|
|
207
|
+
yValue: candidate.yValue,
|
|
208
|
+
lineage: candidate.lineage,
|
|
209
|
+
rowIndex: candidate.rowIndex,
|
|
210
|
+
// Lazy: pay key resolution only after domain membership passes.
|
|
211
|
+
get keys() {
|
|
212
|
+
return context.candidateSemanticKeys(candidate);
|
|
213
|
+
},
|
|
214
|
+
};
|
|
215
|
+
},
|
|
216
|
+
lineageKeys: (lineageId) => model.lineage.keys(lineageId),
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
/** Private — no remaining external consumer (codex P2-7). */
|
|
220
|
+
function commitIntervalSelection(event, source) {
|
|
221
|
+
const targetPanelId = event.panelId;
|
|
222
|
+
if (targetPanelId === null || context.model() === null)
|
|
223
|
+
return;
|
|
224
|
+
const model = context.model();
|
|
225
|
+
if (model.viewport.panel(targetPanelId) === null)
|
|
226
|
+
return;
|
|
227
|
+
const x = semanticAxis(targetPanelId, "x", event.domain.x);
|
|
228
|
+
const y = semanticAxis(targetPanelId, "y", event.domain.y);
|
|
229
|
+
// An empty facet panel trains no band domain, so no semantic axis
|
|
230
|
+
// survives the selection mode. The controller rejects axis-less
|
|
231
|
+
// intervals (TypeError) — treat the brush as an empty selection.
|
|
232
|
+
if (x === undefined && y === undefined)
|
|
233
|
+
return;
|
|
234
|
+
const record = Object.freeze({
|
|
235
|
+
panelId: targetPanelId,
|
|
236
|
+
preset: context.selectConfig()?.preset ?? "independent",
|
|
237
|
+
domains: Object.freeze({
|
|
238
|
+
...(x !== undefined && { x }),
|
|
239
|
+
...(y !== undefined && { y }),
|
|
240
|
+
}),
|
|
241
|
+
keys: Object.freeze([...event.keys]),
|
|
242
|
+
});
|
|
243
|
+
committedIntervalRecord = record;
|
|
244
|
+
committedIntervals.upsert(record, source);
|
|
245
|
+
}
|
|
246
|
+
function finishBrushSelect(eventValue, source) {
|
|
247
|
+
// Snapshot once (drift-safe under reactive selectConfig replacement).
|
|
248
|
+
const persistent = context.selectConfig()?.persistent;
|
|
249
|
+
committedInterval = persistentSelectionOrNull(persistent, eventValue);
|
|
250
|
+
// TRUTHY guard — untyped JS consumers may pass truthy non-boolean
|
|
251
|
+
// `persistent` values, which the config normalizer forwards unchanged.
|
|
252
|
+
// `?? false` only maps nullish (already falsy) values, so runtime
|
|
253
|
+
// truthiness is identical.
|
|
254
|
+
if (persistent ?? false)
|
|
255
|
+
commitIntervalSelection(eventValue, source);
|
|
256
|
+
// Emit after writes so listeners observe committed state (load-bearing).
|
|
257
|
+
options.emitSelection(eventValue);
|
|
258
|
+
}
|
|
259
|
+
function applyPreciseZoomBounds(event) {
|
|
260
|
+
if (event.scale === "band")
|
|
261
|
+
return;
|
|
262
|
+
options.commitZoom(frozenZoomDomains({
|
|
263
|
+
...options.effectiveZoomDomains(),
|
|
264
|
+
[event.axis]: [...event.bounds],
|
|
265
|
+
}), event.inputSource);
|
|
266
|
+
bounds.cancel();
|
|
267
|
+
}
|
|
268
|
+
function applyPreciseSelectionBounds(event) {
|
|
269
|
+
const prior = currentIntervalRecord;
|
|
270
|
+
const targetPanelId = prior?.panelId ?? bounds.boundsEditor?.panelId;
|
|
271
|
+
if (targetPanelId === null || targetPanelId === undefined || context.model() === null)
|
|
272
|
+
return;
|
|
273
|
+
const model = context.model();
|
|
274
|
+
if (model.viewport.panel(targetPanelId) === null)
|
|
275
|
+
return;
|
|
276
|
+
const axis = semanticAxis(targetPanelId, event.axis, event.bounds);
|
|
277
|
+
if (axis === undefined)
|
|
278
|
+
return;
|
|
279
|
+
const domains = Object.freeze({
|
|
280
|
+
...prior?.domains,
|
|
281
|
+
[event.axis]: axis,
|
|
282
|
+
});
|
|
283
|
+
// Keys + lineageCount from one candidate-store pass (not consumption then
|
|
284
|
+
// a second lineage scan).
|
|
285
|
+
const { keys, lineageCount } = recomputePanelIntervalSelection(targetPanelId, domains);
|
|
286
|
+
const next = Object.freeze({
|
|
287
|
+
panelId: targetPanelId,
|
|
288
|
+
preset: prior?.preset ?? context.selectConfig()?.preset ?? "independent",
|
|
289
|
+
domains,
|
|
290
|
+
keys,
|
|
291
|
+
});
|
|
292
|
+
// Precise bounds persist exactly like the brush path: with
|
|
293
|
+
// `persistent: false` the end event still fires, but no durable record,
|
|
294
|
+
// committed rectangle, or clear-selection controls appear.
|
|
295
|
+
const persistent = context.selectConfig()?.persistent === true;
|
|
296
|
+
if (persistent) {
|
|
297
|
+
committedIntervalRecord = next;
|
|
298
|
+
committedIntervals.upsert(next, event.inputSource);
|
|
299
|
+
}
|
|
300
|
+
const viewportPanel = model.viewport.panel(targetPanelId);
|
|
301
|
+
if (viewportPanel === null)
|
|
302
|
+
return;
|
|
303
|
+
const selection = viewportSelection(domains);
|
|
304
|
+
const eventValue = buildIntervalSelection({
|
|
305
|
+
phase: "end",
|
|
306
|
+
mode: context.selectConfig()?.mode ?? "xy",
|
|
307
|
+
panelId: targetPanelId,
|
|
308
|
+
domain: viewportPanel.resolve(selection),
|
|
309
|
+
// The overlay must depict the interval that was actually applied, so
|
|
310
|
+
// project the edited domains back into pixels rather than reusing the
|
|
311
|
+
// pre-edit rectangle (or defaulting to the whole panel).
|
|
312
|
+
pixels: viewportPanel.project(selection),
|
|
313
|
+
keys,
|
|
314
|
+
lineageCount,
|
|
315
|
+
source: event.inputSource,
|
|
316
|
+
});
|
|
317
|
+
committedInterval = persistentSelectionOrNull(context.selectConfig()?.persistent, eventValue);
|
|
318
|
+
options.emitSelection(eventValue);
|
|
319
|
+
bounds.cancel();
|
|
320
|
+
}
|
|
321
|
+
function applyPreciseBounds(event) {
|
|
322
|
+
if (event.action === "zoom")
|
|
323
|
+
applyPreciseZoomBounds(event);
|
|
324
|
+
else
|
|
325
|
+
applyPreciseSelectionBounds(event);
|
|
326
|
+
}
|
|
327
|
+
return {
|
|
328
|
+
get committedInterval() {
|
|
329
|
+
return committedInterval;
|
|
330
|
+
},
|
|
331
|
+
get effectiveIntervals() {
|
|
332
|
+
return effectiveIntervals;
|
|
333
|
+
},
|
|
334
|
+
get effectiveIntervalKeys() {
|
|
335
|
+
return effectiveIntervalKeys;
|
|
336
|
+
},
|
|
337
|
+
get currentIntervalTargetLabel() {
|
|
338
|
+
return currentIntervalTargetLabel;
|
|
339
|
+
},
|
|
340
|
+
get boundsEditorInput() {
|
|
341
|
+
return bounds.boundsEditorInput;
|
|
342
|
+
},
|
|
343
|
+
get boundsReturnFocus() {
|
|
344
|
+
return bounds.boundsReturnFocus;
|
|
345
|
+
},
|
|
346
|
+
get intervalBoundsTargetAvailable() {
|
|
347
|
+
return intervalBoundsTargetAvailable;
|
|
348
|
+
},
|
|
349
|
+
clearIntervalSelection,
|
|
350
|
+
clearCurrentPanelInterval,
|
|
351
|
+
finishBrushSelect,
|
|
352
|
+
openBoundsEditor: (...args) => {
|
|
353
|
+
bounds.openBoundsEditor(...args);
|
|
354
|
+
},
|
|
355
|
+
applyPreciseBounds,
|
|
356
|
+
cancelBoundsEditor: () => {
|
|
357
|
+
bounds.cancel();
|
|
358
|
+
},
|
|
359
|
+
};
|
|
360
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BRUSH_MIN_SPAN_PX, persistentSelectionOrNull, isBrushTooSmall, filterDomainBySelectMode, freezeIntervalDomain, buildIntervalSelection, clearIntervalSelectionEvent, lineageRowIndexesFromCandidates, intervalSelectionFromRows, } from "@ggts-sh/core/interaction";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// Shared pure behavior used by React and Svelte.
|
|
2
|
+
export { BRUSH_MIN_SPAN_PX, persistentSelectionOrNull, isBrushTooSmall, filterDomainBySelectMode, freezeIntervalDomain, buildIntervalSelection, clearIntervalSelectionEvent, lineageRowIndexesFromCandidates, intervalSelectionFromRows, } from "@ggts-sh/core/interaction";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { boundsEditorInputForScale, semanticAxisFromBounds } from "@ggts-sh/core/interaction";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type IntervalQueryScene, intervalQuerySceneFromModel, resolveIntervalQueryParts, buildIntervalSelectionFromScene, } from "@ggts-sh/core/interaction";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* <Labs> — declaration-only labels layer for <GGPlot> (#659 slice 6).
|
|
4
|
+
* The whole Labs surface: title, subtitle, caption, and the per-aesthetic
|
|
5
|
+
* titles (x, y, color, fill, size, linewidth, alpha, shape, linetype).
|
|
6
|
+
*
|
|
7
|
+
* No separate escape hatch: Labs is a flat bag of strings, so
|
|
8
|
+
* `<Labs {...computed} />` already covers the computed case.
|
|
9
|
+
*
|
|
10
|
+
* labs is a keyed-MERGE family — two <Labs> children merge key-by-key rather
|
|
11
|
+
* than the second replacing the first. Two children setting the SAME key
|
|
12
|
+
* emit a DUPLICATE_MERGE_KEY advisory (the later one still wins).
|
|
13
|
+
*
|
|
14
|
+
* Emits NO markup; registers a live labs layer during component init and
|
|
15
|
+
* unregisters on destroy. Inert without a <GGPlot> ancestor.
|
|
16
|
+
*/
|
|
17
|
+
// Aliased deliberately: svelte-package emits `declare const Labs` for this
|
|
18
|
+
// component into Labs.svelte.d.ts, so a bare `import type { Labs }` here
|
|
19
|
+
// collides with it in every consumer's svelte-check.
|
|
20
|
+
import type { Labs as LabsSpec } from "@ggts-sh/spec";
|
|
21
|
+
|
|
22
|
+
import {
|
|
23
|
+
createPlotLayer,
|
|
24
|
+
definedProps,
|
|
25
|
+
} from "../layers/plot-layer.svelte.js";
|
|
26
|
+
|
|
27
|
+
const props: LabsSpec = $props();
|
|
28
|
+
createPlotLayer("labs", () => definedProps(props));
|
|
29
|
+
</script>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const Labs: import("svelte").Component<{
|
|
2
|
+
x?: string;
|
|
3
|
+
y?: string;
|
|
4
|
+
color?: string;
|
|
5
|
+
fill?: string;
|
|
6
|
+
size?: string;
|
|
7
|
+
linewidth?: string;
|
|
8
|
+
alpha?: string;
|
|
9
|
+
shape?: string;
|
|
10
|
+
linetype?: string;
|
|
11
|
+
caption?: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
subtitle?: string;
|
|
14
|
+
}, {}, "">;
|
|
15
|
+
type Labs = ReturnType<typeof Labs>;
|
|
16
|
+
export default Labs;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { foldPlotLayer } from "@ggts-sh/compose";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { GGPLOT_PROP_ORDER, GRAMMAR_DOC_URLS, GRAMMAR_FAMILIES, GRAMMAR_PROP_NAMES, MERGE_KEY_EMIT_ORDER, REPLACE_EMIT_ORDER, deprecatedGrammarPropPattern, grammarCodemodRules, grammarDocUrl, } from "@ggts-sh/compose";
|
|
2
|
+
export type { GrammarCodemodForm, MergeByKeyKind, ReplaceKind } from "@ggts-sh/compose";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GGPLOT_PROP_ORDER, GRAMMAR_DOC_URLS, GRAMMAR_FAMILIES, GRAMMAR_PROP_NAMES, MERGE_KEY_EMIT_ORDER, REPLACE_EMIT_ORDER, deprecatedGrammarPropPattern, grammarCodemodRules, grammarDocUrl, } from "@ggts-sh/compose";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|