@fundar/data-chart-telling 1.1.0 → 1.3.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/CHANGELOG.md +45 -0
- package/README.md +8 -7
- package/dist/configuration/config.svelte.d.ts +1 -1
- package/dist/configuration/config.svelte.js +177 -100
- package/dist/configuration/themes/index.d.ts +5 -1428
- package/dist/index.d.ts +23 -14
- package/dist/index.js +20 -11
- package/dist/layout/base/BasePlotLayout.svelte +115 -50
- package/dist/layout/base/BasePlotLayout.svelte.d.ts +1 -38
- package/dist/layout/coordinates/CoordinatesLayout.svelte +42 -40
- package/dist/layout/coordinates/CoordinatesLayout.svelte.d.ts +0 -2
- package/dist/layout/coordinates/ProjectionZoom.svelte +48 -0
- package/dist/layout/coordinates/ProjectionZoom.svelte.d.ts +10 -0
- package/dist/layout/coordinates/ZoomedProjection.d.ts +11 -0
- package/dist/layout/coordinates/ZoomedProjection.js +24 -0
- package/dist/layout/coordinates/camera.svelte.js +11 -8
- package/dist/layout/coordinates/projections/argentina.js +1 -1
- package/dist/layout/coordinates/projections/fit.d.ts +1 -1
- package/dist/layout/coordinates/projections/fit.js +1 -1
- package/dist/layout/coordinates/zoom.svelte.d.ts +4 -5
- package/dist/layout/coordinates/zoom.svelte.js +4 -5
- package/dist/layout/facet/FacetLayout.svelte +1 -1
- package/dist/layout/facet/config.js +1 -1
- package/dist/layout/facet/scope.d.ts +40 -0
- package/dist/layout/facet/scope.js +104 -0
- package/dist/layout/figure/Figure.svelte +2 -0
- package/dist/layout/geometry/GeometryLayout.svelte +14 -9
- package/dist/layout/geometry/GeometryLayout.svelte.d.ts +0 -3
- package/dist/layout/geometry/MarkerOffset.svelte +28 -0
- package/dist/layout/geometry/MarkerOffset.svelte.d.ts +13 -0
- package/dist/layout/grid/GridCell.svelte +6 -8
- package/dist/layout/legend/ContinuousSection.svelte +44 -9
- package/dist/layout/legend/DiscreteBadgeItem.svelte +2 -2
- package/dist/layout/legend/DiscreteSection.svelte +2 -2
- package/dist/layout/legend/DiscreteSymbolIcon.svelte +39 -15
- package/dist/layout/legend/LegendChannels.js +36 -12
- package/dist/layout/legend/LegendLayout.svelte +9 -1
- package/dist/layout/legend/LegendState.svelte.d.ts +4 -0
- package/dist/layout/legend/LegendState.svelte.js +23 -8
- package/dist/layout/legend/SizeSection.svelte +1 -1
- package/dist/layout/margins/PlotMargins.svelte.d.ts +2 -5
- package/dist/layout/margins/PlotMargins.svelte.js +35 -8
- package/dist/layout/plot/Plot.svelte +22 -2
- package/dist/layout/plot/Slice.d.ts +5 -1
- package/dist/layout/plot/Slice.js +14 -4
- package/dist/layout/scales/NiceTicks.d.ts +3 -0
- package/dist/layout/scales/NiceTicks.js +4 -0
- package/dist/layout/scales/ScalesLayout.svelte +93 -7
- package/dist/layout/scales/ScalesLayout.svelte.d.ts +5 -0
- package/dist/layout/scales/SveltePlotScale.d.ts +2 -2
- package/dist/layout/scales/SveltePlotScale.js +13 -6
- package/dist/layout/scales/TickLabels.d.ts +32 -0
- package/dist/layout/scales/TickLabels.js +55 -0
- package/dist/layout/styles/StylesLayout.svelte +2 -2
- package/dist/layout/styles/ValueLabels.d.ts +33 -5
- package/dist/layout/styles/ValueLabels.js +80 -21
- package/dist/layout/timeline/TimelineLayout.svelte +1 -1
- package/dist/layout/tooltip/Tooltip.svelte +4 -4
- package/dist/layout/tooltip/Tooltip.svelte.d.ts +4 -4
- package/dist/layout/tooltip/TooltipState.svelte.js +1 -1
- package/dist/markers/MarkerKinds.d.ts +5 -0
- package/dist/markers/MarkerKinds.js +1 -0
- package/dist/markers/area/AreaMarker.svelte +15 -63
- package/dist/markers/arrow/ArrowMarker.svelte +51 -9
- package/dist/markers/bar/BarMarker.svelte +8 -4
- package/dist/markers/bollinger/BollingerMarker.svelte +33 -18
- package/dist/markers/box/BoxMarker.svelte +40 -9
- package/dist/markers/delta/Delta.d.ts +6 -1
- package/dist/markers/delta/Delta.js +16 -1
- package/dist/markers/delta/DeltaMarker.svelte +9 -87
- package/dist/markers/delta/DeltaPoint.svelte +97 -0
- package/dist/markers/delta/DeltaPoint.svelte.d.ts +29 -0
- package/dist/markers/dot/DotMarker.svelte +24 -27
- package/dist/markers/image/ImageMarker.svelte +17 -12
- package/dist/markers/inset/InsetMarker.svelte +2 -2
- package/dist/markers/line/LineMarker.svelte +1 -0
- package/dist/markers/link/LinkMarker.svelte +174 -29
- package/dist/markers/regression/RegressionMarker.svelte +16 -33
- package/dist/markers/rule/RuleMarker.svelte +14 -5
- package/dist/markers/text/Declutter.d.ts +4 -0
- package/dist/markers/text/Declutter.js +26 -11
- package/dist/markers/text/TextMarker.svelte +91 -48
- package/dist/markers/tick/TickMarker.svelte +27 -25
- package/dist/markers/utils/MarkerChannels.d.ts +24 -0
- package/dist/markers/utils/MarkerChannels.js +42 -7
- package/dist/markers/utils/RowOffset.d.ts +23 -0
- package/dist/markers/utils/RowOffset.js +23 -0
- package/dist/markers/utils/RowOffsetMarks.svelte +30 -0
- package/dist/markers/utils/RowOffsetMarks.svelte.d.ts +33 -0
- package/dist/markers/utils/RowStroke.d.ts +31 -0
- package/dist/markers/utils/RowStroke.js +28 -0
- package/dist/markers/violin/ViolinMarker.svelte +75 -0
- package/dist/markers/violin/ViolinMarker.svelte.d.ts +7 -0
- package/dist/markers/violin/ViolinProfiles.d.ts +29 -0
- package/dist/markers/violin/ViolinProfiles.js +55 -0
- package/dist/markers/waffle/WaffleMarker.svelte +17 -37
- package/dist/phases/Pipeline.d.ts +5 -0
- package/dist/phases/Pipeline.js +5 -0
- package/dist/phases/data/DataPhase.js +3 -3
- package/dist/phases/data/PlotAxes.d.ts +10 -0
- package/dist/phases/data/PlotAxes.js +14 -1
- package/dist/phases/facet/FacetPanels.d.ts +1 -0
- package/dist/phases/facet/FacetPanels.js +1 -0
- package/dist/phases/facet/FacetPhase.d.ts +2 -1
- package/dist/phases/facet/FacetPhase.js +19 -4
- package/dist/phases/mapping/MappingPhase.js +1 -1
- package/dist/phases/markers/MarkersPhase.js +2 -1
- package/dist/phases/scales/CategoryOrder.d.ts +23 -0
- package/dist/phases/scales/CategoryOrder.js +73 -0
- package/dist/phases/scales/ScalesPhase.js +21 -7
- package/dist/phases/sharedScales/SharedScalesPhase.d.ts +3 -2
- package/dist/phases/sharedScales/SharedScalesPhase.js +5 -2
- package/dist/phases/statistics/Statistics.d.ts +10 -6
- package/dist/phases/statistics/Statistics.js +20 -10
- package/dist/phases/statistics/StatisticsPhase.js +16 -3
- package/dist/phases/statistics/methods/BollingerStatistic.d.ts +1 -1
- package/dist/phases/statistics/methods/BollingerStatistic.js +13 -11
- package/dist/phases/statistics/methods/BoxStatistic.d.ts +1 -1
- package/dist/phases/statistics/methods/BoxStatistic.js +14 -12
- package/dist/phases/statistics/methods/Density2dStatistic.d.ts +1 -1
- package/dist/phases/statistics/methods/Density2dStatistic.js +13 -11
- package/dist/phases/statistics/methods/DensityStatistic.d.ts +1 -1
- package/dist/phases/statistics/methods/DensityStatistic.js +11 -9
- package/dist/phases/statistics/methods/DeviationStatistic.d.ts +8 -0
- package/dist/phases/statistics/methods/DeviationStatistic.js +111 -0
- package/dist/phases/statistics/methods/MovingAverageStatistic.d.ts +1 -1
- package/dist/phases/statistics/methods/MovingAverageStatistic.js +11 -9
- package/dist/phases/statistics/methods/RegressionStatistic.d.ts +1 -1
- package/dist/phases/statistics/methods/RegressionStatistic.js +16 -14
- package/dist/phases/transforms/ProcessedPositions.js +1 -1
- package/dist/phases/transforms/TransformsPhase.js +49 -3
- package/dist/phases/transforms/ValueSelection.d.ts +30 -0
- package/dist/phases/transforms/ValueSelection.js +53 -0
- package/dist/plots/{heatmap → correlation/heatmap}/Plot.svelte +5 -2
- package/dist/plots/{heatmap → correlation/heatmap}/Plot.svelte.d.ts +2 -2
- package/dist/plots/{heatmap → correlation/heatmap}/defaults.d.ts +2 -2
- package/dist/plots/{heatmap → correlation/heatmap}/defaults.js +5 -5
- package/dist/plots/{heatmap → correlation/heatmap}/markers.d.ts +4 -4
- package/dist/plots/{heatmap → correlation/heatmap}/markers.js +3 -3
- package/dist/plots/{scatter → correlation/scatter}/Plot.svelte +5 -2
- package/dist/plots/{scatter → correlation/scatter}/Plot.svelte.d.ts +2 -2
- package/dist/plots/{scatter → correlation/scatter}/defaults.d.ts +2 -2
- package/dist/plots/{scatter → correlation/scatter}/defaults.js +4 -4
- package/dist/plots/{scatter → correlation/scatter}/markers.d.ts +4 -4
- package/dist/plots/{scatter → correlation/scatter}/markers.js +3 -3
- package/dist/plots/{box → distribution/box}/BoxSummaries.d.ts +2 -2
- package/dist/plots/{box → distribution/box}/BoxSummaries.js +6 -6
- package/dist/plots/{box → distribution/box}/Plot.svelte +2 -2
- package/dist/plots/{box → distribution/box}/Plot.svelte.d.ts +2 -2
- package/dist/plots/{box → distribution/box}/defaults.d.ts +2 -2
- package/dist/plots/{box → distribution/box}/defaults.js +1 -1
- package/dist/plots/{box → distribution/box}/markers.d.ts +2 -2
- package/dist/plots/distribution/density/Plot.svelte +45 -0
- package/dist/plots/distribution/density/Plot.svelte.d.ts +26 -0
- package/dist/plots/distribution/density/defaults.d.ts +9 -0
- package/dist/plots/distribution/density/defaults.js +29 -0
- package/dist/plots/distribution/density/markers.d.ts +9 -0
- package/dist/plots/distribution/density/markers.js +42 -0
- package/dist/plots/{histogram → distribution/histogram}/Plot.svelte +2 -2
- package/dist/plots/{histogram → distribution/histogram}/Plot.svelte.d.ts +2 -2
- package/dist/plots/{histogram → distribution/histogram}/defaults.d.ts +2 -2
- package/dist/plots/{histogram → distribution/histogram}/defaults.js +3 -3
- package/dist/plots/{histogram → distribution/histogram}/markers.d.ts +3 -3
- package/dist/plots/{histogram → distribution/histogram}/markers.js +5 -5
- package/dist/plots/{pyramid → distribution/pyramid}/Plot.svelte +5 -2
- package/dist/plots/{pyramid → distribution/pyramid}/Plot.svelte.d.ts +2 -2
- package/dist/plots/{pyramid → distribution/pyramid}/defaults.d.ts +2 -2
- package/dist/plots/{pyramid → distribution/pyramid}/defaults.js +6 -6
- package/dist/plots/{pyramid → distribution/pyramid}/markers.d.ts +4 -4
- package/dist/plots/{pyramid → distribution/pyramid}/markers.js +6 -6
- package/dist/plots/distribution/violin/Plot.svelte +45 -0
- package/dist/plots/distribution/violin/Plot.svelte.d.ts +26 -0
- package/dist/plots/distribution/violin/defaults.d.ts +10 -0
- package/dist/plots/distribution/violin/defaults.js +58 -0
- package/dist/plots/distribution/violin/markers.d.ts +10 -0
- package/dist/plots/distribution/violin/markers.js +71 -0
- package/dist/plots/{area → evolution/area}/Plot.svelte +2 -2
- package/dist/plots/{area → evolution/area}/Plot.svelte.d.ts +2 -2
- package/dist/plots/{area → evolution/area}/defaults.d.ts +2 -2
- package/dist/plots/{area → evolution/area}/defaults.js +2 -0
- package/dist/plots/{area → evolution/area}/markers.d.ts +2 -2
- package/dist/plots/{area → evolution/area}/markers.js +1 -1
- package/dist/plots/{line → evolution/line}/Plot.svelte +2 -2
- package/dist/plots/{line → evolution/line}/Plot.svelte.d.ts +2 -2
- package/dist/plots/{line → evolution/line}/defaults.d.ts +2 -2
- package/dist/plots/{line → evolution/line}/defaults.js +2 -0
- package/dist/plots/{line → evolution/line}/markers.d.ts +11 -8
- package/dist/plots/{line → evolution/line}/markers.js +6 -4
- package/dist/plots/evolution/slope/Plot.svelte +42 -0
- package/dist/plots/evolution/slope/Plot.svelte.d.ts +26 -0
- package/dist/plots/evolution/slope/defaults.d.ts +8 -0
- package/dist/plots/evolution/slope/defaults.js +31 -0
- package/dist/plots/evolution/slope/markers.d.ts +16 -0
- package/dist/plots/evolution/slope/markers.js +79 -0
- package/dist/plots/evolution/sparkline/Plot.svelte +45 -0
- package/dist/plots/evolution/sparkline/Plot.svelte.d.ts +26 -0
- package/dist/plots/evolution/sparkline/defaults.d.ts +7 -0
- package/dist/plots/evolution/sparkline/defaults.js +23 -0
- package/dist/plots/evolution/sparkline/markers.d.ts +7 -0
- package/dist/plots/evolution/sparkline/markers.js +56 -0
- package/dist/plots/{geo → map/geo}/Core.svelte +11 -10
- package/dist/plots/{geo → map/geo}/Core.svelte.d.ts +1 -1
- package/dist/plots/map/geo/GeoFeatures.svelte.d.ts +9 -0
- package/dist/plots/map/geo/GeoFeatures.svelte.js +55 -0
- package/dist/plots/map/geo/GeoGeometry.d.ts +27 -0
- package/dist/plots/map/geo/GeoGeometry.js +142 -0
- package/dist/plots/map/geo/GeoSegments.d.ts +16 -0
- package/dist/plots/map/geo/GeoSegments.js +23 -0
- package/dist/plots/{geo → map/geo}/Plot.svelte +10 -10
- package/dist/plots/{geo → map/geo}/Plot.svelte.d.ts +2 -2
- package/dist/plots/{geo → map/geo}/defaults.d.ts +2 -2
- package/dist/plots/{geo → map/geo}/defaults.js +1 -1
- package/dist/plots/{geo → map/geo}/phases/data.d.ts +1 -1
- package/dist/plots/{geo → map/geo}/phases/data.js +7 -6
- package/dist/plots/{geo → map/geo}/phases/hover.d.ts +1 -1
- package/dist/plots/{geo → map/geo}/phases/hover.js +2 -2
- package/dist/plots/{geo → map/geo}/phases/markers.d.ts +1 -1
- package/dist/plots/{geo → map/geo}/phases/markers.js +6 -10
- package/dist/plots/{geo → map/geo}/phases/scales.d.ts +2 -2
- package/dist/plots/{geo → map/geo}/phases/scales.js +28 -12
- package/dist/plots/{geo → map/geo}/phases/tooltip.d.ts +1 -1
- package/dist/plots/map/geo/phases/tooltip.js +5 -0
- package/dist/plots/{geo → map/geo}/slices.d.ts +2 -2
- package/dist/plots/{geo → map/geo}/slices.js +2 -2
- package/dist/plots/{bar → ranking/bar}/Plot.svelte +2 -2
- package/dist/plots/{bar → ranking/bar}/Plot.svelte.d.ts +2 -2
- package/dist/plots/ranking/bar/defaults.d.ts +16 -0
- package/dist/plots/{bar → ranking/bar}/defaults.js +15 -9
- package/dist/plots/{bar → ranking/bar}/markers.d.ts +8 -8
- package/dist/plots/{bar → ranking/bar}/markers.js +8 -17
- package/dist/plots/ranking/bullet/Plot.svelte +42 -0
- package/dist/plots/ranking/bullet/Plot.svelte.d.ts +26 -0
- package/dist/plots/ranking/bullet/defaults.d.ts +8 -0
- package/dist/plots/ranking/bullet/defaults.js +24 -0
- package/dist/plots/ranking/bullet/markers.d.ts +10 -0
- package/dist/plots/ranking/bullet/markers.js +90 -0
- package/dist/plots/ranking/cleveland/ClevelandConnector.d.ts +48 -0
- package/dist/plots/ranking/cleveland/ClevelandConnector.js +140 -0
- package/dist/plots/ranking/cleveland/ClevelandMarkers.d.ts +33 -0
- package/dist/plots/ranking/cleveland/ClevelandMarkers.js +375 -0
- package/dist/plots/ranking/cleveland/ClevelandRanges.d.ts +31 -0
- package/dist/plots/ranking/cleveland/ClevelandRanges.js +116 -0
- package/dist/plots/ranking/cleveland/Plot.svelte +45 -0
- package/dist/plots/ranking/cleveland/Plot.svelte.d.ts +26 -0
- package/dist/plots/ranking/cleveland/defaults.d.ts +13 -0
- package/dist/plots/ranking/cleveland/defaults.js +66 -0
- package/dist/plots/ranking/dumbbell/Plot.svelte +45 -0
- package/dist/plots/ranking/dumbbell/Plot.svelte.d.ts +26 -0
- package/dist/plots/ranking/dumbbell/defaults.d.ts +9 -0
- package/dist/plots/ranking/dumbbell/defaults.js +19 -0
- package/dist/plots/ranking/forest/Plot.svelte +42 -0
- package/dist/plots/ranking/forest/Plot.svelte.d.ts +26 -0
- package/dist/plots/ranking/forest/defaults.d.ts +11 -0
- package/dist/plots/ranking/forest/defaults.js +20 -0
- package/dist/plots/ranking/lollipop/Plot.svelte +45 -0
- package/dist/plots/ranking/lollipop/Plot.svelte.d.ts +26 -0
- package/dist/plots/ranking/lollipop/defaults.d.ts +9 -0
- package/dist/plots/ranking/lollipop/defaults.js +18 -0
- package/dist/plots/utils/RowNumbers.d.ts +16 -0
- package/dist/plots/utils/RowNumbers.js +24 -0
- package/dist/plots/utils/gaps.js +1 -1
- package/dist/plots/utils/segments.d.ts +4 -1
- package/dist/plots/utils/segments.js +20 -7
- package/dist/types/configuration/styling.d.ts +284 -143
- package/dist/types/layout/coordinates.d.ts +5 -4
- package/dist/types/layout/facet.d.ts +18 -0
- package/dist/types/layout/legend.d.ts +23 -5
- package/dist/types/layout/plot.d.ts +46 -1
- package/dist/types/layout/scales.d.ts +39 -7
- package/dist/types/layout/statistics/deviation.d.ts +40 -0
- package/dist/types/layout/statistics/index.d.ts +7 -2
- package/dist/types/layout/styles/base.d.ts +18 -0
- package/dist/types/layout/styles/bullet.d.ts +25 -0
- package/dist/types/layout/styles/connector.d.ts +98 -0
- package/dist/types/layout/styles/curve.d.ts +11 -0
- package/dist/types/layout/styles/frame.d.ts +17 -0
- package/dist/types/layout/styles/gaps.d.ts +12 -0
- package/dist/types/layout/styles/geo.d.ts +55 -0
- package/dist/types/layout/styles/index.d.ts +8 -0
- package/dist/types/layout/styles/index.js +8 -0
- package/dist/types/layout/styles/values.d.ts +47 -0
- package/dist/types/layout/timeline.d.ts +5 -2
- package/dist/types/layout/tooltip.d.ts +6 -2
- package/dist/types/markers/axis/area.d.ts +2 -2
- package/dist/types/markers/axis/arrow.d.ts +3 -0
- package/dist/types/markers/axis/axisBasedMarkersConfig.d.ts +2 -1
- package/dist/types/markers/axis/bar.d.ts +1 -1
- package/dist/types/markers/axis/box.d.ts +5 -0
- package/dist/types/markers/axis/delta.d.ts +15 -2
- package/dist/types/markers/axis/difference.d.ts +2 -2
- package/dist/types/markers/axis/image.d.ts +3 -2
- package/dist/types/markers/axis/line.d.ts +2 -0
- package/dist/types/markers/axis/rule.d.ts +18 -2
- package/dist/types/markers/axis/trail.d.ts +2 -3
- package/dist/types/markers/axis/violin.d.ts +25 -0
- package/dist/types/markers/basic/dot.d.ts +3 -2
- package/dist/types/markers/basic/text.d.ts +13 -3
- package/dist/types/markers/channels/commonMarkerConfig.d.ts +7 -3
- package/dist/types/markers/channels/commonMarkerConfigWithRowOffset.d.ts +13 -0
- package/dist/types/markers/common.d.ts +1 -1
- package/dist/types/markers/common.js +1 -0
- package/dist/types/markers/geo/link.d.ts +5 -1
- package/dist/types/phases/facet/phase.d.ts +4 -0
- package/dist/types/phases/index.d.ts +1 -1
- package/dist/types/phases/scales/phase.d.ts +5 -1
- package/dist/types/phases/state.d.ts +15 -2
- package/dist/types/phases/statistics/source.d.ts +3 -1
- package/dist/types/phases/transforms/phase.d.ts +22 -0
- package/dist/types/plots/{heatmap → correlation/heatmap}/props.d.ts +6 -6
- package/dist/types/plots/{heatmap → correlation/heatmap}/state.d.ts +4 -4
- package/dist/types/plots/{scatter → correlation/scatter}/props.d.ts +6 -6
- package/dist/types/plots/{scatter → correlation/scatter}/state.d.ts +2 -2
- package/dist/types/plots/{box → distribution/box}/props.d.ts +6 -6
- package/dist/types/plots/{box → distribution/box}/state.d.ts +3 -3
- package/dist/types/plots/distribution/density/props.d.ts +23 -0
- package/dist/types/plots/distribution/density/state.d.ts +6 -0
- package/dist/types/plots/{histogram → distribution/histogram}/props.d.ts +7 -7
- package/dist/types/plots/{histogram → distribution/histogram}/state.d.ts +2 -2
- package/dist/types/plots/distribution/histogram/state.js +1 -0
- package/dist/types/plots/{pyramid → distribution/pyramid}/props.d.ts +6 -6
- package/dist/types/plots/distribution/pyramid/props.js +1 -0
- package/dist/types/plots/{pyramid → distribution/pyramid}/state.d.ts +3 -3
- package/dist/types/plots/distribution/pyramid/state.js +1 -0
- package/dist/types/plots/distribution/violin/props.d.ts +23 -0
- package/dist/types/plots/distribution/violin/props.js +1 -0
- package/dist/types/plots/distribution/violin/state.d.ts +6 -0
- package/dist/types/plots/distribution/violin/state.js +1 -0
- package/dist/types/plots/{area → evolution/area}/props.d.ts +6 -6
- package/dist/types/plots/evolution/area/props.js +1 -0
- package/dist/types/plots/{area → evolution/area}/state.d.ts +2 -2
- package/dist/types/plots/evolution/area/state.js +1 -0
- package/dist/types/plots/evolution/line/props.d.ts +10 -0
- package/dist/types/plots/evolution/line/props.js +1 -0
- package/dist/types/plots/{line → evolution/line}/state.d.ts +3 -3
- package/dist/types/plots/evolution/line/state.js +1 -0
- package/dist/types/plots/evolution/slope/props.d.ts +5 -0
- package/dist/types/plots/evolution/slope/props.js +1 -0
- package/dist/types/plots/evolution/slope/state.d.ts +5 -0
- package/dist/types/plots/evolution/slope/state.js +1 -0
- package/dist/types/plots/evolution/sparkline/props.d.ts +5 -0
- package/dist/types/plots/evolution/sparkline/props.js +1 -0
- package/dist/types/plots/evolution/sparkline/state.d.ts +5 -0
- package/dist/types/plots/evolution/sparkline/state.js +1 -0
- package/dist/types/plots/{geo → map/geo}/props.d.ts +8 -8
- package/dist/types/plots/map/geo/props.js +1 -0
- package/dist/types/plots/{geo → map/geo}/state.d.ts +18 -11
- package/dist/types/plots/map/geo/state.js +1 -0
- package/dist/types/plots/props.d.ts +7 -4
- package/dist/types/plots/{bar → ranking/bar}/props.d.ts +6 -6
- package/dist/types/plots/ranking/bar/props.js +1 -0
- package/dist/types/plots/{bar → ranking/bar}/state.d.ts +2 -2
- package/dist/types/plots/ranking/bar/state.js +1 -0
- package/dist/types/plots/ranking/bullet/props.d.ts +22 -0
- package/dist/types/plots/ranking/bullet/props.js +1 -0
- package/dist/types/plots/ranking/bullet/state.d.ts +5 -0
- package/dist/types/plots/ranking/bullet/state.js +1 -0
- package/dist/types/plots/ranking/cleveland/props.d.ts +10 -0
- package/dist/types/plots/ranking/cleveland/props.js +1 -0
- package/dist/types/plots/ranking/cleveland/state.d.ts +49 -0
- package/dist/types/plots/ranking/cleveland/state.js +1 -0
- package/dist/types/plots/ranking/dumbbell/props.d.ts +10 -0
- package/dist/types/plots/ranking/dumbbell/props.js +1 -0
- package/dist/types/plots/ranking/dumbbell/state.d.ts +5 -0
- package/dist/types/plots/ranking/dumbbell/state.js +1 -0
- package/dist/types/plots/ranking/forest/props.d.ts +23 -0
- package/dist/types/plots/ranking/forest/props.js +1 -0
- package/dist/types/plots/ranking/forest/state.d.ts +5 -0
- package/dist/types/plots/ranking/forest/state.js +1 -0
- package/dist/types/plots/ranking/lollipop/props.d.ts +10 -0
- package/dist/types/plots/ranking/lollipop/props.js +1 -0
- package/dist/types/plots/ranking/lollipop/state.d.ts +5 -0
- package/dist/types/plots/ranking/lollipop/state.js +1 -0
- package/dist/types/plots/segments/common.d.ts +4 -1
- package/dist/types/plots/segments/config.d.ts +4 -2
- package/dist/utils/OpacityScale.d.ts +14 -0
- package/dist/utils/OpacityScale.js +43 -0
- package/dist/utils/{symbol.d.ts → SymbolPath.d.ts} +0 -12
- package/dist/utils/{symbol.js → SymbolPath.js} +0 -24
- package/dist/utils/SymbolScale.d.ts +18 -0
- package/dist/utils/SymbolScale.js +29 -0
- package/dist/utils/color/ColorRamp.d.ts +27 -0
- package/dist/utils/color/ColorRamp.js +120 -0
- package/dist/utils/color/CssColor.d.ts +19 -0
- package/dist/utils/color/CssColor.js +114 -0
- package/dist/utils/color/Palette.d.ts +21 -0
- package/dist/utils/color/Palette.js +52 -0
- package/dist/utils/color/index.d.ts +11 -3
- package/dist/utils/color/index.js +14 -3
- package/dist/utils/grouping.js +1 -1
- package/docs/architecture.md +1 -1
- package/docs/chrome.md +2 -2
- package/docs/composer.md +2 -2
- package/docs/concepts.md +1 -1
- package/docs/development.md +1 -1
- package/docs/facets.md +50 -3
- package/docs/getting-started.md +2 -2
- package/docs/legend.md +13 -11
- package/docs/markers.md +57 -27
- package/docs/plots/correlation/heatmap.md +26 -0
- package/docs/plots/correlation/scatter.md +35 -0
- package/docs/plots/distribution/box.md +28 -0
- package/docs/plots/distribution/density.md +26 -0
- package/docs/plots/distribution/histogram.md +33 -0
- package/docs/plots/distribution/pyramid.md +31 -0
- package/docs/plots/distribution/violin.md +35 -0
- package/docs/plots/evolution/area.md +32 -0
- package/docs/plots/evolution/line.md +93 -0
- package/docs/plots/evolution/slope.md +39 -0
- package/docs/plots/evolution/sparkline.md +34 -0
- package/docs/plots/ranking/bar.md +59 -0
- package/docs/plots/ranking/bullet.md +37 -0
- package/docs/plots/ranking/cleveland.md +54 -0
- package/docs/plots/ranking/dumbbell.md +39 -0
- package/docs/plots/ranking/forest.md +40 -0
- package/docs/plots/ranking/lollipop.md +39 -0
- package/docs/plots.md +22 -280
- package/docs/scales.md +30 -24
- package/docs/styles-and-segments.md +25 -21
- package/docs/theming.md +23 -20
- package/docs/timeline.md +3 -3
- package/docs/tooltip-and-hover.md +10 -10
- package/docs/transforms-and-statistics.md +13 -12
- package/examples/BarValues.svelte +1 -1
- package/examples/Box.svelte +1 -1
- package/examples/Bullet.svelte +17 -0
- package/examples/Chrome.svelte +1 -1
- package/examples/ChromeOrder.svelte +1 -1
- package/examples/Cleveland.svelte +15 -0
- package/examples/Composer.svelte +2 -2
- package/examples/CustomTooltip.svelte +1 -1
- package/examples/Density.svelte +7 -0
- package/examples/Dumbbell.svelte +16 -0
- package/examples/Facets.svelte +1 -1
- package/examples/FacetsCarousel.svelte +1 -1
- package/examples/FacetsRowsCols.svelte +1 -1
- package/examples/FacetsScoped.svelte +26 -0
- package/examples/FirstPlot.svelte +1 -1
- package/examples/Forest.svelte +17 -0
- package/examples/Gaps.svelte +2 -2
- package/examples/GroupedBars.svelte +1 -1
- package/examples/Heatmap.svelte +3 -3
- package/examples/HeatmapSegments.svelte +8 -8
- package/examples/Histogram.svelte +1 -1
- package/examples/HorizontalBars.svelte +1 -1
- package/examples/LegendSections.svelte +1 -1
- package/examples/LegendToggle.svelte +1 -1
- package/examples/LineByRegion.svelte +1 -1
- package/examples/LineDates.svelte +1 -1
- package/examples/LineStep.svelte +16 -0
- package/examples/LineStepSegment.svelte +18 -0
- package/examples/Lollipop.svelte +17 -0
- package/examples/Markers.svelte +1 -1
- package/examples/MovingAverage.svelte +1 -1
- package/examples/Pyramid.svelte +9 -2
- package/examples/Regression.svelte +2 -2
- package/examples/ResponsiveLine.svelte +1 -1
- package/examples/Scales.svelte +1 -1
- package/examples/Scatter.svelte +2 -2
- package/examples/SegmentHighlight.svelte +1 -1
- package/examples/Segments.svelte +1 -1
- package/examples/SegmentsBySeries.svelte +1 -1
- package/examples/Slope.svelte +17 -0
- package/examples/Sparkline.svelte +14 -0
- package/examples/StackedArea.svelte +1 -1
- package/examples/StackedBars.svelte +1 -1
- package/examples/TimelinePlayer.svelte +1 -1
- package/examples/TimelineRule.svelte +1 -1
- package/examples/Tooltip.svelte +1 -1
- package/examples/ValueLabels.svelte +1 -1
- package/examples/Violin.svelte +14 -0
- package/examples/datasets/argentina-chile-trends.ts +34 -0
- package/examples/datasets/commodity-prices.ts +48 -0
- package/examples/datasets/countries-over-time.ts +368 -0
- package/examples/datasets/daily-temperature.ts +121 -0
- package/examples/datasets/earthquakes.ts +977 -0
- package/examples/datasets/flight-routes.ts +29 -0
- package/examples/datasets/height-density.ts +37 -0
- package/examples/datasets/heights.ts +370 -0
- package/examples/datasets/index.ts +24 -0
- package/examples/datasets/inflation-by-region.ts +44 -0
- package/examples/datasets/inflation-ranges.ts +34 -0
- package/examples/datasets/iris-flower.ts +207 -0
- package/examples/datasets/life-expectancy.ts +95 -0
- package/examples/datasets/napoleons-march.ts +182 -0
- package/examples/datasets/penguins.ts +54 -0
- package/examples/datasets/population-by-age-with-gaps.ts +23 -0
- package/examples/datasets/population-by-age.ts +890 -0
- package/examples/datasets/province-population.ts +521 -0
- package/examples/datasets/stock-prices.ts +63 -0
- package/examples/datasets/weather-stations-over-time.ts +31 -0
- package/examples/datasets/weather-stations.ts +22 -0
- package/examples/datasets/wind-vectors.ts +30 -0
- package/examples/datasets/world-temperature.ts +400 -0
- package/llms-full.txt +27 -14
- package/llms.txt +33 -4
- package/package.json +10 -1
- package/dist/plots/bar/defaults.d.ts +0 -9
- package/dist/plots/geo/features.svelte.d.ts +0 -5
- package/dist/plots/geo/features.svelte.js +0 -44
- package/dist/plots/geo/phases/tooltip.js +0 -5
- package/dist/plots/utils/geoAccessors.d.ts +0 -72
- package/dist/plots/utils/geoAccessors.js +0 -220
- package/dist/plots/utils/geoSegments.d.ts +0 -29
- package/dist/plots/utils/geoSegments.js +0 -37
- package/dist/types/layout/styles.d.ts +0 -122
- package/dist/types/markers/axis/curveName.d.ts +0 -2
- package/dist/types/plots/line/props.d.ts +0 -10
- package/dist/utils/color/contrast.d.ts +0 -9
- package/dist/utils/color/contrast.js +0 -40
- package/dist/utils/color/cssColor.d.ts +0 -4
- package/dist/utils/color/cssColor.js +0 -77
- package/dist/utils/color/ramp.d.ts +0 -17
- package/dist/utils/color/ramp.js +0 -110
- package/dist/utils/opacity.d.ts +0 -9
- package/dist/utils/opacity.js +0 -38
- package/examples/data.ts +0 -324
- /package/dist/plots/{box → distribution/box}/markers.js +0 -0
- /package/dist/types/layout/{styles.js → statistics/deviation.js} +0 -0
- /package/dist/types/{markers/axis/curveName.js → layout/styles/base.js} +0 -0
- /package/dist/types/{plots/area/props.js → layout/styles/bullet.js} +0 -0
- /package/dist/types/{plots/area/state.js → layout/styles/connector.js} +0 -0
- /package/dist/types/{plots/bar/props.js → layout/styles/curve.js} +0 -0
- /package/dist/types/{plots/bar/state.js → layout/styles/frame.js} +0 -0
- /package/dist/types/{plots/box/props.js → layout/styles/gaps.js} +0 -0
- /package/dist/types/{plots/box/state.js → layout/styles/geo.js} +0 -0
- /package/dist/types/{plots/geo/props.js → layout/styles/values.js} +0 -0
- /package/dist/types/{plots/geo/state.js → markers/axis/violin.js} +0 -0
- /package/dist/types/{plots/heatmap/props.js → markers/channels/commonMarkerConfigWithRowOffset.js} +0 -0
- /package/dist/types/plots/{histogram → correlation/heatmap}/props.js +0 -0
- /package/dist/types/plots/{heatmap → correlation/heatmap}/state.js +0 -0
- /package/dist/types/plots/{line → correlation/scatter}/props.js +0 -0
- /package/dist/types/plots/{histogram → correlation/scatter}/state.js +0 -0
- /package/dist/types/plots/{pyramid → distribution/box}/props.js +0 -0
- /package/dist/types/plots/{line → distribution/box}/state.js +0 -0
- /package/dist/types/plots/{scatter → distribution/density}/props.js +0 -0
- /package/dist/types/plots/{pyramid → distribution/density}/state.js +0 -0
- /package/dist/types/plots/{scatter/state.js → distribution/histogram/props.js} +0 -0
- /package/dist/{plots/utils → utils}/accessors.d.ts +0 -0
- /package/dist/{plots/utils → utils}/accessors.js +0 -0
|
@@ -17,6 +17,11 @@ function tweenState(args) {
|
|
|
17
17
|
let from;
|
|
18
18
|
let to;
|
|
19
19
|
let raf;
|
|
20
|
+
function stop() {
|
|
21
|
+
if (raf != null)
|
|
22
|
+
cancelAnimationFrame(raf);
|
|
23
|
+
raf = undefined;
|
|
24
|
+
}
|
|
20
25
|
function setCurrent(value) {
|
|
21
26
|
current = value;
|
|
22
27
|
lastValue = value;
|
|
@@ -37,16 +42,16 @@ function tweenState(args) {
|
|
|
37
42
|
from = atStart ? target : (lastValue ?? target);
|
|
38
43
|
to = target;
|
|
39
44
|
}
|
|
40
|
-
if (raf != null) {
|
|
41
|
-
cancelAnimationFrame(raf);
|
|
42
|
-
raf = undefined;
|
|
43
|
-
}
|
|
44
45
|
if (progress != null) {
|
|
46
|
+
stop();
|
|
45
47
|
setCurrent(args.lerp(from, to, Interpolation.buildEasing(transition?.easing)(clamp01(progress)), direction));
|
|
46
48
|
return;
|
|
47
49
|
}
|
|
50
|
+
// A rerun with the same target (the caller rebuilds `transition` on every
|
|
51
|
+
// render) leaves a tween in flight alone.
|
|
48
52
|
if (!changed)
|
|
49
53
|
return;
|
|
54
|
+
stop();
|
|
50
55
|
const duration = Math.max(0, transition?.duration ?? 750);
|
|
51
56
|
const easing = Interpolation.buildEasing(transition?.easing);
|
|
52
57
|
const startFrom = from;
|
|
@@ -58,11 +63,9 @@ function tweenState(args) {
|
|
|
58
63
|
raf = t < 1 ? requestAnimationFrame(tick) : undefined;
|
|
59
64
|
}
|
|
60
65
|
raf = requestAnimationFrame(tick);
|
|
61
|
-
return () => {
|
|
62
|
-
if (raf != null)
|
|
63
|
-
cancelAnimationFrame(raf);
|
|
64
|
-
};
|
|
65
66
|
});
|
|
67
|
+
// Only leaving the page stops a tween the effect above started.
|
|
68
|
+
$effect(() => stop);
|
|
66
69
|
return {
|
|
67
70
|
get current() {
|
|
68
71
|
return current;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { geoAzimuthalEquidistant } from 'd3-geo';
|
|
2
2
|
import { pointsToFitFeature } from './fit';
|
|
3
3
|
// Representative extremity points - not real border geometry (which stays
|
|
4
|
-
// out of `src/lib`, see stories/plots/geo/data.ts), just enough for
|
|
4
|
+
// out of `src/lib`, see stories/plots/map/geo/data.ts), just enough for
|
|
5
5
|
// `fitSize` to frame Argentina's full territorial claim sensibly. These are
|
|
6
6
|
// plain real-world coordinates, not derived from any particular dataset, so
|
|
7
7
|
// they work the same way regardless of which Argentina GeoJSON actually
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Wraps a handful of representative `[lon, lat]` points as a `MultiPoint`
|
|
3
3
|
* Feature, just so `projection.fitExtent`/`fitSize` has something to
|
|
4
4
|
* measure. Custom projections built on these live in `src/lib` (see
|
|
5
|
-
* `stories/plots/geo/data.ts` for why real border geometry doesn't), so a
|
|
5
|
+
* `stories/plots/map/geo/data.ts` for why real border geometry doesn't), so a
|
|
6
6
|
* few hand-picked extremity points stand in for a region's true extent.
|
|
7
7
|
*/
|
|
8
8
|
export declare function pointsToFitFeature(points: [number, number][]): GeoJSON.Feature;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Wraps a handful of representative `[lon, lat]` points as a `MultiPoint`
|
|
3
3
|
* Feature, just so `projection.fitExtent`/`fitSize` has something to
|
|
4
4
|
* measure. Custom projections built on these live in `src/lib` (see
|
|
5
|
-
* `stories/plots/geo/data.ts` for why real border geometry doesn't), so a
|
|
5
|
+
* `stories/plots/map/geo/data.ts` for why real border geometry doesn't), so a
|
|
6
6
|
* few hand-picked extremity points stand in for a region's true extent.
|
|
7
7
|
*/
|
|
8
8
|
export function pointsToFitFeature(points) {
|
|
@@ -6,15 +6,14 @@ export type GeoZoomTransform = {
|
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
8
|
* Wires drag-pan + scroll-zoom onto a DOM node via d3-zoom, exposing the
|
|
9
|
-
* resulting transform as reactive Svelte state,
|
|
10
|
-
*
|
|
9
|
+
* resulting transform as reactive Svelte state, which the caller applies to
|
|
10
|
+
* the plot's projection (see `ProjectionZoom`).
|
|
11
11
|
*
|
|
12
12
|
* `panEnabled`/`zoomEnabled` gate drag-translate and wheel/pinch-scale
|
|
13
13
|
* independently, as separate `.filter()`s on the same underlying instance.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* (d3-zoom can't distinguish a pinch from a one-finger drag until underway).
|
|
15
|
+
* Touch pinch-to-zoom is gated by `panEnabled`, not `zoomEnabled` (d3-zoom
|
|
16
|
+
* can't distinguish a pinch from a one-finger drag until underway).
|
|
18
17
|
*/
|
|
19
18
|
export declare function createGeoZoom(args: {
|
|
20
19
|
panEnabled: () => boolean;
|
|
@@ -2,15 +2,14 @@ import { select } from 'd3-selection';
|
|
|
2
2
|
import { zoom as d3zoom, zoomIdentity } from 'd3-zoom';
|
|
3
3
|
/**
|
|
4
4
|
* Wires drag-pan + scroll-zoom onto a DOM node via d3-zoom, exposing the
|
|
5
|
-
* resulting transform as reactive Svelte state,
|
|
6
|
-
*
|
|
5
|
+
* resulting transform as reactive Svelte state, which the caller applies to
|
|
6
|
+
* the plot's projection (see `ProjectionZoom`).
|
|
7
7
|
*
|
|
8
8
|
* `panEnabled`/`zoomEnabled` gate drag-translate and wheel/pinch-scale
|
|
9
9
|
* independently, as separate `.filter()`s on the same underlying instance.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* (d3-zoom can't distinguish a pinch from a one-finger drag until underway).
|
|
11
|
+
* Touch pinch-to-zoom is gated by `panEnabled`, not `zoomEnabled` (d3-zoom
|
|
12
|
+
* can't distinguish a pinch from a one-finger drag until underway).
|
|
14
13
|
*/
|
|
15
14
|
export function createGeoZoom(args) {
|
|
16
15
|
let transform = $state({ x: 0, y: 0, k: 1 });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts" generics="TRow extends Record<string, unknown>">
|
|
2
2
|
import { isMobile } from '../../stores/device';
|
|
3
|
-
import { resolveAccessor } from '../../
|
|
3
|
+
import { resolveAccessor } from '../../utils/accessors';
|
|
4
4
|
import FacetIndicator from './FacetIndicator.svelte';
|
|
5
5
|
import Grid from '../grid/Grid.svelte';
|
|
6
6
|
import GridCell from '../grid/GridCell.svelte';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { resolveAccessor } from '../../
|
|
1
|
+
import { resolveAccessor } from '../../utils/accessors';
|
|
2
2
|
/** Whether a facet config wraps one facet per `by` value, rather than laying out a `rows`/`cols` grid. */
|
|
3
3
|
export function isFacetWrap(facet) {
|
|
4
4
|
return facet.by !== undefined;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { FacetTarget } from '../../types/layout/facet';
|
|
2
|
+
import type { SlicePlace } from '../../types/layout/plot';
|
|
3
|
+
import type { FacetPanel } from '../../types/phases';
|
|
4
|
+
/** Where a facet panel sits, as a segment's or a marker's `facet` names it. */
|
|
5
|
+
type PanelPlace = SlicePlace['facet'];
|
|
6
|
+
/**
|
|
7
|
+
* Limiting a plot's segments and markers to some facet panels: which panels a `facet` names, and each
|
|
8
|
+
* panel's share of a list of them. A plot with no facet has no panel, so what names one is left out.
|
|
9
|
+
*/
|
|
10
|
+
export declare class FacetScope {
|
|
11
|
+
/** Where a panel the "facet" phase laid out sits. */
|
|
12
|
+
static placeOf(panel: FacetPanel): NonNullable<PanelPlace>;
|
|
13
|
+
/**
|
|
14
|
+
* Whether something limited to `target` applies at the facet panel `place`. Without a target it
|
|
15
|
+
* applies everywhere; with one, only to the panels it names, and to no plot that has no facet.
|
|
16
|
+
*/
|
|
17
|
+
static targets(target: FacetTarget | undefined, place: PanelPlace): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* `items` as the facet panel `place` sees them: those that name no facet, or name this one, with
|
|
20
|
+
* their `facet` taken off. The same list comes back when none names a facet.
|
|
21
|
+
*/
|
|
22
|
+
static scope<T extends object>(items: T[] | undefined, place: PanelPlace): T[] | undefined;
|
|
23
|
+
/** A `segments` config as the facet panel `place` sees it: each series' segments, {@link FacetScope.scope}d. */
|
|
24
|
+
static scopeSegments<T extends object>(segments: Record<string, T[]> | undefined, place: PanelPlace): Record<string, T[]> | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* `segments` for a plot whose series are split by facet panel: each segment that names a facet moves
|
|
27
|
+
* under the key of its series in every panel it names - the id of that series' part there, as
|
|
28
|
+
* {@link FacetPanels.buildSeriesId} writes it, or `default` for the panel's series without their own -
|
|
29
|
+
* and loses its `facet`. Segments that name none stay where they were. The same config comes back
|
|
30
|
+
* when none names a facet.
|
|
31
|
+
*/
|
|
32
|
+
static distributeSegments<T extends object>(segments: Record<string, T[]> | undefined, panels: FacetPanel[]): Record<string, T[]> | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* `markers` for a plot split by facet panel: each marker that names a facet becomes one copy per
|
|
35
|
+
* panel it names, tagged with that panel ({@link PANEL_KEY}) and without its `facet`, in the marker's
|
|
36
|
+
* own place in the list. Markers that name none stay as they are, for every panel.
|
|
37
|
+
*/
|
|
38
|
+
static distributeMarkers<T extends object>(markers: T[] | undefined, panels: FacetPanel[]): T[] | undefined;
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { FacetPanels, PANEL_KEY } from '../../phases/facet/FacetPanels';
|
|
2
|
+
/**
|
|
3
|
+
* Limiting a plot's segments and markers to some facet panels: which panels a `facet` names, and each
|
|
4
|
+
* panel's share of a list of them. A plot with no facet has no panel, so what names one is left out.
|
|
5
|
+
*/
|
|
6
|
+
export class FacetScope {
|
|
7
|
+
/** Where a panel the "facet" phase laid out sits. */
|
|
8
|
+
static placeOf(panel) {
|
|
9
|
+
return {
|
|
10
|
+
facetValue: panel.label,
|
|
11
|
+
...(panel.row !== undefined ? { row: panel.row } : {}),
|
|
12
|
+
...(panel.col !== undefined ? { col: panel.col } : {})
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Whether something limited to `target` applies at the facet panel `place`. Without a target it
|
|
17
|
+
* applies everywhere; with one, only to the panels it names, and to no plot that has no facet.
|
|
18
|
+
*/
|
|
19
|
+
static targets(target, place) {
|
|
20
|
+
if (target === undefined)
|
|
21
|
+
return true;
|
|
22
|
+
if (!place)
|
|
23
|
+
return false;
|
|
24
|
+
const names = (value) => (Array.isArray(value) ? value : [value]).map(String);
|
|
25
|
+
if (typeof target === 'object' && !Array.isArray(target)) {
|
|
26
|
+
const matches = (wanted, actual) => wanted === undefined || (actual !== undefined && names(wanted).includes(actual));
|
|
27
|
+
return matches(target.row, place.row) && matches(target.col, place.col);
|
|
28
|
+
}
|
|
29
|
+
return names(target).includes(place.facetValue);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* `items` as the facet panel `place` sees them: those that name no facet, or name this one, with
|
|
33
|
+
* their `facet` taken off. The same list comes back when none names a facet.
|
|
34
|
+
*/
|
|
35
|
+
static scope(items, place) {
|
|
36
|
+
const facetOf = (item) => item.facet;
|
|
37
|
+
if (!items || items.every((item) => facetOf(item) === undefined))
|
|
38
|
+
return items;
|
|
39
|
+
return items
|
|
40
|
+
.filter((item) => FacetScope.targets(facetOf(item), place))
|
|
41
|
+
.map((item) => {
|
|
42
|
+
const rest = { ...item };
|
|
43
|
+
delete rest.facet;
|
|
44
|
+
return rest;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/** A `segments` config as the facet panel `place` sees it: each series' segments, {@link FacetScope.scope}d. */
|
|
48
|
+
static scopeSegments(segments, place) {
|
|
49
|
+
if (!segments)
|
|
50
|
+
return segments;
|
|
51
|
+
const scoped = Object.entries(segments).map(([series, list]) => [series, FacetScope.scope(list, place) ?? list]);
|
|
52
|
+
if (scoped.every(([series, list]) => list === segments[series]))
|
|
53
|
+
return segments;
|
|
54
|
+
return Object.fromEntries(scoped);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* `segments` for a plot whose series are split by facet panel: each segment that names a facet moves
|
|
58
|
+
* under the key of its series in every panel it names - the id of that series' part there, as
|
|
59
|
+
* {@link FacetPanels.buildSeriesId} writes it, or `default` for the panel's series without their own -
|
|
60
|
+
* and loses its `facet`. Segments that name none stay where they were. The same config comes back
|
|
61
|
+
* when none names a facet.
|
|
62
|
+
*/
|
|
63
|
+
static distributeSegments(segments, panels) {
|
|
64
|
+
if (!segments)
|
|
65
|
+
return segments;
|
|
66
|
+
const named = Object.values(segments).some((list) => list.some((item) => item.facet !== undefined));
|
|
67
|
+
if (!named)
|
|
68
|
+
return segments;
|
|
69
|
+
const distributed = {};
|
|
70
|
+
for (const [series, list] of Object.entries(segments)) {
|
|
71
|
+
for (const item of list) {
|
|
72
|
+
const { facet, ...rest } = item;
|
|
73
|
+
if (facet === undefined) {
|
|
74
|
+
(distributed[series] ??= []).push(item);
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
for (const panel of panels) {
|
|
78
|
+
if (!FacetScope.targets(facet, FacetScope.placeOf(panel)))
|
|
79
|
+
continue;
|
|
80
|
+
(distributed[FacetPanels.buildSeriesId(panel.key, series)] ??= []).push(rest);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return distributed;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* `markers` for a plot split by facet panel: each marker that names a facet becomes one copy per
|
|
88
|
+
* panel it names, tagged with that panel ({@link PANEL_KEY}) and without its `facet`, in the marker's
|
|
89
|
+
* own place in the list. Markers that name none stay as they are, for every panel.
|
|
90
|
+
*/
|
|
91
|
+
static distributeMarkers(markers, panels) {
|
|
92
|
+
if (!markers || markers.every((marker) => marker.facet === undefined)) {
|
|
93
|
+
return markers;
|
|
94
|
+
}
|
|
95
|
+
return markers.flatMap((marker) => {
|
|
96
|
+
const { facet, ...rest } = marker;
|
|
97
|
+
if (facet === undefined)
|
|
98
|
+
return [marker];
|
|
99
|
+
return panels
|
|
100
|
+
.filter((panel) => FacetScope.targets(facet, FacetScope.placeOf(panel)))
|
|
101
|
+
.map((panel) => ({ ...rest, [PANEL_KEY]: panel.key }));
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -90,6 +90,8 @@
|
|
|
90
90
|
// svelte-ignore state_referenced_locally
|
|
91
91
|
const ownLegend = (legend !== undefined && legend !== false) || !outer;
|
|
92
92
|
const legendState = ownLegend ? LegendState.provide() : outer!;
|
|
93
|
+
// svelte-ignore state_referenced_locally
|
|
94
|
+
if (outer && legend === false) LegendState.silence();
|
|
93
95
|
|
|
94
96
|
/** What the figure adds to its automatic legend, when `legend` is `{ items, sections }`. */
|
|
95
97
|
const extension = $derived(
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
import RasterMarker from '../../markers/raster/RasterMarker.svelte';
|
|
24
24
|
import TickMarker from '../../markers/tick/TickMarker.svelte';
|
|
25
25
|
import TrailMarker from '../../markers/trail/TrailMarker.svelte';
|
|
26
|
+
import ViolinMarker from '../../markers/violin/ViolinMarker.svelte';
|
|
26
27
|
import WaffleMarker from '../../markers/waffle/WaffleMarker.svelte';
|
|
27
28
|
import DotMarker from '../../markers/dot/DotMarker.svelte';
|
|
28
29
|
import TextMarker from '../../markers/text/TextMarker.svelte';
|
|
@@ -39,6 +40,7 @@
|
|
|
39
40
|
import ContourClipMarker from '../../markers/contour/ContourClipMarker.svelte';
|
|
40
41
|
import InsetMarker from '../../markers/inset/InsetMarker.svelte';
|
|
41
42
|
import FrameClip from './FrameClip.svelte';
|
|
43
|
+
import MarkerOffset from './MarkerOffset.svelte';
|
|
42
44
|
import { getConfiguration } from '../../configuration/config.svelte';
|
|
43
45
|
import { usePlot } from '../plot/usePlot';
|
|
44
46
|
import { PlotMargins } from '../margins/PlotMargins.svelte';
|
|
@@ -48,7 +50,6 @@
|
|
|
48
50
|
import type { PlotHover } from '../hover/PlotHover.svelte';
|
|
49
51
|
import type { ScopedMarkerGroup } from '../../types/layout/geometry';
|
|
50
52
|
import type { GeoFeature } from '../../types/plots/data/geo';
|
|
51
|
-
import type { ChannelScalesConfig } from '../../types/layout/scales';
|
|
52
53
|
import { MarkerGrouping } from '../../phases/statistics/MarkerGrouping';
|
|
53
54
|
import { FrameClipping } from './FrameClipping';
|
|
54
55
|
|
|
@@ -75,7 +76,6 @@
|
|
|
75
76
|
markers = [],
|
|
76
77
|
seriesData = [],
|
|
77
78
|
scopedGroups = [],
|
|
78
|
-
channelScales = undefined,
|
|
79
79
|
ctrl,
|
|
80
80
|
numericMargins,
|
|
81
81
|
data = [],
|
|
@@ -91,8 +91,6 @@
|
|
|
91
91
|
seriesData?: Series<TSeries>[];
|
|
92
92
|
/** One entry per series that can own a `series`-scoped marker. Same `TSeries` as `seriesData`. */
|
|
93
93
|
scopedGroups?: ScopedMarkerGroup<TSeries>[];
|
|
94
|
-
/** This plot kind's own `color`/`grouping` channel config - the fallback a marker's own `scales` inherits when it sets none of its own. */
|
|
95
|
-
channelScales?: ChannelScalesConfig;
|
|
96
94
|
/** `BasePlotLayout`'s own hover controller. */
|
|
97
95
|
ctrl: PlotHover<TData>;
|
|
98
96
|
/** The plot's own resolved margins - places the content box an `inset` marker needs. */
|
|
@@ -122,7 +120,8 @@
|
|
|
122
120
|
const scope = scopedSeriesOf(marker);
|
|
123
121
|
if (scope) return `${scope}-${marker.type}-${i}`;
|
|
124
122
|
if (marker.type === 'rule') {
|
|
125
|
-
|
|
123
|
+
// A rule over rows (`data`) has no value of its own to tell it from another one.
|
|
124
|
+
const v = typeof marker.value === 'function' || marker.data ? i : marker.value;
|
|
126
125
|
return `rule-${marker.axis}-${v}`;
|
|
127
126
|
}
|
|
128
127
|
if (marker.type === 'bar') return `bar-${marker.role}-${i}`;
|
|
@@ -130,7 +129,7 @@
|
|
|
130
129
|
}
|
|
131
130
|
</script>
|
|
132
131
|
|
|
133
|
-
{#snippet
|
|
132
|
+
{#snippet drawMarker(marker: MarkerConfig, rows: TData[] | TSeries[])}
|
|
134
133
|
{#if marker.type === 'bar'}
|
|
135
134
|
<BarMarker marker={{ ...marker, data: marker.data ?? rows }} />
|
|
136
135
|
{:else if marker.type === 'line'}
|
|
@@ -173,12 +172,12 @@
|
|
|
173
172
|
<TickMarker marker={{ ...marker, data: marker.data ?? rows }} />
|
|
174
173
|
{:else if marker.type === 'trail'}
|
|
175
174
|
<TrailMarker marker={{ ...marker, data: marker.data ?? rows }} />
|
|
175
|
+
{:else if marker.type === 'violin'}
|
|
176
|
+
<ViolinMarker marker={{ ...marker, data: marker.data ?? rows }} />
|
|
176
177
|
{:else if marker.type === 'waffle'}
|
|
177
178
|
<WaffleMarker marker={{ ...marker, data: marker.data ?? rows }} />
|
|
178
179
|
{:else if marker.type === 'dot'}
|
|
179
|
-
<DotMarker
|
|
180
|
-
marker={{ ...marker, data: marker.data ?? rows, scales: marker.scales ?? channelScales }}
|
|
181
|
-
/>
|
|
180
|
+
<DotMarker marker={{ ...marker, data: marker.data ?? rows }} />
|
|
182
181
|
{:else if marker.type === 'text'}
|
|
183
182
|
<TextMarker marker={{ ...marker, data: marker.data ?? rows }} />
|
|
184
183
|
{:else if marker.type === 'rule'}
|
|
@@ -236,6 +235,12 @@
|
|
|
236
235
|
{/if}
|
|
237
236
|
{/snippet}
|
|
238
237
|
|
|
238
|
+
{#snippet renderMarker(marker: MarkerConfig, rows: TData[] | TSeries[])}
|
|
239
|
+
<MarkerOffset {marker}>
|
|
240
|
+
{@render drawMarker(marker, rows)}
|
|
241
|
+
</MarkerOffset>
|
|
242
|
+
{/snippet}
|
|
243
|
+
|
|
239
244
|
{#snippet renderScoped(marker: MarkerConfig, group: ScopedMarkerGroup<TSeries>)}
|
|
240
245
|
{#if marker.type === 'hover'}
|
|
241
246
|
{@const seriesPoints = ctrl.points.filter((p) => p.series === group.name)}
|
|
@@ -4,7 +4,6 @@ import type { TooltipAnchorX, TooltipAnchorY } from '../../types/layout/tooltip'
|
|
|
4
4
|
import type { PlotHover } from '../hover/PlotHover.svelte';
|
|
5
5
|
import type { ScopedMarkerGroup } from '../../types/layout/geometry';
|
|
6
6
|
import type { GeoFeature } from '../../types/plots/data/geo';
|
|
7
|
-
import type { ChannelScalesConfig } from '../../types/layout/scales';
|
|
8
7
|
declare function $$render<TData extends Record<string, unknown>, TSeries extends Record<string, unknown> = TData>(): {
|
|
9
8
|
props: {
|
|
10
9
|
/** The plot's own outer width/height - sizes the content box an `inset` marker needs. */
|
|
@@ -15,8 +14,6 @@ declare function $$render<TData extends Record<string, unknown>, TSeries extends
|
|
|
15
14
|
seriesData?: Series<TSeries>[];
|
|
16
15
|
/** One entry per series that can own a `series`-scoped marker. Same `TSeries` as `seriesData`. */
|
|
17
16
|
scopedGroups?: ScopedMarkerGroup<TSeries>[];
|
|
18
|
-
/** This plot kind's own `color`/`grouping` channel config - the fallback a marker's own `scales` inherits when it sets none of its own. */
|
|
19
|
-
channelScales?: ChannelScalesConfig;
|
|
20
17
|
/** `BasePlotLayout`'s own hover controller. */
|
|
21
18
|
ctrl: PlotHover<TData>;
|
|
22
19
|
/** The plot's own resolved margins - places the content box an `inset` marker needs. */
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import { RowOffset } from '../../markers/utils/RowOffset';
|
|
4
|
+
import type { RowOffset as RowOffsetConfig } from '../../types/markers/channels/commonMarkerConfigWithRowOffset';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Moves what it draws by the marker's `dx` and `dy` (the numbers; a function of
|
|
8
|
+
* the row is each marker's own), as a translate of the whole marker - so any
|
|
9
|
+
* marker kind can be offset, on a map too, where svelteplot ignores a mark's
|
|
10
|
+
* own `dx`/`dy`. A `text` marker places its own labels, since its lanes and
|
|
11
|
+
* flips depend on the offset.
|
|
12
|
+
*/
|
|
13
|
+
let {
|
|
14
|
+
marker,
|
|
15
|
+
children
|
|
16
|
+
}: {
|
|
17
|
+
marker: { type: string; dx?: RowOffsetConfig; dy?: RowOffsetConfig };
|
|
18
|
+
children: Snippet;
|
|
19
|
+
} = $props();
|
|
20
|
+
|
|
21
|
+
const offset = $derived(marker.type === 'text' ? { dx: 0, dy: 0 } : RowOffset.whole(marker));
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
{#if offset.dx !== 0 || offset.dy !== 0}
|
|
25
|
+
<g transform="translate({offset.dx},{offset.dy})">{@render children()}</g>
|
|
26
|
+
{:else}
|
|
27
|
+
{@render children()}
|
|
28
|
+
{/if}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { RowOffset as RowOffsetConfig } from '../../types/markers/channels/commonMarkerConfigWithRowOffset';
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
marker: {
|
|
5
|
+
type: string;
|
|
6
|
+
dx?: RowOffsetConfig;
|
|
7
|
+
dy?: RowOffsetConfig;
|
|
8
|
+
};
|
|
9
|
+
children: Snippet;
|
|
10
|
+
};
|
|
11
|
+
declare const MarkerOffset: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
12
|
+
type MarkerOffset = ReturnType<typeof MarkerOffset>;
|
|
13
|
+
export default MarkerOffset;
|
|
@@ -96,14 +96,12 @@
|
|
|
96
96
|
</div>
|
|
97
97
|
{/if}
|
|
98
98
|
{#if ready && layout && layout.box.width > 0 && layout.box.height > 0}
|
|
99
|
-
{
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
})}
|
|
106
|
-
{/key}
|
|
99
|
+
{@render children({
|
|
100
|
+
width: layout.box.width,
|
|
101
|
+
height: layout.box.height,
|
|
102
|
+
margins: layout.box.margins,
|
|
103
|
+
edges: layout.edges
|
|
104
|
+
})}
|
|
107
105
|
{/if}
|
|
108
106
|
</div>
|
|
109
107
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { untrack } from 'svelte';
|
|
3
3
|
import type { ContinuousLegendSection } from '../../types/layout/legend';
|
|
4
|
-
import {
|
|
4
|
+
import { ColorRamp } from '../../utils/color';
|
|
5
5
|
import { getConfiguration } from '../../configuration/config.svelte';
|
|
6
6
|
import { AxisNumberFormat } from './AxisNumberFormat';
|
|
7
7
|
import { LegendState } from './LegendState.svelte';
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
const cfg = $derived(getConfiguration());
|
|
12
12
|
const gradientId = `dct-grad-${Math.random().toString(36).slice(2)}`;
|
|
13
|
+
const checkerId = `dct-checker-${Math.random().toString(36).slice(2)}`;
|
|
13
14
|
const barWidth = $derived(section.width ?? 170);
|
|
14
15
|
|
|
15
16
|
const fmt = $derived(section.format ?? AxisNumberFormat.of([section.min, section.max], cfg));
|
|
@@ -31,6 +32,7 @@
|
|
|
31
32
|
const svgHeight = $derived(cfg.legend.continuous.height);
|
|
32
33
|
const barHeight = $derived(cfg.legend.continuous.barHeight);
|
|
33
34
|
const barRadius = $derived(cfg.legend.continuous.barRadius);
|
|
35
|
+
const opacityLook = $derived(cfg.legend.continuous.opacity);
|
|
34
36
|
|
|
35
37
|
// Fill/opacity for the excluded-margin rects.
|
|
36
38
|
const excludedStyle = $derived.by((): { fill: string; opacity: number } => {
|
|
@@ -79,16 +81,18 @@
|
|
|
79
81
|
);
|
|
80
82
|
const colorScale = $derived(
|
|
81
83
|
section.scheme !== undefined
|
|
82
|
-
?
|
|
84
|
+
? ColorRamp.resolve({ scheme: section.scheme, pivot: section.pivot }, colorDomain, [
|
|
83
85
|
cfg.continuous.min,
|
|
84
86
|
cfg.continuous.max
|
|
85
87
|
])
|
|
86
|
-
:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
: cfg.continuous.scheme && section.colorMin === undefined && section.colorMax === undefined
|
|
89
|
+
? ColorRamp.continuous(cfg, undefined, colorDomain)
|
|
90
|
+
: ColorRamp.between(
|
|
91
|
+
colorDomain[0],
|
|
92
|
+
colorDomain[1],
|
|
93
|
+
section.colorMin ?? cfg.continuous.min,
|
|
94
|
+
section.colorMax ?? cfg.continuous.max
|
|
95
|
+
)
|
|
92
96
|
);
|
|
93
97
|
|
|
94
98
|
const stops = $derived(
|
|
@@ -98,7 +102,7 @@
|
|
|
98
102
|
return section.opacity
|
|
99
103
|
? {
|
|
100
104
|
offset: t * 100,
|
|
101
|
-
color: section.colorMin ??
|
|
105
|
+
color: section.colorMin ?? opacityLook.color,
|
|
102
106
|
opacity: section.opacity[0] + t * (section.opacity[1] - section.opacity[0])
|
|
103
107
|
}
|
|
104
108
|
: { offset: t * 100, color: colorScale(v), opacity: 1 };
|
|
@@ -203,7 +207,38 @@
|
|
|
203
207
|
<stop offset="{s.offset}%" stop-color={s.color} stop-opacity={s.opacity} />
|
|
204
208
|
{/each}
|
|
205
209
|
</linearGradient>
|
|
210
|
+
{#if section.opacity}
|
|
211
|
+
<pattern
|
|
212
|
+
id={checkerId}
|
|
213
|
+
width={opacityLook.checker.size * 2}
|
|
214
|
+
height={opacityLook.checker.size * 2}
|
|
215
|
+
patternUnits="userSpaceOnUse"
|
|
216
|
+
>
|
|
217
|
+
<rect width="100%" height="100%" fill={opacityLook.checker.light} />
|
|
218
|
+
<rect
|
|
219
|
+
width={opacityLook.checker.size}
|
|
220
|
+
height={opacityLook.checker.size}
|
|
221
|
+
fill={opacityLook.checker.dark}
|
|
222
|
+
/>
|
|
223
|
+
<rect
|
|
224
|
+
x={opacityLook.checker.size}
|
|
225
|
+
y={opacityLook.checker.size}
|
|
226
|
+
width={opacityLook.checker.size}
|
|
227
|
+
height={opacityLook.checker.size}
|
|
228
|
+
fill={opacityLook.checker.dark}
|
|
229
|
+
/>
|
|
230
|
+
</pattern>
|
|
231
|
+
{/if}
|
|
206
232
|
</defs>
|
|
233
|
+
{#if section.opacity}
|
|
234
|
+
<rect
|
|
235
|
+
x={handleBleed}
|
|
236
|
+
width={trackWidth}
|
|
237
|
+
height={barHeight}
|
|
238
|
+
rx={barRadius}
|
|
239
|
+
fill="url(#{checkerId})"
|
|
240
|
+
/>
|
|
241
|
+
{/if}
|
|
207
242
|
<rect
|
|
208
243
|
x={handleBleed}
|
|
209
244
|
width={trackWidth}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { CssColor } from '../../utils/color';
|
|
3
3
|
import { getConfiguration } from '../../configuration/config.svelte';
|
|
4
4
|
import { LegendText } from './LegendText';
|
|
5
5
|
import DiscreteSymbolIcon from './DiscreteSymbolIcon.svelte';
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
omitMode?: boolean;
|
|
25
25
|
} = $props();
|
|
26
26
|
const cfg = $derived(getConfiguration());
|
|
27
|
-
const textColor = $derived(
|
|
27
|
+
const textColor = $derived(CssColor.contrastText(color));
|
|
28
28
|
</script>
|
|
29
29
|
|
|
30
30
|
<span class="dct-discrete__badge" style:background={color} style:color={textColor}>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { SvelteSet } from 'svelte/reactivity';
|
|
3
3
|
import { getConfiguration } from '../../configuration/config.svelte';
|
|
4
|
-
import {
|
|
4
|
+
import { Palette } from '../../utils/color';
|
|
5
5
|
import { LegendState } from './LegendState.svelte';
|
|
6
6
|
import { DisabledStyle } from './DisabledStyle';
|
|
7
7
|
import DiscreteBadgeItem from './DiscreteBadgeItem.svelte';
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
disabledStyle?.fill ??
|
|
168
168
|
disabledStyle?.stroke?.stroke ??
|
|
169
169
|
item.color ??
|
|
170
|
-
|
|
170
|
+
Palette.at(i, cfg.palette)}
|
|
171
171
|
{@const itemOpacity = disabledStyle
|
|
172
172
|
? (disabledStyle.opacity ?? cfg.legend.disabledOpacity)
|
|
173
173
|
: (item.opacity ?? 1)}
|