@fundar/data-chart-telling 1.0.0 → 1.2.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 +53 -0
- package/README.md +58 -19
- package/dist/configuration/config.svelte.d.ts +1 -1
- package/dist/configuration/config.svelte.js +172 -95
- package/dist/configuration/themes/index.d.ts +5 -1304
- package/dist/index.d.ts +24 -14
- package/dist/index.js +20 -10
- package/dist/layout/base/BasePlotLayout.svelte +129 -51
- 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/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/hover/HoverSettings.d.ts +20 -6
- package/dist/layout/hover/HoverSettings.js +29 -4
- 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 +1 -1
- package/dist/layout/legend/LegendChannels.js +36 -12
- package/dist/layout/legend/LegendLayout.svelte +9 -1
- package/dist/layout/legend/LegendState.svelte.d.ts +9 -0
- package/dist/layout/legend/LegendState.svelte.js +24 -3
- 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 +4 -8
- package/dist/layout/plot/Plot.svelte +6 -3
- package/dist/layout/plot/PublicPlotContext.d.ts +5 -4
- package/dist/layout/plot/PublicPlotContext.js +7 -3
- package/dist/layout/plot/Slice.d.ts +5 -1
- package/dist/layout/plot/Slice.js +18 -6
- package/dist/layout/scales/EdgeTicks.d.ts +39 -0
- package/dist/layout/scales/EdgeTicks.js +82 -0
- package/dist/layout/scales/NiceTicks.d.ts +43 -0
- package/dist/layout/scales/NiceTicks.js +76 -0
- package/dist/layout/scales/ScalesLayout.svelte +133 -34
- package/dist/layout/scales/ScalesLayout.svelte.d.ts +10 -0
- package/dist/layout/scales/SveltePlotScale.d.ts +15 -0
- package/dist/layout/scales/SveltePlotScale.js +86 -0
- 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 +83 -23
- package/dist/layout/timeline/Timeline.svelte +5 -2
- package/dist/layout/timeline/Timeline.svelte.d.ts +2 -0
- package/dist/layout/timeline/TimelineLayout.svelte +39 -13
- package/dist/layout/timeline/TimelineLayout.svelte.d.ts +7 -5
- package/dist/layout/timeline/TimelineRule.svelte +1 -0
- package/dist/layout/timeline/TimelineState.svelte.d.ts +13 -5
- package/dist/layout/timeline/TimelineState.svelte.js +42 -8
- package/dist/layout/timeline/TimelineTime.d.ts +18 -0
- package/dist/layout/timeline/TimelineTime.js +117 -0
- package/dist/layout/tooltip/Tooltip.svelte +10 -7
- package/dist/layout/tooltip/Tooltip.svelte.d.ts +6 -4
- package/dist/layout/tooltip/TooltipState.svelte.d.ts +8 -2
- package/dist/layout/tooltip/TooltipState.svelte.js +23 -4
- 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.js +1 -1
- package/dist/markers/delta/DeltaMarker.svelte +9 -7
- 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 +9 -3
- 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 +8 -2
- package/dist/phases/data/DataPhase.d.ts +5 -11
- package/dist/phases/data/DataPhase.js +14 -11
- package/dist/phases/data/PlotAxes.d.ts +10 -0
- package/dist/phases/data/PlotAxes.js +14 -1
- package/dist/phases/facet/FacetPanels.d.ts +55 -0
- package/dist/phases/facet/FacetPanels.js +96 -0
- package/dist/phases/facet/FacetPhase.d.ts +1 -42
- package/dist/phases/facet/FacetPhase.js +1 -87
- package/dist/phases/hover/HoverPhase.d.ts +6 -43
- package/dist/phases/hover/HoverPhase.js +19 -54
- package/dist/phases/mapping/MappingPhase.d.ts +1 -1
- package/dist/phases/mapping/MappingPhase.js +3 -5
- 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.d.ts +1 -3
- package/dist/phases/scales/ScalesPhase.js +37 -27
- package/dist/phases/sharedScales/SharedScalesPhase.d.ts +6 -2
- package/dist/phases/sharedScales/SharedScalesPhase.js +14 -8
- package/dist/phases/statistics/Statistics.d.ts +10 -6
- package/dist/phases/statistics/Statistics.js +20 -10
- package/dist/phases/statistics/StatisticsPhase.js +10 -6
- 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/tooltip/TooltipPhase.d.ts +4 -2
- package/dist/phases/tooltip/TooltipPhase.js +10 -3
- package/dist/phases/transforms/ProcessedPositions.d.ts +30 -0
- package/dist/phases/transforms/ProcessedPositions.js +74 -0
- package/dist/phases/transforms/TransformsPhase.d.ts +5 -42
- package/dist/phases/transforms/TransformsPhase.js +67 -58
- 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 +4 -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 +6 -5
- package/dist/plots/{scatter → correlation/scatter}/markers.d.ts +4 -4
- package/dist/plots/{scatter → correlation/scatter}/markers.js +5 -4
- package/dist/plots/distribution/box/BoxSummaries.d.ts +19 -0
- package/dist/plots/distribution/box/BoxSummaries.js +101 -0
- package/dist/plots/distribution/box/Plot.svelte +42 -0
- package/dist/plots/distribution/box/Plot.svelte.d.ts +26 -0
- package/dist/plots/distribution/box/defaults.d.ts +12 -0
- package/dist/plots/distribution/box/defaults.js +34 -0
- package/dist/plots/distribution/box/markers.d.ts +12 -0
- package/dist/plots/distribution/box/markers.js +34 -0
- 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 +4 -4
- package/dist/plots/{histogram → distribution/histogram}/markers.d.ts +3 -3
- package/dist/plots/{histogram → distribution/histogram}/markers.js +7 -7
- 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 +7 -6
- package/dist/plots/{pyramid → distribution/pyramid}/markers.d.ts +4 -4
- package/dist/plots/{pyramid → distribution/pyramid}/markers.js +8 -11
- 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 +2 -3
- 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 +7 -6
- 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 +5 -5
- package/dist/plots/{geo → map/geo}/phases/markers.d.ts +1 -1
- package/dist/plots/{geo → map/geo}/phases/markers.js +8 -13
- 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 +7 -4
- 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 +17 -15
- package/dist/plots/{bar → ranking/bar}/markers.d.ts +8 -8
- package/dist/plots/{bar → ranking/bar}/markers.js +11 -19
- 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.js +1 -1
- package/dist/types/configuration/styling.d.ts +287 -132
- package/dist/types/layout/composer.d.ts +5 -2
- package/dist/types/layout/coordinates.d.ts +5 -4
- package/dist/types/layout/legend.d.ts +21 -5
- package/dist/types/layout/plot.d.ts +44 -1
- package/dist/types/layout/scales.d.ts +51 -3
- 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 +19 -7
- 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/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 +9 -0
- 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/hover/phase.d.ts +6 -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 +20 -4
- package/dist/types/phases/statistics/phase.d.ts +3 -1
- package/dist/types/phases/statistics/source.d.ts +3 -1
- package/dist/types/phases/transforms/phase.d.ts +32 -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/distribution/box/props.d.ts +10 -0
- package/dist/types/plots/distribution/box/state.d.ts +23 -0
- 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/distribution/density/state.js +1 -0
- package/dist/types/plots/{histogram → distribution/histogram}/props.d.ts +7 -7
- package/dist/types/plots/distribution/histogram/props.js +1 -0
- 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 +3 -1
- 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/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 +39 -8
- package/docs/composer.md +19 -3
- package/docs/concepts.md +1 -1
- package/docs/development.md +14 -5
- package/docs/facets.md +62 -8
- package/docs/getting-started.md +8 -9
- package/docs/legend.md +73 -24
- package/docs/markers.md +45 -32
- 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 -154
- package/docs/scales.md +50 -27
- package/docs/state.md +1 -1
- package/docs/styles-and-segments.md +96 -39
- package/docs/theming.md +33 -19
- package/docs/timeline.md +62 -28
- package/docs/tooltip-and-hover.md +72 -24
- package/docs/transforms-and-statistics.md +56 -25
- package/examples/BarValues.svelte +2 -2
- package/examples/Box.svelte +7 -0
- package/examples/Bullet.svelte +17 -0
- package/examples/Chrome.svelte +17 -0
- package/examples/ChromeOrder.svelte +18 -0
- package/examples/Cleveland.svelte +15 -0
- package/examples/Composer.svelte +23 -0
- package/examples/CustomTooltip.svelte +21 -14
- package/examples/Density.svelte +7 -0
- package/examples/Dumbbell.svelte +16 -0
- package/examples/Facets.svelte +3 -3
- package/examples/FacetsCarousel.svelte +14 -0
- package/examples/FacetsRowsCols.svelte +23 -0
- package/examples/FirstPlot.svelte +7 -0
- package/examples/Forest.svelte +17 -0
- package/examples/Gaps.svelte +21 -0
- package/examples/GroupedBars.svelte +15 -0
- package/examples/Heatmap.svelte +7 -0
- package/examples/HeatmapSegments.svelte +26 -0
- package/examples/Histogram.svelte +14 -0
- package/examples/HorizontalBars.svelte +15 -0
- package/examples/LegendSections.svelte +27 -0
- package/examples/LegendToggle.svelte +3 -3
- package/examples/LineByRegion.svelte +18 -0
- package/examples/LineDates.svelte +15 -0
- package/examples/LineStep.svelte +16 -0
- package/examples/LineStepSegment.svelte +18 -0
- package/examples/Lollipop.svelte +17 -0
- package/examples/Markers.svelte +27 -0
- package/examples/MovingAverage.svelte +15 -0
- package/examples/Pyramid.svelte +14 -0
- package/examples/Regression.svelte +14 -0
- package/examples/ResponsiveLine.svelte +7 -7
- package/examples/Scales.svelte +26 -0
- package/examples/Scatter.svelte +16 -0
- package/examples/SegmentHighlight.svelte +22 -0
- package/examples/Segments.svelte +11 -3
- package/examples/SegmentsBySeries.svelte +25 -0
- package/examples/Slope.svelte +17 -0
- package/examples/Sparkline.svelte +14 -0
- package/examples/StackedArea.svelte +16 -0
- package/examples/StackedBars.svelte +15 -0
- package/examples/TimelinePlayer.svelte +8 -7
- package/examples/TimelineRule.svelte +19 -0
- package/examples/Tooltip.svelte +3 -3
- package/examples/ValueLabels.svelte +21 -0
- 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 +51 -12
- package/llms.txt +60 -4
- package/package.json +12 -2
- package/dist/layout/scales/buildScale.d.ts +0 -8
- package/dist/layout/scales/buildScale.js +0 -67
- package/dist/layout/scales/niceDomain.d.ts +0 -23
- package/dist/layout/scales/niceDomain.js +0 -59
- 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 -12
- /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/geo/props.js → layout/styles/gaps.js} +0 -0
- /package/dist/types/{plots/geo/state.js → layout/styles/geo.js} +0 -0
- /package/dist/types/{plots/heatmap/props.js → layout/styles/values.js} +0 -0
- /package/dist/types/{plots/heatmap/state.js → markers/axis/violin.js} +0 -0
- /package/dist/types/{plots/histogram/props.js → markers/channels/commonMarkerConfigWithRowOffset.js} +0 -0
- /package/dist/types/plots/{line → correlation/heatmap}/props.js +0 -0
- /package/dist/types/plots/{histogram → correlation/heatmap}/state.js +0 -0
- /package/dist/types/plots/{pyramid → correlation/scatter}/props.js +0 -0
- /package/dist/types/plots/{line → correlation/scatter}/state.js +0 -0
- /package/dist/types/plots/{scatter → distribution/box}/props.js +0 -0
- /package/dist/types/plots/{pyramid → distribution/box}/state.js +0 -0
- /package/dist/types/plots/{scatter/state.js → distribution/density/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;
|
|
@@ -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,11 +1,10 @@
|
|
|
1
1
|
import type { TooltipProp } from '../../types/layout/tooltip';
|
|
2
|
-
import type { HoverStrategy } from '../../types/layout/hover';
|
|
3
|
-
import
|
|
2
|
+
import type { HoverPoint, HoverStrategy } from '../../types/layout/hover';
|
|
3
|
+
import { PlotAxes } from '../../phases/data/PlotAxes';
|
|
4
|
+
import type { HoverConfig, PointMatchingStrategy, TooltipConfig } from '../../types/plots/props';
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* strategy that matches points (the tooltip's, else the marker's, else the
|
|
8
|
-
* plot kind's `defaultStrategy`) and whether it syncs across plots.
|
|
6
|
+
* A plot's hover as its `tooltip` and hover marker set it up: whether it is on,
|
|
7
|
+
* how it matches points and whether it syncs across plots.
|
|
9
8
|
*/
|
|
10
9
|
export declare class HoverSettings<TRow extends Record<string, unknown>> {
|
|
11
10
|
/** The tooltip, or `undefined` when off. */
|
|
@@ -17,4 +16,19 @@ export declare class HoverSettings<TRow extends Record<string, unknown>> {
|
|
|
17
16
|
constructor(tooltip: TooltipProp<TRow> | TooltipConfig<TRow> | undefined, markers: {
|
|
18
17
|
type: string;
|
|
19
18
|
}[] | undefined, defaultStrategy: HoverStrategy);
|
|
19
|
+
/** The strategy a plot's axes ask for: along the unmeasured axis, or `'punctual'` when both hold categories. */
|
|
20
|
+
static strategyOf(axes: PlotAxes | undefined): HoverStrategy;
|
|
21
|
+
/** A plot's `hover` config; its tooltip reads as `format` unless it sets its own. */
|
|
22
|
+
static buildConfig<TRow extends Record<string, unknown>>(args: {
|
|
23
|
+
tooltip: TooltipConfig<TRow> | undefined;
|
|
24
|
+
format: (row: TRow) => string;
|
|
25
|
+
sort?: (a: TRow, b: TRow) => number;
|
|
26
|
+
markers: {
|
|
27
|
+
type: string;
|
|
28
|
+
}[];
|
|
29
|
+
points: HoverPoint<TRow>[];
|
|
30
|
+
label: (row: TRow) => string;
|
|
31
|
+
defaultStrategy: HoverStrategy;
|
|
32
|
+
pointMatching?: PointMatchingStrategy;
|
|
33
|
+
}): HoverConfig<TRow>;
|
|
20
34
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { PlotAxes } from '../../phases/data/PlotAxes';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* strategy that matches points (the tooltip's, else the marker's, else the
|
|
5
|
-
* plot kind's `defaultStrategy`) and whether it syncs across plots.
|
|
3
|
+
* A plot's hover as its `tooltip` and hover marker set it up: whether it is on,
|
|
4
|
+
* how it matches points and whether it syncs across plots.
|
|
6
5
|
*/
|
|
7
6
|
export class HoverSettings {
|
|
8
7
|
/** The tooltip, or `undefined` when off. */
|
|
@@ -24,4 +23,30 @@ export class HoverSettings {
|
|
|
24
23
|
this.strategy = this.tooltip?.strategy ?? marker?.strategy ?? defaultStrategy;
|
|
25
24
|
this.sync = this.tooltip?.sync ?? marker?.sync ?? false;
|
|
26
25
|
}
|
|
26
|
+
/** The strategy a plot's axes ask for: along the unmeasured axis, or `'punctual'` when both hold categories. */
|
|
27
|
+
static strategyOf(axes) {
|
|
28
|
+
if (!axes)
|
|
29
|
+
return 'x';
|
|
30
|
+
if (axes.isDiscrete('x') && axes.isDiscrete('y'))
|
|
31
|
+
return 'punctual';
|
|
32
|
+
return PlotAxes.other(PlotAxes.valueOf({ axes }));
|
|
33
|
+
}
|
|
34
|
+
/** A plot's `hover` config; its tooltip reads as `format` unless it sets its own. */
|
|
35
|
+
static buildConfig(args) {
|
|
36
|
+
const { tooltip, format, sort, markers, points, label, defaultStrategy, pointMatching } = args;
|
|
37
|
+
const settings = new HoverSettings(tooltip, markers, defaultStrategy);
|
|
38
|
+
return {
|
|
39
|
+
active: settings.active,
|
|
40
|
+
points,
|
|
41
|
+
label,
|
|
42
|
+
strategy: settings.strategy,
|
|
43
|
+
sync: settings.sync,
|
|
44
|
+
tooltip: tooltip && {
|
|
45
|
+
...tooltip,
|
|
46
|
+
format: tooltip.format ?? format,
|
|
47
|
+
...(sort ? { sort } : {})
|
|
48
|
+
},
|
|
49
|
+
...(pointMatching ? { pointMatching } : {})
|
|
50
|
+
};
|
|
51
|
+
}
|
|
27
52
|
}
|
|
@@ -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)}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { LegendItem } from '../../types/layout/legend';
|
|
3
3
|
import type { LineStyle } from '../../types/plots/constants';
|
|
4
|
-
import { SymbolPath } from '../../utils/
|
|
4
|
+
import { SymbolPath } from '../../utils/SymbolPath';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* The series' symbol/line-style icon, shared by both discrete item looks
|