@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,207 @@
|
|
|
1
|
+
import { pathData, pointShapeGeometry, resolveGlyphMark, resolvePathMark, resolvePointMark, resolveRectMark, resolveSegmentMark, themeVar, } from "@ggts-sh/core";
|
|
2
|
+
/** Panel-local box origin for a glyph anchor + box size (geom_label).
|
|
3
|
+
* Local twin of packages/core labelBoxOrigin — keep private; no new
|
|
4
|
+
* public core export for a Svelte-scene paint parity fix. */
|
|
5
|
+
function labelBoxOrigin(x, y, width, height, anchor, padding) {
|
|
6
|
+
let left = x - width / 2;
|
|
7
|
+
if (anchor === "start")
|
|
8
|
+
left = x - padding;
|
|
9
|
+
else if (anchor === "end")
|
|
10
|
+
left = x - width + padding;
|
|
11
|
+
return { x: left, y: y - height / 2 };
|
|
12
|
+
}
|
|
13
|
+
/** Keyboard-focus cap: point marks become focusable tooltip targets only
|
|
14
|
+
* up to this many marks per batch (a11y pass; beyond it, the canvas-style
|
|
15
|
+
* data-table strategy is the documented alternative). */
|
|
16
|
+
const FOCUSABLE_LIMIT = 100;
|
|
17
|
+
const NO_ROW = 0xffffffff;
|
|
18
|
+
const styleNumber = (value) => Math.round(value * 1_000_000) / 1_000_000;
|
|
19
|
+
export function createBatchPresentation(deps) {
|
|
20
|
+
const batch = $derived(deps.batch());
|
|
21
|
+
const theme = $derived(deps.theme());
|
|
22
|
+
const focusMask = $derived(deps.focusMask());
|
|
23
|
+
const focusable = $derived(deps.focusable());
|
|
24
|
+
const pointsFocusable = $derived(focusable && batch.kind === "points" && batch.rowIndex.length <= FOCUSABLE_LIMIT);
|
|
25
|
+
const ink = $derived(themeVar("ink", theme));
|
|
26
|
+
const accent = $derived(themeVar("accent", theme));
|
|
27
|
+
const points = $derived.by(() => {
|
|
28
|
+
if (batch.kind !== "points")
|
|
29
|
+
return [];
|
|
30
|
+
return Array.from({ length: batch.rowIndex.length }, (_, j) => {
|
|
31
|
+
const style = resolvePointMark(batch, j, ink);
|
|
32
|
+
const size = styleNumber(style.size);
|
|
33
|
+
const x = batch.positions[j * 2];
|
|
34
|
+
const y = batch.positions[j * 2 + 1];
|
|
35
|
+
return {
|
|
36
|
+
index: j,
|
|
37
|
+
x,
|
|
38
|
+
y,
|
|
39
|
+
fill: style.fill,
|
|
40
|
+
size,
|
|
41
|
+
alpha: styleNumber(style.alpha),
|
|
42
|
+
shape: style.shape,
|
|
43
|
+
// Rebuild geometry with display-rounded size so path `d` matches prior SSR.
|
|
44
|
+
geometry: pointShapeGeometry(style.shape, x, y, size),
|
|
45
|
+
row: batch.rowIndex[j] === NO_ROW ? null : batch.rowIndex[j],
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
const subpaths = $derived.by(() => {
|
|
50
|
+
if (batch.kind !== "paths")
|
|
51
|
+
return [];
|
|
52
|
+
const out = [];
|
|
53
|
+
const themeColors = { ink, accent };
|
|
54
|
+
for (let s = 0; s < batch.pathOffsets.length - 1; s++) {
|
|
55
|
+
const d = pathData(batch.positions, batch.pathOffsets[s], batch.pathOffsets[s + 1], batch.curve, batch.closed === true, batch.ringStarts);
|
|
56
|
+
if (d === "")
|
|
57
|
+
continue;
|
|
58
|
+
const style = resolvePathMark(batch, s, themeColors);
|
|
59
|
+
out.push({
|
|
60
|
+
index: s,
|
|
61
|
+
d,
|
|
62
|
+
stroke: style.stroke,
|
|
63
|
+
fill: style.fill,
|
|
64
|
+
linewidth: styleNumber(style.width),
|
|
65
|
+
alpha: styleNumber(style.alpha),
|
|
66
|
+
dasharray: style.dash.length === 0 ? undefined : style.dash.join(" "),
|
|
67
|
+
linecap: style.linecap,
|
|
68
|
+
linejoin: style.linejoin,
|
|
69
|
+
fillRule: batch.fillRule,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return out;
|
|
73
|
+
});
|
|
74
|
+
const rects = $derived.by(() => {
|
|
75
|
+
if (batch.kind !== "rects")
|
|
76
|
+
return [];
|
|
77
|
+
const themeColors = { accent, paper: themeVar("paper", theme), ink };
|
|
78
|
+
return Array.from({ length: batch.rects.length / 4 }, (_, j) => {
|
|
79
|
+
const style = resolveRectMark(batch, j, themeColors);
|
|
80
|
+
return {
|
|
81
|
+
index: j,
|
|
82
|
+
x: batch.rects[j * 4],
|
|
83
|
+
y: batch.rects[j * 4 + 1],
|
|
84
|
+
width: batch.rects[j * 4 + 2],
|
|
85
|
+
height: batch.rects[j * 4 + 3],
|
|
86
|
+
fill: style.fill,
|
|
87
|
+
stroke: style.stroke,
|
|
88
|
+
strokeWidth: style.strokeWidth,
|
|
89
|
+
alpha: styleNumber(style.alpha),
|
|
90
|
+
dasharray: style.dash.length === 0 ? undefined : style.dash.join(" "),
|
|
91
|
+
};
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
const segments = $derived.by(() => {
|
|
95
|
+
if (batch.kind !== "segments")
|
|
96
|
+
return [];
|
|
97
|
+
return Array.from({ length: batch.segments.length / 4 }, (_, j) => {
|
|
98
|
+
const mark = resolveSegmentMark(batch, j, ink);
|
|
99
|
+
return {
|
|
100
|
+
index: j,
|
|
101
|
+
x1: batch.segments[j * 4],
|
|
102
|
+
y1: batch.segments[j * 4 + 1],
|
|
103
|
+
x2: batch.segments[j * 4 + 2],
|
|
104
|
+
y2: batch.segments[j * 4 + 3],
|
|
105
|
+
...(batch.renderPositions !== undefined &&
|
|
106
|
+
batch.renderPathOffsets !== undefined && {
|
|
107
|
+
d: pathData(batch.renderPositions, batch.renderPathOffsets[j], batch.renderPathOffsets[j + 1], "linear"),
|
|
108
|
+
}),
|
|
109
|
+
stroke: mark.stroke,
|
|
110
|
+
linewidth: styleNumber(mark.width),
|
|
111
|
+
alpha: styleNumber(mark.alpha),
|
|
112
|
+
// Conditional: only set when the batch opts in (rule batches leave undefined).
|
|
113
|
+
...(mark.linecap !== undefined && { linecap: mark.linecap }),
|
|
114
|
+
dasharray: mark.dash.length === 0 ? undefined : mark.dash.join(" "),
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
const glyphs = $derived.by(() => {
|
|
119
|
+
if (batch.kind !== "glyphs")
|
|
120
|
+
return [];
|
|
121
|
+
// Measured extents alone do not paint a box (geom_text measures for
|
|
122
|
+
// inspect hover/hit). Visual chrome is geom_label / sf_label only —
|
|
123
|
+
// parity with packages/core render-svg-marks renderGlyphs.
|
|
124
|
+
const hasBox = batch.boxWidths !== undefined &&
|
|
125
|
+
batch.boxHeights !== undefined &&
|
|
126
|
+
(batch.boxRadius !== undefined ||
|
|
127
|
+
batch.boxFill !== undefined ||
|
|
128
|
+
batch.boxFills !== undefined ||
|
|
129
|
+
batch.boxStroke !== undefined ||
|
|
130
|
+
batch.boxStrokes !== undefined);
|
|
131
|
+
const paper = themeVar("paper", theme);
|
|
132
|
+
return batch.texts.map((text, j) => {
|
|
133
|
+
const mark = resolveGlyphMark(batch, j, ink);
|
|
134
|
+
const x = batch.positions[j * 2];
|
|
135
|
+
const y = batch.positions[j * 2 + 1];
|
|
136
|
+
let box;
|
|
137
|
+
if (hasBox) {
|
|
138
|
+
const width = batch.boxWidths[j];
|
|
139
|
+
const height = batch.boxHeights[j];
|
|
140
|
+
const pad = batch.boxPadding ?? 0;
|
|
141
|
+
const origin = labelBoxOrigin(x, y, width, height, batch.anchor, pad);
|
|
142
|
+
box = {
|
|
143
|
+
x: styleNumber(origin.x),
|
|
144
|
+
y: styleNumber(origin.y),
|
|
145
|
+
width: styleNumber(width),
|
|
146
|
+
height: styleNumber(height),
|
|
147
|
+
fill: batch.boxFills?.[j] ?? batch.boxFill ?? paper,
|
|
148
|
+
stroke: batch.boxStrokes?.[j] ?? batch.boxStroke ?? ink,
|
|
149
|
+
strokeWidth: styleNumber(batch.boxStrokeWidth ?? 0.5),
|
|
150
|
+
radius: styleNumber(batch.boxRadius ?? 0),
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
return {
|
|
154
|
+
index: j,
|
|
155
|
+
x,
|
|
156
|
+
y,
|
|
157
|
+
text,
|
|
158
|
+
fill: mark.fill,
|
|
159
|
+
size: styleNumber(mark.size),
|
|
160
|
+
alpha: styleNumber(mark.alpha),
|
|
161
|
+
box,
|
|
162
|
+
};
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
const alpha = $derived(batch.alpha === 1 ? undefined : batch.alpha);
|
|
166
|
+
function presentationOrder(items) {
|
|
167
|
+
if (focusMask === null)
|
|
168
|
+
return items.map((item) => ({ item, focused: true }));
|
|
169
|
+
const presented = items.map((item) => ({
|
|
170
|
+
item,
|
|
171
|
+
focused: focusMask.isFocused(item.index),
|
|
172
|
+
}));
|
|
173
|
+
return [
|
|
174
|
+
...presented.filter((item) => !item.focused),
|
|
175
|
+
...presented.filter((item) => item.focused),
|
|
176
|
+
];
|
|
177
|
+
}
|
|
178
|
+
function itemOpacity(mapped, focused) {
|
|
179
|
+
const opacity = focusMask === null || focused ? mapped : mapped * theme.interactionMuted;
|
|
180
|
+
return opacity === 1 ? undefined : opacity;
|
|
181
|
+
}
|
|
182
|
+
return {
|
|
183
|
+
get points() {
|
|
184
|
+
return points;
|
|
185
|
+
},
|
|
186
|
+
get subpaths() {
|
|
187
|
+
return subpaths;
|
|
188
|
+
},
|
|
189
|
+
get rects() {
|
|
190
|
+
return rects;
|
|
191
|
+
},
|
|
192
|
+
get segments() {
|
|
193
|
+
return segments;
|
|
194
|
+
},
|
|
195
|
+
get glyphs() {
|
|
196
|
+
return glyphs;
|
|
197
|
+
},
|
|
198
|
+
get alpha() {
|
|
199
|
+
return alpha;
|
|
200
|
+
},
|
|
201
|
+
get pointsFocusable() {
|
|
202
|
+
return pointsFocusable;
|
|
203
|
+
},
|
|
204
|
+
presentationOrder,
|
|
205
|
+
itemOpacity,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { type PlotRect } from "@ggts-sh/core";
|
|
2
|
+
export { type PanelBounds, panelBoundsFrom, type ContinuousZoomDomains, clamp, frozenZoomDomains, normalizedRect, HOVER_RING_RADIUS, HOVER_CROSSHAIR_GAP_RADIUS, glyphHoverBox, crosshairGapForBox, glyphExtentsFromBatch, type CrosshairGapBox, CROSSHAIR_BOX_GAP_PAD, gappedCrosshairSegmentsWithObstacles, gappedCrosshairSegments, crosshairGlyphObstacles, } from "@ggts-sh/core/interaction";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// Shared pure behavior used by React and Svelte.
|
|
2
|
+
export {} from "@ggts-sh/core";
|
|
3
|
+
export { panelBoundsFrom, clamp, frozenZoomDomains, normalizedRect, HOVER_RING_RADIUS, HOVER_CROSSHAIR_GAP_RADIUS, glyphHoverBox, crosshairGapForBox, glyphExtentsFromBatch, CROSSHAIR_BOX_GAP_PAD, gappedCrosshairSegmentsWithObstacles, gappedCrosshairSegments, crosshairGlyphObstacles, } from "@ggts-sh/core/interaction";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canvas stratum painting and batch focus-mask projection for GGPlot mark
|
|
3
|
+
* compositing. SSR-safe to import; paintCanvasStratum touches the DOM only
|
|
4
|
+
* when called with a live canvas element.
|
|
5
|
+
*/
|
|
6
|
+
import type { BatchInteractionMask, GeometryBatch, RenderModel } from "@ggts-sh/core";
|
|
7
|
+
/**
|
|
8
|
+
* Project full-scene interaction masks onto a stratum batch subset using
|
|
9
|
+
* scene batch identity. Builds a batch→index Map once (O(S + B)) rather than
|
|
10
|
+
* `indexOf` per batch (O(B · S)), matching host masksForBatches semantics.
|
|
11
|
+
* Empty interactionMasks → empty result (no focus styling).
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveBatchFocusMasks(sceneBatches: readonly GeometryBatch[], batches: readonly GeometryBatch[], interactionMasks: readonly (BatchInteractionMask | null)[]): (BatchInteractionMask | null)[];
|
|
14
|
+
export type PaintCanvasStratumInput = {
|
|
15
|
+
readonly canvas: HTMLCanvasElement;
|
|
16
|
+
readonly scene: RenderModel["scene"];
|
|
17
|
+
readonly batches: readonly GeometryBatch[];
|
|
18
|
+
readonly focusMasks: readonly (BatchInteractionMask | null)[];
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Size for DPR and draw one canvas stratum.
|
|
22
|
+
* Returns false when a 2d context is unavailable — callers must not notify
|
|
23
|
+
* the paint ledger in that case (keeps data-gg-ready false).
|
|
24
|
+
*/
|
|
25
|
+
export declare function paintCanvasStratum(input: PaintCanvasStratumInput): boolean;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canvas stratum painting and batch focus-mask projection for GGPlot mark
|
|
3
|
+
* compositing. SSR-safe to import; paintCanvasStratum touches the DOM only
|
|
4
|
+
* when called with a live canvas element.
|
|
5
|
+
*/
|
|
6
|
+
import { cssColorResolver, drawStratum, sizeCanvasForDpr } from "@ggts-sh/core/dom";
|
|
7
|
+
/**
|
|
8
|
+
* Project full-scene interaction masks onto a stratum batch subset using
|
|
9
|
+
* scene batch identity. Builds a batch→index Map once (O(S + B)) rather than
|
|
10
|
+
* `indexOf` per batch (O(B · S)), matching host masksForBatches semantics.
|
|
11
|
+
* Empty interactionMasks → empty result (no focus styling).
|
|
12
|
+
*/
|
|
13
|
+
export function resolveBatchFocusMasks(sceneBatches, batches, interactionMasks) {
|
|
14
|
+
if (interactionMasks.length === 0)
|
|
15
|
+
return [];
|
|
16
|
+
const indexByBatch = new Map(sceneBatches.map((batch, index) => [batch, index]));
|
|
17
|
+
return batches.map((batch) => {
|
|
18
|
+
const index = indexByBatch.get(batch);
|
|
19
|
+
return index === undefined ? null : (interactionMasks[index] ?? null);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Size for DPR and draw one canvas stratum.
|
|
24
|
+
* Returns false when a 2d context is unavailable — callers must not notify
|
|
25
|
+
* the paint ledger in that case (keeps data-gg-ready false).
|
|
26
|
+
*/
|
|
27
|
+
export function paintCanvasStratum(input) {
|
|
28
|
+
const ctx = input.canvas.getContext("2d");
|
|
29
|
+
if (ctx === null)
|
|
30
|
+
return false;
|
|
31
|
+
const dpr = window.devicePixelRatio || 1;
|
|
32
|
+
sizeCanvasForDpr(input.canvas, ctx, input.scene.width, input.scene.height, dpr);
|
|
33
|
+
drawStratum(ctx, input.scene, input.batches, cssColorResolver(input.canvas), input.focusMasks.length > 0
|
|
34
|
+
? {
|
|
35
|
+
focusMasks: input.focusMasks,
|
|
36
|
+
mutedAlpha: input.scene.theme.interactionMuted,
|
|
37
|
+
}
|
|
38
|
+
: undefined);
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Point-selection controller extracted from GGPlot for S8.
|
|
3
|
+
*
|
|
4
|
+
* Owns local selection state, the construction-time `effectiveSelectedKeys`
|
|
5
|
+
* derived, and commit/clear/toggle/emit handlers. Semantic Candidate
|
|
6
|
+
* projection and presentation shaping belong to the runtime projection module.
|
|
7
|
+
*
|
|
8
|
+
* `commitPointSelection` is PRIVATE (no external caller — toggle/clear only).
|
|
9
|
+
* Public API speaks PropertyKey; PublicKey casts stay at the host boundary.
|
|
10
|
+
*/
|
|
11
|
+
import type { InteractionContext } from "../interaction/interaction-context.svelte.js";
|
|
12
|
+
import type { InteractionSource, PlotSelection } from "../interaction/interaction.js";
|
|
13
|
+
export type SelectionState = {
|
|
14
|
+
readonly effectiveSelectedKeys: readonly PropertyKey[];
|
|
15
|
+
clearPointSelection(source: InteractionSource): void;
|
|
16
|
+
togglePointKeys(keys: readonly PropertyKey[], source: InteractionSource): void;
|
|
17
|
+
emitSelection(event: PlotSelection): void;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Create the point-selection controller. Construction registers only the
|
|
21
|
+
* `effectiveSelectedKeys` derived over interaction and scope.
|
|
22
|
+
*/
|
|
23
|
+
export declare function createSelectionState(context: InteractionContext): SelectionState;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Point-selection controller extracted from GGPlot for S8.
|
|
3
|
+
*
|
|
4
|
+
* Owns local selection state, the construction-time `effectiveSelectedKeys`
|
|
5
|
+
* derived, and commit/clear/toggle/emit handlers. Semantic Candidate
|
|
6
|
+
* projection and presentation shaping belong to the runtime projection module.
|
|
7
|
+
*
|
|
8
|
+
* `commitPointSelection` is PRIVATE (no external caller — toggle/clear only).
|
|
9
|
+
* Public API speaks PropertyKey; PublicKey casts stay at the host boundary.
|
|
10
|
+
*/
|
|
11
|
+
import { createScopedStore } from "../interaction/scoped-store.svelte.js";
|
|
12
|
+
import { selectionAnnouncement } from "../assembly/labels.js";
|
|
13
|
+
import { buildPointSelectionEvent, nextPointSelectionKeys, sameOrderedPropertyKeys, } from "./selection.js";
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
// Factory
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
/**
|
|
18
|
+
* Create the point-selection controller. Construction registers only the
|
|
19
|
+
* `effectiveSelectedKeys` derived over interaction and scope.
|
|
20
|
+
*/
|
|
21
|
+
export function createSelectionState(context) {
|
|
22
|
+
const selectedKeys = createScopedStore({
|
|
23
|
+
initial: [],
|
|
24
|
+
controller: context.interaction,
|
|
25
|
+
scope: context.resolvedInteractionScope,
|
|
26
|
+
read: (controller, scope) => controller.selected(scope),
|
|
27
|
+
write: (controller, next, scope, source) => {
|
|
28
|
+
const transition = controller.setSelection(next, { scope, source });
|
|
29
|
+
if (transition === null)
|
|
30
|
+
return null;
|
|
31
|
+
return {
|
|
32
|
+
value: transition.snapshot.selections.find((selection) => selection.scope === scope.keys)
|
|
33
|
+
?.keys ?? [],
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
clearShared: (controller, scope, source) => controller.clearSelection({ scope, source }) !== null,
|
|
37
|
+
same: sameOrderedPropertyKeys,
|
|
38
|
+
});
|
|
39
|
+
/** Private — only clear/toggle call this; no external caller (P2-7). */
|
|
40
|
+
function commitPointSelection(keys, source) {
|
|
41
|
+
// Dedup for local storage; controller canonicalizes independently.
|
|
42
|
+
const committed = selectedKeys.set([...new Set(keys)], source);
|
|
43
|
+
if (committed === null)
|
|
44
|
+
return;
|
|
45
|
+
emitSelection(buildPointSelectionEvent(committed.value, source));
|
|
46
|
+
}
|
|
47
|
+
function clearPointSelection(source) {
|
|
48
|
+
if (selectedKeys.value.length === 0)
|
|
49
|
+
return;
|
|
50
|
+
commitPointSelection([], source);
|
|
51
|
+
}
|
|
52
|
+
function emitSelection(event) {
|
|
53
|
+
const message = selectionAnnouncement(event);
|
|
54
|
+
if (message !== null)
|
|
55
|
+
context.announce(message);
|
|
56
|
+
context.onselect()?.(event);
|
|
57
|
+
context.oninteraction()?.(event);
|
|
58
|
+
}
|
|
59
|
+
function togglePointKeys(keys, source) {
|
|
60
|
+
if (keys.length === 0)
|
|
61
|
+
return;
|
|
62
|
+
const next = nextPointSelectionKeys(selectedKeys.value, keys, context.selectConfig()?.multiple ?? false);
|
|
63
|
+
commitPointSelection(next, source);
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
get effectiveSelectedKeys() {
|
|
67
|
+
return selectedKeys.value;
|
|
68
|
+
},
|
|
69
|
+
clearPointSelection,
|
|
70
|
+
togglePointKeys,
|
|
71
|
+
emitSelection,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type PresentationChrome, type PresentationAnchor, EMPHASIS_RING_DENSITY_LIMIT, presentationChromeForKind, hoverChromeForKind, applyEmphasisRingDensityGate, sameOrderedPropertyKeys, buildPointSelectionEvent, uniqueKeysFromRowIndexes, nextPointSelectionKeys, iterateCandidates, collectCandidates, anchorsFromCandidateKeys, type PresentationInspectionFocus, presentationFocusFromInspection, mergePresentationFocusKeys, } from "@ggts-sh/core/interaction";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// Shared pure behavior used by React and Svelte.
|
|
2
|
+
export { EMPHASIS_RING_DENSITY_LIMIT, presentationChromeForKind, hoverChromeForKind, applyEmphasisRingDensityGate, sameOrderedPropertyKeys, buildPointSelectionEvent, uniqueKeysFromRowIndexes, nextPointSelectionKeys, iterateCandidates, collectCandidates, anchorsFromCandidateKeys, presentationFocusFromInspection, mergePresentationFocusKeys, } from "@ggts-sh/core/interaction";
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Pointer capture layer for GGPlot interaction (decision 0006).
|
|
4
|
+
* Host owns handlers, inspection/tool state, and focus restoration.
|
|
5
|
+
* Capture is a single absolutely positioned root under `.gg-plot-root`.
|
|
6
|
+
*/
|
|
7
|
+
import {
|
|
8
|
+
isAreaTool,
|
|
9
|
+
type InteractionTool,
|
|
10
|
+
} from "../interaction/interaction.js";
|
|
11
|
+
|
|
12
|
+
let {
|
|
13
|
+
element = $bindable(null as HTMLDivElement | null),
|
|
14
|
+
plotId,
|
|
15
|
+
activeTool,
|
|
16
|
+
ariaLabel,
|
|
17
|
+
ariaControls,
|
|
18
|
+
onFocus,
|
|
19
|
+
onBlur,
|
|
20
|
+
onPointerMove,
|
|
21
|
+
onPointerLeave,
|
|
22
|
+
onPointerDown,
|
|
23
|
+
onPointerUp,
|
|
24
|
+
onPointerCancel,
|
|
25
|
+
onLostPointerCapture,
|
|
26
|
+
onClick,
|
|
27
|
+
onKeyDown,
|
|
28
|
+
onDblClick,
|
|
29
|
+
}: {
|
|
30
|
+
element?: HTMLDivElement | null;
|
|
31
|
+
plotId: string;
|
|
32
|
+
activeTool: InteractionTool;
|
|
33
|
+
ariaLabel: string;
|
|
34
|
+
ariaControls?: string | undefined;
|
|
35
|
+
onFocus: () => void;
|
|
36
|
+
onBlur: (event: FocusEvent) => void;
|
|
37
|
+
onPointerMove: (event: PointerEvent) => void;
|
|
38
|
+
onPointerLeave: () => void;
|
|
39
|
+
onPointerDown: (event: PointerEvent) => void;
|
|
40
|
+
onPointerUp: (event: PointerEvent) => void;
|
|
41
|
+
onPointerCancel: () => void;
|
|
42
|
+
onLostPointerCapture: () => void;
|
|
43
|
+
onClick: (event: MouseEvent) => void;
|
|
44
|
+
onKeyDown: (event: KeyboardEvent) => void;
|
|
45
|
+
onDblClick: () => void;
|
|
46
|
+
} = $props();
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<!-- The capture layer is a pointer-only surface; the accessible
|
|
50
|
+
interaction paths are focusable marks and the data table. -->
|
|
51
|
+
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
|
52
|
+
<!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
|
|
53
|
+
<div
|
|
54
|
+
bind:this={element}
|
|
55
|
+
class="gg-capture"
|
|
56
|
+
class:gg-area-tool={isAreaTool(activeTool)}
|
|
57
|
+
role="group"
|
|
58
|
+
tabindex="0"
|
|
59
|
+
aria-label={ariaLabel}
|
|
60
|
+
aria-describedby={`${plotId}-description ${plotId}-active`}
|
|
61
|
+
aria-controls={ariaControls}
|
|
62
|
+
onfocus={onFocus}
|
|
63
|
+
onblur={onBlur}
|
|
64
|
+
onpointermove={onPointerMove}
|
|
65
|
+
onpointerleave={onPointerLeave}
|
|
66
|
+
onpointerdown={onPointerDown}
|
|
67
|
+
onpointerup={onPointerUp}
|
|
68
|
+
onpointercancel={onPointerCancel}
|
|
69
|
+
onlostpointercapture={onLostPointerCapture}
|
|
70
|
+
onclick={onClick}
|
|
71
|
+
onkeydown={onKeyDown}
|
|
72
|
+
ondblclick={onDblClick}
|
|
73
|
+
></div>
|
|
74
|
+
|
|
75
|
+
<style>
|
|
76
|
+
.gg-capture {
|
|
77
|
+
position: absolute;
|
|
78
|
+
inset: 0;
|
|
79
|
+
pointer-events: auto;
|
|
80
|
+
touch-action: pan-y pinch-zoom;
|
|
81
|
+
background: transparent;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.gg-capture.gg-area-tool {
|
|
85
|
+
touch-action: none;
|
|
86
|
+
cursor: crosshair;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.gg-capture:focus-visible {
|
|
90
|
+
outline: 2px solid var(--gg-focusRing, var(--gg-theme-focusRing, Highlight));
|
|
91
|
+
outline-offset: 2px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* Capture has no transitions; mirror PlotStatusChrome reduced-motion
|
|
95
|
+
policy for consumer-supplied overrides on this node. */
|
|
96
|
+
@media (prefers-reduced-motion: reduce) {
|
|
97
|
+
.gg-capture {
|
|
98
|
+
scroll-behavior: auto;
|
|
99
|
+
transition: none !important;
|
|
100
|
+
animation: none !important;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@media (forced-colors: active) {
|
|
105
|
+
.gg-capture:focus-visible {
|
|
106
|
+
outline-color: Highlight;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pointer capture layer for GGPlot interaction (decision 0006).
|
|
3
|
+
* Host owns handlers, inspection/tool state, and focus restoration.
|
|
4
|
+
* Capture is a single absolutely positioned root under `.gg-plot-root`.
|
|
5
|
+
*/
|
|
6
|
+
import { type InteractionTool } from "../interaction/interaction.js";
|
|
7
|
+
type $$ComponentProps = {
|
|
8
|
+
element?: HTMLDivElement | null;
|
|
9
|
+
plotId: string;
|
|
10
|
+
activeTool: InteractionTool;
|
|
11
|
+
ariaLabel: string;
|
|
12
|
+
ariaControls?: string | undefined;
|
|
13
|
+
onFocus: () => void;
|
|
14
|
+
onBlur: (event: FocusEvent) => void;
|
|
15
|
+
onPointerMove: (event: PointerEvent) => void;
|
|
16
|
+
onPointerLeave: () => void;
|
|
17
|
+
onPointerDown: (event: PointerEvent) => void;
|
|
18
|
+
onPointerUp: (event: PointerEvent) => void;
|
|
19
|
+
onPointerCancel: () => void;
|
|
20
|
+
onLostPointerCapture: () => void;
|
|
21
|
+
onClick: (event: MouseEvent) => void;
|
|
22
|
+
onKeyDown: (event: KeyboardEvent) => void;
|
|
23
|
+
onDblClick: () => void;
|
|
24
|
+
};
|
|
25
|
+
declare const CaptureSurface: import("svelte").Component<$$ComponentProps, {}, "element">;
|
|
26
|
+
type CaptureSurface = ReturnType<typeof CaptureSurface>;
|
|
27
|
+
export default CaptureSurface;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type PanelBounds, type PlotRect } from "../scene/geometry.js";
|
|
2
|
+
/** Live brush corners; may be denormalized while dragging (x0>x1 or y0>y1). */
|
|
3
|
+
export type BrushCorners = {
|
|
4
|
+
x0: number;
|
|
5
|
+
y0: number;
|
|
6
|
+
x1: number;
|
|
7
|
+
y1: number;
|
|
8
|
+
};
|
|
9
|
+
export type PlotPoint = Readonly<{
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
}>;
|
|
13
|
+
/** Degenerate brush at a single point (pointer-down / first keyboard corner). */
|
|
14
|
+
export declare function brushAtPoint(point: PlotPoint): BrushCorners;
|
|
15
|
+
/** Update the free corner of a brush (pointer move / second-corner down). */
|
|
16
|
+
export declare function brushWithEnd(corners: BrushCorners, point: PlotPoint): BrushCorners;
|
|
17
|
+
/**
|
|
18
|
+
* Pointer-down begin-area corners.
|
|
19
|
+
* Extend free corner only when reducer is awaiting second AND draft exists;
|
|
20
|
+
* otherwise start a degenerate brush at `point`. Both conditions are required
|
|
21
|
+
* so a surviving draft without first-corner state restarts fresh (not extend).
|
|
22
|
+
*/
|
|
23
|
+
export declare function initialBrushRect(input: {
|
|
24
|
+
readonly areaAwaitingSecond: boolean;
|
|
25
|
+
readonly existing: BrushCorners | null;
|
|
26
|
+
readonly point: PlotPoint;
|
|
27
|
+
}): BrushCorners;
|
|
28
|
+
/**
|
|
29
|
+
* Keyboard arrow nudge of the free corner, clamped to panel bounds.
|
|
30
|
+
* Does not normalize; callers keep denormalized corners until commit.
|
|
31
|
+
*/
|
|
32
|
+
export declare function nudgeBrushEnd(corners: BrushCorners, dx: number, dy: number, panel: PanelBounds): BrushCorners;
|
|
33
|
+
/**
|
|
34
|
+
* Pointer brush-end evaluation.
|
|
35
|
+
* Too-small: BOTH spans < min (see isBrushTooSmall); returns normalized corners
|
|
36
|
+
* for the retained draft (matches existing GGPlot behavior).
|
|
37
|
+
* Otherwise returns a normalized commit rect.
|
|
38
|
+
*/
|
|
39
|
+
export type PointerBrushEnd = {
|
|
40
|
+
readonly kind: "too-small";
|
|
41
|
+
readonly corners: PlotRect;
|
|
42
|
+
} | {
|
|
43
|
+
readonly kind: "commit";
|
|
44
|
+
readonly rect: PlotRect;
|
|
45
|
+
};
|
|
46
|
+
export declare function evaluatePointerBrushEnd(corners: BrushCorners, endPoint: PlotPoint): PointerBrushEnd;
|
|
47
|
+
/** Panel center for keyboard first-corner placement when no inspection anchor. */
|
|
48
|
+
export declare function panelCenterAnchor(panel: PanelBounds | undefined): PlotPoint;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { clamp, normalizedRect } from "../scene/geometry.js";
|
|
2
|
+
import { isBrushTooSmall } from "../interval/interval.js";
|
|
3
|
+
/** Degenerate brush at a single point (pointer-down / first keyboard corner). */
|
|
4
|
+
export function brushAtPoint(point) {
|
|
5
|
+
return { x0: point.x, y0: point.y, x1: point.x, y1: point.y };
|
|
6
|
+
}
|
|
7
|
+
/** Update the free corner of a brush (pointer move / second-corner down). */
|
|
8
|
+
export function brushWithEnd(corners, point) {
|
|
9
|
+
return { ...corners, x1: point.x, y1: point.y };
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Pointer-down begin-area corners.
|
|
13
|
+
* Extend free corner only when reducer is awaiting second AND draft exists;
|
|
14
|
+
* otherwise start a degenerate brush at `point`. Both conditions are required
|
|
15
|
+
* so a surviving draft without first-corner state restarts fresh (not extend).
|
|
16
|
+
*/
|
|
17
|
+
export function initialBrushRect(input) {
|
|
18
|
+
return input.areaAwaitingSecond && input.existing !== null
|
|
19
|
+
? brushWithEnd(input.existing, input.point)
|
|
20
|
+
: brushAtPoint(input.point);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Keyboard arrow nudge of the free corner, clamped to panel bounds.
|
|
24
|
+
* Does not normalize; callers keep denormalized corners until commit.
|
|
25
|
+
*/
|
|
26
|
+
export function nudgeBrushEnd(corners, dx, dy, panel) {
|
|
27
|
+
return {
|
|
28
|
+
...corners,
|
|
29
|
+
x1: clamp(corners.x1 + dx, panel.x, panel.x + panel.width),
|
|
30
|
+
y1: clamp(corners.y1 + dy, panel.y, panel.y + panel.height),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export function evaluatePointerBrushEnd(corners, endPoint) {
|
|
34
|
+
const rect = normalizedRect(brushWithEnd(corners, endPoint));
|
|
35
|
+
if (isBrushTooSmall(rect))
|
|
36
|
+
return { kind: "too-small", corners: rect };
|
|
37
|
+
return { kind: "commit", rect };
|
|
38
|
+
}
|
|
39
|
+
/** Panel center for keyboard first-corner placement when no inspection anchor. */
|
|
40
|
+
export function panelCenterAnchor(panel) {
|
|
41
|
+
if (panel === undefined)
|
|
42
|
+
return { x: 0, y: 0 };
|
|
43
|
+
return { x: panel.x + panel.width / 2, y: panel.y + panel.height / 2 };
|
|
44
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { InteractionTool } from "../interaction/interaction.js";
|
|
2
|
+
import { type BrushCorners, type PlotPoint, type PointerBrushEnd } from "./area-brush.js";
|
|
3
|
+
import type { PlotRect } from "../scene/geometry.js";
|
|
4
|
+
export type FinishBrushAction = {
|
|
5
|
+
readonly type: "keep-second-corner";
|
|
6
|
+
readonly corners: PlotRect;
|
|
7
|
+
} | {
|
|
8
|
+
readonly type: "select-end";
|
|
9
|
+
readonly rect: PlotRect;
|
|
10
|
+
} | {
|
|
11
|
+
readonly type: "zoom-end";
|
|
12
|
+
readonly rect: PlotRect;
|
|
13
|
+
} | {
|
|
14
|
+
readonly type: "end-area";
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Pure routing after brush-end evaluation for pointer finish-brush and
|
|
18
|
+
* keyboard complete-area.
|
|
19
|
+
*
|
|
20
|
+
* Takes the full ended discriminant so actions carry rect/corners payloads —
|
|
21
|
+
* host must not re-narrow `ended.kind` for emit/apply.
|
|
22
|
+
*
|
|
23
|
+
* Priority:
|
|
24
|
+
* 1. keep-second-corner — too-small (wins for any tool); carries corners
|
|
25
|
+
* 2. select-end — commit + select-area; carries rect
|
|
26
|
+
* 3. zoom-end — commit + zoom-area; carries rect
|
|
27
|
+
* 4. end-area — commit + any other tool (clear draft + cancel-area, no emit)
|
|
28
|
+
*
|
|
29
|
+
* Host on keep-second-corner: brushRect = action.corners, announce, no cancel-area.
|
|
30
|
+
* Host on select-end/zoom-end/end-area: brushRect=null, cancel-area; emit/apply
|
|
31
|
+
* using action.rect when present.
|
|
32
|
+
*
|
|
33
|
+
* Keyboard complete-area always supplies `kind: "commit"` (no free-corner
|
|
34
|
+
* too-small evaluation); pointer uses `resolvePointerFinishBrushAction`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function resolveFinishBrushAction(input: {
|
|
37
|
+
readonly ended: PointerBrushEnd;
|
|
38
|
+
readonly activeTool: InteractionTool;
|
|
39
|
+
}): FinishBrushAction;
|
|
40
|
+
/**
|
|
41
|
+
* Compose free-corner evaluation + finish routing for pointer finish-brush.
|
|
42
|
+
* Host supplies draft corners and the up event plot point; pure owns too-small
|
|
43
|
+
* vs commit and select/zoom/end payloads.
|
|
44
|
+
*/
|
|
45
|
+
export declare function resolvePointerFinishBrushAction(input: {
|
|
46
|
+
readonly brushCorners: BrushCorners;
|
|
47
|
+
readonly endPoint: PlotPoint;
|
|
48
|
+
readonly activeTool: InteractionTool;
|
|
49
|
+
}): FinishBrushAction;
|