@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,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <CoordTransform> — declaration-only post-stat coordinate transform for
|
|
3
|
+
* <GGPlot> (#659 slice 5). Accepts the same options as `coordTransform(…)`.
|
|
4
|
+
* Emits NO markup.
|
|
5
|
+
*/
|
|
6
|
+
import { type CoordTransformOptions } from "@ggts-sh/spec";
|
|
7
|
+
declare const CoordTransform: import("svelte").Component<CoordTransformOptions, {}, "">;
|
|
8
|
+
type CoordTransform = ReturnType<typeof CoordTransform>;
|
|
9
|
+
export default CoordTransform;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ggts-sh/core/data";
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plot-level composition advisories (ADR 0013 / #659).
|
|
3
|
+
*
|
|
4
|
+
* Sibling union to InteractionDiagnostic and DeprecationDiagnostic, delivered
|
|
5
|
+
* through the existing `ondiagnostic` channel as PlotDiagnostic.
|
|
6
|
+
*
|
|
7
|
+
* Three families:
|
|
8
|
+
* - keyed MERGE, scales (`kind: "scale"`): duplicate aesthetic channels after
|
|
9
|
+
* shallow per-key merge → `DUPLICATE_SCALE_CHANNEL`
|
|
10
|
+
* - keyed MERGE, everything else (`kind: "labs" | "guides" | "legend"`, #659
|
|
11
|
+
* slice 6): duplicate keys in the same shallow merge → `DUPLICATE_MERGE_KEY`
|
|
12
|
+
* - REPLACE (`kind: "coord" | "facet" | "theme"`): two children of the same
|
|
13
|
+
* kind → one silently wins → `DUPLICATE_PLOT_LAYER`
|
|
14
|
+
*
|
|
15
|
+
* The scale family keeps its own code rather than folding into
|
|
16
|
+
* DUPLICATE_MERGE_KEY: it shipped in 0.11.0, its `channel` field and its
|
|
17
|
+
* spelling-alias suggestion are scale-specific, and renaming a live advisory
|
|
18
|
+
* code would break consumer `switch`es for no behavioural gain.
|
|
19
|
+
*
|
|
20
|
+
* Kind sets and doc anchors come from GRAMMAR_FAMILIES (#785).
|
|
21
|
+
*/
|
|
22
|
+
import { type MergeByKeyKind, type ReplaceKind } from "../layers/grammar-families.js";
|
|
23
|
+
import type { PlotLayerLike } from "../layers/types.js";
|
|
24
|
+
export type CompositionDiagnosticCode = "DUPLICATE_SCALE_CHANNEL" | "DUPLICATE_MERGE_KEY" | "DUPLICATE_PLOT_LAYER";
|
|
25
|
+
/**
|
|
26
|
+
* `suggestions` and `docUrl` are NOT optional: both sibling members of
|
|
27
|
+
* PlotDiagnostic (InteractionDiagnostic, DeprecationDiagnostic) carry them, so
|
|
28
|
+
* a consumer rendering `d.docUrl` / `d.suggestions` over the union must not
|
|
29
|
+
* break on this variant. An advisory whose whole job is "your chart is
|
|
30
|
+
* silently wrong" is also the last place to omit the fix link.
|
|
31
|
+
*/
|
|
32
|
+
export interface DuplicateScaleChannelDiagnostic {
|
|
33
|
+
readonly severity: "advisory";
|
|
34
|
+
readonly code: "DUPLICATE_SCALE_CHANNEL";
|
|
35
|
+
readonly message: string;
|
|
36
|
+
readonly channel: string;
|
|
37
|
+
readonly kind: "scale";
|
|
38
|
+
readonly suggestions: ReadonlyArray<string>;
|
|
39
|
+
readonly docUrl: string;
|
|
40
|
+
}
|
|
41
|
+
/** Keyed-MERGE families other than scales (#659 slice 6 / #785). */
|
|
42
|
+
export type DuplicateMergeKeyKind = MergeByKeyKind;
|
|
43
|
+
/**
|
|
44
|
+
* Two children of one keyed-MERGE family wrote the same key. Unlike the
|
|
45
|
+
* REPLACE families nothing is wholesale lost — only that one key, where the
|
|
46
|
+
* later child's value silently overwrites the earlier one's.
|
|
47
|
+
*/
|
|
48
|
+
export interface DuplicateMergeKeyDiagnostic {
|
|
49
|
+
readonly severity: "advisory";
|
|
50
|
+
readonly code: "DUPLICATE_MERGE_KEY";
|
|
51
|
+
readonly message: string;
|
|
52
|
+
readonly kind: DuplicateMergeKeyKind;
|
|
53
|
+
/** The colliding key: a labs/legend option name, or a guides channel. */
|
|
54
|
+
readonly key: string;
|
|
55
|
+
readonly suggestions: ReadonlyArray<string>;
|
|
56
|
+
readonly docUrl: string;
|
|
57
|
+
}
|
|
58
|
+
export type DuplicatePlotLayerKind = ReplaceKind;
|
|
59
|
+
export interface DuplicatePlotLayerDiagnostic {
|
|
60
|
+
readonly severity: "advisory";
|
|
61
|
+
readonly code: "DUPLICATE_PLOT_LAYER";
|
|
62
|
+
readonly message: string;
|
|
63
|
+
readonly kind: DuplicatePlotLayerKind;
|
|
64
|
+
readonly suggestions: ReadonlyArray<string>;
|
|
65
|
+
readonly docUrl: string;
|
|
66
|
+
}
|
|
67
|
+
export type CompositionDiagnostic = DuplicateScaleChannelDiagnostic | DuplicateMergeKeyDiagnostic | DuplicatePlotLayerDiagnostic;
|
|
68
|
+
export declare function isCompositionDiagnostic(d: {
|
|
69
|
+
readonly code: string;
|
|
70
|
+
}): d is CompositionDiagnostic;
|
|
71
|
+
/** Narrow to the scale variant so `.channel` consumers stay type-safe. */
|
|
72
|
+
export declare function isDuplicateScaleChannelDiagnostic(d: CompositionDiagnostic | {
|
|
73
|
+
readonly code: string;
|
|
74
|
+
}): d is DuplicateScaleChannelDiagnostic;
|
|
75
|
+
/** Narrow to the non-scale keyed-MERGE variant so `.key` consumers stay safe. */
|
|
76
|
+
export declare function isDuplicateMergeKeyDiagnostic(d: CompositionDiagnostic | {
|
|
77
|
+
readonly code: string;
|
|
78
|
+
}): d is DuplicateMergeKeyDiagnostic;
|
|
79
|
+
/** Narrow to the REPLACE-family plot-layer variant. */
|
|
80
|
+
export declare function isDuplicatePlotLayerDiagnostic(d: CompositionDiagnostic | {
|
|
81
|
+
readonly code: string;
|
|
82
|
+
}): d is DuplicatePlotLayerDiagnostic;
|
|
83
|
+
/**
|
|
84
|
+
* Frozen catalog entry for composition codes. Per-emission fields are filled
|
|
85
|
+
* by {@link duplicateScaleChannelDiagnostic} / {@link duplicatePlotLayerDiagnostic}.
|
|
86
|
+
*/
|
|
87
|
+
export declare const COMPOSITION_DIAGNOSTIC_CATALOG: Readonly<Record<CompositionDiagnosticCode, Pick<CompositionDiagnostic, "severity" | "code"> & {
|
|
88
|
+
readonly messageTemplate: (subject: string) => string;
|
|
89
|
+
}>>;
|
|
90
|
+
/** Build a fully-populated duplicate-channel advisory. */
|
|
91
|
+
export declare function duplicateScaleChannelDiagnostic(channel: string): DuplicateScaleChannelDiagnostic;
|
|
92
|
+
/** Build a fully-populated duplicate merge-key advisory (labs/guides/legend). */
|
|
93
|
+
export declare function duplicateMergeKeyDiagnostic(kind: DuplicateMergeKeyKind, key: string): DuplicateMergeKeyDiagnostic;
|
|
94
|
+
/** Build a fully-populated duplicate REPLACE-family plot-layer advisory. */
|
|
95
|
+
export declare function duplicatePlotLayerDiagnostic(kind: DuplicatePlotLayerKind): DuplicatePlotLayerDiagnostic;
|
|
96
|
+
/**
|
|
97
|
+
* Scan plot layers for composition collisions (duplicate scale channels,
|
|
98
|
+
* keyed-MERGE key collisions, REPLACE multi-children). Pure — safe to call
|
|
99
|
+
* from a `$derived` that only re-reads `registry.layers`.
|
|
100
|
+
*
|
|
101
|
+
* Emission order: scale channels, then MERGE_KEY_EMIT_ORDER, then
|
|
102
|
+
* REPLACE_EMIT_ORDER. Mark layers are ignored.
|
|
103
|
+
*/
|
|
104
|
+
export declare function collectCompositionDiagnostics(layers: readonly PlotLayerLike[]): CompositionDiagnostic[];
|
|
105
|
+
/**
|
|
106
|
+
* Once-per-instance advisory dedup key for composition diagnostics.
|
|
107
|
+
* Shape matches the assembly deliveredAdvisories Set:
|
|
108
|
+
* - scale: `${code}:${channel}`
|
|
109
|
+
* - merge-key: `${code}:${kind}:${key}`
|
|
110
|
+
* - replace: `${code}:${kind}`
|
|
111
|
+
*/
|
|
112
|
+
export declare function compositionAdvisoryDedupKey(diagnostic: CompositionDiagnostic): string;
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plot-level composition advisories (ADR 0013 / #659).
|
|
3
|
+
*
|
|
4
|
+
* Sibling union to InteractionDiagnostic and DeprecationDiagnostic, delivered
|
|
5
|
+
* through the existing `ondiagnostic` channel as PlotDiagnostic.
|
|
6
|
+
*
|
|
7
|
+
* Three families:
|
|
8
|
+
* - keyed MERGE, scales (`kind: "scale"`): duplicate aesthetic channels after
|
|
9
|
+
* shallow per-key merge → `DUPLICATE_SCALE_CHANNEL`
|
|
10
|
+
* - keyed MERGE, everything else (`kind: "labs" | "guides" | "legend"`, #659
|
|
11
|
+
* slice 6): duplicate keys in the same shallow merge → `DUPLICATE_MERGE_KEY`
|
|
12
|
+
* - REPLACE (`kind: "coord" | "facet" | "theme"`): two children of the same
|
|
13
|
+
* kind → one silently wins → `DUPLICATE_PLOT_LAYER`
|
|
14
|
+
*
|
|
15
|
+
* The scale family keeps its own code rather than folding into
|
|
16
|
+
* DUPLICATE_MERGE_KEY: it shipped in 0.11.0, its `channel` field and its
|
|
17
|
+
* spelling-alias suggestion are scale-specific, and renaming a live advisory
|
|
18
|
+
* code would break consumer `switch`es for no behavioural gain.
|
|
19
|
+
*
|
|
20
|
+
* Kind sets and doc anchors come from GRAMMAR_FAMILIES (#785).
|
|
21
|
+
*/
|
|
22
|
+
import { GRAMMAR_FAMILIES, MERGE_KEY_EMIT_ORDER, REPLACE_EMIT_ORDER, grammarDocUrl, } from "../layers/grammar-families.js";
|
|
23
|
+
export function isCompositionDiagnostic(d) {
|
|
24
|
+
return (d.code === "DUPLICATE_SCALE_CHANNEL" ||
|
|
25
|
+
d.code === "DUPLICATE_MERGE_KEY" ||
|
|
26
|
+
d.code === "DUPLICATE_PLOT_LAYER");
|
|
27
|
+
}
|
|
28
|
+
/** Narrow to the scale variant so `.channel` consumers stay type-safe. */
|
|
29
|
+
export function isDuplicateScaleChannelDiagnostic(d) {
|
|
30
|
+
return d.code === "DUPLICATE_SCALE_CHANNEL";
|
|
31
|
+
}
|
|
32
|
+
/** Narrow to the non-scale keyed-MERGE variant so `.key` consumers stay safe. */
|
|
33
|
+
export function isDuplicateMergeKeyDiagnostic(d) {
|
|
34
|
+
return d.code === "DUPLICATE_MERGE_KEY";
|
|
35
|
+
}
|
|
36
|
+
/** Narrow to the REPLACE-family plot-layer variant. */
|
|
37
|
+
export function isDuplicatePlotLayerDiagnostic(d) {
|
|
38
|
+
return d.code === "DUPLICATE_PLOT_LAYER";
|
|
39
|
+
}
|
|
40
|
+
function mergeKeyNoun(kind) {
|
|
41
|
+
return GRAMMAR_FAMILIES[kind].mergeKeyNoun ?? "key";
|
|
42
|
+
}
|
|
43
|
+
function mergeKeyChild(kind) {
|
|
44
|
+
return GRAMMAR_FAMILIES[kind].mergeKeyChild ?? `<${kind}>`;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Frozen catalog entry for composition codes. Per-emission fields are filled
|
|
48
|
+
* by {@link duplicateScaleChannelDiagnostic} / {@link duplicatePlotLayerDiagnostic}.
|
|
49
|
+
*/
|
|
50
|
+
export const COMPOSITION_DIAGNOSTIC_CATALOG = Object.freeze({
|
|
51
|
+
DUPLICATE_SCALE_CHANNEL: {
|
|
52
|
+
severity: "advisory",
|
|
53
|
+
code: "DUPLICATE_SCALE_CHANNEL",
|
|
54
|
+
messageTemplate: (channel) => `Multiple scale children configure channel "${channel}"; later children overwrite earlier ones.`,
|
|
55
|
+
},
|
|
56
|
+
DUPLICATE_MERGE_KEY: {
|
|
57
|
+
severity: "advisory",
|
|
58
|
+
code: "DUPLICATE_MERGE_KEY",
|
|
59
|
+
messageTemplate: (key) => `Multiple children set "${key}"; later children overwrite earlier ones.`,
|
|
60
|
+
},
|
|
61
|
+
DUPLICATE_PLOT_LAYER: {
|
|
62
|
+
severity: "advisory",
|
|
63
|
+
code: "DUPLICATE_PLOT_LAYER",
|
|
64
|
+
messageTemplate: (kind) => `Multiple ${kind} children are registered; the last one replaces earlier ones.`,
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
/** Build a fully-populated duplicate-channel advisory. */
|
|
68
|
+
export function duplicateScaleChannelDiagnostic(channel) {
|
|
69
|
+
const entry = COMPOSITION_DIAGNOSTIC_CATALOG.DUPLICATE_SCALE_CHANNEL;
|
|
70
|
+
return {
|
|
71
|
+
severity: entry.severity,
|
|
72
|
+
code: "DUPLICATE_SCALE_CHANNEL",
|
|
73
|
+
message: entry.messageTemplate(channel),
|
|
74
|
+
channel,
|
|
75
|
+
kind: "scale",
|
|
76
|
+
suggestions: [
|
|
77
|
+
`Keep one scale child per channel — remove all but the intended "${channel}" scale`,
|
|
78
|
+
`British and American spellings write the same channel: <ScaleColorDiscrete/> and <ScaleColourContinuous/> both configure "color"`,
|
|
79
|
+
],
|
|
80
|
+
docUrl: grammarDocUrl("scale"),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/** Build a fully-populated duplicate merge-key advisory (labs/guides/legend). */
|
|
84
|
+
export function duplicateMergeKeyDiagnostic(kind, key) {
|
|
85
|
+
const entry = COMPOSITION_DIAGNOSTIC_CATALOG.DUPLICATE_MERGE_KEY;
|
|
86
|
+
const noun = mergeKeyNoun(kind);
|
|
87
|
+
const child = mergeKeyChild(kind);
|
|
88
|
+
return {
|
|
89
|
+
severity: entry.severity,
|
|
90
|
+
code: "DUPLICATE_MERGE_KEY",
|
|
91
|
+
message: entry.messageTemplate(key),
|
|
92
|
+
kind,
|
|
93
|
+
key,
|
|
94
|
+
suggestions: [
|
|
95
|
+
`Set the ${noun} "${key}" on exactly one ${child} child`,
|
|
96
|
+
`${kind} is a MERGE family: siblings that touch different ${noun}s all survive — only "${key}" is overwritten`,
|
|
97
|
+
],
|
|
98
|
+
docUrl: grammarDocUrl(kind),
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
/** Build a fully-populated duplicate REPLACE-family plot-layer advisory. */
|
|
102
|
+
export function duplicatePlotLayerDiagnostic(kind) {
|
|
103
|
+
const entry = COMPOSITION_DIAGNOSTIC_CATALOG.DUPLICATE_PLOT_LAYER;
|
|
104
|
+
const shell = kind === "theme" ? "Theme" : kind === "coord" ? "Coord" : kind === "facet" ? "Facet" : kind;
|
|
105
|
+
return {
|
|
106
|
+
severity: entry.severity,
|
|
107
|
+
code: "DUPLICATE_PLOT_LAYER",
|
|
108
|
+
message: entry.messageTemplate(kind),
|
|
109
|
+
kind,
|
|
110
|
+
suggestions: [
|
|
111
|
+
`Keep one <${shell}*> child — remove earlier ${kind} children so the intended one is the only registration`,
|
|
112
|
+
`${kind} is a REPLACE family: the last child fully replaces earlier ones (and any ${kind} prop)`,
|
|
113
|
+
],
|
|
114
|
+
docUrl: grammarDocUrl(kind),
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
function isMergeKeyLayer(layer) {
|
|
118
|
+
return MERGE_KEY_EMIT_ORDER.includes(layer.kind);
|
|
119
|
+
}
|
|
120
|
+
function isReplaceLayer(layer) {
|
|
121
|
+
return REPLACE_EMIT_ORDER.includes(layer.kind);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Scan plot layers for composition collisions (duplicate scale channels,
|
|
125
|
+
* keyed-MERGE key collisions, REPLACE multi-children). Pure — safe to call
|
|
126
|
+
* from a `$derived` that only re-reads `registry.layers`.
|
|
127
|
+
*
|
|
128
|
+
* Emission order: scale channels, then MERGE_KEY_EMIT_ORDER, then
|
|
129
|
+
* REPLACE_EMIT_ORDER. Mark layers are ignored.
|
|
130
|
+
*/
|
|
131
|
+
export function collectCompositionDiagnostics(layers) {
|
|
132
|
+
const list = [];
|
|
133
|
+
const seenChannels = new Set();
|
|
134
|
+
const duplicateChannels = new Set();
|
|
135
|
+
// Kind membership and emit order come from GRAMMAR_FAMILIES (#785).
|
|
136
|
+
// Scales keep their own advisory code (0.11.0 surface); labs/guides/legend
|
|
137
|
+
// share DUPLICATE_MERGE_KEY.
|
|
138
|
+
const mergeSeen = Object.fromEntries(MERGE_KEY_EMIT_ORDER.map((k) => [k, new Set()]));
|
|
139
|
+
const mergeDuplicates = Object.fromEntries(MERGE_KEY_EMIT_ORDER.map((k) => [k, new Set()]));
|
|
140
|
+
const replaceCounts = Object.fromEntries(REPLACE_EMIT_ORDER.map((k) => [k, 0]));
|
|
141
|
+
for (const layer of layers) {
|
|
142
|
+
if (layer.kind === "scale") {
|
|
143
|
+
for (const channel of Object.keys(layer.value)) {
|
|
144
|
+
if (seenChannels.has(channel)) {
|
|
145
|
+
duplicateChannels.add(channel);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
seenChannels.add(channel);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
if (isMergeKeyLayer(layer)) {
|
|
154
|
+
const kind = layer.kind;
|
|
155
|
+
for (const key of Object.keys(layer.value)) {
|
|
156
|
+
if (mergeSeen[kind].has(key)) {
|
|
157
|
+
mergeDuplicates[kind].add(key);
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
mergeSeen[kind].add(key);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
if (isReplaceLayer(layer)) {
|
|
166
|
+
replaceCounts[layer.kind] += 1;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
for (const channel of duplicateChannels) {
|
|
170
|
+
list.push(duplicateScaleChannelDiagnostic(channel));
|
|
171
|
+
}
|
|
172
|
+
for (const kind of MERGE_KEY_EMIT_ORDER) {
|
|
173
|
+
for (const key of mergeDuplicates[kind]) {
|
|
174
|
+
list.push(duplicateMergeKeyDiagnostic(kind, key));
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
for (const kind of REPLACE_EMIT_ORDER) {
|
|
178
|
+
if (replaceCounts[kind] > 1) {
|
|
179
|
+
list.push(duplicatePlotLayerDiagnostic(kind));
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return list;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Once-per-instance advisory dedup key for composition diagnostics.
|
|
186
|
+
* Shape matches the assembly deliveredAdvisories Set:
|
|
187
|
+
* - scale: `${code}:${channel}`
|
|
188
|
+
* - merge-key: `${code}:${kind}:${key}`
|
|
189
|
+
* - replace: `${code}:${kind}`
|
|
190
|
+
*/
|
|
191
|
+
export function compositionAdvisoryDedupKey(diagnostic) {
|
|
192
|
+
if (isDuplicateScaleChannelDiagnostic(diagnostic)) {
|
|
193
|
+
return `${diagnostic.code}:${diagnostic.channel}`;
|
|
194
|
+
}
|
|
195
|
+
if (isDuplicateMergeKeyDiagnostic(diagnostic)) {
|
|
196
|
+
return `${diagnostic.code}:${diagnostic.kind}:${diagnostic.key}`;
|
|
197
|
+
}
|
|
198
|
+
if (isDuplicatePlotLayerDiagnostic(diagnostic)) {
|
|
199
|
+
return `${diagnostic.code}:${diagnostic.kind}`;
|
|
200
|
+
}
|
|
201
|
+
// Exhaustiveness: CompositionDiagnostic has only the three variants above.
|
|
202
|
+
return ((x) => x)(diagnostic);
|
|
203
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plot-level deprecation advisories (ADR 0013).
|
|
3
|
+
*
|
|
4
|
+
* Sibling union to InteractionDiagnostic, delivered through the existing
|
|
5
|
+
* `ondiagnostic` channel as PlotDiagnostic. One code (`DEPRECATED_PLOT_PROP`)
|
|
6
|
+
* covers every deprecated grammar prop — `prop` carries the name.
|
|
7
|
+
*
|
|
8
|
+
* Runtime emission left in 0.13.0 (#704) when the seven grammar props were
|
|
9
|
+
* removed. Types + catalog + builder stay for union typing, upgrade-guide
|
|
10
|
+
* anchors, and codemod consumers. Discriminate with
|
|
11
|
+
* `d.code === "DEPRECATED_PLOT_PROP"` (no type-guard export).
|
|
12
|
+
*
|
|
13
|
+
* Deliberately NOT merged into INTERACTION_DIAGNOSTIC_CATALOG / the
|
|
14
|
+
* interaction-reference guide page: a deprecated grammar prop is not an
|
|
15
|
+
* interaction concern, and migration guidance belongs on /guide/upgrading
|
|
16
|
+
* (docUrl below). Omitting it from the interaction catalog is a decision,
|
|
17
|
+
* not an oversight.
|
|
18
|
+
*/
|
|
19
|
+
import type { InteractionDiagnostic } from "../interaction/interaction-diagnostics.js";
|
|
20
|
+
import type { CompositionDiagnostic } from "./composition.js";
|
|
21
|
+
export type DeprecationDiagnosticCode = "DEPRECATED_PLOT_PROP";
|
|
22
|
+
export interface DeprecationDiagnostic {
|
|
23
|
+
readonly severity: "advisory";
|
|
24
|
+
readonly code: DeprecationDiagnosticCode;
|
|
25
|
+
readonly message: string;
|
|
26
|
+
readonly prop: string;
|
|
27
|
+
readonly since: string;
|
|
28
|
+
readonly removeIn: string;
|
|
29
|
+
readonly suggestions: ReadonlyArray<string>;
|
|
30
|
+
readonly docUrl: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Union of every diagnostic the plot may deliver through `ondiagnostic`.
|
|
34
|
+
* Interaction capability/key/lineage checks, grammar-prop deprecations, and
|
|
35
|
+
* composition collisions (duplicate scale channels). Additive: handlers
|
|
36
|
+
* annotated `PlotDiagnostic` (the 0.11 form) remain valid. Exhaustive
|
|
37
|
+
* `switch` on `.code` needs arms for `DUPLICATE_SCALE_CHANNEL` and
|
|
38
|
+
* `DUPLICATE_PLOT_LAYER`.
|
|
39
|
+
*/
|
|
40
|
+
export type PlotDiagnostic = InteractionDiagnostic | DeprecationDiagnostic | CompositionDiagnostic;
|
|
41
|
+
/**
|
|
42
|
+
* Frozen catalog entry for the single deprecation code. Message / prop /
|
|
43
|
+
* since / removeIn / docUrl are filled per emission by
|
|
44
|
+
* {@link deprecatedPropDiagnostic}.
|
|
45
|
+
*/
|
|
46
|
+
export declare const DEPRECATION_DIAGNOSTIC_CATALOG: Readonly<Record<DeprecationDiagnosticCode, Pick<DeprecationDiagnostic, "severity" | "code"> & {
|
|
47
|
+
readonly messageTemplate: (prop: string, since: string, removeIn: string) => string;
|
|
48
|
+
}>>;
|
|
49
|
+
export type DeprecatedPropDiagnosticInput = {
|
|
50
|
+
readonly prop: string;
|
|
51
|
+
readonly since: string;
|
|
52
|
+
readonly removeIn: string;
|
|
53
|
+
readonly suggestions: ReadonlyArray<string>;
|
|
54
|
+
/** Heading anchor on /guide/upgrading (without the leading `#`). */
|
|
55
|
+
readonly anchor: string;
|
|
56
|
+
};
|
|
57
|
+
/** Build a fully-populated deprecation advisory for one prop. */
|
|
58
|
+
export declare function deprecatedPropDiagnostic(input: DeprecatedPropDiagnosticInput): DeprecationDiagnostic;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const GUIDE_UPGRADING = "https://ggts.sh/guide/upgrading";
|
|
2
|
+
/**
|
|
3
|
+
* Frozen catalog entry for the single deprecation code. Message / prop /
|
|
4
|
+
* since / removeIn / docUrl are filled per emission by
|
|
5
|
+
* {@link deprecatedPropDiagnostic}.
|
|
6
|
+
*/
|
|
7
|
+
export const DEPRECATION_DIAGNOSTIC_CATALOG = Object.freeze({
|
|
8
|
+
DEPRECATED_PLOT_PROP: {
|
|
9
|
+
severity: "advisory",
|
|
10
|
+
code: "DEPRECATED_PLOT_PROP",
|
|
11
|
+
messageTemplate: (prop, since, removeIn) => `GGPlot prop "${prop}" is deprecated since ${since} and will be removed in ${removeIn}. Prefer the matching declaration-only child layer.`,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
/** Build a fully-populated deprecation advisory for one prop. */
|
|
15
|
+
export function deprecatedPropDiagnostic(input) {
|
|
16
|
+
const entry = DEPRECATION_DIAGNOSTIC_CATALOG.DEPRECATED_PLOT_PROP;
|
|
17
|
+
return {
|
|
18
|
+
severity: entry.severity,
|
|
19
|
+
code: entry.code,
|
|
20
|
+
message: entry.messageTemplate(input.prop, input.since, input.removeIn),
|
|
21
|
+
prop: input.prop,
|
|
22
|
+
since: input.since,
|
|
23
|
+
removeIn: input.removeIn,
|
|
24
|
+
suggestions: input.suggestions,
|
|
25
|
+
docUrl: `${GUIDE_UPGRADING}#${input.anchor}`,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plot-engine diagnostic orchestration — config delivery plus the once-only
|
|
3
|
+
* advisory effects (wiring, multi-Inspect, dropped identity, deprecations,
|
|
4
|
+
* composition, inspect-geom, high-cardinality) and the chrome re-delivery
|
|
5
|
+
* effects.
|
|
6
|
+
*
|
|
7
|
+
* Extraction contract (S5): inputs are lazy getters / stable service refs over
|
|
8
|
+
* the engine's live deriveds — never snapshots. `deliverDiagnostic` is one
|
|
9
|
+
* stable closure per engine (shared dedup Set included), so late
|
|
10
|
+
* registrations (chrome re-delivery, semantic-keys) deliver through the same
|
|
11
|
+
* sink.
|
|
12
|
+
*
|
|
13
|
+
* Call `createPlotEngineDiagnostics` synchronously while `createPlotEngine`
|
|
14
|
+
* runs during component init: every `$effect` here must land in the component
|
|
15
|
+
* effect tree. Runtime-gated advisories (inspect-geom, high-cardinality) and
|
|
16
|
+
* the chrome re-delivery effects register later via the register* functions —
|
|
17
|
+
* still during init, at the engine's original registration positions.
|
|
18
|
+
*/
|
|
19
|
+
import type { PortableSpec } from "@ggts-sh/spec";
|
|
20
|
+
import { type PlotDiagnostic } from "./deprecation.js";
|
|
21
|
+
import type { LayerRegistry } from "../geoms/registry.svelte.js";
|
|
22
|
+
import { type ResolvedInteractionConfig } from "../interaction/interaction.js";
|
|
23
|
+
import type { CapabilityResolution } from "../interaction/capability-resolution.svelte.js";
|
|
24
|
+
import { type EnginePlotProps } from "../plot-props.js";
|
|
25
|
+
import type { PlotChromeState } from "../chrome/chrome-state.svelte.js";
|
|
26
|
+
import type { PlotRuntime } from "../runtime/runtime.svelte.js";
|
|
27
|
+
/**
|
|
28
|
+
* Inputs: live props proxy + registry (reactive reads) and the engine's
|
|
29
|
+
* capability-resolution / interaction-config accessors.
|
|
30
|
+
*/
|
|
31
|
+
export type PlotEngineDiagnosticsInput = {
|
|
32
|
+
readonly props: EnginePlotProps;
|
|
33
|
+
readonly registry: LayerRegistry;
|
|
34
|
+
readonly interactionConfig: () => ResolvedInteractionConfig;
|
|
35
|
+
readonly capabilityResolution: CapabilityResolution;
|
|
36
|
+
};
|
|
37
|
+
export declare function createPlotEngineDiagnostics(input: PlotEngineDiagnosticsInput): {
|
|
38
|
+
deliverDiagnostic: (diagnostic: PlotDiagnostic) => void;
|
|
39
|
+
registerChromeDiagnostics: (chrome: PlotChromeState) => void;
|
|
40
|
+
registerInspectDiagnostics: (opts: {
|
|
41
|
+
assembled: () => PortableSpec | null;
|
|
42
|
+
model: () => PlotRuntime["model"];
|
|
43
|
+
}) => void;
|
|
44
|
+
};
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { collectCompositionDiagnostics, compositionAdvisoryDedupKey, } from "./composition.js";
|
|
2
|
+
import { deprecatedPropDiagnostic } from "./deprecation.js";
|
|
3
|
+
import { discreteColorFillDomainSizes, inspectAxisOnBarColDiagnostics, inspectAxisOnDistributionDiagnostics, inspectHighCardinalityDiagnostics, layerGeomsFromSpecLayers, } from "../interaction/interaction.js";
|
|
4
|
+
import { droppedInspectIdentityDiagnostics, duplicateInspectCapabilityDiagnostics, } from "../interaction/resolve-inspect-capability.js";
|
|
5
|
+
import { collectWiringDiagnostics } from "../interaction/wiring-advisories.js";
|
|
6
|
+
import { readLegacyPlotKey, readLegacyPlotLegendFilter, readLegacyPlotLegendFocus, } from "../plot-props.js";
|
|
7
|
+
export function createPlotEngineDiagnostics(input) {
|
|
8
|
+
const capabilityResolution = input.capabilityResolution;
|
|
9
|
+
function deliverDiagnostic(diagnostic) {
|
|
10
|
+
const ondiagnostic = input.props.ondiagnostic;
|
|
11
|
+
ondiagnostic?.(diagnostic);
|
|
12
|
+
const nodeEnvironment = globalThis.process
|
|
13
|
+
?.env?.NODE_ENV;
|
|
14
|
+
if (nodeEnvironment !== "production" && ondiagnostic === undefined)
|
|
15
|
+
console.warn(`[ggts:${diagnostic.code}] ${diagnostic.message}`);
|
|
16
|
+
}
|
|
17
|
+
$effect(() => {
|
|
18
|
+
for (const diagnostic of input.interactionConfig().diagnostics)
|
|
19
|
+
deliverDiagnostic(diagnostic);
|
|
20
|
+
});
|
|
21
|
+
// Wiring advisories (ADR 0013 audit): prop combinations that silently do
|
|
22
|
+
// nothing. Unlike config diagnostics (re-delivered per recompute), these
|
|
23
|
+
// fire once per prop per plot instance — a later capability toggle must
|
|
24
|
+
// not re-advise. Pure collect lives in wiring-advisories.ts; snapshot is
|
|
25
|
+
// taken inside this derived so late-bound handlers still recompute.
|
|
26
|
+
// capabilities.inspect is resolved (prop + <Inspect> children), not raw prop.
|
|
27
|
+
const wiringDiagnostics = $derived.by(() => {
|
|
28
|
+
const capabilities = capabilityResolution.caps();
|
|
29
|
+
// legendFocus "requested" is the GuideLegend/child (or deprecated prop)
|
|
30
|
+
// opt-in — not the post-key-check resolved config — so keyless focus does
|
|
31
|
+
// not double-advise HANDLER_WITHOUT_CAPABILITY + LEGEND_REQUIRES_KEY.
|
|
32
|
+
return collectWiringDiagnostics({
|
|
33
|
+
interactionScope: input.props.interactionScope,
|
|
34
|
+
interaction: input.props.interaction,
|
|
35
|
+
handlers: {
|
|
36
|
+
oninspect: input.props.oninspect,
|
|
37
|
+
onselect: input.props.onselect,
|
|
38
|
+
onzoom: input.props.onzoom,
|
|
39
|
+
onlegendfocus: input.props.onlegendfocus,
|
|
40
|
+
onlegendfilter: input.props.onlegendfilter,
|
|
41
|
+
},
|
|
42
|
+
capabilities: {
|
|
43
|
+
inspect: capabilities.inspect,
|
|
44
|
+
select: capabilities.select,
|
|
45
|
+
zoom: capabilities.zoom,
|
|
46
|
+
legendFocus: capabilityResolution.legendFocus().requested,
|
|
47
|
+
// legendFilter "requested" is GuideLegend/child (or deprecated prop)
|
|
48
|
+
// opt-in — not resolveCapabilities(plot prop alone).
|
|
49
|
+
legendFilter: capabilityResolution.legendFilter().requested,
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
// Shared once-per-dedup-key Set for wiring + multi-Inspect + deprecations +
|
|
54
|
+
// composition + inspect-geom. Each deliverAdvisoriesOnce call registers ONE
|
|
55
|
+
// $effect; call order below is the registration (and first-flush delivery)
|
|
56
|
+
// order. Re-delivering effects (config diagnostics above, chrome
|
|
57
|
+
// re-delivery via registerChromeDiagnostics) stay outside this helper by
|
|
58
|
+
// design.
|
|
59
|
+
const deliveredAdvisories = new Set();
|
|
60
|
+
function deliverAdvisoriesOnce(get, dedupKeyOf = (diagnostic) => `${diagnostic.code}:${diagnostic.prop}`) {
|
|
61
|
+
$effect(() => {
|
|
62
|
+
for (const diagnostic of get()) {
|
|
63
|
+
const dedupKey = dedupKeyOf(diagnostic);
|
|
64
|
+
if (deliveredAdvisories.has(dedupKey))
|
|
65
|
+
continue;
|
|
66
|
+
deliveredAdvisories.add(dedupKey);
|
|
67
|
+
deliverDiagnostic(diagnostic);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
deliverAdvisoriesOnce(() => wiringDiagnostics);
|
|
72
|
+
// Multiple <Inspect> children: last wins; advisory once per mount.
|
|
73
|
+
const multiInspectDiagnostics = $derived.by(() => duplicateInspectCapabilityDiagnostics(capabilityResolution.inspect().multiChild));
|
|
74
|
+
deliverAdvisoriesOnce(() => multiInspectDiagnostics);
|
|
75
|
+
// <Inspect> replaced an inspect prop that named `identity`: rows silently
|
|
76
|
+
// fell back to id column / row index before #1305's follow-up.
|
|
77
|
+
const droppedIdentityDiagnostics = $derived.by(() => droppedInspectIdentityDiagnostics(capabilityResolution.inspect().droppedPropIdentity));
|
|
78
|
+
deliverAdvisoriesOnce(() => droppedIdentityDiagnostics);
|
|
79
|
+
// Deprecated plot-level key → Inspect / Select / controller identity.
|
|
80
|
+
const deprecatedKeyDiagnostics = $derived.by(() => {
|
|
81
|
+
const plotProp = readLegacyPlotKey(input.props);
|
|
82
|
+
if (plotProp === undefined)
|
|
83
|
+
return [];
|
|
84
|
+
return [
|
|
85
|
+
deprecatedPropDiagnostic({
|
|
86
|
+
prop: "key",
|
|
87
|
+
since: "0.21.0",
|
|
88
|
+
removeIn: "0.22.0",
|
|
89
|
+
suggestions: [
|
|
90
|
+
'Use <Inspect identity="year" /> (or inspect={{ identity: "year" }})',
|
|
91
|
+
'Use select={{ type: "point", identity: "year" }} when selection owns the key',
|
|
92
|
+
'Use createPlotInteraction({ identity: "year" }) for linked controllers',
|
|
93
|
+
],
|
|
94
|
+
anchor: "row-identity-on-interaction",
|
|
95
|
+
}),
|
|
96
|
+
];
|
|
97
|
+
});
|
|
98
|
+
deliverAdvisoriesOnce(() => deprecatedKeyDiagnostics);
|
|
99
|
+
// Deprecated plot-level legendFocus → GuideLegend.focus (one minor window).
|
|
100
|
+
const deprecatedLegendFocusDiagnostics = $derived.by(() => {
|
|
101
|
+
const plotProp = readLegacyPlotLegendFocus(input.props);
|
|
102
|
+
if (plotProp === undefined || plotProp === false)
|
|
103
|
+
return [];
|
|
104
|
+
return [
|
|
105
|
+
deprecatedPropDiagnostic({
|
|
106
|
+
prop: "legendFocus",
|
|
107
|
+
since: "0.19.0",
|
|
108
|
+
removeIn: "0.20.0",
|
|
109
|
+
suggestions: [
|
|
110
|
+
'Use <GuideLegend channel="color" focus /> (or the aesthetic that owns the discrete legend)',
|
|
111
|
+
"focus={{ preview: false }} on GuideLegend replaces legendFocus={{ preview: false }}",
|
|
112
|
+
],
|
|
113
|
+
anchor: "legend-focus-on-guidelegend",
|
|
114
|
+
}),
|
|
115
|
+
];
|
|
116
|
+
});
|
|
117
|
+
deliverAdvisoriesOnce(() => deprecatedLegendFocusDiagnostics);
|
|
118
|
+
// Deprecated plot-level legendFilter → GuideLegend.filter (one minor window).
|
|
119
|
+
const deprecatedLegendFilterDiagnostics = $derived.by(() => {
|
|
120
|
+
const plotProp = readLegacyPlotLegendFilter(input.props);
|
|
121
|
+
if (plotProp === undefined || plotProp === false)
|
|
122
|
+
return [];
|
|
123
|
+
return [
|
|
124
|
+
deprecatedPropDiagnostic({
|
|
125
|
+
prop: "legendFilter",
|
|
126
|
+
since: "0.19.0",
|
|
127
|
+
removeIn: "0.20.0",
|
|
128
|
+
suggestions: [
|
|
129
|
+
'Use <GuideLegend channel="color" filter /> (or the aesthetic that owns the discrete legend)',
|
|
130
|
+
'filter={{ mode: "include", multiple: false }} on GuideLegend replaces legendFilter={{ … }}',
|
|
131
|
+
],
|
|
132
|
+
anchor: "legend-filter-on-guidelegend",
|
|
133
|
+
}),
|
|
134
|
+
];
|
|
135
|
+
});
|
|
136
|
+
deliverAdvisoriesOnce(() => deprecatedLegendFilterDiagnostics);
|
|
137
|
+
// Composition advisories (#659 slices 3+5+6): pure collect over
|
|
138
|
+
// registry.layers. Last child still wins (shallow merge / last write);
|
|
139
|
+
// delivery is once-per-dedup-key via compositionAdvisoryDedupKey.
|
|
140
|
+
const compositionDiagnostics = $derived.by(() => collectCompositionDiagnostics(input.registry.layers));
|
|
141
|
+
deliverAdvisoriesOnce(() => compositionDiagnostics, compositionAdvisoryDedupKey);
|
|
142
|
+
// Chrome area-scale / legend diagnostics re-deliver per recompute (outside
|
|
143
|
+
// the once-only helper by design). Register after chromeState exists.
|
|
144
|
+
function registerChromeDiagnostics(chrome) {
|
|
145
|
+
$effect(() => {
|
|
146
|
+
for (const diagnostic of chrome.areaScaleDiagnostics)
|
|
147
|
+
deliverDiagnostic(diagnostic);
|
|
148
|
+
});
|
|
149
|
+
$effect(() => {
|
|
150
|
+
for (const diagnostic of chrome.legendDiagnostics)
|
|
151
|
+
deliverDiagnostic(diagnostic);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
// Runtime-gated inspect advisories — register after the plot runtime exists
|
|
155
|
+
// (trained scales gate both). Still during init, at the engine's original
|
|
156
|
+
// registration position.
|
|
157
|
+
function registerInspectDiagnostics(opts) {
|
|
158
|
+
// Inspect axis guides that fight bar/col geometry (or bisect on-bar labels)
|
|
159
|
+
// and freescrolling guides through distribution/interval band geoms (#1528).
|
|
160
|
+
// After runtime so trained scales gate interval-geom advisories (continuous
|
|
161
|
+
// shared-x line+errorbar with mode="x" stays silent). Mode x/xy still fire
|
|
162
|
+
// under coord_flip (#1409): the band-axis guide remains.
|
|
163
|
+
const inspectGeomDiagnostics = $derived.by(() => {
|
|
164
|
+
const mode = input.interactionConfig().inspect?.mode;
|
|
165
|
+
if (mode === undefined)
|
|
166
|
+
return [];
|
|
167
|
+
const geoms = layerGeomsFromSpecLayers(opts.assembled()?.layers);
|
|
168
|
+
const scales = opts.model()?.scales;
|
|
169
|
+
const discreteBandAxis = scales !== undefined && (scales.x.type === "band" || scales.y.type === "band");
|
|
170
|
+
return [
|
|
171
|
+
...inspectAxisOnBarColDiagnostics(mode, geoms),
|
|
172
|
+
...inspectAxisOnDistributionDiagnostics(mode, geoms, { discreteBandAxis }),
|
|
173
|
+
];
|
|
174
|
+
});
|
|
175
|
+
deliverAdvisoriesOnce(() => inspectGeomDiagnostics);
|
|
176
|
+
// High-cardinality discrete color/fill + inspect: default tooltip policy
|
|
177
|
+
// advisory (#1274). Needs trained scales (runtime.model); once-per-channel.
|
|
178
|
+
const inspectHighCardinality = $derived.by(() => {
|
|
179
|
+
// Resolved inspect is null when off (never undefined) — see normalizeInteractionConfig.
|
|
180
|
+
if (input.interactionConfig().inspect === null)
|
|
181
|
+
return [];
|
|
182
|
+
const model = opts.model();
|
|
183
|
+
if (model === null)
|
|
184
|
+
return [];
|
|
185
|
+
return inspectHighCardinalityDiagnostics({
|
|
186
|
+
inspectEnabled: true,
|
|
187
|
+
domainSizes: discreteColorFillDomainSizes(model.scales),
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
deliverAdvisoriesOnce(() => inspectHighCardinality);
|
|
191
|
+
}
|
|
192
|
+
return { deliverDiagnostic, registerChromeDiagnostics, registerInspectDiagnostics };
|
|
193
|
+
}
|