@fundar/data-chart-telling 1.17.0 → 1.19.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 +59 -0
- package/README.md +2 -1
- package/dist/configuration/config.svelte.js +4 -3
- package/dist/index.d.ts +10 -3
- package/dist/index.js +4 -1
- package/dist/layout/coordinates/CoordinatesLayout.svelte +3 -1
- package/dist/layout/geometry/GeometryLayout.svelte +222 -53
- package/dist/layout/geometry/ScaleFreeContext.d.ts +31 -0
- package/dist/layout/geometry/ScaleFreeContext.js +65 -0
- package/dist/layout/geometry/ScaleFreeMarks.svelte +14 -0
- package/dist/layout/geometry/ScaleFreeMarks.svelte.d.ts +7 -0
- package/dist/layout/geometry/ScaleGate.svelte.d.ts +8 -0
- package/dist/layout/geometry/ScaleGate.svelte.js +95 -0
- package/dist/layout/geometry/ScaleGateMarks.svelte +15 -0
- package/dist/layout/geometry/ScaleGateMarks.svelte.d.ts +7 -0
- package/dist/layout/hover/HoverDefaults.d.ts +52 -0
- package/dist/layout/hover/HoverDefaults.js +96 -0
- package/dist/layout/hover/HoverLayers.d.ts +35 -0
- package/dist/layout/hover/HoverLayers.js +122 -0
- package/dist/layout/hover/HoverSettings.d.ts +1 -3
- package/dist/layout/hover/HoverSettings.js +3 -2
- package/dist/layout/hover/HoverShapes.d.ts +56 -0
- package/dist/layout/hover/HoverShapes.js +163 -0
- package/dist/layout/hover/PlotHover.svelte.d.ts +18 -0
- package/dist/layout/hover/PlotHover.svelte.js +54 -1
- package/dist/layout/legend/LegendState.svelte.d.ts +2 -0
- package/dist/layout/legend/LegendState.svelte.js +5 -0
- package/dist/layout/margins/Box.d.ts +4 -0
- package/dist/layout/margins/Box.js +14 -0
- package/dist/layout/margins/PlotMargins.svelte.js +26 -1
- package/dist/layout/plot/{Plot.svelte.d.ts → AbstractPlot.svelte.d.ts} +3 -3
- package/dist/layout/plot/Core.svelte +2 -2
- package/dist/layout/plot/PublicPlotContext.d.ts +6 -0
- package/dist/layout/plot/PublicPlotContext.js +8 -0
- package/dist/layout/styles/ValueLabels.d.ts +118 -59
- package/dist/layout/styles/ValueLabels.js +313 -146
- package/dist/layout/tooltip/TooltipState.svelte.d.ts +8 -9
- package/dist/layout/tooltip/TooltipState.svelte.js +28 -29
- package/dist/markers/MarkerKinds.d.ts +84 -1
- package/dist/markers/MarkerKinds.js +150 -23
- package/dist/markers/area/AreaMarker.svelte +1 -1
- package/dist/markers/band/BandMarker.svelte +74 -0
- package/dist/markers/band/BandMarker.svelte.d.ts +7 -0
- package/dist/markers/band/Bands.d.ts +16 -0
- package/dist/markers/band/Bands.js +48 -0
- package/dist/markers/bar/BarMarker.svelte +29 -70
- package/dist/markers/bollinger/BollingerMarker.svelte +1 -1
- package/dist/markers/box/BoxMarker.svelte +1 -1
- package/dist/markers/dot/DotRadius.d.ts +11 -0
- package/dist/markers/dot/DotRadius.js +21 -0
- package/dist/markers/hover/HoverMarker.svelte +7 -265
- package/dist/markers/hover/HoverMarker.svelte.d.ts +4 -27
- package/dist/markers/labels/CurveLabel.svelte +56 -0
- package/dist/markers/labels/CurveLabel.svelte.d.ts +9 -0
- package/dist/markers/labels/LabelMerge.d.ts +11 -0
- package/dist/markers/labels/LabelMerge.js +87 -0
- package/dist/markers/labels/MarkerLabel.svelte +36 -0
- package/dist/markers/labels/MarkerLabel.svelte.d.ts +10 -0
- package/dist/markers/labels/MarkerLabels.d.ts +52 -0
- package/dist/markers/labels/MarkerLabels.js +97 -0
- package/dist/markers/labels/geometry/BoxGeometry.d.ts +8 -0
- package/dist/markers/labels/geometry/BoxGeometry.js +101 -0
- package/dist/markers/labels/geometry/CurveGeometry.d.ts +34 -0
- package/dist/markers/labels/geometry/CurveGeometry.js +193 -0
- package/dist/markers/labels/geometry/PointGeometry.d.ts +9 -0
- package/dist/markers/labels/geometry/PointGeometry.js +22 -0
- package/dist/markers/labels/layouts/BoxLayout.d.ts +10 -0
- package/dist/markers/labels/layouts/BoxLayout.js +49 -0
- package/dist/markers/labels/layouts/PathLayout.d.ts +11 -0
- package/dist/markers/labels/layouts/PathLayout.js +91 -0
- package/dist/markers/labels/layouts/PointLayout.d.ts +19 -0
- package/dist/markers/labels/layouts/PointLayout.js +94 -0
- package/dist/markers/regression/RegressionMarker.svelte +1 -1
- package/dist/markers/text/Covering.d.ts +13 -0
- package/dist/markers/text/Covering.js +29 -0
- package/dist/markers/text/Declutter.d.ts +24 -3
- package/dist/markers/text/Declutter.js +46 -3
- package/dist/markers/text/TextMarker.svelte +90 -17
- package/dist/markers/text/TextMarker.svelte.d.ts +1 -1
- package/dist/markers/tick/TickMarker.svelte +1 -1
- package/dist/markers/utils/MarkerChannels.d.ts +1 -1
- package/dist/markers/utils/MarkerChannels.js +3 -2
- package/dist/markers/utils/PointPixel.d.ts +37 -0
- package/dist/markers/utils/PointPixel.js +44 -0
- package/dist/markers/violin/ViolinMarker.svelte +1 -1
- package/dist/markers/waffle/WaffleMarker.svelte +1 -1
- package/dist/phases/Pipeline.d.ts +7 -7
- package/dist/phases/Pipeline.js +12 -9
- package/dist/phases/context/ContextPhase.d.ts +22 -0
- package/dist/phases/context/ContextPhase.js +23 -0
- package/dist/phases/context/RowContext.d.ts +37 -0
- package/dist/phases/context/RowContext.js +97 -0
- package/dist/phases/data/DataPhase.d.ts +4 -4
- package/dist/phases/data/DataPhase.js +7 -7
- package/dist/phases/hover/HoverPhase.d.ts +6 -7
- package/dist/phases/hover/HoverPhase.js +28 -23
- package/dist/phases/mapping/MappingPhase.d.ts +4 -4
- package/dist/phases/mapping/MappingPhase.js +2 -2
- package/dist/phases/markers/MarkerStyles.d.ts +8 -0
- package/dist/phases/markers/MarkerStyles.js +24 -6
- package/dist/phases/markers/MarkersPhase.d.ts +6 -7
- package/dist/phases/markers/MarkersPhase.js +18 -12
- package/dist/phases/scales/ScalesPhase.d.ts +4 -4
- package/dist/phases/scales/ScalesPhase.js +4 -4
- package/dist/phases/sharedScales/SharedScalesPhase.d.ts +2 -2
- package/dist/phases/sharedScales/SharedScalesPhase.js +2 -2
- package/dist/phases/statistics/MarkerGrouping.d.ts +0 -9
- package/dist/phases/statistics/MarkerGrouping.js +5 -48
- package/dist/phases/statistics/MarkerInheritance.d.ts +11 -0
- package/dist/phases/statistics/MarkerInheritance.js +25 -0
- package/dist/phases/statistics/MarkerOrientation.d.ts +26 -0
- package/dist/phases/statistics/MarkerOrientation.js +29 -0
- package/dist/phases/statistics/StatisticsPhase.js +15 -15
- package/dist/phases/styles/StylesPhase.d.ts +3 -3
- package/dist/phases/styles/StylesPhase.js +2 -2
- package/dist/phases/tooltip/TooltipPhase.d.ts +4 -4
- package/dist/phases/tooltip/TooltipPhase.js +10 -7
- package/dist/phases/transforms/TransformsPhase.d.ts +3 -3
- package/dist/phases/transforms/TransformsPhase.js +7 -5
- package/dist/plots/correlation/heatmap/Plot.svelte +2 -2
- package/dist/plots/correlation/heatmap/Plot.svelte.d.ts +0 -1
- package/dist/plots/correlation/heatmap/defaults.d.ts +2 -2
- package/dist/plots/correlation/heatmap/defaults.js +35 -7
- package/dist/plots/correlation/heatmap/markers.d.ts +2 -8
- package/dist/plots/correlation/heatmap/markers.js +8 -11
- package/dist/plots/correlation/scatter/Plot.svelte +2 -2
- package/dist/plots/correlation/scatter/Plot.svelte.d.ts +0 -1
- package/dist/plots/correlation/scatter/defaults.d.ts +2 -2
- package/dist/plots/correlation/scatter/defaults.js +18 -6
- package/dist/plots/correlation/scatter/markers.d.ts +2 -11
- package/dist/plots/correlation/scatter/markers.js +24 -30
- package/dist/plots/distribution/box/BoxSummaries.d.ts +22 -8
- package/dist/plots/distribution/box/BoxSummaries.js +99 -40
- package/dist/plots/distribution/box/Plot.svelte +2 -2
- package/dist/plots/distribution/box/Plot.svelte.d.ts +0 -1
- package/dist/plots/distribution/box/defaults.d.ts +2 -2
- package/dist/plots/distribution/box/defaults.js +20 -6
- package/dist/plots/distribution/box/markers.d.ts +2 -2
- package/dist/plots/distribution/box/markers.js +13 -4
- package/dist/plots/distribution/density/Plot.svelte +2 -2
- package/dist/plots/distribution/density/Plot.svelte.d.ts +0 -1
- package/dist/plots/distribution/density/defaults.d.ts +2 -2
- package/dist/plots/distribution/density/defaults.js +33 -1
- package/dist/plots/distribution/density/markers.d.ts +2 -2
- package/dist/plots/distribution/density/markers.js +9 -5
- package/dist/plots/distribution/histogram/Plot.svelte +2 -2
- package/dist/plots/distribution/histogram/Plot.svelte.d.ts +0 -1
- package/dist/plots/distribution/histogram/defaults.d.ts +2 -2
- package/dist/plots/distribution/histogram/defaults.js +36 -36
- package/dist/plots/distribution/histogram/markers.d.ts +2 -2
- package/dist/plots/distribution/histogram/markers.js +7 -6
- package/dist/plots/distribution/pyramid/Plot.svelte +2 -2
- package/dist/plots/distribution/pyramid/Plot.svelte.d.ts +0 -1
- package/dist/plots/distribution/pyramid/defaults.d.ts +2 -2
- package/dist/plots/distribution/pyramid/defaults.js +13 -3
- package/dist/plots/distribution/pyramid/markers.d.ts +2 -10
- package/dist/plots/distribution/pyramid/markers.js +9 -18
- package/dist/plots/distribution/violin/Plot.svelte +2 -2
- package/dist/plots/distribution/violin/Plot.svelte.d.ts +0 -1
- package/dist/plots/distribution/violin/defaults.d.ts +2 -2
- package/dist/plots/distribution/violin/defaults.js +20 -7
- package/dist/plots/distribution/violin/markers.d.ts +2 -2
- package/dist/plots/distribution/violin/markers.js +30 -6
- package/dist/plots/evolution/area/Plot.svelte +2 -2
- package/dist/plots/evolution/area/Plot.svelte.d.ts +0 -1
- package/dist/plots/evolution/area/defaults.d.ts +2 -2
- package/dist/plots/evolution/area/defaults.js +5 -8
- package/dist/plots/evolution/area/markers.d.ts +2 -2
- package/dist/plots/evolution/area/markers.js +7 -5
- package/dist/plots/evolution/line/Plot.svelte +2 -2
- package/dist/plots/evolution/line/Plot.svelte.d.ts +0 -1
- package/dist/plots/evolution/line/defaults.d.ts +2 -2
- package/dist/plots/evolution/line/defaults.js +5 -7
- package/dist/plots/evolution/line/markers.d.ts +2 -2
- package/dist/plots/evolution/line/markers.js +6 -4
- package/dist/plots/evolution/slope/Plot.svelte +2 -2
- package/dist/plots/evolution/slope/Plot.svelte.d.ts +0 -1
- package/dist/plots/evolution/slope/defaults.d.ts +2 -2
- package/dist/plots/evolution/slope/defaults.js +11 -6
- package/dist/plots/evolution/slope/markers.d.ts +6 -5
- package/dist/plots/evolution/slope/markers.js +19 -12
- package/dist/plots/evolution/sparkline/Plot.svelte +2 -2
- package/dist/plots/evolution/sparkline/Plot.svelte.d.ts +0 -1
- package/dist/plots/evolution/sparkline/defaults.d.ts +2 -2
- package/dist/plots/evolution/sparkline/defaults.js +5 -2
- package/dist/plots/evolution/sparkline/markers.d.ts +2 -2
- package/dist/plots/evolution/sparkline/markers.js +6 -4
- package/dist/plots/generic/Plot.svelte +42 -0
- package/dist/plots/generic/Plot.svelte.d.ts +25 -0
- package/dist/plots/generic/defaults.d.ts +4 -0
- package/dist/plots/generic/defaults.js +7 -0
- package/dist/plots/map/geo/Core.svelte +3 -3
- package/dist/plots/map/geo/Plot.svelte +2 -2
- package/dist/plots/map/geo/Plot.svelte.d.ts +0 -1
- package/dist/plots/map/geo/defaults.d.ts +2 -2
- package/dist/plots/map/geo/phases/data.d.ts +1 -1
- package/dist/plots/map/geo/phases/data.js +1 -1
- package/dist/plots/map/geo/phases/hover.d.ts +2 -2
- package/dist/plots/map/geo/phases/hover.js +3 -3
- package/dist/plots/map/geo/phases/markers.d.ts +2 -2
- package/dist/plots/map/geo/phases/markers.js +3 -3
- package/dist/plots/map/geo/phases/scales.d.ts +2 -2
- package/dist/plots/map/geo/phases/scales.js +2 -2
- package/dist/plots/part-of-a-whole/treemap/Plot.svelte +2 -2
- package/dist/plots/part-of-a-whole/treemap/Plot.svelte.d.ts +0 -1
- package/dist/plots/part-of-a-whole/treemap/defaults.d.ts +2 -2
- package/dist/plots/part-of-a-whole/treemap/defaults.js +38 -22
- package/dist/plots/ranking/bar/Plot.svelte +2 -2
- package/dist/plots/ranking/bar/Plot.svelte.d.ts +0 -1
- package/dist/plots/ranking/bar/defaults.d.ts +2 -2
- package/dist/plots/ranking/bar/defaults.js +26 -10
- package/dist/plots/ranking/bar/markers.d.ts +3 -3
- package/dist/plots/ranking/bar/markers.js +17 -33
- package/dist/plots/ranking/bullet/Plot.svelte +2 -2
- package/dist/plots/ranking/bullet/Plot.svelte.d.ts +0 -1
- package/dist/plots/ranking/bullet/defaults.d.ts +2 -2
- package/dist/plots/ranking/bullet/defaults.js +24 -4
- package/dist/plots/ranking/bullet/markers.d.ts +3 -3
- package/dist/plots/ranking/bullet/markers.js +16 -10
- package/dist/plots/ranking/cleveland/ClevelandMarkers.d.ts +4 -11
- package/dist/plots/ranking/cleveland/ClevelandMarkers.js +73 -54
- package/dist/plots/ranking/cleveland/Plot.svelte +2 -2
- package/dist/plots/ranking/cleveland/Plot.svelte.d.ts +0 -1
- package/dist/plots/ranking/cleveland/defaults.d.ts +2 -2
- package/dist/plots/ranking/cleveland/defaults.js +39 -5
- package/dist/plots/ranking/dumbbell/Plot.svelte +2 -2
- package/dist/plots/ranking/dumbbell/Plot.svelte.d.ts +0 -1
- package/dist/plots/ranking/dumbbell/defaults.d.ts +2 -2
- package/dist/plots/ranking/forest/Plot.svelte +2 -2
- package/dist/plots/ranking/forest/Plot.svelte.d.ts +0 -1
- package/dist/plots/ranking/forest/defaults.d.ts +2 -2
- package/dist/plots/ranking/lollipop/Plot.svelte +2 -2
- package/dist/plots/ranking/lollipop/Plot.svelte.d.ts +0 -1
- package/dist/plots/ranking/lollipop/defaults.d.ts +2 -2
- package/dist/types/configuration/styling.d.ts +4 -0
- package/dist/types/layout/context.d.ts +23 -0
- package/dist/types/layout/context.js +1 -0
- package/dist/types/layout/hover.d.ts +3 -0
- package/dist/types/layout/styles/bullet.d.ts +4 -1
- package/dist/types/layout/styles/values.d.ts +59 -13
- package/dist/types/layout/tooltip.d.ts +5 -10
- package/dist/types/markers/axis/area.d.ts +5 -1
- package/dist/types/markers/axis/axisBasedMarkersConfig.d.ts +2 -1
- package/dist/types/markers/axis/band.d.ts +24 -0
- package/dist/types/markers/axis/band.js +1 -0
- package/dist/types/markers/axis/bar.d.ts +7 -4
- package/dist/types/markers/axis/bollinger.d.ts +2 -1
- package/dist/types/markers/axis/box.d.ts +2 -1
- package/dist/types/markers/axis/cell.d.ts +4 -1
- package/dist/types/markers/axis/hover.d.ts +60 -15
- package/dist/types/markers/axis/line.d.ts +4 -1
- package/dist/types/markers/axis/rect.d.ts +4 -1
- package/dist/types/markers/axis/regression.d.ts +2 -1
- package/dist/types/markers/axis/tick.d.ts +2 -1
- package/dist/types/markers/axis/trail.d.ts +4 -1
- package/dist/types/markers/axis/violin.d.ts +2 -1
- package/dist/types/markers/axis/waffle.d.ts +5 -1
- package/dist/types/markers/basic/dot.d.ts +4 -1
- package/dist/types/markers/basic/text.d.ts +25 -21
- package/dist/types/markers/channels/commonMarkerConfig.d.ts +6 -2
- package/dist/types/markers/channels/commonMarkerConfigWithLabel.d.ts +5 -9
- package/dist/types/markers/channels/commonMarkerConfigWithOrientation.d.ts +5 -0
- package/dist/types/markers/channels/commonMarkerConfigWithOrientation.js +1 -0
- package/dist/types/markers/common.d.ts +1 -0
- package/dist/types/markers/common.js +1 -0
- package/dist/types/markers/labels/box.d.ts +57 -0
- package/dist/types/markers/labels/box.js +1 -0
- package/dist/types/markers/labels/common.d.ts +15 -0
- package/dist/types/markers/labels/common.js +1 -0
- package/dist/types/markers/labels/path.d.ts +52 -0
- package/dist/types/markers/labels/path.js +1 -0
- package/dist/types/markers/labels/point.d.ts +40 -0
- package/dist/types/markers/labels/point.js +1 -0
- package/dist/types/markers/traits.d.ts +10 -0
- package/dist/types/phases/context/phase.d.ts +7 -0
- package/dist/types/phases/context/phase.js +1 -0
- package/dist/types/phases/data/phase.d.ts +2 -2
- package/dist/types/phases/hover/phase.d.ts +10 -7
- package/dist/types/phases/index.d.ts +2 -1
- package/dist/types/phases/kind.d.ts +11 -8
- package/dist/types/phases/mapping/phase.d.ts +2 -2
- package/dist/types/phases/markers/phase.d.ts +3 -10
- package/dist/types/phases/scales/phase.d.ts +4 -4
- package/dist/types/phases/stage.d.ts +3 -3
- package/dist/types/phases/state.d.ts +1 -1
- package/dist/types/phases/statistics/phase.d.ts +8 -3
- package/dist/types/phases/styles/phase.d.ts +18 -5
- package/dist/types/phases/transforms/phase.d.ts +4 -2
- package/dist/types/plots/constants.d.ts +3 -17
- package/dist/types/plots/correlation/heatmap/props.d.ts +3 -2
- package/dist/types/plots/correlation/heatmap/state.d.ts +2 -2
- package/dist/types/plots/correlation/scatter/props.d.ts +3 -2
- package/dist/types/plots/correlation/scatter/state.d.ts +2 -2
- package/dist/types/plots/distribution/box/props.d.ts +28 -2
- package/dist/types/plots/distribution/box/state.d.ts +6 -17
- package/dist/types/plots/distribution/density/props.d.ts +2 -1
- package/dist/types/plots/distribution/density/state.d.ts +2 -2
- package/dist/types/plots/distribution/histogram/props.d.ts +16 -2
- package/dist/types/plots/distribution/histogram/state.d.ts +2 -2
- package/dist/types/plots/distribution/pyramid/props.d.ts +3 -2
- package/dist/types/plots/distribution/pyramid/state.d.ts +2 -2
- package/dist/types/plots/distribution/violin/props.d.ts +6 -2
- package/dist/types/plots/distribution/violin/state.d.ts +2 -2
- package/dist/types/plots/evolution/area/props.d.ts +3 -2
- package/dist/types/plots/evolution/area/state.d.ts +2 -2
- package/dist/types/plots/evolution/line/props.d.ts +3 -2
- package/dist/types/plots/evolution/line/state.d.ts +2 -2
- package/dist/types/plots/evolution/slope/state.d.ts +2 -2
- package/dist/types/plots/evolution/sparkline/state.d.ts +2 -2
- package/dist/types/plots/generic/props.d.ts +16 -0
- package/dist/types/plots/generic/props.js +1 -0
- package/dist/types/plots/generic/state.d.ts +4 -0
- package/dist/types/plots/generic/state.js +1 -0
- package/dist/types/plots/map/geo/state.d.ts +1 -1
- package/dist/types/plots/part-of-a-whole/treemap/props.d.ts +18 -6
- package/dist/types/plots/part-of-a-whole/treemap/state.d.ts +2 -2
- package/dist/types/plots/props.d.ts +3 -0
- package/dist/types/plots/ranking/bar/props.d.ts +3 -2
- package/dist/types/plots/ranking/bar/state.d.ts +2 -2
- package/dist/types/plots/ranking/bullet/state.d.ts +2 -2
- package/dist/types/plots/ranking/cleveland/props.d.ts +3 -2
- package/dist/types/plots/ranking/cleveland/state.d.ts +2 -2
- package/dist/types/plots/ranking/dumbbell/props.d.ts +3 -2
- package/dist/types/plots/ranking/dumbbell/state.d.ts +2 -2
- package/dist/types/plots/ranking/forest/props.d.ts +5 -2
- package/dist/types/plots/ranking/forest/state.d.ts +2 -2
- package/dist/types/plots/ranking/lollipop/props.d.ts +3 -2
- package/dist/types/plots/ranking/lollipop/state.d.ts +2 -2
- package/docs/architecture.md +9 -9
- package/docs/markers.md +36 -6
- package/docs/plots/evolution/line.md +1 -1
- package/docs/plots/evolution/slope.md +1 -1
- package/docs/plots/part-of-a-whole/treemap.md +36 -2
- package/docs/plots/ranking/bar.md +1 -0
- package/docs/plots/ranking/cleveland.md +1 -1
- package/docs/state.md +33 -0
- package/docs/styles-and-segments.md +2 -15
- package/docs/theming.md +2 -1
- package/docs/tooltip-and-hover.md +81 -3
- package/docs/value-labels.md +159 -0
- package/examples/BarValues.svelte +1 -1
- package/examples/LineDates.svelte +1 -1
- package/examples/ResponsiveLine.svelte +3 -1
- package/examples/TreemapHover.svelte +25 -0
- package/examples/ValueLabels.svelte +1 -1
- package/llms-full.txt +9 -7
- package/llms.txt +3 -1
- package/package.json +3 -1
- package/dist/markers/utils/BoxLabel.d.ts +0 -58
- package/dist/markers/utils/BoxLabel.js +0 -175
- package/dist/markers/utils/MarkerLabel.svelte +0 -33
- package/dist/markers/utils/MarkerLabel.svelte.d.ts +0 -10
- /package/dist/layout/plot/{Plot.svelte → AbstractPlot.svelte} +0 -0
|
@@ -1,14 +1,27 @@
|
|
|
1
|
+
import type { PlotRowContext } from '../../layout/context';
|
|
1
2
|
import type { EdgeBox } from '../../layout/box';
|
|
2
3
|
import type { ValueLabels } from '../../../layout/styles/ValueLabels';
|
|
3
|
-
import type {
|
|
4
|
+
import type { LabelLayout } from '../../markers/labels/common';
|
|
4
5
|
/** A plot kind's own defaults for its value labels, under the author's `styles.values`. */
|
|
5
6
|
export type ValueLabelsOptions<TState> = {
|
|
6
7
|
/** Whether the labels draw when `styles.values.show` is unset. Defaults to `false`. */
|
|
7
8
|
show?: boolean;
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
|
|
9
|
+
/** The layout the labels take when `styles.values.layout` is unset. Defaults to `'point'`. */
|
|
10
|
+
layout?: LabelLayout | ((state: TState) => LabelLayout);
|
|
11
|
+
/** The kind's own options for each layout it takes, under the author's: a bar's `path` at its `tip`, say. */
|
|
12
|
+
/**
|
|
13
|
+
* On a kind whose rows have several values, the parts it can label: each one's own placement, over the layout's,
|
|
14
|
+
* and those it labels when `styles.values.parts` is unset.
|
|
15
|
+
*/
|
|
16
|
+
parts?: {
|
|
17
|
+
placements: Record<string, Record<string, unknown>> | ((state: TState) => Record<string, Record<string, unknown>>);
|
|
18
|
+
default: string[];
|
|
19
|
+
};
|
|
20
|
+
layouts?: Partial<Record<LabelLayout, Record<string, unknown>>> | ((state: TState) => Partial<Record<LabelLayout, Record<string, unknown>>>);
|
|
21
|
+
/** A label's text when `styles.values.format` is unset. Defaults to the bare value. `number` writes a value as the plot's `styles.values` display fields (`decimals`, `prefix`, `suffix`, `signDisplay`) ask, and `context` is what the plot knows of the labelled row. */
|
|
22
|
+
format?: (value: number, number: (value: number) => string, context: PlotRowContext) => string;
|
|
23
|
+
/** `format`, chosen off the plot's state: a curve named when there are several, its peak's position when alone. */
|
|
24
|
+
formatFor?: (state: TState) => (value: number, number: (value: number) => string, context: PlotRowContext) => string;
|
|
12
25
|
/**
|
|
13
26
|
* Where the labels are expected to sit, from the whole data: boxes around
|
|
14
27
|
* the points they label, on the plot edges those points can reach (see
|
|
@@ -51,9 +51,9 @@ export type TransformsStageState = {
|
|
|
51
51
|
processedGroups?: VisualGroup<Series<ProcessedRow>, any>[];
|
|
52
52
|
};
|
|
53
53
|
/** What differs between plots in the shared "transforms" stage. */
|
|
54
|
-
export type TransformsStageOptions<TState extends TransformsStageState,
|
|
54
|
+
export type TransformsStageOptions<TState extends TransformsStageState, TEnv> = {
|
|
55
55
|
/** The transforms to run. Defaults to the plot's own `transforms`. */
|
|
56
|
-
transforms?: (state: TState,
|
|
56
|
+
transforms?: (state: TState, env: TEnv) => MarkerTransform[];
|
|
57
57
|
/**
|
|
58
58
|
* Whether a series the legend omits keeps its part of the whole (a treemap's tile): the transforms run over
|
|
59
59
|
* its rows too, so every other part keeps its share and its place, and its own rows are dropped after.
|
|
@@ -77,6 +77,8 @@ export type TransformsStageOptions<TState extends TransformsStageState, TCtx> =
|
|
|
77
77
|
show?: boolean;
|
|
78
78
|
/** The rows picked when `styles.values.select` is unset. Defaults to every row. */
|
|
79
79
|
select?: ValueSelect | ValueSelect[];
|
|
80
|
+
/** What `'min'` and `'max'` compare: the plot's value axis by default, or this (a heatmap's `color`). */
|
|
81
|
+
measure?: (state: TransformsStageState) => ((row: ProcessedRow) => unknown) | undefined;
|
|
80
82
|
/** What a selector picks among: each series (the default), or each category. */
|
|
81
83
|
group?: 'series' | 'category';
|
|
82
84
|
/** A test for the rows that cannot be labelled (a gap), read off the state once. */
|
|
@@ -3,18 +3,6 @@
|
|
|
3
3
|
* the page, or in one of its corners. The anchors of a text marker's `frameAnchor`, and of a shape's `label`.
|
|
4
4
|
*/
|
|
5
5
|
export type LabelAnchor = 'middle' | 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
6
|
-
/**
|
|
7
|
-
* Where a value label sits on its mark. Two vocabularies share the type, one per family of plots:
|
|
8
|
-
*
|
|
9
|
-
* - The plots that label a point or the end of a line (`LinePlot`, `AreaPlot`, `SlopePlot`, `ScatterPlot`...) read
|
|
10
|
-
* the side of the point its text is written on: `'start'` after it (right of a line's last point), `'end'` before
|
|
11
|
-
* it, `'middle'` on it and `'outside'` beyond it.
|
|
12
|
-
* - The plots that label a shape (`BarPlot`, `BulletPlot`, `PyramidPlot`, `HistogramPlot`) read where in it the
|
|
13
|
-
* label is. Inside the shape: a {@link LabelAnchor} - its `'middle'`, an edge as it is drawn on the page
|
|
14
|
-
* (`'top'`, `'left'`...) or a corner (`'top-left'`...) - or, whichever side of zero the value is, the end of the bar
|
|
15
|
-
* away from zero, `'tip'`, or the one at zero, `'base'`. Beyond the tip, outside the shape: `'outside'`.
|
|
16
|
-
*/
|
|
17
|
-
export type ValueAnchor = LabelAnchor | 'outside' | 'start' | 'end' | 'tip' | 'base';
|
|
18
6
|
/**
|
|
19
7
|
* Shared by two unrelated renderers: a `dot` mark's own point shape
|
|
20
8
|
* (delegated to svelteplot/d3-shape) and a discrete legend item's own icon
|
|
@@ -32,11 +20,9 @@ export type FontWeight = 'normal' | 'bold' | number;
|
|
|
32
20
|
/** `font-style` keyword accepted by any text styling. */
|
|
33
21
|
export type FontStyleKeyword = 'normal' | 'italic';
|
|
34
22
|
/**
|
|
35
|
-
* Horizontal text anchor. `'outside'`
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* for a positive x, `'end'` (extending left) for negative. Elsewhere it's
|
|
39
|
-
* treated the same as `'start'`.
|
|
23
|
+
* Horizontal text anchor. `'outside'` leaves the side to the mark that writes
|
|
24
|
+
* the label, where it picks one per point (a Cleveland plot's labels take
|
|
25
|
+
* their own); elsewhere it's treated the same as `'start'`.
|
|
40
26
|
*/
|
|
41
27
|
export type TextAnchor = 'start' | 'middle' | 'end' | 'outside';
|
|
42
28
|
/** Vertical text anchor. */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { WithValues, CellValueLabel } from '../../../layout/styles';
|
|
1
2
|
import type { BasePlotProps, PlotCoreProps } from '../../props';
|
|
2
3
|
import type { AxisBasedScalesConfig } from '../../../layout/scales';
|
|
3
4
|
import type { AxisBasedMarkersConfig } from '../../../markers/common';
|
|
@@ -5,6 +6,6 @@ import type { SeriesProps, DualAxisDataProps } from '../../data/common';
|
|
|
5
6
|
import type { AxisBasedStylesConfig } from '../../../layout/styles';
|
|
6
7
|
import type { CellSegmentStyle } from '../../segments/common';
|
|
7
8
|
/** `HeatmapPlot`'s public props. */
|
|
8
|
-
export type HeatmapPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, AxisBasedStylesConfig, CellSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
9
|
+
export type HeatmapPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, WithValues<AxisBasedStylesConfig, CellValueLabel>, CellSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
9
10
|
/** What `HeatmapPlot`'s core draws from. */
|
|
10
|
-
export type HeatmapPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, AxisBasedStylesConfig, CellSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
11
|
+
export type HeatmapPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, WithValues<AxisBasedStylesConfig, CellValueLabel>, CellSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CellSegmentStyle } from '../../segments/common';
|
|
2
2
|
import type { ResolvedChannel, ResolvedChannels } from '../../../layout/mapping';
|
|
3
3
|
import type { LegendRange } from '../../../layout/legend';
|
|
4
|
-
import type { AxisPlotState,
|
|
4
|
+
import type { AxisPlotState, AxisPlotEnv } from '../../../phases';
|
|
5
5
|
/**
|
|
6
6
|
* The active continuous-legend range filter, if any - narrows which cells
|
|
7
7
|
* render at full opacity, and in `'rescale'` mode, the color domain itself.
|
|
@@ -23,6 +23,6 @@ export type HeatmapPlotState<TData extends Record<string, unknown>> = AxisPlotSt
|
|
|
23
23
|
resolveOpacity?: (row: TData) => number;
|
|
24
24
|
};
|
|
25
25
|
/** The environment every HeatmapPlot phase reads from, alongside the growing state. */
|
|
26
|
-
export type
|
|
26
|
+
export type HeatmapPlotEnv = AxisPlotEnv & {
|
|
27
27
|
range: HeatmapRangeFilter | null | undefined;
|
|
28
28
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { WithValues, DotValueLabel } from '../../../layout/styles';
|
|
1
2
|
import type { BasePlotProps, PlotCoreProps } from '../../props';
|
|
2
3
|
import type { AxisBasedScalesConfig } from '../../../layout/scales';
|
|
3
4
|
import type { AxisBasedMarkersConfig } from '../../../markers/common';
|
|
@@ -5,6 +6,6 @@ import type { SeriesProps, DualAxisDataProps } from '../../data/common';
|
|
|
5
6
|
import type { AxisBasedStylesConfig } from '../../../layout/styles';
|
|
6
7
|
import type { ScatterSegmentStyle } from '../../segments/common';
|
|
7
8
|
/** `ScatterPlot`'s public props. */
|
|
8
|
-
export type ScatterPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, AxisBasedStylesConfig, ScatterSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
9
|
+
export type ScatterPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, WithValues<AxisBasedStylesConfig, DotValueLabel>, ScatterSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
9
10
|
/** What `ScatterPlot`'s core draws from. */
|
|
10
|
-
export type ScatterPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, AxisBasedStylesConfig, ScatterSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
11
|
+
export type ScatterPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, WithValues<AxisBasedStylesConfig, DotValueLabel>, ScatterSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ScatterSegmentStyle } from '../../segments/common';
|
|
2
|
-
import type { AxisPlotState,
|
|
2
|
+
import type { AxisPlotState, AxisPlotEnv } from '../../../phases';
|
|
3
3
|
/** ScatterPlot's pipeline state: the shared axis-based state, with no extras of its own. */
|
|
4
4
|
export type ScatterPlotState<TData extends Record<string, unknown>> = AxisPlotState<TData, ScatterSegmentStyle>;
|
|
5
5
|
/** The environment every ScatterPlot phase reads from, alongside the growing state. */
|
|
6
|
-
export type
|
|
6
|
+
export type ScatterPlotEnv = AxisPlotEnv;
|
|
@@ -1,10 +1,36 @@
|
|
|
1
|
+
import type { WithValues } from '../../../layout/styles';
|
|
2
|
+
import type { PointLabelConfig } from '../../../markers/labels/point';
|
|
3
|
+
import type { KindRowContext } from '../../../layout/context';
|
|
4
|
+
import type { AxisValue } from '../../../layout/mapping';
|
|
1
5
|
import type { BasePlotProps, PlotCoreProps } from '../../props';
|
|
2
6
|
import type { AxisBasedScalesConfig } from '../../../layout/scales';
|
|
3
7
|
import type { AxisBasedMarkersConfig } from '../../../markers/common';
|
|
4
8
|
import type { SeriesProps, DualAxisDataProps } from '../../data/common';
|
|
5
9
|
import type { AxisBasedStylesConfig } from '../../../layout/styles';
|
|
6
10
|
import type { AreaStyle } from '../../styling';
|
|
11
|
+
/**
|
|
12
|
+
* One box's summary: its category, its quartiles, the whisker ends (the farthest values within 1.5 IQR of the box),
|
|
13
|
+
* how many values it has and the ones past the whiskers.
|
|
14
|
+
*/
|
|
15
|
+
export type BoxSummary = {
|
|
16
|
+
category: AxisValue;
|
|
17
|
+
min: number;
|
|
18
|
+
p25: number;
|
|
19
|
+
median: number;
|
|
20
|
+
p75: number;
|
|
21
|
+
max: number;
|
|
22
|
+
count: number;
|
|
23
|
+
outliers: number[];
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* What a `BoxPlot` or a `ViolinPlot` knows of a row, which its tooltip's and value labels' `format`, its hover and
|
|
27
|
+
* `usePlot().contextOf` read: the summary of the box (or violin) it is in. A value's own `value` stays its own; a
|
|
28
|
+
* hovered box's is its median.
|
|
29
|
+
*/
|
|
30
|
+
export type BoxRowContext = KindRowContext<BoxSummary>;
|
|
31
|
+
/** The values of a box its value labels can write: its quartiles, its whiskers' ends and the values past them. */
|
|
32
|
+
export type BoxValuePart = Exclude<keyof BoxSummary, 'category' | 'count'>;
|
|
7
33
|
/** `BoxPlot`'s public props. */
|
|
8
|
-
export type BoxPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, AxisBasedStylesConfig, AreaStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData
|
|
34
|
+
export type BoxPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, WithValues<AxisBasedStylesConfig, PointLabelConfig, BoxValuePart>, AreaStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>, undefined, BoxRowContext>;
|
|
9
35
|
/** What `BoxPlot`'s core draws from. */
|
|
10
|
-
export type BoxPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, AxisBasedStylesConfig, AreaStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
36
|
+
export type BoxPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, WithValues<AxisBasedStylesConfig, PointLabelConfig, BoxValuePart>, AreaStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
@@ -1,23 +1,12 @@
|
|
|
1
1
|
import type { AreaStyle } from '../../styling';
|
|
2
|
-
import type { AxisPlotState,
|
|
3
|
-
import type {
|
|
2
|
+
import type { AxisPlotState, AxisPlotEnv, ProcessedRow } from '../../../phases';
|
|
3
|
+
import type { BoxSummary } from './props';
|
|
4
4
|
/** BoxPlot's pipeline state: the shared axis-based state, with no extras of its own. */
|
|
5
5
|
export type BoxPlotState<TData extends Record<string, unknown>> = AxisPlotState<TData, AreaStyle>;
|
|
6
6
|
/** The environment every BoxPlot phase reads from, alongside the growing state. */
|
|
7
|
-
export type
|
|
7
|
+
export type BoxPlotEnv = AxisPlotEnv;
|
|
8
8
|
/**
|
|
9
|
-
* One box's summary - what a hovered box reads as
|
|
10
|
-
*
|
|
11
|
-
* box) and the values past them. It also keeps the series tags and, when the
|
|
12
|
-
* category channel is a field key, the category under that field.
|
|
9
|
+
* One box's summary as a row - what a hovered box reads as. It also keeps the series tags and, when the category
|
|
10
|
+
* channel is a field key, the category under that field.
|
|
13
11
|
*/
|
|
14
|
-
export type BoxSummaryRow = ProcessedRow &
|
|
15
|
-
category: AxisValue;
|
|
16
|
-
min: number;
|
|
17
|
-
p25: number;
|
|
18
|
-
median: number;
|
|
19
|
-
p75: number;
|
|
20
|
-
max: number;
|
|
21
|
-
count: number;
|
|
22
|
-
outliers: number[];
|
|
23
|
-
};
|
|
12
|
+
export type BoxSummaryRow = ProcessedRow & BoxSummary;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AreaValueLabel, LineValueLabel, WithValues } from '../../../layout/styles';
|
|
1
2
|
import type { BasePlotProps, PlotCoreProps } from '../../props';
|
|
2
3
|
import type { AxisBasedScalesConfig } from '../../../layout/scales';
|
|
3
4
|
import type { AxisBasedMarkersConfig } from '../../../markers/common';
|
|
@@ -5,7 +6,7 @@ import type { SeriesProps, SingleAxisDataProps } from '../../data/common';
|
|
|
5
6
|
import type { CurveAwarePlotStylesConfig } from '../../../layout/styles';
|
|
6
7
|
import type { AreaStyle } from '../../styling';
|
|
7
8
|
/** `styles` of `DensityPlot`: the curve of the estimate, and the mark that draws it. */
|
|
8
|
-
export type DensityPlotStylesConfig = CurveAwarePlotStylesConfig & {
|
|
9
|
+
export type DensityPlotStylesConfig = WithValues<CurveAwarePlotStylesConfig, AreaValueLabel | LineValueLabel> & {
|
|
9
10
|
/** The mark drawing each estimate: a filled `'area'` or a `'line'`. Defaults to `'area'`. */
|
|
10
11
|
mark?: 'area' | 'line';
|
|
11
12
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AreaStyle } from '../../styling';
|
|
2
|
-
import type { AxisPlotState,
|
|
2
|
+
import type { AxisPlotState, AxisPlotEnv } from '../../../phases';
|
|
3
3
|
/** DensityPlot's pipeline state: the shared axis-based state, with no extras of its own. */
|
|
4
4
|
export type DensityPlotState<TData extends Record<string, unknown>> = AxisPlotState<TData, AreaStyle>;
|
|
5
5
|
/** The environment every DensityPlot phase reads from, alongside the growing state. */
|
|
6
|
-
export type
|
|
6
|
+
export type DensityPlotEnv = AxisPlotEnv;
|
|
@@ -1,10 +1,24 @@
|
|
|
1
|
+
import type { WithValues, CellValueLabel } from '../../../layout/styles';
|
|
2
|
+
import type { KindRowContext } from '../../../layout/context';
|
|
1
3
|
import type { BasePlotProps, PlotCoreProps } from '../../props';
|
|
2
4
|
import type { AxisBasedScalesConfig } from '../../../layout/scales';
|
|
3
5
|
import type { AxisBasedMarkersConfig } from '../../../markers/common';
|
|
4
6
|
import type { SeriesProps, SingleAxisDataProps } from '../../data/common';
|
|
5
7
|
import type { AxisBasedStylesConfig } from '../../../layout/styles';
|
|
6
8
|
import type { AreaStyle } from '../../styling';
|
|
9
|
+
/**
|
|
10
|
+
* What a `HistogramPlot` knows of a bin, which its tooltip's and value labels' `format`, its hover and
|
|
11
|
+
* `usePlot().contextOf` read: its `count` (also its `value`) and the edges it spans.
|
|
12
|
+
*/
|
|
13
|
+
export type HistogramRowContext = KindRowContext<{
|
|
14
|
+
/** How many values fall in the bin. */
|
|
15
|
+
count: number;
|
|
16
|
+
/** The bin's lower edge. */
|
|
17
|
+
from: number;
|
|
18
|
+
/** The bin's upper edge. */
|
|
19
|
+
to: number;
|
|
20
|
+
}>;
|
|
7
21
|
/** `HistogramPlot`'s public props. */
|
|
8
|
-
export type HistogramPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | SingleAxisDataProps<TData>, TData, AxisBasedStylesConfig, AreaStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData
|
|
22
|
+
export type HistogramPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | SingleAxisDataProps<TData>, TData, WithValues<AxisBasedStylesConfig, CellValueLabel>, AreaStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>, undefined, HistogramRowContext>;
|
|
9
23
|
/** What `HistogramPlot`'s core draws from. */
|
|
10
|
-
export type HistogramPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | SingleAxisDataProps<TData>, TData, AxisBasedStylesConfig, AreaStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
24
|
+
export type HistogramPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | SingleAxisDataProps<TData>, TData, WithValues<AxisBasedStylesConfig, CellValueLabel>, AreaStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AreaStyle } from '../../styling';
|
|
2
|
-
import type { AxisPlotState,
|
|
2
|
+
import type { AxisPlotState, AxisPlotEnv } from '../../../phases';
|
|
3
3
|
/** HistogramPlot's pipeline state: the shared axis-based state, with no extras of its own. */
|
|
4
4
|
export type HistogramPlotState<TData extends Record<string, unknown>> = AxisPlotState<TData, AreaStyle>;
|
|
5
5
|
/** The environment every HistogramPlot phase reads from, alongside the growing state. */
|
|
6
|
-
export type
|
|
6
|
+
export type HistogramPlotEnv = AxisPlotEnv;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { WithValues, BarValueLabel } from '../../../layout/styles';
|
|
1
2
|
import type { BasePlotProps, PlotCoreProps } from '../../props';
|
|
2
3
|
import type { AxisBasedScalesConfig } from '../../../layout/scales';
|
|
3
4
|
import type { AxisBasedMarkersConfig } from '../../../markers/common';
|
|
@@ -5,6 +6,6 @@ import type { SeriesProps, DualAxisDataProps } from '../../data/common';
|
|
|
5
6
|
import type { GapsAwarePlotStylesConfig } from '../../../layout/styles';
|
|
6
7
|
import type { BarSegmentStyle } from '../../segments/common';
|
|
7
8
|
/** `PyramidPlot`'s public props. */
|
|
8
|
-
export type PyramidPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, GapsAwarePlotStylesConfig<BarSegmentStyle>, BarSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
9
|
+
export type PyramidPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, WithValues<GapsAwarePlotStylesConfig<BarSegmentStyle>, BarValueLabel>, BarSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
9
10
|
/** What `PyramidPlot`'s core draws from. */
|
|
10
|
-
export type PyramidPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, GapsAwarePlotStylesConfig<BarSegmentStyle>, BarSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
11
|
+
export type PyramidPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, WithValues<GapsAwarePlotStylesConfig<BarSegmentStyle>, BarValueLabel>, BarSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Series } from '../../data/common';
|
|
2
2
|
import type { BarSegmentStyle } from '../../segments/common';
|
|
3
|
-
import type { AxisPlotState,
|
|
3
|
+
import type { AxisPlotState, AxisPlotEnv } from '../../../phases';
|
|
4
4
|
export type PyramidSide = 'left' | 'right';
|
|
5
5
|
/** A resolved series tagged with which side of the shared zero baseline it renders on. */
|
|
6
6
|
export type PyramidSeries<TData extends Record<string, unknown>> = Series<TData> & {
|
|
@@ -13,4 +13,4 @@ export type PyramidSeries<TData extends Record<string, unknown>> = Series<TData>
|
|
|
13
13
|
*/
|
|
14
14
|
export type PyramidPlotState<TData extends Record<string, unknown>> = AxisPlotState<TData, BarSegmentStyle, PyramidSeries<TData>>;
|
|
15
15
|
/** The environment every PyramidPlot phase reads from, alongside the growing state. */
|
|
16
|
-
export type
|
|
16
|
+
export type PyramidPlotEnv = AxisPlotEnv;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import type { WithValues } from '../../../layout/styles';
|
|
2
|
+
import type { PointLabelConfig } from '../../../markers/labels/point';
|
|
3
|
+
import type { BoxValuePart } from '../box/props';
|
|
4
|
+
import type { BoxRowContext } from '../box/props';
|
|
1
5
|
import type { BasePlotProps, PlotCoreProps } from '../../props';
|
|
2
6
|
import type { AxisBasedScalesConfig } from '../../../layout/scales';
|
|
3
7
|
import type { AxisBasedMarkersConfig } from '../../../markers/common';
|
|
@@ -6,7 +10,7 @@ import type { AxisBasedStylesConfig } from '../../../layout/styles';
|
|
|
6
10
|
import type { AreaStyle } from '../../styling';
|
|
7
11
|
import type { DensityKernel } from '../../../transforms/density';
|
|
8
12
|
/** `styles` of `ViolinPlot`: how each category's density is estimated and drawn. */
|
|
9
|
-
export type ViolinPlotStylesConfig = AxisBasedStylesConfig & {
|
|
13
|
+
export type ViolinPlotStylesConfig = WithValues<AxisBasedStylesConfig, PointLabelConfig, BoxValuePart> & {
|
|
10
14
|
kernel?: DensityKernel;
|
|
11
15
|
/** Kernel bandwidth in data units; Silverman's rule picks one per violin when unset. */
|
|
12
16
|
bandwidth?: number;
|
|
@@ -18,6 +22,6 @@ export type ViolinPlotStylesConfig = AxisBasedStylesConfig & {
|
|
|
18
22
|
box?: boolean | number;
|
|
19
23
|
};
|
|
20
24
|
/** `ViolinPlot`'s public props. */
|
|
21
|
-
export type ViolinPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, ViolinPlotStylesConfig, AreaStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData
|
|
25
|
+
export type ViolinPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, ViolinPlotStylesConfig, AreaStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>, undefined, BoxRowContext>;
|
|
22
26
|
/** What `ViolinPlot`'s core draws from. */
|
|
23
27
|
export type ViolinPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, ViolinPlotStylesConfig, AreaStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AreaStyle } from '../../styling';
|
|
2
|
-
import type { AxisPlotState,
|
|
2
|
+
import type { AxisPlotState, AxisPlotEnv } from '../../../phases';
|
|
3
3
|
/** ViolinPlot's pipeline state: the shared axis-based state, with no extras of its own. */
|
|
4
4
|
export type ViolinPlotState<TData extends Record<string, unknown>> = AxisPlotState<TData, AreaStyle>;
|
|
5
5
|
/** The environment every ViolinPlot phase reads from, alongside the growing state. */
|
|
6
|
-
export type
|
|
6
|
+
export type ViolinPlotEnv = AxisPlotEnv;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { WithValues, AreaValueLabel } from '../../../layout/styles';
|
|
1
2
|
import type { BasePlotProps, PlotCoreProps } from '../../props';
|
|
2
3
|
import type { AxisBasedScalesConfig } from '../../../layout/scales';
|
|
3
4
|
import type { AxisBasedMarkersConfig } from '../../../markers/common';
|
|
@@ -5,6 +6,6 @@ import type { SeriesProps, DualAxisDataProps } from '../../data/common';
|
|
|
5
6
|
import type { AxisBasedStylesConfig } from '../../../layout/styles';
|
|
6
7
|
import type { AreaStyle } from '../../styling';
|
|
7
8
|
/** `AreaPlot`'s public props. */
|
|
8
|
-
export type AreaPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, AxisBasedStylesConfig, AreaStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
9
|
+
export type AreaPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, WithValues<AxisBasedStylesConfig, AreaValueLabel>, AreaStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
9
10
|
/** What `AreaPlot`'s core draws from. */
|
|
10
|
-
export type AreaPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, AxisBasedStylesConfig, AreaStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
11
|
+
export type AreaPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, WithValues<AxisBasedStylesConfig, AreaValueLabel>, AreaStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AreaStyle } from '../../styling';
|
|
2
|
-
import type { AxisPlotState,
|
|
2
|
+
import type { AxisPlotState, AxisPlotEnv } from '../../../phases';
|
|
3
3
|
/** AreaPlot's pipeline state: the shared axis-based state, with no extras of its own. */
|
|
4
4
|
export type AreaPlotState<TData extends Record<string, unknown>> = AxisPlotState<TData, AreaStyle>;
|
|
5
5
|
/** The environment every AreaPlot phase reads from, alongside the growing state. */
|
|
6
|
-
export type
|
|
6
|
+
export type AreaPlotEnv = AxisPlotEnv;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { WithValues, LineValueLabel } from '../../../layout/styles';
|
|
1
2
|
import type { BasePlotProps, PlotCoreProps } from '../../props';
|
|
2
3
|
import type { AxisBasedScalesConfig } from '../../../layout/scales';
|
|
3
4
|
import type { AxisBasedMarkersConfig } from '../../../markers/common';
|
|
@@ -5,6 +6,6 @@ import type { SeriesProps, DualAxisDataProps } from '../../data/common';
|
|
|
5
6
|
import type { CurveAwarePlotStylesConfig, GapsAwarePlotStylesConfig } from '../../../layout/styles';
|
|
6
7
|
import type { LineSegmentStyle } from '../../segments/common';
|
|
7
8
|
/** `LinePlot`'s public props. */
|
|
8
|
-
export type LinePlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, GapsAwarePlotStylesConfig<LineSegmentStyle> & CurveAwarePlotStylesConfig, LineSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
9
|
+
export type LinePlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, WithValues<GapsAwarePlotStylesConfig<LineSegmentStyle> & CurveAwarePlotStylesConfig, LineValueLabel>, LineSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
9
10
|
/** What `LinePlot`'s core draws from. */
|
|
10
|
-
export type LinePlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, GapsAwarePlotStylesConfig<LineSegmentStyle> & CurveAwarePlotStylesConfig, LineSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
11
|
+
export type LinePlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, WithValues<GapsAwarePlotStylesConfig<LineSegmentStyle> & CurveAwarePlotStylesConfig, LineValueLabel>, LineSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { GapsConfig } from '../../gaps';
|
|
2
2
|
import type { LineSegmentStyle } from '../../segments/common';
|
|
3
|
-
import type { AxisPlotState,
|
|
3
|
+
import type { AxisPlotState, AxisPlotEnv } from '../../../phases';
|
|
4
4
|
/** LinePlot's pipeline state: the shared axis-based state plus its gaps. */
|
|
5
5
|
export type LinePlotState<TData extends Record<string, unknown>> = AxisPlotState<TData, LineSegmentStyle> & {
|
|
6
6
|
gaps?: GapsConfig<LineSegmentStyle>;
|
|
7
7
|
};
|
|
8
8
|
/** The environment every LinePlot phase reads from, alongside the growing state. */
|
|
9
|
-
export type
|
|
9
|
+
export type LinePlotEnv = AxisPlotEnv;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { LinePlotState,
|
|
1
|
+
import type { LinePlotState, LinePlotEnv } from '../line/state';
|
|
2
2
|
/** SlopePlot's pipeline state: a LinePlot's. */
|
|
3
3
|
export type SlopePlotState<TData extends Record<string, unknown>> = LinePlotState<TData>;
|
|
4
4
|
/** The environment every SlopePlot phase reads from, alongside the growing state. */
|
|
5
|
-
export type
|
|
5
|
+
export type SlopePlotEnv = LinePlotEnv;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { LinePlotState,
|
|
1
|
+
import type { LinePlotState, LinePlotEnv } from '../line/state';
|
|
2
2
|
/** SparklinePlot's pipeline state: a LinePlot's. */
|
|
3
3
|
export type SparklinePlotState<TData extends Record<string, unknown>> = LinePlotState<TData>;
|
|
4
4
|
/** The environment every SparklinePlot phase reads from, alongside the growing state. */
|
|
5
|
-
export type
|
|
5
|
+
export type SparklinePlotEnv = LinePlotEnv;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { BasePlotProps, PlotCoreProps } from '../props';
|
|
2
|
+
import type { AxisBasedScalesConfig } from '../../layout/scales';
|
|
3
|
+
import type { AxisBasedMarkersConfig } from '../../markers/common';
|
|
4
|
+
import type { ChannelAccessors } from '../../layout/mapping';
|
|
5
|
+
import type { Series } from '../data/common';
|
|
6
|
+
import type { AxisBasedStylesConfig } from '../../layout/styles';
|
|
7
|
+
import type { AreaStyle } from '../styling';
|
|
8
|
+
/** Rows, series or neither, and every channel optional: what markers without their own take. */
|
|
9
|
+
export type GenericDataProps<TData extends Record<string, unknown>> = {
|
|
10
|
+
data?: TData[];
|
|
11
|
+
series?: Series<TData>[];
|
|
12
|
+
} & ChannelAccessors<TData>;
|
|
13
|
+
/** `Plot`'s public props. */
|
|
14
|
+
export type GenericPlotProps<TData extends Record<string, unknown>> = BasePlotProps<GenericDataProps<TData>, TData, AxisBasedStylesConfig, AreaStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
15
|
+
/** What `Plot`'s core draws from. */
|
|
16
|
+
export type GenericPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<GenericDataProps<TData>, TData, AxisBasedStylesConfig, AreaStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -78,7 +78,7 @@ export type GeoPlotState<TProps extends Record<string, unknown>> = {
|
|
|
78
78
|
hoverRows?: TaggedGeoFeature<TProps>[];
|
|
79
79
|
};
|
|
80
80
|
/** The environment every GeoPlot phase reads from, alongside the growing state. */
|
|
81
|
-
export type
|
|
81
|
+
export type GeoPlotEnv<TProps extends Record<string, unknown>> = {
|
|
82
82
|
cfg: PlotStylesConfig;
|
|
83
83
|
range: GeoRangeFilter | null | undefined;
|
|
84
84
|
fill?: string;
|
|
@@ -1,19 +1,31 @@
|
|
|
1
|
+
import type { WithValues } from '../../../layout/styles';
|
|
2
|
+
import type { BoxLabelConfig } from '../../../markers/labels/box';
|
|
1
3
|
import type { BasePlotProps, PlotCoreProps } from '../../props';
|
|
2
4
|
import type { AxisBasedScalesConfig } from '../../../layout/scales';
|
|
3
5
|
import type { AxisBasedMarkersConfig } from '../../../markers/common';
|
|
4
6
|
import type { NonAxisDataProps } from '../../data/common';
|
|
5
7
|
import type { AxisBasedStylesConfig } from '../../../layout/styles';
|
|
6
|
-
import type {
|
|
8
|
+
import type { KindRowContext } from '../../../layout/context';
|
|
7
9
|
import type { BarSegmentStyle } from '../../segments/common';
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
+
/**
|
|
11
|
+
* What a `TreemapPlot` knows of a tile, which its tooltip's and value labels' `format`, its hover and
|
|
12
|
+
* `usePlot().contextOf` read: its series (the outermost level), and what the plot works out for it. Its `value`
|
|
13
|
+
* is the tile's summed value, and it has no `x` or `y`.
|
|
14
|
+
*/
|
|
15
|
+
export type TreemapRowContext = KindRowContext<{
|
|
16
|
+
/** The tile's name: the value at its innermost level. */
|
|
17
|
+
name: string;
|
|
18
|
+
/** The value at every level of the tile, outermost first. */
|
|
19
|
+
path: string[];
|
|
10
20
|
/** The tile's part of the whole, from `0` to `100`, worked out from the values in whatever unit they are. */
|
|
11
21
|
share: number;
|
|
12
|
-
}
|
|
22
|
+
}>;
|
|
23
|
+
/** What a `TreemapPlot`'s `tooltip.format` gets in its third argument - see {@link TreemapRowContext}. */
|
|
24
|
+
export type TreemapTooltipContext = TreemapRowContext;
|
|
13
25
|
/**
|
|
14
26
|
* `TreemapPlot`'s public props: flat rows, a tile each, on no axes. `value` is a tile's area, and `grouping` what
|
|
15
27
|
* the tiles nest by (`'sector.branch'`, outermost first), whose outermost level colors them.
|
|
16
28
|
*/
|
|
17
|
-
export type TreemapPlotProps<TData extends Record<string, unknown>> = BasePlotProps<NonAxisDataProps<TData, 'value'>, TData, AxisBasedStylesConfig, BarSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>, undefined, TreemapTooltipContext>;
|
|
29
|
+
export type TreemapPlotProps<TData extends Record<string, unknown>> = BasePlotProps<NonAxisDataProps<TData, 'value'>, TData, WithValues<AxisBasedStylesConfig, BoxLabelConfig>, BarSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>, undefined, TreemapTooltipContext>;
|
|
18
30
|
/** What `TreemapPlot`'s core draws from. */
|
|
19
|
-
export type TreemapPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<NonAxisDataProps<TData, 'value'>, TData, AxisBasedStylesConfig, BarSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
31
|
+
export type TreemapPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<NonAxisDataProps<TData, 'value'>, TData, WithValues<AxisBasedStylesConfig, BoxLabelConfig>, BarSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BarSegmentStyle } from '../../segments/common';
|
|
2
|
-
import type { AxisPlotState,
|
|
2
|
+
import type { AxisPlotState, AxisPlotEnv } from '../../../phases';
|
|
3
3
|
/** TreemapPlot's pipeline state: the shared axis-based state, over a unit square its tiles are laid out in. */
|
|
4
4
|
export type TreemapPlotState<TData extends Record<string, unknown>> = AxisPlotState<TData, BarSegmentStyle>;
|
|
5
5
|
/** The environment every TreemapPlot phase reads from, alongside the growing state. */
|
|
6
|
-
export type
|
|
6
|
+
export type TreemapPlotEnv = AxisPlotEnv;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HoverLook } from '../markers/common';
|
|
1
2
|
import type { Pipeline } from '../../phases/Pipeline';
|
|
2
3
|
import type { Snippet } from 'svelte';
|
|
3
4
|
import type { TooltipContext, TooltipOptions, TooltipProp } from '../layout/tooltip';
|
|
@@ -62,6 +63,8 @@ export type HoverConfig<TRow extends Record<string, unknown>> = {
|
|
|
62
63
|
pointMatching?: PointMatchingStrategy;
|
|
63
64
|
/** Forces the crosshair rule(s) a `hover` marker draws off entirely, overriding whatever `strategy` implies. */
|
|
64
65
|
crosshair?: boolean;
|
|
66
|
+
/** The plot kind's own hover under the strategy in force, which an author's `hover` marker is laid over as it is drawn. */
|
|
67
|
+
look?: (strategy: HoverStrategy) => HoverLook;
|
|
65
68
|
};
|
|
66
69
|
/** The `scales` prop of any plot kind. */
|
|
67
70
|
export type ScalesConfig<TData = Record<string, unknown>> = AxisBasedScalesConfig<TData> | GeoScalesConfig;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { WithValues, BarValueLabel } from '../../../layout/styles';
|
|
1
2
|
import type { BasePlotProps, PlotCoreProps } from '../../props';
|
|
2
3
|
import type { AxisBasedScalesConfig } from '../../../layout/scales';
|
|
3
4
|
import type { AxisBasedMarkersConfig } from '../../../markers/common';
|
|
@@ -5,6 +6,6 @@ import type { SeriesProps, DualAxisDataProps } from '../../data/common';
|
|
|
5
6
|
import type { GapsAwarePlotStylesConfig } from '../../../layout/styles';
|
|
6
7
|
import type { BarSegmentStyle } from '../../segments/common';
|
|
7
8
|
/** `BarPlot`'s public props. */
|
|
8
|
-
export type BarPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, GapsAwarePlotStylesConfig<BarSegmentStyle>, BarSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
9
|
+
export type BarPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, WithValues<GapsAwarePlotStylesConfig<BarSegmentStyle>, BarValueLabel>, BarSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
9
10
|
/** What `BarPlot`'s core draws from. */
|
|
10
|
-
export type BarPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, GapsAwarePlotStylesConfig<BarSegmentStyle>, BarSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
11
|
+
export type BarPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, WithValues<GapsAwarePlotStylesConfig<BarSegmentStyle>, BarValueLabel>, BarSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { AxisPlotState,
|
|
1
|
+
import type { AxisPlotState, AxisPlotEnv } from '../../../phases';
|
|
2
2
|
import type { BarSegmentStyle } from '../../segments/common';
|
|
3
3
|
/** BarPlot's pipeline state: the shared axis-based state. */
|
|
4
4
|
export type BarPlotState<TData extends Record<string, unknown>> = AxisPlotState<TData, BarSegmentStyle>;
|
|
5
5
|
/** The environment every BarPlot phase reads from, alongside the growing state. */
|
|
6
|
-
export type
|
|
6
|
+
export type BarPlotEnv = AxisPlotEnv;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BarPlotState,
|
|
1
|
+
import type { BarPlotState, BarPlotEnv } from '../bar/state';
|
|
2
2
|
/** BulletPlot's pipeline state: a bar plot's, which already carries the `target` and `ranges` it measures against. */
|
|
3
3
|
export type BulletPlotState<TData extends Record<string, unknown>> = BarPlotState<TData>;
|
|
4
4
|
/** The environment every BulletPlot phase reads from. */
|
|
5
|
-
export type
|
|
5
|
+
export type BulletPlotEnv = BarPlotEnv;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { WithValues, DotValueLabel } from '../../../layout/styles';
|
|
1
2
|
import type { BasePlotProps, PlotCoreProps } from '../../props';
|
|
2
3
|
import type { AxisBasedScalesConfig } from '../../../layout/scales';
|
|
3
4
|
import type { AxisBasedMarkersConfig } from '../../../markers/common';
|
|
@@ -5,6 +6,6 @@ import type { SeriesProps, DualAxisDataProps } from '../../data/common';
|
|
|
5
6
|
import type { ConnectorBasedStylesConfig } from '../../../layout/styles';
|
|
6
7
|
import type { LineSegmentStyle } from '../../segments/common';
|
|
7
8
|
/** `ClevelandPlot`'s public props. */
|
|
8
|
-
export type ClevelandPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, ConnectorBasedStylesConfig, LineSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
9
|
+
export type ClevelandPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, WithValues<ConnectorBasedStylesConfig, DotValueLabel>, LineSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
9
10
|
/** What `ClevelandPlot`'s core draws from. */
|
|
10
|
-
export type ClevelandPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, ConnectorBasedStylesConfig, LineSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
11
|
+
export type ClevelandPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, WithValues<ConnectorBasedStylesConfig, DotValueLabel>, LineSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|