@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,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal props contract for <GGPlot> + the plot engine (#1040).
|
|
3
|
+
* Not part of the public package surface — never export from the package root.
|
|
4
|
+
*
|
|
5
|
+
* Runtime helpers here own:
|
|
6
|
+
* - capability defaults (`resolveCapabilities`)
|
|
7
|
+
* - PublicKey → PropertyKey widening for engine controllers (`widenPlotProps`)
|
|
8
|
+
*/
|
|
9
|
+
import type { Snippet } from "svelte";
|
|
10
|
+
import type { A11yMode, AesInput, DataInput, LayerInput, PortableSpec, SpecInput } from "@ggts-sh/spec";
|
|
11
|
+
import type { CellValue, RenderModel } from "@ggts-sh/core";
|
|
12
|
+
import type { PlotDiagnostic } from "./diagnostics/deprecation.js";
|
|
13
|
+
import type { InspectInput, InteractionTool, LegendFocusEvent, LegendFocusInput, PlotInspection, PlotInteractionEvent, PlotInteractionScope, PlotSelection, SelectInput, ZoomEvent, ZoomInput } from "./interaction/interaction.js";
|
|
14
|
+
import type { PlotInteractionController } from "./interaction/controller.svelte.js";
|
|
15
|
+
import type { LegendFilterEvent, LegendFilterInput } from "./legend/filter.js";
|
|
16
|
+
type PublicKey<Row extends Record<string, CellValue>, Identity extends keyof Row | ((row: Row, index: number) => PropertyKey)> = Identity extends keyof Row ? Extract<Row[Identity], PropertyKey> : Identity extends (row: Row, index: number) => infer Key ? Extract<Key, PropertyKey> : never;
|
|
17
|
+
/**
|
|
18
|
+
* Props for `<GGPlot>`. Grammar pieces (theme, scales, coord, facet, labs,
|
|
19
|
+
* guides, legend) are declaration-only children — not props (#704 / #659).
|
|
20
|
+
* Removed from the prop surface in 0.13.0 (deprecated since 0.11.0).
|
|
21
|
+
*/
|
|
22
|
+
export interface GGPlotProps<Row extends Record<string, CellValue> = Record<string, CellValue>, Identity extends keyof Row | ((row: Row, index: number) => PropertyKey) = keyof Row> {
|
|
23
|
+
/** A complete spec (bare-string channel shorthand allowed). Wins over the other props. */
|
|
24
|
+
spec?: SpecInput;
|
|
25
|
+
/** Data rows, columns, or a DataRef ({values}/{columns}/{name}). */
|
|
26
|
+
data?: DataInput | readonly Row[];
|
|
27
|
+
/** Plot-level aesthetic mapping (inherited by every layer). */
|
|
28
|
+
aes?: AesInput;
|
|
29
|
+
/** Layers (props-first canonical form). Wins over declaration-only children. */
|
|
30
|
+
layers?: LayerInput[];
|
|
31
|
+
/** Accessibility mode ("force-svg" keeps every layer as SVG marks). */
|
|
32
|
+
a11y?: A11yMode;
|
|
33
|
+
/** Plot width in px. Omitted is container-responsive. */
|
|
34
|
+
width?: number | "container";
|
|
35
|
+
/** Plot height in px (falls back to spec.height, then 400). */
|
|
36
|
+
height?: number;
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated since 0.21.0 — use `identity` on `<Inspect>`, object-form
|
|
39
|
+
* `select={{ type, identity }}`, or `createPlotInteraction({ identity })`.
|
|
40
|
+
* Still honoured (dual-read) until 0.22.0; emits DEPRECATED_PLOT_PROP.
|
|
41
|
+
* Default when no surface sets identity: `id` column when present, else
|
|
42
|
+
* row index. Ordinary charts should omit identity entirely.
|
|
43
|
+
* Migration: https://ggts.sh/guide/upgrading#row-identity-on-interaction
|
|
44
|
+
*/
|
|
45
|
+
key?: Identity;
|
|
46
|
+
/** Opt into inspection, its semantic crosshair, tooltip, and pinning. */
|
|
47
|
+
inspect?: InspectInput;
|
|
48
|
+
/** Opt into point or interval selection. */
|
|
49
|
+
select?: SelectInput;
|
|
50
|
+
/** Opt into brush zoom. */
|
|
51
|
+
zoom?: ZoomInput;
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated since 0.19.0 — use `<GuideLegend channel="…" focus />` instead.
|
|
54
|
+
* Still honoured (plot-wide enablement) until 0.20.0; emits DEPRECATED_PLOT_PROP.
|
|
55
|
+
* Migration: https://ggts.sh/guide/upgrading#legend-focus-on-guidelegend
|
|
56
|
+
*/
|
|
57
|
+
legendFocus?: LegendFocusInput;
|
|
58
|
+
/**
|
|
59
|
+
* @deprecated since 0.19.0 — use `<GuideLegend channel="…" filter />` instead.
|
|
60
|
+
* Still honoured (plot-wide enablement) until 0.20.0; emits DEPRECATED_PLOT_PROP.
|
|
61
|
+
* Migration: https://ggts.sh/guide/upgrading#legend-filter-on-guidelegend
|
|
62
|
+
*/
|
|
63
|
+
legendFilter?: LegendFilterInput;
|
|
64
|
+
/** Controlled initial/active tool. */
|
|
65
|
+
tool?: InteractionTool;
|
|
66
|
+
/** Optional durable semantic state shared with other plots and Svelte UI. */
|
|
67
|
+
interaction?: PlotInteractionController<PublicKey<Row, Identity>>;
|
|
68
|
+
/** Semantic identity for linked keys and positional domains. */
|
|
69
|
+
interactionScope?: PlotInteractionScope;
|
|
70
|
+
/** Accessible chart name; falls back to the plot title/generated label. */
|
|
71
|
+
ariaLabel?: string;
|
|
72
|
+
oninspect?: (event: PlotInspection<Row, PublicKey<Row, Identity>>) => void;
|
|
73
|
+
onselect?: (event: PlotSelection<PublicKey<Row, Identity>>) => void;
|
|
74
|
+
onzoom?: (event: ZoomEvent) => void;
|
|
75
|
+
onlegendfocus?: (event: LegendFocusEvent<PublicKey<Row, Identity>>) => void;
|
|
76
|
+
onlegendfilter?: (event: LegendFilterEvent) => void;
|
|
77
|
+
oninteraction?: (event: PlotInteractionEvent<Row, PublicKey<Row, Identity>>) => void;
|
|
78
|
+
ondiagnostic?: (diagnostic: PlotDiagnostic) => void;
|
|
79
|
+
ontoolchange?: (tool: InteractionTool) => void;
|
|
80
|
+
/** Called after each committed render with the model (warnings,
|
|
81
|
+
* advisories, scales) and the normalized PortableSpec. */
|
|
82
|
+
onrender?: (model: RenderModel, spec: PortableSpec) => void;
|
|
83
|
+
children?: Snippet;
|
|
84
|
+
}
|
|
85
|
+
/** Capability defaults after optional props resolve (engine-facing). */
|
|
86
|
+
export type ResolvedPlotCapabilities = {
|
|
87
|
+
inspect: InspectInput;
|
|
88
|
+
select: SelectInput;
|
|
89
|
+
zoom: ZoomInput;
|
|
90
|
+
legendFocus: LegendFocusInput;
|
|
91
|
+
legendFilter: LegendFilterInput;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Defaults the five interaction capability props to `false` when omitted.
|
|
95
|
+
* Pure — does not clone object-form configs (identity preserved for epoch
|
|
96
|
+
* and reference-equality consumers).
|
|
97
|
+
*
|
|
98
|
+
* Input is a plain bag (not `Pick<GGPlotProps, …>`) so dual-read of the
|
|
99
|
+
* deprecated `legendFocus` / `legendFilter` props does not trip
|
|
100
|
+
* `typescript/no-deprecated` at every resolveCapabilities call site during
|
|
101
|
+
* the 0.19→0.20 window.
|
|
102
|
+
*/
|
|
103
|
+
export declare function resolveCapabilities(props: {
|
|
104
|
+
readonly inspect?: InspectInput;
|
|
105
|
+
readonly select?: SelectInput;
|
|
106
|
+
readonly zoom?: ZoomInput;
|
|
107
|
+
readonly legendFocus?: LegendFocusInput;
|
|
108
|
+
readonly legendFilter?: LegendFilterInput;
|
|
109
|
+
}): ResolvedPlotCapabilities;
|
|
110
|
+
/**
|
|
111
|
+
* Read the deprecated plot-level `key` prop during the dual-read window.
|
|
112
|
+
* Prefer Inspect / Select / createPlotInteraction `identity` instead.
|
|
113
|
+
*/
|
|
114
|
+
export declare function readLegacyPlotKey(props: EnginePlotProps | GGPlotProps): EnginePlotProps["key"] | undefined;
|
|
115
|
+
/**
|
|
116
|
+
* Read the deprecated plot-level `legendFocus` prop during the dual-read
|
|
117
|
+
* window. Isolate the deprecation access so call sites stay clean.
|
|
118
|
+
*/
|
|
119
|
+
export declare function readLegacyPlotLegendFocus(props: EnginePlotProps | GGPlotProps): LegendFocusInput | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Read the deprecated plot-level `legendFilter` prop during the dual-read
|
|
122
|
+
* window. Isolate the deprecation access so call sites stay clean.
|
|
123
|
+
*/
|
|
124
|
+
export declare function readLegacyPlotLegendFilter(props: EnginePlotProps | GGPlotProps): LegendFilterInput | undefined;
|
|
125
|
+
/**
|
|
126
|
+
* Engine-facing props: same surface as `GGPlotProps` with the six
|
|
127
|
+
* PublicKey-generic fields widened to PropertyKey (controller deps).
|
|
128
|
+
* Derived via `Omit` — not a hand-restated 30-field mirror (#1040).
|
|
129
|
+
*/
|
|
130
|
+
export type EnginePlotProps = Omit<GGPlotProps, "key" | "interaction" | "oninspect" | "onselect" | "onlegendfocus" | "oninteraction"> & {
|
|
131
|
+
key?: PropertyKey | ((row: Record<string, CellValue>, index: number) => PropertyKey);
|
|
132
|
+
interaction?: PlotInteractionController;
|
|
133
|
+
oninspect?: (event: PlotInspection<Record<string, CellValue>>) => void;
|
|
134
|
+
onselect?: (event: PlotSelection) => void;
|
|
135
|
+
onlegendfocus?: (event: LegendFocusEvent) => void;
|
|
136
|
+
oninteraction?: (event: PlotInteractionEvent<Record<string, CellValue>>) => void;
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* Stable lazy view of plot props for the engine. Non-widened fields forward
|
|
140
|
+
* through the source proxy (per-field reactive deps). The six PublicKey
|
|
141
|
+
* fields cast once here instead of at the GGPlot call site.
|
|
142
|
+
*/
|
|
143
|
+
export declare function widenPlotProps<Row extends Record<string, CellValue>, Identity extends keyof Row | ((row: Row, index: number) => PropertyKey)>(props: GGPlotProps<Row, Identity>): EnginePlotProps;
|
|
144
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defaults the five interaction capability props to `false` when omitted.
|
|
3
|
+
* Pure — does not clone object-form configs (identity preserved for epoch
|
|
4
|
+
* and reference-equality consumers).
|
|
5
|
+
*
|
|
6
|
+
* Input is a plain bag (not `Pick<GGPlotProps, …>`) so dual-read of the
|
|
7
|
+
* deprecated `legendFocus` / `legendFilter` props does not trip
|
|
8
|
+
* `typescript/no-deprecated` at every resolveCapabilities call site during
|
|
9
|
+
* the 0.19→0.20 window.
|
|
10
|
+
*/
|
|
11
|
+
export function resolveCapabilities(props) {
|
|
12
|
+
return {
|
|
13
|
+
inspect: props.inspect ?? false,
|
|
14
|
+
select: props.select ?? false,
|
|
15
|
+
zoom: props.zoom ?? false,
|
|
16
|
+
legendFocus: props.legendFocus ?? false,
|
|
17
|
+
legendFilter: props.legendFilter ?? false,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Read the deprecated plot-level `key` prop during the dual-read window.
|
|
22
|
+
* Prefer Inspect / Select / createPlotInteraction `identity` instead.
|
|
23
|
+
*/
|
|
24
|
+
export function readLegacyPlotKey(props) {
|
|
25
|
+
// Dual-read until 0.22.0 — prefer interaction-surface identity.
|
|
26
|
+
// oxlint-disable-next-line typescript/no-deprecated -- intentional dual-read
|
|
27
|
+
return props.key;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Read the deprecated plot-level `legendFocus` prop during the dual-read
|
|
31
|
+
* window. Isolate the deprecation access so call sites stay clean.
|
|
32
|
+
*/
|
|
33
|
+
export function readLegacyPlotLegendFocus(props) {
|
|
34
|
+
// Dual-read until 0.20.0 — prefer <GuideLegend focus>.
|
|
35
|
+
// oxlint-disable-next-line typescript/no-deprecated -- intentional dual-read
|
|
36
|
+
return props.legendFocus;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Read the deprecated plot-level `legendFilter` prop during the dual-read
|
|
40
|
+
* window. Isolate the deprecation access so call sites stay clean.
|
|
41
|
+
*/
|
|
42
|
+
export function readLegacyPlotLegendFilter(props) {
|
|
43
|
+
// Dual-read until 0.20.0 — prefer <GuideLegend filter>.
|
|
44
|
+
// oxlint-disable-next-line typescript/no-deprecated -- intentional dual-read
|
|
45
|
+
return props.legendFilter;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Stable lazy view of plot props for the engine. Non-widened fields forward
|
|
49
|
+
* through the source proxy (per-field reactive deps). The six PublicKey
|
|
50
|
+
* fields cast once here instead of at the GGPlot call site.
|
|
51
|
+
*/
|
|
52
|
+
export function widenPlotProps(props) {
|
|
53
|
+
const handler = {
|
|
54
|
+
get(target, prop, receiver) {
|
|
55
|
+
// Six precise casts — only these fields change assignability.
|
|
56
|
+
if (prop === "key") {
|
|
57
|
+
// Dual-read until 0.22.0 — prefer interaction-surface identity.
|
|
58
|
+
// oxlint-disable-next-line typescript/no-deprecated -- intentional dual-read
|
|
59
|
+
return target.key;
|
|
60
|
+
}
|
|
61
|
+
if (prop === "interaction") {
|
|
62
|
+
return target.interaction;
|
|
63
|
+
}
|
|
64
|
+
if (prop === "oninspect") {
|
|
65
|
+
return target.oninspect;
|
|
66
|
+
}
|
|
67
|
+
if (prop === "onselect") {
|
|
68
|
+
return target.onselect;
|
|
69
|
+
}
|
|
70
|
+
if (prop === "onlegendfocus") {
|
|
71
|
+
return target.onlegendfocus;
|
|
72
|
+
}
|
|
73
|
+
if (prop === "oninteraction") {
|
|
74
|
+
return target.oninteraction;
|
|
75
|
+
}
|
|
76
|
+
return Reflect.get(target, prop, receiver);
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
// Proxy of GGPlotProps is the EnginePlotProps view; bridge via unknown once.
|
|
80
|
+
return new Proxy(props, handler);
|
|
81
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plot live-region announcer extracted from GGPlot shared services.
|
|
3
|
+
*
|
|
4
|
+
* Pure refactor host: move body verbatim; no behavior change.
|
|
5
|
+
*/
|
|
6
|
+
export type PlotAnnouncer = {
|
|
7
|
+
readonly text: string;
|
|
8
|
+
announce(message: string): void;
|
|
9
|
+
clear(): void;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Owns the interaction live-region string: clear then set after a microtask
|
|
13
|
+
* so re-announcements of the same message still fire for assistive tech.
|
|
14
|
+
* `clear` is synchronous and queues nothing — a queued blank would run after
|
|
15
|
+
* (and swallow) a message announced earlier in the same tick.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createPlotAnnouncer(): PlotAnnouncer;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plot live-region announcer extracted from GGPlot shared services.
|
|
3
|
+
*
|
|
4
|
+
* Pure refactor host: move body verbatim; no behavior change.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Owns the interaction live-region string: clear then set after a microtask
|
|
8
|
+
* so re-announcements of the same message still fire for assistive tech.
|
|
9
|
+
* `clear` is synchronous and queues nothing — a queued blank would run after
|
|
10
|
+
* (and swallow) a message announced earlier in the same tick.
|
|
11
|
+
*/
|
|
12
|
+
export function createPlotAnnouncer() {
|
|
13
|
+
let interactionAnnouncement = $state("");
|
|
14
|
+
return {
|
|
15
|
+
get text() {
|
|
16
|
+
return interactionAnnouncement;
|
|
17
|
+
},
|
|
18
|
+
announce(message) {
|
|
19
|
+
interactionAnnouncement = "";
|
|
20
|
+
queueMicrotask(() => {
|
|
21
|
+
interactionAnnouncement = message;
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
clear() {
|
|
25
|
+
interactionAnnouncement = "";
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canvas first-paint readiness for GGPlot compositing.
|
|
3
|
+
*
|
|
4
|
+
* Readiness waits until every canvas stratum of the current model run has
|
|
5
|
+
* painted at least once. Tracking is by distinct stratum key (not raw
|
|
6
|
+
* notification count) so a re-attached canvas cannot mark the plot ready
|
|
7
|
+
* before sibling strata paint.
|
|
8
|
+
*/
|
|
9
|
+
export type PlotReadyInput = {
|
|
10
|
+
readonly hasModel: boolean;
|
|
11
|
+
readonly widthMode: "fixed" | "container";
|
|
12
|
+
readonly containerHasPositiveWidth: boolean;
|
|
13
|
+
readonly hasCanvas: boolean;
|
|
14
|
+
/** True when every canvas stratum of the current model run has painted. */
|
|
15
|
+
readonly paintComplete: boolean;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* VR / screenshot readiness predicate for `[data-gg-ready]`.
|
|
19
|
+
* Container width must be positive only when width is container-responsive.
|
|
20
|
+
* Canvas plots additionally require paintComplete.
|
|
21
|
+
*/
|
|
22
|
+
export declare function isPlotReady(input: PlotReadyInput): boolean;
|
|
23
|
+
export type PaintLedger = {
|
|
24
|
+
/** Record that a canvas stratum painted for `runId`. */
|
|
25
|
+
notify(runId: number, stratumKey: string): void;
|
|
26
|
+
/** Distinct strata painted for the current run. */
|
|
27
|
+
readonly paintedCount: number;
|
|
28
|
+
/** Run id of the current paint set, or -1 before any notify. */
|
|
29
|
+
readonly paintedRunId: number;
|
|
30
|
+
/**
|
|
31
|
+
* True when `runId` matches the ledger run and at least `canvasCount`
|
|
32
|
+
* distinct stratum keys have notified. `canvasCount === 0` is complete
|
|
33
|
+
* only when the ledger run already matches (including the initial -1 run).
|
|
34
|
+
*/
|
|
35
|
+
isComplete(runId: number, canvasCount: number): boolean;
|
|
36
|
+
};
|
|
37
|
+
/** Mutable paint ledger owned by one GGPlot instance. */
|
|
38
|
+
export declare function createPaintLedger(): PaintLedger;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canvas first-paint readiness for GGPlot compositing.
|
|
3
|
+
*
|
|
4
|
+
* Readiness waits until every canvas stratum of the current model run has
|
|
5
|
+
* painted at least once. Tracking is by distinct stratum key (not raw
|
|
6
|
+
* notification count) so a re-attached canvas cannot mark the plot ready
|
|
7
|
+
* before sibling strata paint.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* VR / screenshot readiness predicate for `[data-gg-ready]`.
|
|
11
|
+
* Container width must be positive only when width is container-responsive.
|
|
12
|
+
* Canvas plots additionally require paintComplete.
|
|
13
|
+
*/
|
|
14
|
+
export function isPlotReady(input) {
|
|
15
|
+
if (!input.hasModel)
|
|
16
|
+
return false;
|
|
17
|
+
if (input.widthMode === "container" && !input.containerHasPositiveWidth)
|
|
18
|
+
return false;
|
|
19
|
+
if (input.hasCanvas && !input.paintComplete)
|
|
20
|
+
return false;
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
/** Mutable paint ledger owned by one GGPlot instance. */
|
|
24
|
+
export function createPaintLedger() {
|
|
25
|
+
let paintedRunId = -1;
|
|
26
|
+
const paintedKeys = new Set();
|
|
27
|
+
return {
|
|
28
|
+
notify(runId, stratumKey) {
|
|
29
|
+
if (paintedRunId !== runId) {
|
|
30
|
+
paintedRunId = runId;
|
|
31
|
+
paintedKeys.clear();
|
|
32
|
+
}
|
|
33
|
+
paintedKeys.add(stratumKey);
|
|
34
|
+
},
|
|
35
|
+
get paintedCount() {
|
|
36
|
+
return paintedKeys.size;
|
|
37
|
+
},
|
|
38
|
+
get paintedRunId() {
|
|
39
|
+
return paintedRunId;
|
|
40
|
+
},
|
|
41
|
+
isComplete(runId, canvasCount) {
|
|
42
|
+
return paintedRunId === runId && paintedKeys.size >= canvasCount;
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve durable row identity for interaction (selection, legend focus, pin
|
|
3
|
+
* rebind, linked controllers).
|
|
4
|
+
*
|
|
5
|
+
* Plot authors should not need a custom identity for ordinary charts:
|
|
6
|
+
* 1. Interaction-surface identity (Inspect / Select / controller) when set.
|
|
7
|
+
* 2. Deprecated GGPlot `key` dual-read (until removal).
|
|
8
|
+
* 3. Else if plot data exposes a PropertyKey-valued `id` column → use `"id"`.
|
|
9
|
+
* 4. Else use the row index (order-stable only — not reorder-safe).
|
|
10
|
+
*
|
|
11
|
+
* Index identity is enough for single-plot legend focus / inspect / local
|
|
12
|
+
* selection. Custom durable identity across reorders or non-`id` natural keys
|
|
13
|
+
* belongs on Inspect / Select / createPlotInteraction — not plot grammar.
|
|
14
|
+
*/
|
|
15
|
+
import type { CellValue } from "@ggts-sh/core";
|
|
16
|
+
export type DatumKey = PropertyKey | ((row: Record<string, CellValue>, index: number) => PropertyKey);
|
|
17
|
+
/**
|
|
18
|
+
* Explicit identity sources. Prefer interaction surfaces over the deprecated
|
|
19
|
+
* plot-level `key` prop. First defined wins in this order.
|
|
20
|
+
*/
|
|
21
|
+
export type ExplicitDatumKeySources = {
|
|
22
|
+
/** `<Inspect identity=…>` or `inspect={{ identity: … }}`. */
|
|
23
|
+
readonly inspect?: DatumKey;
|
|
24
|
+
/** `select={{ type, identity: … }}`. */
|
|
25
|
+
readonly select?: DatumKey;
|
|
26
|
+
/** `createPlotInteraction({ identity })` when bound via `interaction=`. */
|
|
27
|
+
readonly controller?: DatumKey;
|
|
28
|
+
/** Deprecated GGPlot `key` dual-read (prefer interaction-surface identity). */
|
|
29
|
+
readonly legacy?: DatumKey;
|
|
30
|
+
};
|
|
31
|
+
export type ResolveDatumKeyInput = {
|
|
32
|
+
/**
|
|
33
|
+
* Already-picked explicit identity (from {@link pickExplicitDatumKey} or a
|
|
34
|
+
* single override). Wins over auto `id` / row-index defaults.
|
|
35
|
+
*/
|
|
36
|
+
readonly explicit?: DatumKey;
|
|
37
|
+
/** Plot data input (row array, DataRef, or bare columns map). */
|
|
38
|
+
readonly data?: unknown;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Pick the first defined identity from interaction surfaces, then legacy
|
|
42
|
+
* GGPlot `key`. Returns `undefined` when no surface supplies an override.
|
|
43
|
+
*/
|
|
44
|
+
export declare function pickExplicitDatumKey(sources: ExplicitDatumKeySources): DatumKey | undefined;
|
|
45
|
+
/** Read `identity` from object-form `select` (string shorthand has none). */
|
|
46
|
+
export declare function identityFromSelectInput(input: false | string | {
|
|
47
|
+
readonly identity?: DatumKey;
|
|
48
|
+
} | undefined): DatumKey | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Resolve the datum-key used by the plot engine.
|
|
51
|
+
* Always returns a key strategy — never `undefined`.
|
|
52
|
+
*/
|
|
53
|
+
export declare function resolveDatumKey(input: ResolveDatumKeyInput): DatumKey;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pick the first defined identity from interaction surfaces, then legacy
|
|
3
|
+
* GGPlot `key`. Returns `undefined` when no surface supplies an override.
|
|
4
|
+
*/
|
|
5
|
+
export function pickExplicitDatumKey(sources) {
|
|
6
|
+
if (sources.inspect !== undefined)
|
|
7
|
+
return sources.inspect;
|
|
8
|
+
if (sources.select !== undefined)
|
|
9
|
+
return sources.select;
|
|
10
|
+
if (sources.controller !== undefined)
|
|
11
|
+
return sources.controller;
|
|
12
|
+
if (sources.legacy !== undefined)
|
|
13
|
+
return sources.legacy;
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
/** Read `identity` from object-form `select` (string shorthand has none). */
|
|
17
|
+
export function identityFromSelectInput(input) {
|
|
18
|
+
if (input === undefined || input === false || typeof input === "string")
|
|
19
|
+
return undefined;
|
|
20
|
+
return input.identity;
|
|
21
|
+
}
|
|
22
|
+
/** Row-index identity — default when no `id` column and no explicit key. */
|
|
23
|
+
function rowIndexDatumKey(_row, index) {
|
|
24
|
+
return index;
|
|
25
|
+
}
|
|
26
|
+
/** True when `value` is a legal PropertyKey for semantic row identity. */
|
|
27
|
+
function isPropertyKeyIdentity(value) {
|
|
28
|
+
return typeof value === "string" || typeof value === "number" || typeof value === "symbol";
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Detect a usable `id` column on plot data (first cell must be PropertyKey).
|
|
32
|
+
* Does not scan every row for uniqueness — invalid/duplicate keys still emit
|
|
33
|
+
* INTERACTION_* key diagnostics at resolve time.
|
|
34
|
+
*/
|
|
35
|
+
function dataHasIdIdentityColumn(data) {
|
|
36
|
+
if (data === null || data === undefined)
|
|
37
|
+
return false;
|
|
38
|
+
if (Array.isArray(data)) {
|
|
39
|
+
if (data.length === 0)
|
|
40
|
+
return false;
|
|
41
|
+
const row = data[0];
|
|
42
|
+
if (row === null || typeof row !== "object" || Array.isArray(row))
|
|
43
|
+
return false;
|
|
44
|
+
return isPropertyKeyIdentity(row["id"]);
|
|
45
|
+
}
|
|
46
|
+
if (typeof data !== "object")
|
|
47
|
+
return false;
|
|
48
|
+
const record = data;
|
|
49
|
+
// DataRef { values: Row[] }
|
|
50
|
+
if (Array.isArray(record["values"]))
|
|
51
|
+
return dataHasIdIdentityColumn(record["values"]);
|
|
52
|
+
// DataRef { columns: { id: [...] } } or bare column map with id array
|
|
53
|
+
const columns = record["columns"] !== null &&
|
|
54
|
+
typeof record["columns"] === "object" &&
|
|
55
|
+
!Array.isArray(record["columns"])
|
|
56
|
+
? record["columns"]
|
|
57
|
+
: record;
|
|
58
|
+
const idColumn = columns["id"];
|
|
59
|
+
if (!Array.isArray(idColumn) || idColumn.length === 0)
|
|
60
|
+
return false;
|
|
61
|
+
return isPropertyKeyIdentity(idColumn[0]);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Resolve the datum-key used by the plot engine.
|
|
65
|
+
* Always returns a key strategy — never `undefined`.
|
|
66
|
+
*/
|
|
67
|
+
export function resolveDatumKey(input) {
|
|
68
|
+
if (input.explicit !== undefined)
|
|
69
|
+
return input.explicit;
|
|
70
|
+
if (dataHasIdIdentityColumn(input.data))
|
|
71
|
+
return "id";
|
|
72
|
+
return rowIndexDatumKey;
|
|
73
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { RenderModel, Stratum } from "@ggts-sh/core";
|
|
2
|
+
import type { PortableSpec } from "@ggts-sh/spec";
|
|
3
|
+
import type { LegendFilterClause } from "../legend/filter.js";
|
|
4
|
+
import type { ReadonlyZoomDomains } from "../interaction/interaction.js";
|
|
5
|
+
export type PlotRuntimeDeps = {
|
|
6
|
+
widthProp: () => number | "container" | undefined;
|
|
7
|
+
heightProp: () => number | undefined;
|
|
8
|
+
assembled: () => PortableSpec | null;
|
|
9
|
+
effectiveSpec: () => PortableSpec | null;
|
|
10
|
+
effectiveZoomDomains: () => ReadonlyZoomDomains | null;
|
|
11
|
+
effectiveLegendFilters: () => readonly LegendFilterClause[];
|
|
12
|
+
root: () => HTMLDivElement | null;
|
|
13
|
+
/** Silent zoom clear owned by the S4 zoom controller (`resetForScales`). */
|
|
14
|
+
resetZoom: () => void;
|
|
15
|
+
/**
|
|
16
|
+
* Getter for the onrender callback. The dispose/onrender effects wrap the
|
|
17
|
+
* getter invocation in `untrack` so callback identity is not a dependency
|
|
18
|
+
* (matches GGPlot.svelte:677-680).
|
|
19
|
+
*/
|
|
20
|
+
onrender: () => ((model: RenderModel, spec: PortableSpec) => void) | undefined;
|
|
21
|
+
};
|
|
22
|
+
export type PlotRuntime = {
|
|
23
|
+
readonly model: RenderModel | null;
|
|
24
|
+
readonly resolvedWidth: number;
|
|
25
|
+
readonly resolvedHeight: number;
|
|
26
|
+
readonly strata: readonly Stratum[];
|
|
27
|
+
readonly hasCanvas: boolean;
|
|
28
|
+
readonly ready: boolean;
|
|
29
|
+
notifyPainted(runId: number, stratumKey: string): void;
|
|
30
|
+
resetScales(): void;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Create the plot runtime. Construction registers ResizeObserver, model
|
|
34
|
+
* dispose/onrender, and clientFlush effects (#627). Dep getters must not be
|
|
35
|
+
* invoked during construction for construction-time deriveds.
|
|
36
|
+
*/
|
|
37
|
+
export declare function createPlotRuntime(deps: PlotRuntimeDeps): PlotRuntime;
|