@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
|
@@ -1,15 +1,28 @@
|
|
|
1
|
-
import { resolveAccessor } from '
|
|
1
|
+
import { resolveAccessor } from '../../utils/accessors';
|
|
2
2
|
import { merge } from '../../utils/merge';
|
|
3
|
+
import { seriesIdOf } from '../../utils/grouping';
|
|
4
|
+
import { FacetPanels } from '../../phases/facet/FacetPanels';
|
|
3
5
|
const DEFAULT_KEY = 'default';
|
|
4
6
|
/**
|
|
5
7
|
* Returns the flat {@link Segment} list for one series.
|
|
6
8
|
* Series-specific segments are added before `'default'` segments so that
|
|
7
9
|
* series-specific catch-alls win over default catch-alls on tie-breaks.
|
|
10
|
+
* A series split by facet panel also reads the segments its panel was given
|
|
11
|
+
* for it - under its id - and for every series of the panel - under the
|
|
12
|
+
* panel's own `'default'` - ahead of the plot's own, as the more specific.
|
|
8
13
|
*/
|
|
9
|
-
export function resolveSegmentsForSeries(segments,
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
14
|
+
export function resolveSegmentsForSeries(segments, series) {
|
|
15
|
+
const noPanel = series.panel === undefined;
|
|
16
|
+
const own = noPanel ? [] : (segments[seriesIdOf(series)] ?? []);
|
|
17
|
+
const panelDefaults = noPanel
|
|
18
|
+
? []
|
|
19
|
+
: (segments[FacetPanels.buildSeriesId(series.panel, DEFAULT_KEY)] ?? []);
|
|
20
|
+
return [
|
|
21
|
+
...own,
|
|
22
|
+
...(segments[series.name] ?? []),
|
|
23
|
+
...panelDefaults,
|
|
24
|
+
...(segments[DEFAULT_KEY] ?? [])
|
|
25
|
+
];
|
|
13
26
|
}
|
|
14
27
|
/** Returns true when `xVal` falls inside any of a segment's x ranges. */
|
|
15
28
|
export function matchesSegmentX(xVal, seg) {
|
|
@@ -176,7 +189,7 @@ function readChannel(accessor) {
|
|
|
176
189
|
export function buildGroupedSeries(seriesList, segments = {}, connect = true) {
|
|
177
190
|
return seriesList.map((s) => ({
|
|
178
191
|
series: s,
|
|
179
|
-
visualSegments: resolveSeriesSegments(s, resolveSegmentsForSeries(segments, s
|
|
192
|
+
visualSegments: resolveSeriesSegments(s, resolveSegmentsForSeries(segments, s), connect)
|
|
180
193
|
}));
|
|
181
194
|
}
|
|
182
195
|
/**
|
|
@@ -193,7 +206,7 @@ export function buildScopedMarkerGroups(args) {
|
|
|
193
206
|
return groupedSeries.map((group, seriesIndex) => {
|
|
194
207
|
const defaultColor = colorFor(group.series, seriesIndex);
|
|
195
208
|
const xFor = readChannel(group.series.x);
|
|
196
|
-
const segs = resolveSegmentsForSeries(segments, group.series
|
|
209
|
+
const segs = resolveSegmentsForSeries(segments, group.series);
|
|
197
210
|
return {
|
|
198
211
|
name: group.series.name,
|
|
199
212
|
...(group.series.id !== undefined ? { id: group.series.id } : {}),
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { StrokeStyle, DotStyle, FontStyle, AreaStyle } from '../plots/styling';
|
|
2
2
|
import type { LineAnchor, SymbolType, TextAnchor } from '../plots/constants';
|
|
3
3
|
import type { PlotChromeEntry } from '../plots/props';
|
|
4
|
+
import type { LegendMark } from '../layout/legend';
|
|
4
5
|
import type { EdgeTicksOptions } from '../layout/scales';
|
|
6
|
+
import type { CurveName } from '../layout/styles/curve';
|
|
5
7
|
export type TextStyle = {
|
|
6
8
|
/** font-family */
|
|
7
9
|
font: string;
|
|
@@ -16,12 +18,32 @@ export type TextStyle = {
|
|
|
16
18
|
/** letter-spacing */
|
|
17
19
|
spacing: string;
|
|
18
20
|
};
|
|
21
|
+
/** What the plots that join dots along a category (lollipop, dumbbell, Cleveland) read from their own configuration block. */
|
|
22
|
+
export type DotRangeStyling = {
|
|
23
|
+
/** Radius of every dot that sets none of its own, in px. */
|
|
24
|
+
dotRadius: number;
|
|
25
|
+
/** Whether every connector draws a cap - a short tick across it - at each end, unless `styles.connector.caps` says otherwise. */
|
|
26
|
+
caps?: boolean;
|
|
27
|
+
/** Width of every connector that sets none of its own, in px; `'dots'` makes it as thick as the dots are wide, a band. */
|
|
28
|
+
stemWidth: number | 'dots';
|
|
29
|
+
/** Color of the connector of a category with several dots; a lone dot's stem takes its series' color. Unset, the axis color. */
|
|
30
|
+
connectorColor?: string;
|
|
31
|
+
/** Gap, in px, between a dot and its value label, unless the labels' own `dx`/`dy` set one. */
|
|
32
|
+
labelGap: number;
|
|
33
|
+
/** Fallback gap (0-1) between neighbouring categories, when a plot doesn't set its own `scales.x/y.paddingInner`. */
|
|
34
|
+
paddingInner: number;
|
|
35
|
+
/** Fallback gap (0-1) before the first and after the last category, when a plot doesn't set its own `scales.x/y.paddingOuter`. */
|
|
36
|
+
paddingOuter: number;
|
|
37
|
+
};
|
|
19
38
|
/** How a chrome divider's line is drawn, as a CSS border style. */
|
|
20
39
|
export type DividerLineStyle = 'solid' | 'dashed' | 'dotted' | 'double';
|
|
21
40
|
export type PlotStylesConfig = {
|
|
22
41
|
font: string;
|
|
23
42
|
color: string;
|
|
24
43
|
background: string;
|
|
44
|
+
title: TextStyle;
|
|
45
|
+
subtitle: TextStyle;
|
|
46
|
+
caption: TextStyle;
|
|
25
47
|
spacing: {
|
|
26
48
|
headerPadding: string;
|
|
27
49
|
legendPadding: string;
|
|
@@ -44,9 +66,63 @@ export type PlotStylesConfig = {
|
|
|
44
66
|
/** The space between the blocks of a row of the chrome, as a CSS length. */
|
|
45
67
|
rowGap: string;
|
|
46
68
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
69
|
+
/** Discrete categorical palette (grouped series). */
|
|
70
|
+
palette: string[];
|
|
71
|
+
/** Default shape cycle for the `symbol` channel, in order. */
|
|
72
|
+
symbols: SymbolType[];
|
|
73
|
+
/** The default continuous ramp, the on-cell label colour and the default opacity-channel range. */
|
|
74
|
+
continuous: {
|
|
75
|
+
/** The ramp's first color, when it is not a named `scheme`. */
|
|
76
|
+
min: string;
|
|
77
|
+
/** The ramp's last color, when it is not a named `scheme`. */
|
|
78
|
+
max: string;
|
|
79
|
+
/** A named d3-scale-chromatic ramp (`'viridis'`, `'blues'`...), over `min` and `max`. */
|
|
80
|
+
scheme?: string;
|
|
81
|
+
/** The part of `scheme` to use, as `[from, to]` fractions of it: `[0.2, 1]` skips the near-white start of `'blues'`. */
|
|
82
|
+
schemeRange?: [number, number];
|
|
83
|
+
labelColor: string;
|
|
84
|
+
opacityRange: [number, number];
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Per-side plot margin. `'auto'` (the default) lets svelteplot size that
|
|
88
|
+
* side to fit whatever it actually renders there - tick labels, an axis
|
|
89
|
+
* title, rotated ticks - instead of clipping content or leaving unused
|
|
90
|
+
* space. A number pins that side exactly, opting out of auto-sizing.
|
|
91
|
+
*/
|
|
92
|
+
margins: {
|
|
93
|
+
top: number | 'auto';
|
|
94
|
+
right: number | 'auto';
|
|
95
|
+
bottom: number | 'auto';
|
|
96
|
+
left: number | 'auto';
|
|
97
|
+
};
|
|
98
|
+
/** Marker clipping to the plot's inner frame (see `FrameClip`). */
|
|
99
|
+
frameClip: {
|
|
100
|
+
/**
|
|
101
|
+
* How far (px) a clipped mark may reach past the frame before it's cut,
|
|
102
|
+
* so strokes and labels on the edge aren't shaved off. A number sets all
|
|
103
|
+
* four sides; a string takes CSS shorthand px values for 1-4 sides, e.g.
|
|
104
|
+
* `'4px'`, `'4px 8px'`, `'0 8px 4px'`, `'0 8px 4px 2px'`.
|
|
105
|
+
*/
|
|
106
|
+
tolerance: number | string;
|
|
107
|
+
};
|
|
108
|
+
axis: {
|
|
109
|
+
color: string;
|
|
110
|
+
fontSize: number;
|
|
111
|
+
labelFontSize: number;
|
|
112
|
+
titleFontSize: number;
|
|
113
|
+
xTickSize: number;
|
|
114
|
+
yTickSize: number;
|
|
115
|
+
xTickPadding: number;
|
|
116
|
+
yTickPadding: number;
|
|
117
|
+
grid: boolean;
|
|
118
|
+
locale: string;
|
|
119
|
+
compactDisplay: 'short' | 'long';
|
|
120
|
+
edgeTicks: {
|
|
121
|
+
x: EdgeTicksOptions;
|
|
122
|
+
y: EdgeTicksOptions;
|
|
123
|
+
};
|
|
124
|
+
autoRotate: boolean;
|
|
125
|
+
};
|
|
50
126
|
legend: {
|
|
51
127
|
font: string;
|
|
52
128
|
size: string;
|
|
@@ -58,6 +134,13 @@ export type PlotStylesConfig = {
|
|
|
58
134
|
gap: string;
|
|
59
135
|
/** swatch square size */
|
|
60
136
|
swatchSize: string;
|
|
137
|
+
/** The icon a discrete legend item draws for its series. */
|
|
138
|
+
icon: {
|
|
139
|
+
/** Draws the icons with rounded corners. */
|
|
140
|
+
rounded: boolean;
|
|
141
|
+
/** The shape a series icon takes by how the series draws, unless the series sets its own `symbol`. */
|
|
142
|
+
marks: Record<LegendMark, SymbolType>;
|
|
143
|
+
};
|
|
61
144
|
/** Fallback opacity for a legend-disabled series/value when a section doesn't set its own style. */
|
|
62
145
|
disabledOpacity: number;
|
|
63
146
|
/**
|
|
@@ -95,6 +178,17 @@ export type PlotStylesConfig = {
|
|
|
95
178
|
barHeight: number;
|
|
96
179
|
/** Corner radius (px) of the gradient bar and excluded-range overlays. */
|
|
97
180
|
barRadius: number;
|
|
181
|
+
/** The bar of an opacity section: one color fading over a checkerboard, so it reads as transparency and not as a color ramp. */
|
|
182
|
+
opacity: {
|
|
183
|
+
/** The color that fades, unless the marker it describes draws in one of its own. */
|
|
184
|
+
color: string;
|
|
185
|
+
/** The checkerboard behind the bar: its squares' size (px) and two colors. */
|
|
186
|
+
checker: {
|
|
187
|
+
size: number;
|
|
188
|
+
light: string;
|
|
189
|
+
dark: string;
|
|
190
|
+
};
|
|
191
|
+
};
|
|
98
192
|
/** The draggable lo/hi handle. */
|
|
99
193
|
handle: {
|
|
100
194
|
width: string;
|
|
@@ -129,23 +223,6 @@ export type PlotStylesConfig = {
|
|
|
129
223
|
};
|
|
130
224
|
};
|
|
131
225
|
};
|
|
132
|
-
axis: {
|
|
133
|
-
color: string;
|
|
134
|
-
fontSize: number;
|
|
135
|
-
labelFontSize: number;
|
|
136
|
-
titleFontSize: number;
|
|
137
|
-
xTickSize: number;
|
|
138
|
-
yTickSize: number;
|
|
139
|
-
xTickPadding: number;
|
|
140
|
-
yTickPadding: number;
|
|
141
|
-
grid: boolean;
|
|
142
|
-
locale: string;
|
|
143
|
-
compactDisplay: 'short' | 'long';
|
|
144
|
-
edgeTicks: {
|
|
145
|
-
x: EdgeTicksOptions;
|
|
146
|
-
y: EdgeTicksOptions;
|
|
147
|
-
};
|
|
148
|
-
};
|
|
149
226
|
tooltip: {
|
|
150
227
|
background: string;
|
|
151
228
|
color: string;
|
|
@@ -155,107 +232,35 @@ export type PlotStylesConfig = {
|
|
|
155
232
|
border: string;
|
|
156
233
|
};
|
|
157
234
|
/**
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
* space. A number pins that side exactly, opting out of auto-sizing.
|
|
235
|
+
* In-SVG hover highlight: crosshair rule, dot + value label, and the area
|
|
236
|
+
* highlight - a restyled feature on `GeoPlot`, or an `areaX`/`areaY` band
|
|
237
|
+
* on an axis-based plot's band scale.
|
|
162
238
|
*/
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
};
|
|
169
|
-
/** Marker clipping to the plot's inner frame (see `FrameClip`). */
|
|
170
|
-
frameClip: {
|
|
171
|
-
/**
|
|
172
|
-
* How far (px) a clipped mark may reach past the frame before it's cut,
|
|
173
|
-
* so strokes and labels on the edge aren't shaved off. A number sets all
|
|
174
|
-
* four sides; a string takes CSS shorthand px values for 1-4 sides, e.g.
|
|
175
|
-
* `'4px'`, `'4px 8px'`, `'0 8px 4px'`, `'0 8px 4px 2px'`.
|
|
176
|
-
*/
|
|
177
|
-
tolerance: number | string;
|
|
178
|
-
};
|
|
179
|
-
/** Discrete categorical palette (grouped series). */
|
|
180
|
-
palette: string[];
|
|
181
|
-
/** Default shape cycle for the `symbol` channel, in order. */
|
|
182
|
-
symbols: SymbolType[];
|
|
183
|
-
/** Continuous gradient endpoints + on-cell label colour, plus the default opacity-channel range. */
|
|
184
|
-
continuous: {
|
|
185
|
-
min: string;
|
|
186
|
-
max: string;
|
|
187
|
-
labelColor: string;
|
|
188
|
-
opacityRange: [number, number];
|
|
239
|
+
hover: {
|
|
240
|
+
rule: StrokeStyle;
|
|
241
|
+
dot: DotStyle;
|
|
242
|
+
font: FontStyle;
|
|
243
|
+
area: AreaStyle;
|
|
189
244
|
};
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
*/
|
|
199
|
-
gap: {
|
|
200
|
-
stroke: StrokeStyle;
|
|
201
|
-
dots: DotStyle;
|
|
245
|
+
facet: {
|
|
246
|
+
/** Position badge shown in `carousel`/`paginated` facet modes. */
|
|
247
|
+
indicator: {
|
|
248
|
+
background: string;
|
|
249
|
+
color: string;
|
|
250
|
+
fontSize: string;
|
|
251
|
+
padding: string;
|
|
252
|
+
radius: string;
|
|
202
253
|
};
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
laneStep: number;
|
|
212
|
-
/** Clearance (px) between the outermost lane and the label text. */
|
|
213
|
-
labelGap: number;
|
|
214
|
-
/** Default connector stroke. */
|
|
215
|
-
connector: StrokeStyle;
|
|
254
|
+
/** Prev/next buttons shown in `paginated` facet mode. */
|
|
255
|
+
navButton: {
|
|
256
|
+
background: string;
|
|
257
|
+
color: string;
|
|
258
|
+
/** Button diameter (width and height). */
|
|
259
|
+
size: string;
|
|
260
|
+
fontSize: string;
|
|
261
|
+
disabledOpacity: number;
|
|
216
262
|
};
|
|
217
263
|
};
|
|
218
|
-
/** Default bar-mark styling. */
|
|
219
|
-
bar: {
|
|
220
|
-
/** Default gap-fill styling (`BarPlot`'s `styles.gaps`) - the fallback merged under whatever a gap zone's own `style` sets. */
|
|
221
|
-
gap: AreaStyle;
|
|
222
|
-
/** Gap (0-1) between the bars of side-by-side series within one category, as a fraction of each bar's slice. */
|
|
223
|
-
seriesPadding: number;
|
|
224
|
-
/** Fallback gap (0-1) *between* category groups on BarPlot's own category axis, when a plot doesn't set its own `scales.x/y.paddingInner`. */
|
|
225
|
-
paddingInner: number;
|
|
226
|
-
/** Fallback gap (0-1) before the first and after the last category group on BarPlot's own category axis, when a plot doesn't set its own `scales.x/y.paddingOuter`. */
|
|
227
|
-
paddingOuter: number;
|
|
228
|
-
};
|
|
229
|
-
/** Default pyramid-bar styling. */
|
|
230
|
-
pyramid: {
|
|
231
|
-
/** Default gap-fill styling (`PyramidPlot`'s `styles.gaps`) - the fallback merged under whatever a gap zone's own `style` sets. */
|
|
232
|
-
gap: AreaStyle;
|
|
233
|
-
};
|
|
234
|
-
/** Default area-plot styling. */
|
|
235
|
-
area: {
|
|
236
|
-
/** Fill opacity of every area marker that sets none of its own. */
|
|
237
|
-
fillOpacity: number;
|
|
238
|
-
};
|
|
239
|
-
/** Default histogram styling. */
|
|
240
|
-
histogram: {
|
|
241
|
-
/** Pixels taken off each side of every bar, so neighbouring bars leave a gap of twice this. */
|
|
242
|
-
inset: number;
|
|
243
|
-
/** Fill opacity of every bar, so a grouped histogram's bars behind another group's still show. */
|
|
244
|
-
fillOpacity: number;
|
|
245
|
-
};
|
|
246
|
-
/** Default box-plot styling. */
|
|
247
|
-
box: {
|
|
248
|
-
/** Fill opacity of every box that sets none of its own. */
|
|
249
|
-
fillOpacity: number;
|
|
250
|
-
/** Fallback gap (0-1) between the boxes of neighbouring categories, when a plot doesn't set its own `scales.x/y.paddingInner`. */
|
|
251
|
-
paddingInner: number;
|
|
252
|
-
/** Fallback gap (0-1) before the first and after the last box, when a plot doesn't set its own `scales.x/y.paddingOuter`. */
|
|
253
|
-
paddingOuter: number;
|
|
254
|
-
};
|
|
255
|
-
/** Default scatter point geometry. */
|
|
256
|
-
scatter: {
|
|
257
|
-
dotRadius: number;
|
|
258
|
-
};
|
|
259
264
|
/** Timeline gutter styling. */
|
|
260
265
|
timeline: {
|
|
261
266
|
axisColor: string;
|
|
@@ -326,16 +331,32 @@ export type PlotStylesConfig = {
|
|
|
326
331
|
};
|
|
327
332
|
};
|
|
328
333
|
};
|
|
329
|
-
/**
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
334
|
+
/** What `styles.connector` falls back to on the plots that join dots (lollipop, dumbbell, Cleveland). */
|
|
335
|
+
connector: {
|
|
336
|
+
/** The colors of a connector colored `{ by: 'sign' }`: where the value rose, fell, or did not move. */
|
|
337
|
+
sign: {
|
|
338
|
+
positive: string;
|
|
339
|
+
negative: string;
|
|
340
|
+
zero: string;
|
|
341
|
+
};
|
|
342
|
+
/** The ramp of a connector colored `{ by: 'length' }`: from the shortest to the longest. */
|
|
343
|
+
lengthScheme: string[];
|
|
344
|
+
/** The ramp of a connector colored `{ by: 'difference' }`: falling, still, rising, meeting at 0. */
|
|
345
|
+
differenceScheme: string[];
|
|
346
|
+
/** Opacity (0-1) of the part of a connector outside the stretch between its `from` and `to` dots. */
|
|
347
|
+
outsideOpacity: number;
|
|
348
|
+
/** A connector drawn as an arrow (`styles.connector.arrow`): its thickness, and the length (px) and angle (degrees) of its head. */
|
|
349
|
+
arrow: {
|
|
350
|
+
width: number;
|
|
351
|
+
headLength: number;
|
|
352
|
+
headAngle: number;
|
|
353
|
+
};
|
|
354
|
+
/** The length (px) of the caps a connector draws at its ends (`styles.connector.caps`). */
|
|
355
|
+
capLength: number;
|
|
356
|
+
/** Font size of a connector's label, in px. */
|
|
357
|
+
labelFontSize: number;
|
|
358
|
+
/** Gap, in px, between a connector and its label when it is written beside it. */
|
|
359
|
+
labelGap: number;
|
|
339
360
|
};
|
|
340
361
|
/** The `delta` marker's label offset and anchor, per axis the delta is taken on. A marker's own `text` wins. */
|
|
341
362
|
delta: {
|
|
@@ -346,28 +367,148 @@ export type PlotStylesConfig = {
|
|
|
346
367
|
textAnchor: TextAnchor;
|
|
347
368
|
}>;
|
|
348
369
|
};
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
370
|
+
/** Default text-marker behavior. */
|
|
371
|
+
text: {
|
|
372
|
+
/** Geometry and connector of a decluttered text marker (`declutter`) - e.g. LinePlot's end-of-line value labels. */
|
|
373
|
+
declutter: {
|
|
374
|
+
/** Shortest lane's distance (px) from the point before a connector bends. */
|
|
375
|
+
elbowGap: number;
|
|
376
|
+
/** Extra distance (px) each further lane sits out from the last. */
|
|
377
|
+
laneStep: number;
|
|
378
|
+
/** Clearance (px) between the outermost lane and the label text. */
|
|
379
|
+
labelGap: number;
|
|
380
|
+
/** Default connector stroke. */
|
|
381
|
+
connector: StrokeStyle;
|
|
357
382
|
};
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
383
|
+
};
|
|
384
|
+
/** Default area-plot styling. */
|
|
385
|
+
area: {
|
|
386
|
+
/** Fill opacity of every area marker that sets none of its own. */
|
|
387
|
+
fillOpacity: number;
|
|
388
|
+
};
|
|
389
|
+
/** Default bar-mark styling. */
|
|
390
|
+
bar: {
|
|
391
|
+
/** Default gap-fill styling (`BarPlot`'s `styles.gaps`) - the fallback merged under whatever a gap zone's own `style` sets. */
|
|
392
|
+
gap: AreaStyle;
|
|
393
|
+
/** Gap (0-1) between the bars of side-by-side series within one category, as a fraction of each bar's slice. */
|
|
394
|
+
seriesPadding: number;
|
|
395
|
+
/** Fallback gap (0-1) *between* category groups on BarPlot's own category axis, when a plot doesn't set its own `scales.x/y.paddingInner`. */
|
|
396
|
+
paddingInner: number;
|
|
397
|
+
/** Fallback gap (0-1) before the first and after the last category group on BarPlot's own category axis, when a plot doesn't set its own `scales.x/y.paddingOuter`. */
|
|
398
|
+
paddingOuter: number;
|
|
399
|
+
};
|
|
400
|
+
/** Default box-plot styling. */
|
|
401
|
+
box: {
|
|
402
|
+
/** Fill opacity of every box that sets none of its own. */
|
|
403
|
+
fillOpacity: number;
|
|
404
|
+
/** Fallback gap (0-1) between the boxes of neighbouring categories, when a plot doesn't set its own `scales.x/y.paddingInner`. */
|
|
405
|
+
paddingInner: number;
|
|
406
|
+
/** Fallback gap (0-1) before the first and after the last box, when a plot doesn't set its own `scales.x/y.paddingOuter`. */
|
|
407
|
+
paddingOuter: number;
|
|
408
|
+
};
|
|
409
|
+
/** Default bullet-plot styling: a bar over graded ranges, with a tick at its target. */
|
|
410
|
+
bullet: {
|
|
411
|
+
/** The bar's thickness (px) across its category band. */
|
|
412
|
+
barThickness: number;
|
|
413
|
+
/** The thickness (px) of the bands that grade the value. */
|
|
414
|
+
rangeWidth: number;
|
|
415
|
+
/** The colors of those bands, from the smallest to the largest; the last one repeats if there are more bands. */
|
|
416
|
+
rangeColors: string[];
|
|
417
|
+
/** The length (px) and thickness of the target tick. */
|
|
418
|
+
targetLength: number;
|
|
419
|
+
targetWidth: number;
|
|
420
|
+
/** The target tick's color; the axis color when unset. */
|
|
421
|
+
targetColor?: string;
|
|
422
|
+
/** Padding between category bands, as fractions (0-1) of a band. */
|
|
423
|
+
paddingInner: number;
|
|
424
|
+
paddingOuter: number;
|
|
425
|
+
};
|
|
426
|
+
/** Default Cleveland-plot styling. */
|
|
427
|
+
cleveland: DotRangeStyling;
|
|
428
|
+
/** Default density-plot styling. */
|
|
429
|
+
density: {
|
|
430
|
+
/** Fill opacity of every area, so a grouped density's curves behind another group's still show. */
|
|
431
|
+
fillOpacity: number;
|
|
432
|
+
/** Stroke width of every curve drawn as a line. */
|
|
433
|
+
strokeWidth: number;
|
|
434
|
+
};
|
|
435
|
+
/** Default dumbbell-plot styling. */
|
|
436
|
+
dumbbell: DotRangeStyling;
|
|
437
|
+
/** Default forest-plot styling: the dot is the estimate, the stem its interval. */
|
|
438
|
+
forest: DotRangeStyling;
|
|
439
|
+
/** Default histogram styling. */
|
|
440
|
+
histogram: {
|
|
441
|
+
/** Pixels taken off each side of every bar, so neighbouring bars leave a gap of twice this. */
|
|
442
|
+
inset: number;
|
|
443
|
+
/** Fill opacity of every bar, so a grouped histogram's bars behind another group's still show. */
|
|
444
|
+
fillOpacity: number;
|
|
445
|
+
};
|
|
446
|
+
/** Default line geometry. */
|
|
447
|
+
line: {
|
|
448
|
+
/** Curve of every line that sets none (`styles.curve`, a segment's `curve`): `'auto'` joins the points with straight segments, or along the great circle on a projected map. */
|
|
449
|
+
curve: CurveName | 'auto';
|
|
450
|
+
strokeWidth: number;
|
|
451
|
+
dotRadius: number;
|
|
452
|
+
/**
|
|
453
|
+
* Default gap-fill bridge styling (`LinePlot`'s `styles.gaps`) - the
|
|
454
|
+
* fallback merged under whatever a gap zone's own `style` sets, the
|
|
455
|
+
* same way `hover.rule`/`hover.dot` back every hover marker's style.
|
|
456
|
+
*/
|
|
457
|
+
gap: {
|
|
458
|
+
stroke: StrokeStyle;
|
|
459
|
+
dots: DotStyle;
|
|
366
460
|
};
|
|
367
461
|
};
|
|
462
|
+
/** Default lollipop-plot styling. */
|
|
463
|
+
lollipop: DotRangeStyling;
|
|
464
|
+
/** Default pyramid-bar styling. */
|
|
465
|
+
pyramid: {
|
|
466
|
+
/** Default gap-fill styling (`PyramidPlot`'s `styles.gaps`) - the fallback merged under whatever a gap zone's own `style` sets. */
|
|
467
|
+
gap: AreaStyle;
|
|
468
|
+
};
|
|
469
|
+
/** Default scatter point geometry. */
|
|
470
|
+
scatter: {
|
|
471
|
+
dotRadius: number;
|
|
472
|
+
};
|
|
473
|
+
/** Default slope-plot styling: a line and a dot per series between the positions of its category axis. */
|
|
474
|
+
slope: {
|
|
475
|
+
strokeWidth: number;
|
|
476
|
+
dotRadius: number;
|
|
477
|
+
/** Space (0-1, as a fraction of the step between positions) left outside the first and last position; the labels' margins grow beyond it. */
|
|
478
|
+
padding: number;
|
|
479
|
+
};
|
|
480
|
+
/** Default sparkline styling: a thin line, and the dot on its last point. */
|
|
481
|
+
sparkline: {
|
|
482
|
+
strokeWidth: number;
|
|
483
|
+
dotRadius: number;
|
|
484
|
+
};
|
|
485
|
+
/** Default violin-plot styling. */
|
|
486
|
+
violin: {
|
|
487
|
+
/** Fill opacity of every violin that sets none of its own. */
|
|
488
|
+
fillOpacity: number;
|
|
489
|
+
/** Fallback gap (0-1) between the violins of neighbouring categories, when a plot doesn't set its own `scales.x/y.paddingInner`. */
|
|
490
|
+
paddingInner: number;
|
|
491
|
+
/** Fallback gap (0-1) before the first and after the last violin, when a plot doesn't set its own `scales.x/y.paddingOuter`. */
|
|
492
|
+
paddingOuter: number;
|
|
493
|
+
/** Width (px) of the box inside each violin. */
|
|
494
|
+
boxWidth: number;
|
|
495
|
+
};
|
|
496
|
+
};
|
|
497
|
+
/**
|
|
498
|
+
* A categorical palette as `setConfiguration` takes it: a list of colors, or the name of a
|
|
499
|
+
* d3-scale-chromatic scheme - a color list (`'dark2'`, `'tableau10'`...) or a ramp (`'viridis'`,
|
|
500
|
+
* `'blues'`...) - or one with its own `count` of colors (8 for a ramp) and `schemeRange`, the part of
|
|
501
|
+
* the ramp to spread them over (`[0.3, 1]` skips the near-white start of `'blues'`).
|
|
502
|
+
*/
|
|
503
|
+
export type PaletteInput = string[] | string | {
|
|
504
|
+
scheme: string;
|
|
505
|
+
count?: number;
|
|
506
|
+
schemeRange?: [number, number];
|
|
368
507
|
};
|
|
369
508
|
/** Deep-partial input accepted by `setConfiguration`. */
|
|
370
|
-
export type PlotStylesConfigInput = DeepPartial<PlotStylesConfig
|
|
509
|
+
export type PlotStylesConfigInput = Omit<DeepPartial<PlotStylesConfig>, 'palette'> & {
|
|
510
|
+
palette?: PaletteInput;
|
|
511
|
+
};
|
|
371
512
|
type DeepPartial<T> = {
|
|
372
513
|
[K in keyof T]?: T[K] extends (infer U)[] ? U[] : T[K] extends object ? DeepPartial<T[K]> : T[K];
|
|
373
514
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { GeoProjection } from 'd3-geo';
|
|
2
2
|
import type { GeoCameraConfig } from '../plots/camera';
|
|
3
|
-
import type { ChannelScalesConfig, LengthScaleConfig } from './scales';
|
|
3
|
+
import type { ChannelScalesConfig, LengthScaleConfig, RScaleConfig } from './scales';
|
|
4
4
|
/**
|
|
5
5
|
* The projection names svelteplot's `<Plot projection>` accepts as a string
|
|
6
6
|
* (svelteplot itself doesn't export this as a type - defined here so authors
|
|
@@ -47,11 +47,12 @@ export type GeoProjectionConfig = GeoProjectionName | {
|
|
|
47
47
|
/**
|
|
48
48
|
* `scales` prop for GeoPlot - the geo analog of `AxisBasedScalesConfig`. A
|
|
49
49
|
* map has no x/y axis pair (the coordinate system is `coordinates.projection`),
|
|
50
|
-
* so this carries the channels in {@link ChannelScalesConfig} plus
|
|
51
|
-
*
|
|
52
|
-
*
|
|
50
|
+
* so this carries the channels in {@link ChannelScalesConfig} plus the two
|
|
51
|
+
* plot-wide-only ones: `r` (a `dot` marker's size) and `length` (a `vector`
|
|
52
|
+
* marker's magnitude).
|
|
53
53
|
*/
|
|
54
54
|
export type GeoScalesConfig = ChannelScalesConfig & {
|
|
55
|
+
r?: RScaleConfig;
|
|
55
56
|
length?: LengthScaleConfig;
|
|
56
57
|
};
|
|
57
58
|
/** Wheel/pinch scale gesture only - see `CoordinatesConfig.pan` for drag-to-translate, and `.rotate` for drag-to-spin-the-globe. */
|
|
@@ -40,6 +40,24 @@ export type FacetCellContext<TRow extends Record<string, unknown>> = {
|
|
|
40
40
|
export type FacetCellSnippet<TRow extends Record<string, unknown>> = Snippet<[
|
|
41
41
|
FacetCellContext<TRow>
|
|
42
42
|
]>;
|
|
43
|
+
/** A facet value as the panel's label reads it: a number or a boolean matches by the text it prints as. */
|
|
44
|
+
export type FacetValue = string | number | boolean;
|
|
45
|
+
/**
|
|
46
|
+
* The facet panels a segment or a marker applies to. A value, or a list of them, names panels by their
|
|
47
|
+
* label - the `by` value; in a `rows`/`cols` grid, `{ row, col }` name the panels by the grid's own
|
|
48
|
+
* values, and a side left out matches every value of it.
|
|
49
|
+
*/
|
|
50
|
+
export type FacetTarget = FacetValue | FacetValue[] | {
|
|
51
|
+
row?: FacetValue | FacetValue[];
|
|
52
|
+
col?: FacetValue | FacetValue[];
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* A segment or a marker that can be limited to some facet panels. Without `facet` it applies to every
|
|
56
|
+
* panel, as before; with it, only to the panels it names - and to none of a plot that has no facet.
|
|
57
|
+
*/
|
|
58
|
+
export type FacetScoped = {
|
|
59
|
+
facet?: FacetTarget;
|
|
60
|
+
};
|
|
43
61
|
export type FacetIndicatorContext = {
|
|
44
62
|
current: number;
|
|
45
63
|
total: number;
|