@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,158 @@
|
|
|
1
|
+
import { INTERACTION_DIAGNOSTIC_CATALOG, } from "../interaction/interaction.js";
|
|
2
|
+
import { bandChannelsForZoom, canPublishPointSelection as canPublishPointSelectionFromSelect, capabilityStatusText, isEmptyPlotScene, legendFocusDiscreteOnlyDiagnostics, resolveFilteredAvailableTools, shouldShowToolRail, zoomScaleDiagnosticsFromChannels, zoomSupportsChannel, } from "../interaction/capability.js";
|
|
3
|
+
import { datumLabel as datumLabelFor, labelFromFields, markLabel as markLabelFor, uniqueMappedFields, } from "../assembly/labels.js";
|
|
4
|
+
import { isContainerWidthProp, plotRootInlineStyle } from "../assembly/layout.js";
|
|
5
|
+
import { themeTokensToCss } from "./theme-css.js";
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
// Factory
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
/**
|
|
10
|
+
* Create the plot chrome controller. All deriveds are construction-time —
|
|
11
|
+
* every dep is earlier-declared at the host factory position. No $state,
|
|
12
|
+
* handlers, or effects.
|
|
13
|
+
*/
|
|
14
|
+
export function createPlotChromeState(deps) {
|
|
15
|
+
const zoomHasSupportedChannel = $derived.by(() => {
|
|
16
|
+
const zoom = deps.zoomConfig();
|
|
17
|
+
const model = deps.model();
|
|
18
|
+
if (zoom === null || model === null)
|
|
19
|
+
return true;
|
|
20
|
+
return zoomSupportsChannel(zoom.mode, model.scales);
|
|
21
|
+
});
|
|
22
|
+
const availableTools = $derived(resolveFilteredAvailableTools(deps.configuredAvailableTools(), deps.zoomConfig(), deps.model()?.scales ?? null));
|
|
23
|
+
const canPublishPointSelection = $derived(canPublishPointSelectionFromSelect(deps.selectConfig()));
|
|
24
|
+
// Shared by tool-rail visibility and ToolRail recovery props (avoid dual calc).
|
|
25
|
+
const hasPointSelection = $derived(canPublishPointSelection && deps.effectiveSelectedKeys().length > 0);
|
|
26
|
+
// R3: interval presence covers dormant panel intervals, not just the
|
|
27
|
+
// committed one (effectiveIntervals), so recovery controls stay reachable.
|
|
28
|
+
const hasIntervalSelection = $derived(deps.effectiveIntervals().length > 0);
|
|
29
|
+
const hasZoomDomains = $derived(deps.effectiveZoomDomains() !== null);
|
|
30
|
+
const showToolRail = $derived(shouldShowToolRail({
|
|
31
|
+
interactive: deps.interactive(),
|
|
32
|
+
availableToolCount: availableTools.length,
|
|
33
|
+
canPublishPointSelection,
|
|
34
|
+
selectedKeyCount: deps.effectiveSelectedKeys().length,
|
|
35
|
+
hasIntervalSelection,
|
|
36
|
+
hasZoomDomains,
|
|
37
|
+
}));
|
|
38
|
+
const emptyPlot = $derived.by(() => {
|
|
39
|
+
const model = deps.model();
|
|
40
|
+
return model !== null && isEmptyPlotScene(model.scene.batches);
|
|
41
|
+
});
|
|
42
|
+
const preciseIntervalAxes = $derived.by(() => {
|
|
43
|
+
const selectOptions = deps.selectConfig();
|
|
44
|
+
if (selectOptions === null || selectOptions.type !== "interval")
|
|
45
|
+
return [];
|
|
46
|
+
return ["x", "y"].filter((axis) => selectOptions.mode === "xy" || selectOptions.mode === axis);
|
|
47
|
+
});
|
|
48
|
+
const preciseZoomAxes = $derived.by(() => {
|
|
49
|
+
const zoom = deps.zoomConfig();
|
|
50
|
+
const model = deps.model();
|
|
51
|
+
if (zoom === null || model === null)
|
|
52
|
+
return [];
|
|
53
|
+
return ["x", "y"].filter((axis) => (zoom.mode === "xy" || zoom.mode === axis) && model.scales[axis].type !== "band");
|
|
54
|
+
});
|
|
55
|
+
const areaScaleDiagnostics = $derived.by(() => {
|
|
56
|
+
const model = deps.model();
|
|
57
|
+
const zoom = deps.zoomConfig();
|
|
58
|
+
if (model === null || zoom === null)
|
|
59
|
+
return [];
|
|
60
|
+
return zoomScaleDiagnosticsFromChannels(bandChannelsForZoom(zoom.mode, model.scales), INTERACTION_DIAGNOSTIC_CATALOG.INTERACTION_INTERVAL_SCALE_UNSUPPORTED);
|
|
61
|
+
});
|
|
62
|
+
const legendDiagnostics = $derived.by(() => {
|
|
63
|
+
const model = deps.model();
|
|
64
|
+
if (model === null)
|
|
65
|
+
return [];
|
|
66
|
+
return legendFocusDiscreteOnlyDiagnostics(deps.legendFocusEnabled(), model.scene.legends);
|
|
67
|
+
});
|
|
68
|
+
const capabilityStatus = $derived.by(() => {
|
|
69
|
+
const unavailable = deps
|
|
70
|
+
.interactionDiagnostics()
|
|
71
|
+
.find((diagnostic) => diagnostic.code === "INTERACTION_INTERVAL_FACET_UNSUPPORTED");
|
|
72
|
+
const model = deps.model();
|
|
73
|
+
return capabilityStatusText({
|
|
74
|
+
...(unavailable !== undefined && {
|
|
75
|
+
facetUnavailableMessage: unavailable.message,
|
|
76
|
+
}),
|
|
77
|
+
areaDiagnostics: areaScaleDiagnostics,
|
|
78
|
+
zoomSupported: zoomHasSupportedChannel,
|
|
79
|
+
interactive: deps.interactive(),
|
|
80
|
+
emptyPlot,
|
|
81
|
+
candidateCount: model === null ? null : model.candidates.size,
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
const themeStyle = $derived.by(() => {
|
|
85
|
+
const model = deps.model();
|
|
86
|
+
return model === null ? "" : themeTokensToCss(model.scene.theme);
|
|
87
|
+
});
|
|
88
|
+
const rootStyle = $derived(plotRootInlineStyle({
|
|
89
|
+
needsSizedBox: deps.hasCanvas() ||
|
|
90
|
+
deps.interactive() ||
|
|
91
|
+
deps.effectiveEmphasisKeys().length > 0 ||
|
|
92
|
+
deps.effectiveSelectedKeys().length > 0,
|
|
93
|
+
containerWidth: isContainerWidthProp(deps.width()),
|
|
94
|
+
sceneWidth: deps.model()?.scene.width ?? deps.resolvedWidth(),
|
|
95
|
+
sceneHeight: deps.model()?.scene.height ?? deps.resolvedHeight(),
|
|
96
|
+
themeStyle,
|
|
97
|
+
}));
|
|
98
|
+
// Stable SceneView callback identity when model is unchanged. Unique field
|
|
99
|
+
// list is built once per model so per-mark labels do not re-flatten
|
|
100
|
+
// layerFields (#1329).
|
|
101
|
+
const markLabel = $derived.by(() => {
|
|
102
|
+
const model = deps.model();
|
|
103
|
+
if (model === null)
|
|
104
|
+
return (row) => markLabelFor(null, row);
|
|
105
|
+
const fields = uniqueMappedFields(model);
|
|
106
|
+
return (row) => {
|
|
107
|
+
const values = model.row(row);
|
|
108
|
+
if (values === null)
|
|
109
|
+
return `data point ${row + 1}`;
|
|
110
|
+
return labelFromFields(fields, values, `data point ${row + 1}`);
|
|
111
|
+
};
|
|
112
|
+
});
|
|
113
|
+
function datumLabel(values) {
|
|
114
|
+
return datumLabelFor(deps.model(), values);
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
get availableTools() {
|
|
118
|
+
return availableTools;
|
|
119
|
+
},
|
|
120
|
+
get canPublishPointSelection() {
|
|
121
|
+
return canPublishPointSelection;
|
|
122
|
+
},
|
|
123
|
+
get hasPointSelection() {
|
|
124
|
+
return hasPointSelection;
|
|
125
|
+
},
|
|
126
|
+
get hasIntervalSelection() {
|
|
127
|
+
return hasIntervalSelection;
|
|
128
|
+
},
|
|
129
|
+
get showToolRail() {
|
|
130
|
+
return showToolRail;
|
|
131
|
+
},
|
|
132
|
+
get emptyPlot() {
|
|
133
|
+
return emptyPlot;
|
|
134
|
+
},
|
|
135
|
+
get preciseIntervalAxes() {
|
|
136
|
+
return preciseIntervalAxes;
|
|
137
|
+
},
|
|
138
|
+
get preciseZoomAxes() {
|
|
139
|
+
return preciseZoomAxes;
|
|
140
|
+
},
|
|
141
|
+
get areaScaleDiagnostics() {
|
|
142
|
+
return areaScaleDiagnostics;
|
|
143
|
+
},
|
|
144
|
+
get legendDiagnostics() {
|
|
145
|
+
return legendDiagnostics;
|
|
146
|
+
},
|
|
147
|
+
get capabilityStatus() {
|
|
148
|
+
return capabilityStatus;
|
|
149
|
+
},
|
|
150
|
+
get rootStyle() {
|
|
151
|
+
return rootStyle;
|
|
152
|
+
},
|
|
153
|
+
get markLabel() {
|
|
154
|
+
return markLabel;
|
|
155
|
+
},
|
|
156
|
+
datumLabel,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Interaction theme roles exposed as CSS custom properties on the plot root.
|
|
2
|
+
* Values may be color strings or numeric opacities (e.g. interactionMuted). */
|
|
3
|
+
export type PlotThemeCssTokens = {
|
|
4
|
+
readonly interactionInk: string | number;
|
|
5
|
+
readonly interactionMuted: string | number;
|
|
6
|
+
readonly focusRing: string | number;
|
|
7
|
+
readonly crosshair: string | number;
|
|
8
|
+
readonly selectionFill: string | number;
|
|
9
|
+
readonly selectionStroke: string | number;
|
|
10
|
+
readonly tooltipPaper: string | number;
|
|
11
|
+
readonly tooltipInk: string | number;
|
|
12
|
+
readonly tooltipBorder: string | number;
|
|
13
|
+
readonly toolActive: string | number;
|
|
14
|
+
};
|
|
15
|
+
/** Stable role-order CSS custom property string for interaction chrome. */
|
|
16
|
+
export declare function themeTokensToCss(tokens: PlotThemeCssTokens): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const THEME_ROLES = [
|
|
2
|
+
"interactionInk",
|
|
3
|
+
"interactionMuted",
|
|
4
|
+
"focusRing",
|
|
5
|
+
"crosshair",
|
|
6
|
+
"selectionFill",
|
|
7
|
+
"selectionStroke",
|
|
8
|
+
"tooltipPaper",
|
|
9
|
+
"tooltipInk",
|
|
10
|
+
"tooltipBorder",
|
|
11
|
+
"toolActive",
|
|
12
|
+
];
|
|
13
|
+
/** Stable role-order CSS custom property string for interaction chrome. */
|
|
14
|
+
export function themeTokensToCss(tokens) {
|
|
15
|
+
return THEME_ROLES.map((role) => `--gg-theme-${role}:${tokens[role]}`).join(";");
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Filesystem and streams, injected so the command stays pure. */
|
|
2
|
+
export interface CodemodIO {
|
|
3
|
+
/** Every .svelte file at `path`, which may be a file or a directory. */
|
|
4
|
+
listSvelteFiles: (path: string) => string[];
|
|
5
|
+
readFile: (path: string) => string;
|
|
6
|
+
writeFile: (path: string, content: string) => void;
|
|
7
|
+
writeOut: (line: string) => void;
|
|
8
|
+
writeErr: (line: string) => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Run the codemod.
|
|
12
|
+
*
|
|
13
|
+
* Parses every file before writing any of them: a parse failure halfway
|
|
14
|
+
* through a directory must not leave a half-migrated tree behind.
|
|
15
|
+
*/
|
|
16
|
+
export declare function runCodemodCLI(argv: readonly string[], io: CodemodIO): number;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ggts-codemod` — opt-in migration of deprecated <GGPlot> grammar props
|
|
3
|
+
* to child layers (#659 slice 7, closes #290).
|
|
4
|
+
*
|
|
5
|
+
* Pure entry point: all I/O is injected through {@link CodemodIO}, so the whole
|
|
6
|
+
* command is testable without touching a disk. bin/ggts-codemod.js wires
|
|
7
|
+
* process streams and the exit code, exactly as @ggts-sh/cli's
|
|
8
|
+
* bin/ggts.js does.
|
|
9
|
+
*
|
|
10
|
+
* ADR 0013: dry-run by default, writes only behind an explicit `--write`, and
|
|
11
|
+
* anything the transform refuses to guess at is reported with the guide anchor
|
|
12
|
+
* for the manual change rather than half-migrated.
|
|
13
|
+
*
|
|
14
|
+
* Exit codes: 0 ok · 1 a file failed to parse · 2 usage error.
|
|
15
|
+
*/
|
|
16
|
+
import { migratePlotProps } from "./migrate-plot-props.js";
|
|
17
|
+
const USAGE = [
|
|
18
|
+
"usage: ggts-codemod [--write] <path…>",
|
|
19
|
+
"",
|
|
20
|
+
"Migrate deprecated <GGPlot> grammar props (facet, coord, scales, guides,",
|
|
21
|
+
"legend, theme, labs) to declaration-only child layers.",
|
|
22
|
+
"",
|
|
23
|
+
" --write apply the changes (default: print a diff and write nothing)",
|
|
24
|
+
" --source=S also treat module specifier S as ggts (repeatable)",
|
|
25
|
+
" --help show this message",
|
|
26
|
+
"",
|
|
27
|
+
"Shapes the codemod will not guess at are reported with the guide anchor",
|
|
28
|
+
"for the manual change: https://ggts.sh/guide/upgrading",
|
|
29
|
+
].join("\n");
|
|
30
|
+
function parseArgs(argv) {
|
|
31
|
+
const sources = [];
|
|
32
|
+
const paths = [];
|
|
33
|
+
let write = false;
|
|
34
|
+
for (const arg of argv) {
|
|
35
|
+
if (arg === "--write")
|
|
36
|
+
write = true;
|
|
37
|
+
else if (arg.startsWith("--source="))
|
|
38
|
+
sources.push(arg.slice("--source=".length));
|
|
39
|
+
else if (arg.startsWith("-"))
|
|
40
|
+
return { error: `unknown option: ${arg}` };
|
|
41
|
+
else
|
|
42
|
+
paths.push(arg);
|
|
43
|
+
}
|
|
44
|
+
if (paths.length === 0)
|
|
45
|
+
return { error: "no paths given" };
|
|
46
|
+
return { write, sources, paths };
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* A unified-ish diff of the changed lines.
|
|
50
|
+
*
|
|
51
|
+
* Deliberately line-based and dependency-free: the point is to let a human see
|
|
52
|
+
* what `--write` would do, not to produce a patch another tool can apply.
|
|
53
|
+
*/
|
|
54
|
+
function diff(path, before, after) {
|
|
55
|
+
const beforeLines = before.split("\n");
|
|
56
|
+
const afterLines = after.split("\n");
|
|
57
|
+
const lines = [`--- ${path}`, `+++ ${path}`];
|
|
58
|
+
let b = 0;
|
|
59
|
+
let a = 0;
|
|
60
|
+
while (b < beforeLines.length || a < afterLines.length) {
|
|
61
|
+
if (b < beforeLines.length && a < afterLines.length && beforeLines[b] === afterLines[a]) {
|
|
62
|
+
b += 1;
|
|
63
|
+
a += 1;
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
// `before` exhausted: everything left is appended. Handled ahead of the
|
|
67
|
+
// resync scan because that scan can only advance `a` as far as a line the
|
|
68
|
+
// two sides still share, and there is none left — which advanced neither
|
|
69
|
+
// index and spun forever on a file with no trailing newline.
|
|
70
|
+
if (b >= beforeLines.length) {
|
|
71
|
+
lines.push(`+${afterLines[a]}`);
|
|
72
|
+
a += 1;
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
// Resynchronize on the next line the two sides share, so an insertion
|
|
76
|
+
// shows as added lines rather than rewriting the whole tail. indexOf
|
|
77
|
+
// searches from `a` and an exact hit at `a` was consumed above, so a
|
|
78
|
+
// successful resync always sits strictly ahead and always advances `a`.
|
|
79
|
+
const resync = afterLines.indexOf(beforeLines[b], a);
|
|
80
|
+
if (resync === -1) {
|
|
81
|
+
lines.push(`-${beforeLines[b]}`);
|
|
82
|
+
b += 1;
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
while (a < resync) {
|
|
86
|
+
lines.push(`+${afterLines[a]}`);
|
|
87
|
+
a += 1;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return lines;
|
|
91
|
+
}
|
|
92
|
+
function reportSkips(io, path, skips) {
|
|
93
|
+
for (const skip of skips) {
|
|
94
|
+
io.writeErr(`manual change required: ${path}:${String(skip.line)} — ${skip.prop} (${skip.reason})`);
|
|
95
|
+
io.writeErr(` see ${skip.docUrl}`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Run the codemod.
|
|
100
|
+
*
|
|
101
|
+
* Parses every file before writing any of them: a parse failure halfway
|
|
102
|
+
* through a directory must not leave a half-migrated tree behind.
|
|
103
|
+
*/
|
|
104
|
+
export function runCodemodCLI(argv, io) {
|
|
105
|
+
if (argv.includes("--help") || argv.includes("-h")) {
|
|
106
|
+
io.writeOut(USAGE);
|
|
107
|
+
return 0;
|
|
108
|
+
}
|
|
109
|
+
const options = parseArgs(argv);
|
|
110
|
+
if ("error" in options) {
|
|
111
|
+
io.writeErr(options.error);
|
|
112
|
+
io.writeErr(USAGE);
|
|
113
|
+
return 2;
|
|
114
|
+
}
|
|
115
|
+
const files = options.paths.flatMap((path) => io.listSvelteFiles(path));
|
|
116
|
+
const pending = [];
|
|
117
|
+
let failed = false;
|
|
118
|
+
for (const path of files) {
|
|
119
|
+
if (!path.endsWith(".svelte"))
|
|
120
|
+
continue;
|
|
121
|
+
const before = io.readFile(path);
|
|
122
|
+
let result;
|
|
123
|
+
try {
|
|
124
|
+
result = migratePlotProps(before, { sources: options.sources });
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
io.writeErr(`${path}: ${error instanceof Error ? error.message : String(error)}`);
|
|
128
|
+
failed = true;
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
reportSkips(io, path, result.skipped);
|
|
132
|
+
if (result.changes.length > 0)
|
|
133
|
+
pending.push({ path, before, after: result.code });
|
|
134
|
+
}
|
|
135
|
+
if (failed)
|
|
136
|
+
return 1;
|
|
137
|
+
for (const change of pending) {
|
|
138
|
+
if (options.write)
|
|
139
|
+
io.writeFile(change.path, change.after);
|
|
140
|
+
else
|
|
141
|
+
for (const line of diff(change.path, change.before, change.after))
|
|
142
|
+
io.writeOut(line);
|
|
143
|
+
}
|
|
144
|
+
const count = pending.length;
|
|
145
|
+
const noun = count === 1 ? "file" : "files";
|
|
146
|
+
io.writeOut(options.write
|
|
147
|
+
? `${String(count)} ${noun} changed`
|
|
148
|
+
: `${String(count)} ${noun} would change (run again with --write to apply)`);
|
|
149
|
+
return 0;
|
|
150
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Positional source edits (#659 slice 7).
|
|
3
|
+
*
|
|
4
|
+
* ADR 0013 named `magic-string` as the starting-point stack and told the first
|
|
5
|
+
* real codemod to revisit it. This transform only ever removes attribute
|
|
6
|
+
* ranges and inserts child elements, so the whole requirement is "apply
|
|
7
|
+
* non-overlapping [start, end) replacements to the original string" — 20 lines
|
|
8
|
+
* that keep `@ggts-sh/svelte` free of a runtime dependency consumers would
|
|
9
|
+
* install forever to run a tool once.
|
|
10
|
+
*
|
|
11
|
+
* Applying right-to-left is what makes earlier offsets stay valid, which is
|
|
12
|
+
* why every offset in the caller can come straight from the parse tree.
|
|
13
|
+
*/
|
|
14
|
+
/** A replacement of `source[start, end)` with `text`. Insert ⇒ start === end. */
|
|
15
|
+
export interface Edit {
|
|
16
|
+
readonly start: number;
|
|
17
|
+
readonly end: number;
|
|
18
|
+
readonly text: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Apply non-overlapping edits to `source`.
|
|
22
|
+
*
|
|
23
|
+
* @throws if two edits overlap — a codemod bug that would otherwise corrupt
|
|
24
|
+
* output silently, which is exactly the "wrong rewrite" blast radius ADR 0013
|
|
25
|
+
* weighs. Insertions at the same offset are not overlaps and keep their
|
|
26
|
+
* relative order.
|
|
27
|
+
*/
|
|
28
|
+
export declare function applyEdits(source: string, edits: readonly Edit[]): string;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Positional source edits (#659 slice 7).
|
|
3
|
+
*
|
|
4
|
+
* ADR 0013 named `magic-string` as the starting-point stack and told the first
|
|
5
|
+
* real codemod to revisit it. This transform only ever removes attribute
|
|
6
|
+
* ranges and inserts child elements, so the whole requirement is "apply
|
|
7
|
+
* non-overlapping [start, end) replacements to the original string" — 20 lines
|
|
8
|
+
* that keep `@ggts-sh/svelte` free of a runtime dependency consumers would
|
|
9
|
+
* install forever to run a tool once.
|
|
10
|
+
*
|
|
11
|
+
* Applying right-to-left is what makes earlier offsets stay valid, which is
|
|
12
|
+
* why every offset in the caller can come straight from the parse tree.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Apply non-overlapping edits to `source`.
|
|
16
|
+
*
|
|
17
|
+
* @throws if two edits overlap — a codemod bug that would otherwise corrupt
|
|
18
|
+
* output silently, which is exactly the "wrong rewrite" blast radius ADR 0013
|
|
19
|
+
* weighs. Insertions at the same offset are not overlaps and keep their
|
|
20
|
+
* relative order.
|
|
21
|
+
*/
|
|
22
|
+
export function applyEdits(source, edits) {
|
|
23
|
+
const ordered = edits
|
|
24
|
+
.map((edit, index) => ({ edit, index }))
|
|
25
|
+
.toSorted((a, b) => b.edit.start - a.edit.start || b.index - a.index);
|
|
26
|
+
let out = source;
|
|
27
|
+
let lowestApplied = source.length;
|
|
28
|
+
for (const { edit } of ordered) {
|
|
29
|
+
if (edit.end > lowestApplied) {
|
|
30
|
+
throw new Error(`codemod: overlapping edits at [${String(edit.start)}, ${String(edit.end)})`);
|
|
31
|
+
}
|
|
32
|
+
out = out.slice(0, edit.start) + edit.text + out.slice(edit.end);
|
|
33
|
+
lowestApplied = edit.start;
|
|
34
|
+
}
|
|
35
|
+
return out;
|
|
36
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codemod entry point (#659 slice 7, closes #290).
|
|
3
|
+
*
|
|
4
|
+
* Consumed by bin/ggts-codemod.js. Not re-exported from the package root:
|
|
5
|
+
* a one-shot migration tool is not part of the charting API, and pulling
|
|
6
|
+
* `svelte/compiler` into the main entry would drag the compiler into every
|
|
7
|
+
* consumer bundle that imports a component.
|
|
8
|
+
*/
|
|
9
|
+
export { runCodemodCLI, type CodemodIO } from "./cli.js";
|
|
10
|
+
export { migratePlotProps, PACKAGE_SPECIFIER, type MigrateOptions, type MigrationResult, type PropChange, type PropSkip, } from "./migrate-plot-props.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codemod entry point (#659 slice 7, closes #290).
|
|
3
|
+
*
|
|
4
|
+
* Consumed by bin/ggts-codemod.js. Not re-exported from the package root:
|
|
5
|
+
* a one-shot migration tool is not part of the charting API, and pulling
|
|
6
|
+
* `svelte/compiler` into the main entry would drag the compiler into every
|
|
7
|
+
* consumer bundle that imports a component.
|
|
8
|
+
*/
|
|
9
|
+
export { runCodemodCLI } from "./cli.js";
|
|
10
|
+
export { migratePlotProps, PACKAGE_SPECIFIER, } from "./migrate-plot-props.js";
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure rewrite helpers for the plot-props codemod (AST walk, attribute→child
|
|
3
|
+
* emission, import edits). The public transform is migrate-plot-props.ts.
|
|
4
|
+
*
|
|
5
|
+
* Semantic confidence (ADR 0013): only meaning-preserving rewrites are
|
|
6
|
+
* performed. Each target component's props type is the prop's own type, so the
|
|
7
|
+
* rewrite cannot change the assembled PortableSpec:
|
|
8
|
+
*
|
|
9
|
+
* coord / scales / guides → <Coord|Scale|Guides value={…}/> (`value` IS the prop type)
|
|
10
|
+
* facet / legend / labs → <Facet|Legend|Labs {...…}/> (flat prop bags)
|
|
11
|
+
* theme (string literal) → <Theme name="…"/>
|
|
12
|
+
*
|
|
13
|
+
* `theme={expr}` is NOT rewritten: `theme` is `ThemeName | ThemeSpec`, and
|
|
14
|
+
* `<Theme>` takes `name` plus role overrides with no `value` hatch, so an
|
|
15
|
+
* object-valued expression cannot be routed without judgment.
|
|
16
|
+
*
|
|
17
|
+
* Named shells (`<ThemeDark/>`, `<ScaleColorDiscrete scheme="…"/>`) are what
|
|
18
|
+
* the guide recommends by hand, but the codemod never produces them: mapping a
|
|
19
|
+
* value onto a helper is a style choice, and for scales it is not even
|
|
20
|
+
* byte-identity-preserving (D8 — `normalize()` does not infer scale `type`).
|
|
21
|
+
*/
|
|
22
|
+
import type { GrammarCodemodForm } from "../layers/grammar-families.js";
|
|
23
|
+
import type { Edit } from "./edits.js";
|
|
24
|
+
/** How a deprecated prop's value is handed to its replacement component. */
|
|
25
|
+
type Form = GrammarCodemodForm;
|
|
26
|
+
export interface PropRule {
|
|
27
|
+
readonly component: string;
|
|
28
|
+
readonly form: Form;
|
|
29
|
+
readonly docUrl: string;
|
|
30
|
+
}
|
|
31
|
+
export interface Node {
|
|
32
|
+
readonly type: string;
|
|
33
|
+
readonly start: number;
|
|
34
|
+
readonly end: number;
|
|
35
|
+
}
|
|
36
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
37
|
+
/**
|
|
38
|
+
* Every object reachable one step down, arrays flattened.
|
|
39
|
+
*
|
|
40
|
+
* Deliberately not filtered to {@link isNode}: `Fragment` carries the children
|
|
41
|
+
* of an element but has no start/end, so a node-only walk stops at the first
|
|
42
|
+
* `<div>` and silently skips every plot nested inside one.
|
|
43
|
+
*/
|
|
44
|
+
export declare function childObjects(value: unknown): unknown[];
|
|
45
|
+
export declare function isNode(value: unknown): value is Node;
|
|
46
|
+
export declare function lineOf(source: string, offset: number): number;
|
|
47
|
+
/** Leading whitespace of the line `offset` sits on, or "" if code precedes it. */
|
|
48
|
+
export declare function indentAt(source: string, offset: number): string;
|
|
49
|
+
/**
|
|
50
|
+
* Build the replacement child for one deprecated attribute.
|
|
51
|
+
*
|
|
52
|
+
* @returns the element source, or a skip reason when the shape is one the
|
|
53
|
+
* codemod refuses to guess at.
|
|
54
|
+
*/
|
|
55
|
+
export declare function childFor(source: string, prop: string, rule: PropRule, attribute: Record<string, unknown>): {
|
|
56
|
+
element: string;
|
|
57
|
+
} | {
|
|
58
|
+
skip: string;
|
|
59
|
+
};
|
|
60
|
+
export interface ImportSite {
|
|
61
|
+
/** Named specifiers, in source order. */
|
|
62
|
+
readonly specifiers: {
|
|
63
|
+
readonly local: string;
|
|
64
|
+
readonly start: number;
|
|
65
|
+
readonly end: number;
|
|
66
|
+
}[];
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The named-import statement that brought ggts's `GGPlot` into scope.
|
|
70
|
+
*
|
|
71
|
+
* Scoped by module specifier on purpose: a `GGPlot` imported from a consumer's
|
|
72
|
+
* own `./local.js` is somebody else's component, and rewriting its props would
|
|
73
|
+
* be exactly the wrong-rewrite blast radius ADR 0013 weighs. `sources` exists
|
|
74
|
+
* so this repo can still migrate its own files, which import the package
|
|
75
|
+
* through relative paths because the workspace has no self-link.
|
|
76
|
+
*/
|
|
77
|
+
export declare function findGGPlotImport(program: unknown, sources: readonly string[]): ImportSite | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Edits that add `additions` to an existing named-import list.
|
|
80
|
+
*
|
|
81
|
+
* Sorted lists stay sorted (case-insensitively — the repo's own convention,
|
|
82
|
+
* e.g. `{ coordFixed, GGPlot, GeomLine }`); an unsorted list is appended to,
|
|
83
|
+
* so the codemod never reorders a line the author arranged deliberately.
|
|
84
|
+
*/
|
|
85
|
+
export declare function importEdits(site: ImportSite, additions: readonly string[]): Edit[];
|
|
86
|
+
export {};
|