@fundar/data-chart-telling 1.1.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 +32 -0
- package/README.md +6 -6
- package/dist/configuration/config.svelte.d.ts +1 -1
- package/dist/configuration/config.svelte.js +165 -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/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 +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 +4 -0
- package/dist/layout/legend/LegendState.svelte.js +20 -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/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 +72 -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.js +1 -1
- 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 +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/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 +7 -2
- 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.js +1 -1
- package/dist/types/configuration/styling.d.ts +276 -143
- 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 +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/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/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 +1 -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 +2 -2
- package/docs/composer.md +2 -2
- package/docs/concepts.md +1 -1
- package/docs/development.md +1 -1
- package/docs/facets.md +3 -3
- package/docs/getting-started.md +2 -2
- package/docs/legend.md +13 -11
- package/docs/markers.md +29 -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 +24 -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/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 +22 -11
- package/llms.txt +32 -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
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import { PlotAxes } from '../../../phases/data/PlotAxes';
|
|
2
|
+
import { ProcessedPositions } from '../../../phases/transforms/ProcessedPositions';
|
|
3
|
+
import { SERIES_KEY } from '../../../phases/transforms/TransformsPhase';
|
|
4
|
+
import { ValueLabels } from '../../../layout/styles/ValueLabels';
|
|
5
|
+
import { ClevelandRanges } from './ClevelandRanges';
|
|
6
|
+
import { ClevelandConnector } from './ClevelandConnector';
|
|
7
|
+
/** The messages already warned about, so a plot that redraws warns once. */
|
|
8
|
+
const warned = new Set();
|
|
9
|
+
/**
|
|
10
|
+
* The marks of the Cleveland family of plots, which differ only by their
|
|
11
|
+
* {@link ClevelandOptions}: per category, a connector from its lowest to its
|
|
12
|
+
* highest value (from the baseline, for a lollipop) with a dot at each value.
|
|
13
|
+
* A category with one dot gets a stem in that dot's series color, restyled by
|
|
14
|
+
* the segment its dot belongs to; a category with several gets one neutral
|
|
15
|
+
* connector. The "markers" phase takes its `marks`, `valueLabels` and `reach`.
|
|
16
|
+
*/
|
|
17
|
+
export class ClevelandMarkers {
|
|
18
|
+
#options;
|
|
19
|
+
constructor(options) {
|
|
20
|
+
this.#options = options;
|
|
21
|
+
}
|
|
22
|
+
/** Forgets what was warned about; for tests. */
|
|
23
|
+
static resetWarnings() {
|
|
24
|
+
warned.clear();
|
|
25
|
+
}
|
|
26
|
+
/** The plot's connectors, then its dots, which draw on top of them. */
|
|
27
|
+
marks = (state, ctx) => {
|
|
28
|
+
const { cfg, interaction } = ctx;
|
|
29
|
+
const style = cfg[this.#options.config];
|
|
30
|
+
const { isHorizontal } = ClevelandMarkers.#geometry(state);
|
|
31
|
+
const ranges = ClevelandRanges.of(state, this.#options.fromBaseline ?? false, ClevelandConnector.ends(state), this.#options.interval ?? false);
|
|
32
|
+
this.#validate(ranges);
|
|
33
|
+
const connector = ClevelandConnector.of(state, cfg.connector, ranges.entries);
|
|
34
|
+
const groups = state.processedGroups ?? [];
|
|
35
|
+
const segmentOf = new Map();
|
|
36
|
+
for (const group of groups) {
|
|
37
|
+
for (const segment of group.visualSegments) {
|
|
38
|
+
for (const row of segment.data) {
|
|
39
|
+
segmentOf.set(row, { series: group.series.name, styles: segment.styles });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// Each category's connector: a row of its own look. A lone dot's stem takes its series'
|
|
44
|
+
// color and its segment's style; the legend dims it with the series.
|
|
45
|
+
const size = state.channels?.r;
|
|
46
|
+
const dotRadius = typeof size === 'number' ? size : style.dotRadius;
|
|
47
|
+
const neutral = style.connectorColor ?? cfg.axis.color;
|
|
48
|
+
const looks = ranges.entries.map((entry) => {
|
|
49
|
+
const range = connector.rangeOf(entry);
|
|
50
|
+
const owner = range.series === undefined ? undefined : segmentOf.get(entry.dots[0].row);
|
|
51
|
+
const stem = owner?.styles.stroke;
|
|
52
|
+
const disabled = owner && interaction?.strokeFor(owner.series);
|
|
53
|
+
const strokeWidth = disabled?.strokeWidth ??
|
|
54
|
+
stem?.strokeWidth ??
|
|
55
|
+
connector.width(range, dotRadius) ??
|
|
56
|
+
(style.stemWidth === 'dots' ? dotRadius * 2 : style.stemWidth);
|
|
57
|
+
// The stretch between the `from` and `to` dots, in the connector's look...
|
|
58
|
+
const [start, end] = range.span ?? [entry.from, entry.to];
|
|
59
|
+
const category = entry.category;
|
|
60
|
+
const span = {
|
|
61
|
+
category,
|
|
62
|
+
from: start,
|
|
63
|
+
to: end,
|
|
64
|
+
mid: (start + end) / 2,
|
|
65
|
+
stroke: disabled?.stroke ??
|
|
66
|
+
stem?.stroke ??
|
|
67
|
+
connector.color(range) ??
|
|
68
|
+
(owner ? state.colorForSeries(owner.series) : neutral),
|
|
69
|
+
strokeWidth,
|
|
70
|
+
strokeOpacity: disabled?.strokeOpacity ?? stem?.strokeOpacity ?? connector.opacity(range) ?? 1
|
|
71
|
+
};
|
|
72
|
+
// ...as an arrow from one dot to the other, when the connector asks for one...
|
|
73
|
+
const arrow = connector.arrow;
|
|
74
|
+
const way = arrow && entry.change && entry.change[0] !== entry.change[1] ? entry.change : undefined;
|
|
75
|
+
const drawn = way
|
|
76
|
+
? {
|
|
77
|
+
category,
|
|
78
|
+
start: way[0],
|
|
79
|
+
end: way[1],
|
|
80
|
+
stroke: span.stroke,
|
|
81
|
+
strokeWidth: connector.width(range, dotRadius) ?? arrow.width,
|
|
82
|
+
strokeOpacity: span.strokeOpacity
|
|
83
|
+
}
|
|
84
|
+
: undefined;
|
|
85
|
+
// ...and what runs on past either end of it, to the other series' dots.
|
|
86
|
+
const outside = connector.outside(neutral);
|
|
87
|
+
const beyond = [
|
|
88
|
+
[entry.from, start],
|
|
89
|
+
[end, entry.to]
|
|
90
|
+
]
|
|
91
|
+
.filter(([from, to]) => to > from)
|
|
92
|
+
.map(([from, to]) => ({
|
|
93
|
+
category,
|
|
94
|
+
from,
|
|
95
|
+
to,
|
|
96
|
+
mid: (from + to) / 2,
|
|
97
|
+
...outside,
|
|
98
|
+
strokeWidth
|
|
99
|
+
}));
|
|
100
|
+
return {
|
|
101
|
+
range,
|
|
102
|
+
row: span,
|
|
103
|
+
// A stretch drawn as an arrow is not one of the lines.
|
|
104
|
+
rows: drawn ? beyond : [span, ...beyond],
|
|
105
|
+
arrow: drawn,
|
|
106
|
+
dash: disabled?.strokeDasharray ?? stem?.strokeDasharray
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
// One rule marker per dash pattern, which a marker takes once for all its rows.
|
|
110
|
+
const byDash = new Map();
|
|
111
|
+
for (const look of looks)
|
|
112
|
+
byDash.set(look.dash, [...(byDash.get(look.dash) ?? []), look]);
|
|
113
|
+
const rules = [...byDash].map(([dash, group]) => ({
|
|
114
|
+
type: 'rule',
|
|
115
|
+
// A connector is not what the series look like: its dots are.
|
|
116
|
+
legend: false,
|
|
117
|
+
axis: isHorizontal ? 'y' : 'x',
|
|
118
|
+
data: group.flatMap((look) => look.rows),
|
|
119
|
+
value: 'category',
|
|
120
|
+
...(isHorizontal ? { x1: 'from', x2: 'to' } : { y1: 'from', y2: 'to' }),
|
|
121
|
+
stroke: 'stroke',
|
|
122
|
+
strokeWidth: 'strokeWidth',
|
|
123
|
+
strokeOpacity: 'strokeOpacity',
|
|
124
|
+
...(dash ? { styles: { strokeDasharray: dash } } : {})
|
|
125
|
+
}));
|
|
126
|
+
// The arrows, one marker per dash pattern like the lines, each from its `from` dot to its `to` dot.
|
|
127
|
+
const head = connector.arrow;
|
|
128
|
+
const arrows = [...byDash].flatMap(([dash, group]) => {
|
|
129
|
+
const rows = group.flatMap((look) => (look.arrow ? [look.arrow] : []));
|
|
130
|
+
if (rows.length === 0 || !head)
|
|
131
|
+
return [];
|
|
132
|
+
return [
|
|
133
|
+
{
|
|
134
|
+
type: 'arrow',
|
|
135
|
+
legend: false,
|
|
136
|
+
data: rows,
|
|
137
|
+
...(isHorizontal
|
|
138
|
+
? { x1: 'start', x2: 'end', y1: 'category', y2: 'category' }
|
|
139
|
+
: { y1: 'start', y2: 'end', x1: 'category', x2: 'category' }),
|
|
140
|
+
headLength: head.headLength,
|
|
141
|
+
headAngle: head.headAngle,
|
|
142
|
+
// The shaft starts and ends at the edge of its dots, not under them.
|
|
143
|
+
insetStart: dotRadius,
|
|
144
|
+
insetEnd: dotRadius,
|
|
145
|
+
stroke: 'stroke',
|
|
146
|
+
strokeWidth: 'strokeWidth',
|
|
147
|
+
strokeOpacity: 'strokeOpacity',
|
|
148
|
+
...(dash ? { styles: { strokeDasharray: dash } } : {})
|
|
149
|
+
}
|
|
150
|
+
];
|
|
151
|
+
});
|
|
152
|
+
// Caps: a tick across each end of a connector, in its look - one marker per look, which a marker takes once for all its ticks.
|
|
153
|
+
const capLength = connector.caps(style.caps);
|
|
154
|
+
const caps = capLength === undefined ? [] : this.#caps(ranges.entries, looks, capLength, isHorizontal);
|
|
155
|
+
const { category, value } = ClevelandMarkers.#channels(state);
|
|
156
|
+
// A number is a literal pixel radius; a field or function sizes each dot by its row.
|
|
157
|
+
const r = size === undefined || typeof size === 'number' ? size : size.accessor;
|
|
158
|
+
const dots = groups.flatMap((group) => {
|
|
159
|
+
const name = group.series.name;
|
|
160
|
+
const color = state.colorForSeries(name);
|
|
161
|
+
const disabled = interaction?.dotsFor(name);
|
|
162
|
+
return group.visualSegments.map((segment) => {
|
|
163
|
+
const stem = segment.styles.stroke;
|
|
164
|
+
const dot = segment.styles.dots;
|
|
165
|
+
return {
|
|
166
|
+
type: 'dot',
|
|
167
|
+
series: name,
|
|
168
|
+
data: segment.data,
|
|
169
|
+
...(isHorizontal ? { x: value, y: category } : { x: category, y: value }),
|
|
170
|
+
r,
|
|
171
|
+
styles: {
|
|
172
|
+
dotRadius: disabled?.dotRadius ?? dot?.dotRadius ?? style.dotRadius,
|
|
173
|
+
dotFill: disabled?.dotFill ?? dot?.dotFill ?? stem?.stroke ?? color,
|
|
174
|
+
dotFillOpacity: disabled?.dotFillOpacity ?? dot?.dotFillOpacity,
|
|
175
|
+
dotSymbol: disabled?.dotSymbol ?? dot?.dotSymbol,
|
|
176
|
+
dotStroke: disabled?.dotStroke ?? dot?.dotStroke ?? 'none',
|
|
177
|
+
dotStrokeWidth: disabled?.dotStrokeWidth ?? dot?.dotStrokeWidth,
|
|
178
|
+
dotStrokeOpacity: disabled?.dotStrokeOpacity ?? dot?.dotStrokeOpacity
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
return [
|
|
184
|
+
...rules,
|
|
185
|
+
...caps,
|
|
186
|
+
...arrows,
|
|
187
|
+
...dots,
|
|
188
|
+
...this.#connectorLabels(state, ctx, connector, looks, isHorizontal)
|
|
189
|
+
];
|
|
190
|
+
};
|
|
191
|
+
/** The caps of the connectors: a tick at each end of those that have a length, one marker per stroke look. */
|
|
192
|
+
#caps(entries, looks, length, isHorizontal) {
|
|
193
|
+
const byLook = new Map();
|
|
194
|
+
entries.forEach((entry, index) => {
|
|
195
|
+
if (!(entry.to > entry.from))
|
|
196
|
+
return;
|
|
197
|
+
const look = looks[index].row;
|
|
198
|
+
const key = [look.stroke, look.strokeWidth, look.strokeOpacity].join('|');
|
|
199
|
+
const group = byLook.get(key) ?? { look, rows: [] };
|
|
200
|
+
group.rows.push({ category: entry.category, end: entry.from }, { category: entry.category, end: entry.to });
|
|
201
|
+
byLook.set(key, group);
|
|
202
|
+
});
|
|
203
|
+
return [...byLook.values()].map(({ look, rows }) => ({
|
|
204
|
+
type: 'tick',
|
|
205
|
+
legend: false,
|
|
206
|
+
data: rows,
|
|
207
|
+
...(isHorizontal ? { x: 'end', y: 'category' } : { x: 'category', y: 'end' }),
|
|
208
|
+
tickLength: length,
|
|
209
|
+
styles: {
|
|
210
|
+
stroke: look.stroke,
|
|
211
|
+
strokeWidth: look.strokeWidth,
|
|
212
|
+
strokeOpacity: look.strokeOpacity
|
|
213
|
+
}
|
|
214
|
+
}));
|
|
215
|
+
}
|
|
216
|
+
/** The label on each connector, when `styles.connector.label` asks for one: written at its middle, beside it or on it. */
|
|
217
|
+
#connectorLabels(state, ctx, connector, looks, isHorizontal) {
|
|
218
|
+
const label = connector.label;
|
|
219
|
+
if (!label)
|
|
220
|
+
return [];
|
|
221
|
+
const data = looks.flatMap(({ range, row }) => {
|
|
222
|
+
const text = connector.text(range);
|
|
223
|
+
return text === undefined ? [] : [{ ...row, text }];
|
|
224
|
+
});
|
|
225
|
+
if (data.length === 0)
|
|
226
|
+
return [];
|
|
227
|
+
const font = label.fontStyle;
|
|
228
|
+
// Beside a connector: clear of half its thickest, and a few px.
|
|
229
|
+
const clear = Math.max(...data.map((row) => Number(row.strokeWidth))) / 2 + ctx.cfg.connector.labelGap;
|
|
230
|
+
const inside = label.anchor === 'middle';
|
|
231
|
+
const at = inside
|
|
232
|
+
? { dx: 0, dy: 0, textAnchor: 'middle', lineAnchor: 'middle' }
|
|
233
|
+
: isHorizontal
|
|
234
|
+
? { dx: 0, dy: -clear, textAnchor: 'middle', lineAnchor: 'bottom' }
|
|
235
|
+
: { dx: clear, dy: 0, textAnchor: 'start', lineAnchor: 'middle' };
|
|
236
|
+
return [
|
|
237
|
+
{
|
|
238
|
+
type: 'text',
|
|
239
|
+
data,
|
|
240
|
+
...(isHorizontal ? { x: 'mid', y: 'category' } : { x: 'category', y: 'mid' }),
|
|
241
|
+
text: 'text',
|
|
242
|
+
styles: {
|
|
243
|
+
...font,
|
|
244
|
+
fill: font?.fill ?? ctx.cfg.axis.color,
|
|
245
|
+
fontSize: font?.fontSize ?? ctx.cfg.connector.labelFontSize,
|
|
246
|
+
dx: font?.dx ?? at.dx,
|
|
247
|
+
dy: font?.dy ?? at.dy,
|
|
248
|
+
textAnchor: font?.textAnchor && font.textAnchor !== 'outside' ? font.textAnchor : at.textAnchor,
|
|
249
|
+
lineAnchor: font?.lineAnchor ?? at.lineAnchor
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
];
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* The value labels of the dots `styles.values.of` picks, one `'text'` marker
|
|
256
|
+
* per place a dot can hold in its range - past the top end (above, or right
|
|
257
|
+
* of it), past the bottom end (below, or left of it) and, for the dots
|
|
258
|
+
* between, beside it - and per series, when they take their series' color.
|
|
259
|
+
*/
|
|
260
|
+
valueLabels = (labels, state, ctx) => {
|
|
261
|
+
if (!state.processedData?.data.length)
|
|
262
|
+
return [];
|
|
263
|
+
const { isHorizontal } = ClevelandMarkers.#geometry(state);
|
|
264
|
+
const { category, value } = ClevelandMarkers.#channels(state);
|
|
265
|
+
const { font, format } = labels;
|
|
266
|
+
const read = ValueLabels.valueOf(state);
|
|
267
|
+
const valueOf = ProcessedPositions.of(state.processedData, PlotAxes.valueOf(state))[PlotAxes.valueOf(state)];
|
|
268
|
+
const gap = labels.offset(isHorizontal ? 'x' : 'y', ctx.cfg[this.#options.config].labelGap);
|
|
269
|
+
const nameOf = (d) => String(d[SERIES_KEY]);
|
|
270
|
+
const picked = this.#picked(state);
|
|
271
|
+
// Where a label sits from its dot, by role: along the range (past an end) or across it (between).
|
|
272
|
+
const placement = {
|
|
273
|
+
max: isHorizontal
|
|
274
|
+
? { dx: gap, dy: 0, textAnchor: 'start', lineAnchor: 'middle' }
|
|
275
|
+
: { dx: 0, dy: -gap, textAnchor: 'middle', lineAnchor: 'bottom' },
|
|
276
|
+
min: isHorizontal
|
|
277
|
+
? { dx: -gap, dy: 0, textAnchor: 'end', lineAnchor: 'middle' }
|
|
278
|
+
: { dx: 0, dy: gap, textAnchor: 'middle', lineAnchor: 'top' },
|
|
279
|
+
between: isHorizontal
|
|
280
|
+
? { dx: 0, dy: -gap, textAnchor: 'middle', lineAnchor: 'bottom' }
|
|
281
|
+
: { dx: gap, dy: 0, textAnchor: 'start', lineAnchor: 'middle' }
|
|
282
|
+
};
|
|
283
|
+
// What fills the labels of a series: the one fill all share, its own color, or the axis'.
|
|
284
|
+
const fillOf = (series) => labels.fill ??
|
|
285
|
+
(labels.color === 'series' ? state.colorForSeries(series) : undefined) ??
|
|
286
|
+
ctx.cfg.axis.color;
|
|
287
|
+
const names = labels.color === 'series' && !labels.fill
|
|
288
|
+
? (state.resolvedSeries ?? []).map((s) => s.name)
|
|
289
|
+
: [''];
|
|
290
|
+
return ['max', 'min', 'between'].flatMap((role) => names.flatMap((name) => {
|
|
291
|
+
const data = picked
|
|
292
|
+
.filter(({ entry, dot }) => ClevelandRanges.roleOf(entry, dot.value) === role &&
|
|
293
|
+
(name === '' || dot.series === name))
|
|
294
|
+
.map(({ dot }) => dot.row);
|
|
295
|
+
if (data.length === 0)
|
|
296
|
+
return [];
|
|
297
|
+
const at = placement[role];
|
|
298
|
+
return [
|
|
299
|
+
{
|
|
300
|
+
type: 'text',
|
|
301
|
+
data,
|
|
302
|
+
...(isHorizontal ? { x: value, y: category } : { x: category, y: value }),
|
|
303
|
+
text: (d) => format(Number(read(d) ?? valueOf(d)), nameOf(d), d),
|
|
304
|
+
styles: {
|
|
305
|
+
...font,
|
|
306
|
+
fill: fillOf(name),
|
|
307
|
+
fontSize: font?.fontSize ?? 12,
|
|
308
|
+
dx: font?.dx ?? at.dx,
|
|
309
|
+
dy: font?.dy ?? at.dy,
|
|
310
|
+
textAnchor: labels.textAnchor ?? at.textAnchor,
|
|
311
|
+
lineAnchor: font?.lineAnchor ?? at.lineAnchor
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
];
|
|
315
|
+
}));
|
|
316
|
+
};
|
|
317
|
+
/**
|
|
318
|
+
* Room for the labels past the dots at the end of the value axis, so the
|
|
319
|
+
* farthest one fits inside the figure instead of crossing its edge. Only the
|
|
320
|
+
* dots at the top end of their range reach there, and only the picked ones.
|
|
321
|
+
*/
|
|
322
|
+
reach = (labels, state) => {
|
|
323
|
+
const gap = labels.config[this.#options.config].labelGap;
|
|
324
|
+
const top = this.#picked(state).filter(({ entry, dot }) => ClevelandRanges.roleOf(entry, dot.value) === 'max');
|
|
325
|
+
if (top.length === 0)
|
|
326
|
+
return [];
|
|
327
|
+
if (!state.axes?.isHorizontal) {
|
|
328
|
+
const at = { y: -labels.offset('y', gap) };
|
|
329
|
+
return [labels.edgeBox('0', { x: 'middle', y: 'before' }, at, ['top'])];
|
|
330
|
+
}
|
|
331
|
+
const at = { x: labels.offset('x', gap) };
|
|
332
|
+
const texts = new Set(top.map(({ dot }) => labels.format(dot.value, dot.series, dot.row)));
|
|
333
|
+
return [...texts].map((text) => labels.edgeBox(text, { x: 'after', y: 'middle' }, at, ['right']));
|
|
334
|
+
};
|
|
335
|
+
/**
|
|
336
|
+
* The dots `styles.values` labels, each with the category it sits in: the rows
|
|
337
|
+
* the "transforms" phase picked (`labelled`), traced back to the dots of each
|
|
338
|
+
* category by the series they belong to.
|
|
339
|
+
*/
|
|
340
|
+
#picked(state) {
|
|
341
|
+
const categoryAxis = PlotAxes.categoryOf(state);
|
|
342
|
+
const position = ProcessedPositions.of(state.processedData, PlotAxes.valueOf(state));
|
|
343
|
+
const ranges = ClevelandRanges.of(state, this.#options.fromBaseline ?? false, {}, this.#options.interval ?? false);
|
|
344
|
+
const keyOf = (category, series) => `${String(category)}\u0000${series}`;
|
|
345
|
+
const chosen = new Set((state.labelled ?? []).map((row) => keyOf(position[categoryAxis](row), String(row[SERIES_KEY]))));
|
|
346
|
+
return ranges.entries.flatMap((entry) => entry.dots
|
|
347
|
+
.filter((dot) => chosen.has(keyOf(entry.category, dot.series)))
|
|
348
|
+
.map((dot) => ({ entry, dot })));
|
|
349
|
+
}
|
|
350
|
+
/** Warns, once, when the series layout is not one this plot is for. */
|
|
351
|
+
#validate(ranges) {
|
|
352
|
+
const problem = this.#options.validate?.(ranges.layout);
|
|
353
|
+
if (!problem)
|
|
354
|
+
return;
|
|
355
|
+
const message = `${this.#options.name}: ${problem}`;
|
|
356
|
+
if (warned.has(message))
|
|
357
|
+
return;
|
|
358
|
+
warned.add(message);
|
|
359
|
+
console.warn(message);
|
|
360
|
+
}
|
|
361
|
+
static #geometry(state) {
|
|
362
|
+
return { isHorizontal: state.axes?.isHorizontal ?? false };
|
|
363
|
+
}
|
|
364
|
+
/** How the plot hands its category and value to the marks: raw when the transforms left a plain channel (a field key keeps feeding svelteplot's axis-title inference), through the positions otherwise. */
|
|
365
|
+
static #channels(state) {
|
|
366
|
+
const valueAxis = PlotAxes.valueOf(state);
|
|
367
|
+
const categoryAxis = PlotAxes.categoryOf(state);
|
|
368
|
+
const { channels } = state.processedData;
|
|
369
|
+
const position = ProcessedPositions.of(state.processedData, valueAxis);
|
|
370
|
+
return {
|
|
371
|
+
category: (channels[categoryAxis] ?? position[categoryAxis]),
|
|
372
|
+
value: (channels[valueAxis] ?? position[valueAxis])
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { PlotAxes } from '../../../phases/data/PlotAxes';
|
|
2
|
+
import type { ProcessedData, ProcessedRow } from '../../../types/phases';
|
|
3
|
+
import type { ClevelandPlotState, ClevelandEntry, ClevelandLayout, ClevelandRole } from '../../../types/plots/ranking/cleveland/state';
|
|
4
|
+
/**
|
|
5
|
+
* Where the dots of a Cleveland-style plot sit category by category: each
|
|
6
|
+
* category's values - across every series that has one - and the range they
|
|
7
|
+
* span, with the baseline counted as one end when the plot asks for it.
|
|
8
|
+
* Built from the rows the "transforms" phase left, so a series the legend
|
|
9
|
+
* omits is not in it.
|
|
10
|
+
*/
|
|
11
|
+
export declare class ClevelandRanges {
|
|
12
|
+
readonly entries: readonly ClevelandEntry[];
|
|
13
|
+
readonly layout: ClevelandLayout;
|
|
14
|
+
private constructor();
|
|
15
|
+
/**
|
|
16
|
+
* The ranges of `state`'s rows; `fromBaseline` adds the plot's baseline to each
|
|
17
|
+
* category's values. A category's difference runs from the series `ends.from`
|
|
18
|
+
* to `ends.to` - by default the first and the last one the plot draws.
|
|
19
|
+
*/
|
|
20
|
+
static of<TData extends Record<string, unknown>>(state: ClevelandPlotState<TData>, fromBaseline: boolean, ends?: {
|
|
21
|
+
from?: string;
|
|
22
|
+
to?: string;
|
|
23
|
+
}, interval?: boolean): ClevelandRanges;
|
|
24
|
+
/** The rows that cannot be labelled, because they have no value: for the "transforms" phase's `labels.skip`. */
|
|
25
|
+
static skipGaps(state: {
|
|
26
|
+
processedData?: ProcessedData;
|
|
27
|
+
axes?: PlotAxes;
|
|
28
|
+
}): (row: ProcessedRow) => boolean;
|
|
29
|
+
/** Where `value` sits in its category's range: the top end when it is the largest (or the only one), the bottom end when the smallest, else between. */
|
|
30
|
+
static roleOf(entry: ClevelandEntry, value: number): ClevelandRole;
|
|
31
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { ProcessedPositions } from '../../../phases/transforms/ProcessedPositions';
|
|
2
|
+
import { PlotAxes } from '../../../phases/data/PlotAxes';
|
|
3
|
+
import { isGapValue } from '../../utils/gaps';
|
|
4
|
+
import { RowNumbers } from '../../utils/RowNumbers';
|
|
5
|
+
/**
|
|
6
|
+
* Where the dots of a Cleveland-style plot sit category by category: each
|
|
7
|
+
* category's values - across every series that has one - and the range they
|
|
8
|
+
* span, with the baseline counted as one end when the plot asks for it.
|
|
9
|
+
* Built from the rows the "transforms" phase left, so a series the legend
|
|
10
|
+
* omits is not in it.
|
|
11
|
+
*/
|
|
12
|
+
export class ClevelandRanges {
|
|
13
|
+
entries;
|
|
14
|
+
layout;
|
|
15
|
+
constructor(entries, layout) {
|
|
16
|
+
this.entries = entries;
|
|
17
|
+
this.layout = layout;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The ranges of `state`'s rows; `fromBaseline` adds the plot's baseline to each
|
|
21
|
+
* category's values. A category's difference runs from the series `ends.from`
|
|
22
|
+
* to `ends.to` - by default the first and the last one the plot draws.
|
|
23
|
+
*/
|
|
24
|
+
static of(state, fromBaseline, ends = {}, interval = false) {
|
|
25
|
+
const valueAxis = PlotAxes.valueOf(state);
|
|
26
|
+
const categoryAxis = PlotAxes.categoryOf(state);
|
|
27
|
+
const position = ProcessedPositions.of(state.processedData, valueAxis);
|
|
28
|
+
const baseline = PlotAxes.baselineOf(state);
|
|
29
|
+
const byCategory = new Map();
|
|
30
|
+
const seriesOf = new Map();
|
|
31
|
+
const groups = state.processedGroups ?? [];
|
|
32
|
+
for (const group of groups) {
|
|
33
|
+
for (const segment of group.visualSegments) {
|
|
34
|
+
for (const row of segment.data) {
|
|
35
|
+
const raw = position[valueAxis](row);
|
|
36
|
+
const value = Number(raw);
|
|
37
|
+
if (isGapValue(raw) || !Number.isFinite(value))
|
|
38
|
+
continue;
|
|
39
|
+
const category = position[categoryAxis](row);
|
|
40
|
+
const key = String(category);
|
|
41
|
+
let entry = byCategory.get(key);
|
|
42
|
+
if (!entry) {
|
|
43
|
+
const ends = fromBaseline ? baseline : value;
|
|
44
|
+
entry = {
|
|
45
|
+
category,
|
|
46
|
+
dots: [],
|
|
47
|
+
from: ends,
|
|
48
|
+
to: ends,
|
|
49
|
+
difference: undefined,
|
|
50
|
+
span: undefined,
|
|
51
|
+
change: undefined
|
|
52
|
+
};
|
|
53
|
+
byCategory.set(key, entry);
|
|
54
|
+
seriesOf.set(key, new Set());
|
|
55
|
+
}
|
|
56
|
+
entry.dots.push({ row, value, series: group.series.name });
|
|
57
|
+
// A dot that stands for an interval spans it; else only its own value.
|
|
58
|
+
const [low, high] = interval ? RowNumbers.interval(state, row, value) : [value, value];
|
|
59
|
+
entry.from = Math.min(entry.from, low);
|
|
60
|
+
entry.to = Math.max(entry.to, high);
|
|
61
|
+
seriesOf.get(key).add(group.series.name);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const names = groups.map((group) => group.series.name);
|
|
66
|
+
for (const entry of byCategory.values()) {
|
|
67
|
+
// An end of the difference: a series' dot, the first or last series', or the lowest or highest dot.
|
|
68
|
+
const at = (which) => {
|
|
69
|
+
if (which === 'min')
|
|
70
|
+
return Math.min(...entry.dots.map((dot) => dot.value));
|
|
71
|
+
if (which === 'max')
|
|
72
|
+
return Math.max(...entry.dots.map((dot) => dot.value));
|
|
73
|
+
const series = which === 'first' ? names[0] : which === 'last' ? names[names.length - 1] : which;
|
|
74
|
+
return entry.dots.find((dot) => dot.series === series)?.value;
|
|
75
|
+
};
|
|
76
|
+
const last = at(ends.to ?? 'last');
|
|
77
|
+
const first = fromBaseline ? baseline : at(ends.from ?? 'first');
|
|
78
|
+
entry.difference = last === undefined || first === undefined ? undefined : last - first;
|
|
79
|
+
entry.change = last === undefined || first === undefined ? undefined : [first, last];
|
|
80
|
+
entry.span =
|
|
81
|
+
last === undefined || first === undefined
|
|
82
|
+
? undefined
|
|
83
|
+
: [Math.min(first, last), Math.max(first, last)];
|
|
84
|
+
}
|
|
85
|
+
if (interval) {
|
|
86
|
+
// What an interval says is its own width, from its lower end to its upper.
|
|
87
|
+
for (const entry of byCategory.values()) {
|
|
88
|
+
entry.difference = entry.to - entry.from;
|
|
89
|
+
entry.change = [entry.from, entry.to];
|
|
90
|
+
entry.span = [entry.from, entry.to];
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
const maxSeriesPerCategory = Math.max(0, ...[...seriesOf.values()].map((s) => s.size));
|
|
94
|
+
return new ClevelandRanges([...byCategory.values()], {
|
|
95
|
+
seriesCount: groups.length,
|
|
96
|
+
maxSeriesPerCategory
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/** The rows that cannot be labelled, because they have no value: for the "transforms" phase's `labels.skip`. */
|
|
100
|
+
static skipGaps(state) {
|
|
101
|
+
const valueAxis = PlotAxes.valueOf(state);
|
|
102
|
+
const read = ProcessedPositions.of(state.processedData, valueAxis)[valueAxis];
|
|
103
|
+
return (row) => {
|
|
104
|
+
const raw = read(row);
|
|
105
|
+
return isGapValue(raw) || !Number.isFinite(Number(raw));
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/** Where `value` sits in its category's range: the top end when it is the largest (or the only one), the bottom end when the smallest, else between. */
|
|
109
|
+
static roleOf(entry, value) {
|
|
110
|
+
if (value >= entry.to)
|
|
111
|
+
return 'max';
|
|
112
|
+
if (value <= entry.from)
|
|
113
|
+
return 'min';
|
|
114
|
+
return 'between';
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script lang="ts" generics="TData extends Record<string, unknown>">
|
|
2
|
+
import Plot from '../../../layout/plot/Plot.svelte';
|
|
3
|
+
import { buildClevelandDefaults } from './defaults';
|
|
4
|
+
import type {
|
|
5
|
+
ClevelandPlotProps,
|
|
6
|
+
ClevelandPlotCoreProps
|
|
7
|
+
} from '../../../types/plots/ranking/cleveland/props';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A Cleveland dot plot: per category, one dot for each series that has a value there, joined by a connector from the lowest to the highest - the general form of `LollipopPlot` (one value) and `DumbbellPlot` (two). Upright, or sideways when the categories run along `y`. Draws from pre-built `series` or flat `data` rows.
|
|
11
|
+
* Optional chrome (`title`, `subtitle`, `caption`, `header`, `footer`,
|
|
12
|
+
* `legend`) frames it; `timeline` and `facet` slice its `data` rows.
|
|
13
|
+
* `margins` is bindable: it reports the margin the plot settled on.
|
|
14
|
+
*/
|
|
15
|
+
let {
|
|
16
|
+
title,
|
|
17
|
+
subtitle,
|
|
18
|
+
caption,
|
|
19
|
+
header,
|
|
20
|
+
footer,
|
|
21
|
+
legend,
|
|
22
|
+
order,
|
|
23
|
+
timeline,
|
|
24
|
+
facet,
|
|
25
|
+
tooltip,
|
|
26
|
+
margins = $bindable(),
|
|
27
|
+
...core
|
|
28
|
+
}: ClevelandPlotProps<TData> = $props();
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<Plot
|
|
32
|
+
core={core as ClevelandPlotCoreProps<TData>}
|
|
33
|
+
defaults={buildClevelandDefaults}
|
|
34
|
+
bind:margins
|
|
35
|
+
{title}
|
|
36
|
+
{subtitle}
|
|
37
|
+
{caption}
|
|
38
|
+
{header}
|
|
39
|
+
{footer}
|
|
40
|
+
{legend}
|
|
41
|
+
{order}
|
|
42
|
+
{timeline}
|
|
43
|
+
{facet}
|
|
44
|
+
{tooltip}
|
|
45
|
+
/>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import Plot from '../../../layout/plot/Plot.svelte';
|
|
2
|
+
import type { ClevelandPlotProps } from '../../../types/plots/ranking/cleveland/props';
|
|
3
|
+
declare function $$render<TData extends Record<string, unknown>>(): {
|
|
4
|
+
props: ClevelandPlotProps<TData>;
|
|
5
|
+
exports: {};
|
|
6
|
+
bindings: "margins";
|
|
7
|
+
slots: {};
|
|
8
|
+
events: {};
|
|
9
|
+
};
|
|
10
|
+
declare class __sveltets_Render<TData extends Record<string, unknown>> {
|
|
11
|
+
props(): ReturnType<typeof $$render<TData>>['props'];
|
|
12
|
+
events(): ReturnType<typeof $$render<TData>>['events'];
|
|
13
|
+
slots(): ReturnType<typeof $$render<TData>>['slots'];
|
|
14
|
+
bindings(): "margins";
|
|
15
|
+
exports(): {};
|
|
16
|
+
}
|
|
17
|
+
interface $$IsomorphicComponent {
|
|
18
|
+
new <TData extends Record<string, unknown>>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<TData>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<TData>['props']>, ReturnType<__sveltets_Render<TData>['events']>, ReturnType<__sveltets_Render<TData>['slots']>> & {
|
|
19
|
+
$$bindings?: ReturnType<__sveltets_Render<TData>['bindings']>;
|
|
20
|
+
} & ReturnType<__sveltets_Render<TData>['exports']>;
|
|
21
|
+
<TData extends Record<string, unknown>>(internal: unknown, props: ReturnType<__sveltets_Render<TData>['props']> & {}): ReturnType<__sveltets_Render<TData>['exports']>;
|
|
22
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
23
|
+
}
|
|
24
|
+
declare const Plot: $$IsomorphicComponent;
|
|
25
|
+
type Plot<TData extends Record<string, unknown>> = InstanceType<typeof Plot<TData>>;
|
|
26
|
+
export default Plot;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AxisPlotDefaults } from '../../../types/phases';
|
|
2
|
+
import type { ClevelandOptions, ClevelandPlotState, ClevelandPlotCtx } from '../../../types/plots/ranking/cleveland/state';
|
|
3
|
+
/**
|
|
4
|
+
* ClevelandPlot on the shared pipeline, and the base of its wrappers: per
|
|
5
|
+
* category along one category axis - `x`, or `y` for sideways rows, as the
|
|
6
|
+
* "data" phase reads it off the values - one dot for each series that has a
|
|
7
|
+
* value there, joined by a connector from the lowest to the highest. The
|
|
8
|
+
* `options` set one plot of the family apart: its name, its configuration
|
|
9
|
+
* block, whether the baseline is an end of the range (a lollipop's stem), and
|
|
10
|
+
* what it checks about the series before drawing. Its plot defaults to hover
|
|
11
|
+
* along the category axis.
|
|
12
|
+
*/
|
|
13
|
+
export declare function buildClevelandDefaults<TData extends Record<string, unknown>>(options?: ClevelandOptions): AxisPlotDefaults<ClevelandPlotState<TData>, ClevelandPlotCtx>;
|