@fundar/data-chart-telling 1.16.0 → 1.18.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 +56 -0
- package/dist/configuration/ConfigVars.svelte +14 -0
- package/dist/configuration/ConfigVars.svelte.d.ts +3 -0
- package/dist/configuration/config.svelte.d.ts +5 -0
- package/dist/configuration/config.svelte.js +20 -6
- package/dist/configuration/themes/dark.js +1 -1
- package/dist/configuration/themes/editorial.js +1 -1
- package/dist/index.d.ts +12 -4
- package/dist/index.js +4 -1
- package/dist/layout/base/BasePlotLayout.svelte +1 -1
- package/dist/layout/figure/Figure.svelte +5 -12
- package/dist/layout/figure/FigureChrome.svelte +2 -10
- package/dist/layout/geometry/GeometryLayout.svelte +219 -44
- 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.js +4 -1
- package/dist/layout/hover/HoverShapes.d.ts +44 -0
- package/dist/layout/hover/HoverShapes.js +103 -0
- package/dist/layout/hover/PlotHover.svelte.d.ts +18 -0
- package/dist/layout/hover/PlotHover.svelte.js +54 -1
- package/dist/layout/legend/DisabledStyle.d.ts +1 -1
- package/dist/layout/legend/DisabledStyle.js +1 -1
- package/dist/layout/legend/DiscreteBadgeItem.svelte +1 -1
- package/dist/layout/legend/DiscreteSection.svelte +1 -1
- package/dist/layout/legend/LegendState.svelte.d.ts +14 -2
- package/dist/layout/legend/LegendState.svelte.js +23 -4
- package/dist/layout/legend/LegendText.d.ts +4 -1
- package/dist/layout/legend/LegendText.js +7 -1
- package/dist/layout/margins/PlotMargins.svelte.d.ts +2 -2
- package/dist/layout/margins/PlotMargins.svelte.js +2 -2
- package/dist/layout/plot/Core.svelte +2 -2
- package/dist/layout/plot/Plot.svelte +4 -2
- package/dist/layout/plot/Plot.svelte.d.ts +2 -1
- package/dist/layout/plot/PublicPlotContext.d.ts +6 -0
- package/dist/layout/plot/PublicPlotContext.js +8 -0
- package/dist/layout/scales/ScalesLayout.svelte +1 -1
- package/dist/layout/styles/ValueLabels.d.ts +43 -4
- package/dist/layout/styles/ValueLabels.js +87 -19
- package/dist/layout/timeline/Timeline.svelte +5 -1
- 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 +5 -0
- package/dist/markers/MarkerKinds.js +1 -0
- package/dist/markers/area/AreaMarker.svelte +3 -0
- package/dist/markers/arrow/ArrowMarker.svelte +9 -5
- 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 +50 -96
- package/dist/markers/bollinger/BollingerMarker.svelte +3 -0
- package/dist/markers/box/BoxMarker.svelte +3 -1
- package/dist/markers/cell/CellMarker.svelte +11 -7
- package/dist/markers/contour/ContourMarker.svelte +3 -0
- package/dist/markers/delaunay/DelaunayLinkMarker.svelte +9 -5
- package/dist/markers/delaunay/DelaunayMeshMarker.svelte +3 -0
- package/dist/markers/density/DensityMarker.svelte +3 -0
- package/dist/markers/difference/DifferenceMarker.svelte +3 -0
- package/dist/markers/dot/DotMarker.svelte +11 -6
- package/dist/markers/geo/GraticuleMarker.svelte +3 -0
- package/dist/markers/geo/SphereMarker.svelte +3 -0
- package/dist/markers/hover/HoverMarker.svelte +7 -249
- package/dist/markers/hover/HoverMarker.svelte.d.ts +4 -27
- package/dist/markers/hull/HullMarker.svelte +3 -0
- package/dist/markers/image/ImageMarker.svelte +3 -0
- package/dist/markers/line/LineMarker.svelte +3 -0
- package/dist/markers/link/LinkMarker.svelte +3 -0
- package/dist/markers/raster/RasterMarker.svelte +3 -0
- package/dist/markers/rect/RectMarker.svelte +25 -17
- package/dist/markers/regression/RegressionMarker.svelte +3 -0
- package/dist/markers/rule/RuleMarker.svelte +15 -5
- package/dist/markers/text/TextFit.d.ts +44 -0
- package/dist/markers/text/TextFit.js +86 -0
- package/dist/markers/text/TextMarker.svelte +186 -90
- package/dist/markers/text/TextMarker.svelte.d.ts +2 -0
- package/dist/markers/tick/TickMarker.svelte +9 -3
- package/dist/markers/trail/TrailMarker.svelte +3 -0
- package/dist/markers/utils/BoxLabel.d.ts +58 -0
- package/dist/markers/utils/BoxLabel.js +175 -0
- package/dist/markers/utils/MarkerEvents.d.ts +23 -0
- package/dist/markers/utils/MarkerEvents.js +44 -0
- package/dist/markers/utils/MarkerLabel.svelte +33 -0
- package/dist/markers/utils/MarkerLabel.svelte.d.ts +10 -0
- package/dist/markers/utils/PointPixel.d.ts +37 -0
- package/dist/markers/utils/PointPixel.js +44 -0
- package/dist/markers/utils/RowStroke.d.ts +9 -21
- package/dist/markers/utils/RowStroke.js +10 -21
- package/dist/markers/utils/RowStyle.d.ts +26 -0
- package/dist/markers/utils/RowStyle.js +55 -0
- package/dist/markers/vector/VectorMarker.svelte +3 -0
- package/dist/markers/voronoi/VoronoiMarker.svelte +9 -5
- package/dist/markers/voronoi/VoronoiMeshMarker.svelte +3 -0
- package/dist/markers/waffle/WaffleMarker.svelte +9 -5
- package/dist/phases/Pipeline.d.ts +10 -8
- package/dist/phases/Pipeline.js +13 -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 +35 -0
- package/dist/phases/context/RowContext.js +95 -0
- package/dist/phases/data/DataPhase.d.ts +4 -4
- package/dist/phases/data/DataPhase.js +53 -12
- package/dist/phases/hover/HoverPhase.d.ts +6 -7
- package/dist/phases/hover/HoverPhase.js +28 -15
- package/dist/phases/mapping/MappingPhase.d.ts +4 -4
- package/dist/phases/mapping/MappingPhase.js +4 -3
- package/dist/phases/markers/MarkerStyles.d.ts +26 -0
- package/dist/phases/markers/MarkerStyles.js +126 -0
- package/dist/phases/markers/MarkersPhase.d.ts +5 -5
- package/dist/phases/markers/MarkersPhase.js +8 -6
- 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 +0 -16
- package/dist/phases/statistics/StatisticsPhase.js +1 -1
- 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/Transforms.js +3 -1
- package/dist/phases/transforms/TransformsPhase.d.ts +3 -3
- package/dist/phases/transforms/TransformsPhase.js +60 -6
- package/dist/phases/transforms/methods/TreemapTransform.d.ts +28 -0
- package/dist/phases/transforms/methods/TreemapTransform.js +119 -0
- package/dist/plots/correlation/heatmap/defaults.d.ts +2 -2
- package/dist/plots/correlation/heatmap/defaults.js +23 -8
- package/dist/plots/correlation/heatmap/markers.d.ts +2 -10
- package/dist/plots/correlation/heatmap/markers.js +11 -37
- package/dist/plots/correlation/scatter/defaults.d.ts +2 -2
- package/dist/plots/correlation/scatter/defaults.js +9 -3
- package/dist/plots/correlation/scatter/markers.d.ts +3 -3
- package/dist/plots/correlation/scatter/markers.js +6 -5
- package/dist/plots/distribution/box/BoxSummaries.d.ts +17 -8
- package/dist/plots/distribution/box/BoxSummaries.js +90 -40
- package/dist/plots/distribution/box/defaults.d.ts +2 -2
- package/dist/plots/distribution/box/defaults.js +9 -6
- package/dist/plots/distribution/box/markers.d.ts +2 -2
- package/dist/plots/distribution/box/markers.js +3 -3
- package/dist/plots/distribution/density/defaults.d.ts +2 -2
- package/dist/plots/distribution/density/defaults.js +17 -1
- package/dist/plots/distribution/density/markers.d.ts +2 -2
- package/dist/plots/distribution/density/markers.js +4 -4
- package/dist/plots/distribution/histogram/defaults.d.ts +2 -2
- package/dist/plots/distribution/histogram/defaults.js +22 -27
- package/dist/plots/distribution/histogram/markers.d.ts +3 -12
- package/dist/plots/distribution/histogram/markers.js +21 -62
- package/dist/plots/distribution/pyramid/defaults.d.ts +2 -2
- package/dist/plots/distribution/pyramid/defaults.js +7 -4
- package/dist/plots/distribution/pyramid/markers.d.ts +2 -12
- package/dist/plots/distribution/pyramid/markers.js +16 -66
- package/dist/plots/distribution/violin/defaults.d.ts +2 -2
- package/dist/plots/distribution/violin/defaults.js +9 -7
- package/dist/plots/distribution/violin/markers.d.ts +2 -2
- package/dist/plots/distribution/violin/markers.js +4 -4
- package/dist/plots/evolution/area/defaults.d.ts +2 -2
- package/dist/plots/evolution/area/defaults.js +1 -1
- package/dist/plots/evolution/area/markers.d.ts +2 -2
- package/dist/plots/evolution/area/markers.js +4 -4
- package/dist/plots/evolution/line/defaults.d.ts +2 -2
- package/dist/plots/evolution/line/defaults.js +1 -1
- package/dist/plots/evolution/line/markers.d.ts +2 -2
- package/dist/plots/evolution/line/markers.js +3 -3
- package/dist/plots/evolution/slope/defaults.d.ts +2 -2
- package/dist/plots/evolution/slope/defaults.js +8 -4
- package/dist/plots/evolution/slope/markers.d.ts +2 -2
- package/dist/plots/evolution/slope/markers.js +3 -3
- 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 +3 -3
- package/dist/plots/map/geo/Core.svelte +3 -3
- 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 +5 -4
- 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 +47 -0
- package/dist/plots/part-of-a-whole/treemap/Plot.svelte.d.ts +26 -0
- package/dist/plots/part-of-a-whole/treemap/defaults.d.ts +10 -0
- package/dist/plots/part-of-a-whole/treemap/defaults.js +183 -0
- package/dist/plots/ranking/bar/defaults.d.ts +2 -2
- package/dist/plots/ranking/bar/defaults.js +15 -9
- package/dist/plots/ranking/bar/markers.d.ts +4 -14
- package/dist/plots/ranking/bar/markers.js +45 -86
- package/dist/plots/ranking/bullet/defaults.d.ts +2 -2
- package/dist/plots/ranking/bullet/defaults.js +4 -4
- package/dist/plots/ranking/bullet/markers.d.ts +3 -3
- package/dist/plots/ranking/bullet/markers.js +11 -12
- package/dist/plots/ranking/cleveland/ClevelandMarkers.d.ts +3 -3
- package/dist/plots/ranking/cleveland/ClevelandMarkers.js +28 -23
- package/dist/plots/ranking/cleveland/defaults.d.ts +2 -2
- package/dist/plots/ranking/cleveland/defaults.js +7 -4
- package/dist/plots/ranking/dumbbell/defaults.d.ts +2 -2
- package/dist/plots/ranking/forest/defaults.d.ts +2 -2
- package/dist/plots/ranking/lollipop/defaults.d.ts +2 -2
- package/dist/types/configuration/styling.d.ts +31 -2
- package/dist/types/layout/context.d.ts +21 -0
- package/dist/types/layout/context.js +1 -0
- package/dist/types/layout/hover.d.ts +3 -0
- package/dist/types/layout/legend.d.ts +8 -1
- package/dist/types/layout/mapping.d.ts +12 -3
- package/dist/types/layout/scales.d.ts +6 -0
- package/dist/types/layout/styles/values.d.ts +8 -2
- package/dist/types/layout/tooltip.d.ts +11 -4
- package/dist/types/markers/axis/arrow.d.ts +2 -8
- 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 +6 -10
- package/dist/types/markers/axis/cell.d.ts +5 -5
- package/dist/types/markers/axis/delaunayLink.d.ts +2 -2
- package/dist/types/markers/axis/hover.d.ts +60 -15
- package/dist/types/markers/axis/rect.d.ts +4 -8
- package/dist/types/markers/axis/rule.d.ts +2 -16
- package/dist/types/markers/axis/tick.d.ts +2 -2
- package/dist/types/markers/axis/voronoi.d.ts +2 -2
- package/dist/types/markers/axis/waffle.d.ts +4 -3
- package/dist/types/markers/basic/dot.d.ts +2 -2
- package/dist/types/markers/basic/text.d.ts +56 -14
- package/dist/types/markers/channels/commonMarkerConfig.d.ts +8 -1
- package/dist/types/markers/channels/commonMarkerConfigWithArea.d.ts +1 -2
- package/dist/types/markers/channels/commonMarkerConfigWithLabel.d.ts +10 -0
- package/dist/types/markers/channels/commonMarkerConfigWithLabel.js +1 -0
- package/dist/types/markers/channels/commonMarkerEvents.d.ts +17 -0
- package/dist/types/markers/channels/commonMarkerEvents.js +13 -0
- package/dist/types/markers/common.d.ts +1 -0
- package/dist/types/markers/common.js +1 -0
- package/dist/types/markers/geo/contour.d.ts +2 -1
- package/dist/types/markers/geo/graticule.d.ts +2 -1
- package/dist/types/markers/geo/link.d.ts +2 -1
- package/dist/types/markers/geo/sphere.d.ts +2 -1
- package/dist/types/markers/geo/vector.d.ts +2 -1
- 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 +7 -2
- package/dist/types/phases/hover/phase.d.ts +10 -5
- 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 -3
- 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 +8 -1
- package/dist/types/phases/statistics/phase.d.ts +2 -1
- package/dist/types/phases/styles/phase.d.ts +3 -2
- package/dist/types/phases/transforms/phase.d.ts +13 -2
- package/dist/types/plots/constants.d.ts +17 -19
- package/dist/types/plots/correlation/heatmap/props.d.ts +3 -3
- package/dist/types/plots/correlation/heatmap/state.d.ts +2 -2
- package/dist/types/plots/correlation/scatter/props.d.ts +3 -3
- package/dist/types/plots/correlation/scatter/state.d.ts +2 -2
- package/dist/types/plots/data/common.d.ts +19 -6
- package/dist/types/plots/data/geo.d.ts +1 -1
- package/dist/types/plots/distribution/box/props.d.ts +25 -3
- package/dist/types/plots/distribution/box/state.d.ts +6 -17
- package/dist/types/plots/distribution/density/props.d.ts +3 -11
- package/dist/types/plots/distribution/density/state.d.ts +2 -2
- package/dist/types/plots/distribution/histogram/props.d.ts +16 -11
- package/dist/types/plots/distribution/histogram/state.d.ts +2 -2
- package/dist/types/plots/distribution/pyramid/props.d.ts +3 -3
- package/dist/types/plots/distribution/pyramid/state.d.ts +2 -2
- package/dist/types/plots/distribution/violin/props.d.ts +4 -3
- package/dist/types/plots/distribution/violin/state.d.ts +2 -2
- package/dist/types/plots/evolution/area/props.d.ts +3 -3
- package/dist/types/plots/evolution/area/state.d.ts +2 -2
- package/dist/types/plots/evolution/line/props.d.ts +3 -3
- 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/map/geo/state.d.ts +1 -1
- package/dist/types/plots/part-of-a-whole/treemap/props.d.ts +29 -0
- package/dist/types/plots/part-of-a-whole/treemap/props.js +1 -0
- package/dist/types/plots/part-of-a-whole/treemap/state.d.ts +6 -0
- package/dist/types/plots/part-of-a-whole/treemap/state.js +1 -0
- package/dist/types/plots/props.d.ts +10 -4
- package/dist/types/plots/ranking/bar/props.d.ts +3 -3
- 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 -3
- package/dist/types/plots/ranking/cleveland/state.d.ts +2 -2
- package/dist/types/plots/ranking/dumbbell/props.d.ts +3 -3
- package/dist/types/plots/ranking/dumbbell/state.d.ts +2 -2
- package/dist/types/plots/ranking/forest/props.d.ts +3 -3
- package/dist/types/plots/ranking/forest/state.d.ts +2 -2
- package/dist/types/plots/ranking/lollipop/props.d.ts +3 -3
- package/dist/types/plots/ranking/lollipop/state.d.ts +2 -2
- package/dist/types/plots/styling.d.ts +24 -0
- package/dist/types/transforms/index.d.ts +3 -1
- package/dist/types/transforms/treemap.d.ts +32 -0
- package/dist/types/transforms/treemap.js +5 -0
- package/dist/utils/color/ColorTones.d.ts +19 -0
- package/dist/utils/color/ColorTones.js +64 -0
- package/dist/utils/color/CssColor.d.ts +14 -5
- package/dist/utils/color/CssColor.js +69 -27
- package/dist/utils/color/index.d.ts +4 -0
- package/dist/utils/color/index.js +4 -0
- package/dist/utils/grouping.d.ts +18 -1
- package/dist/utils/grouping.js +31 -0
- package/docs/concepts.md +3 -2
- package/docs/legend.md +8 -5
- package/docs/markers.md +110 -28
- 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 +103 -0
- package/docs/plots/ranking/bar.md +2 -1
- package/docs/plots/ranking/cleveland.md +1 -1
- package/docs/plots.md +21 -20
- package/docs/scales.md +3 -0
- package/docs/state.md +34 -1
- package/docs/styles-and-segments.md +20 -19
- package/docs/theming.md +6 -12
- package/docs/tooltip-and-hover.md +81 -3
- package/docs/transforms-and-statistics.md +17 -16
- package/examples/LineDates.svelte +1 -1
- package/examples/ResponsiveLine.svelte +3 -1
- package/examples/Treemap.svelte +13 -0
- package/examples/TreemapHover.svelte +25 -0
- package/examples/ValueLabels.svelte +1 -1
- package/examples/datasets/economic-activity.ts +40 -0
- package/examples/datasets/index.ts +1 -0
- package/llms-full.txt +11 -9
- package/llms.txt +4 -1
- package/package.json +3 -1
|
@@ -13,7 +13,7 @@ export type AxisFit = Partial<AnyAxisScale> & {
|
|
|
13
13
|
* numeric axis to cover derived markers and transformed ranges; these say
|
|
14
14
|
* where a kind goes beyond that.
|
|
15
15
|
*/
|
|
16
|
-
export type ScalesStageOptions<TState,
|
|
16
|
+
export type ScalesStageOptions<TState, TEnv> = {
|
|
17
17
|
/** Axes whose marks grow from zero, so a domain this stage sets still reaches it - by name or by role (`'value'`). */
|
|
18
18
|
zero?: AxisRef[];
|
|
19
19
|
/** Axes that reach as far below zero as above it, to the largest magnitude - by name or by role. */
|
|
@@ -21,10 +21,10 @@ export type ScalesStageOptions<TState, TCtx> = {
|
|
|
21
21
|
/** Keeps a category axis in the order the data gives it. Without it, categories sort ascending, as svelteplot does. */
|
|
22
22
|
bandOrder?: 'data';
|
|
23
23
|
/** The kind's own options for an axis, by name or by role, under the author's `scales`: padding, label anchor, tick format. */
|
|
24
|
-
defaults?: (state: TState,
|
|
24
|
+
defaults?: (state: TState, env: TEnv) => Partial<Record<AxisRef, AnyAxisScale>>;
|
|
25
25
|
/** The options the kind fits to its own marks on an axis the author left unpinned - a niced value axis, a domain padded for its dots. */
|
|
26
|
-
fit?: (state: TState,
|
|
26
|
+
fit?: (state: TState, env: TEnv) => Partial<Record<AxisChannelName, AxisFit>>;
|
|
27
27
|
/** The kind's own extra "scales" output, once every scale is in place. */
|
|
28
|
-
extend?: (state: TState,
|
|
28
|
+
extend?: (state: TState, env: TEnv) => TState;
|
|
29
29
|
};
|
|
30
30
|
export {};
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* of a plot shares, `tooltip`, how a hovered row reads once
|
|
5
5
|
* everything it reads from is placed, and `hover`, what the pointer can match.
|
|
6
6
|
*/
|
|
7
|
-
export type PlotPhase = 'facet' | 'data' | 'mapping' | 'transforms' | 'statistics' | 'sharedScales' | 'scales' | 'styles' | 'markers' | 'coordinates' | 'tooltip' | 'hover';
|
|
7
|
+
export type PlotPhase = 'facet' | 'data' | 'mapping' | 'transforms' | 'context' | 'statistics' | 'sharedScales' | 'scales' | 'styles' | 'markers' | 'coordinates' | 'tooltip' | 'hover';
|
|
8
8
|
/** A resolution step for one {@link PlotPhase} - same state shape in and out. Each shared phase is a class (`DataPhase`, `HoverPhase`...) that implements it. */
|
|
9
|
-
export type PhaseStage<TState,
|
|
9
|
+
export type PhaseStage<TState, TEnv = unknown> = {
|
|
10
10
|
phase: PlotPhase;
|
|
11
|
-
run: (state: TState,
|
|
11
|
+
run: (state: TState, env: TEnv) => TState;
|
|
12
12
|
};
|
|
@@ -57,6 +57,11 @@ export type AxisPlotState<TData extends Record<string, unknown>, TStyle extends
|
|
|
57
57
|
/** What each position channel is, which one holds the categories, and which way the plot runs. */
|
|
58
58
|
axes?: PlotAxes;
|
|
59
59
|
resolvedSeries?: TSeries[];
|
|
60
|
+
/** The series the legend took out of the rows, and how (`'omit'` or `'rescale'`): a part of a whole still reads its whole from them. */
|
|
61
|
+
removedSeries?: {
|
|
62
|
+
mode: 'omit' | 'rescale';
|
|
63
|
+
series: TSeries[];
|
|
64
|
+
};
|
|
60
65
|
seriesGrouping?: Accessor<any, unknown>;
|
|
61
66
|
/** Every series name, before legend-omitted ones are dropped, so colors stay put. */
|
|
62
67
|
allSeriesNames?: string[];
|
|
@@ -66,6 +71,8 @@ export type AxisPlotState<TData extends Record<string, unknown>, TStyle extends
|
|
|
66
71
|
flat?: TRow[];
|
|
67
72
|
scopedGroups?: ScopedMarkerGroup<TData>[];
|
|
68
73
|
colorForSeries?: (name: string) => string;
|
|
74
|
+
/** The color of a path of the `grouping` levels, outermost first, while `scales.color.depth` reaches past the outermost (see `ColorTones.hierarchy`). */
|
|
75
|
+
colorForPath?: (path: readonly string[]) => string;
|
|
69
76
|
/** A discrete mark's gap fills, per series id: the value each missing row is drawn at. */
|
|
70
77
|
gapFillMaps?: Map<string, Map<TData, DiscreteGapFill<TStyle>>>;
|
|
71
78
|
channels?: ResolvedChannels<TData>;
|
|
@@ -84,7 +91,7 @@ export type AxisPlotState<TData extends Record<string, unknown>, TStyle extends
|
|
|
84
91
|
hoverRows?: unknown[];
|
|
85
92
|
};
|
|
86
93
|
/** The environment every axis-based plot's phases read from, alongside the growing state. */
|
|
87
|
-
export type
|
|
94
|
+
export type AxisPlotEnv = {
|
|
88
95
|
cfg: PlotStylesConfig;
|
|
89
96
|
/** The legend's toggles and the figure's hover, read for one plot: which series show and how each dims. */
|
|
90
97
|
interaction?: PlotInteraction;
|
|
@@ -13,7 +13,8 @@ import type { PlotAxes } from '../../../phases/data/PlotAxes';
|
|
|
13
13
|
export type StatisticsStageState = Pick<FacetStageState, 'panels'> & {
|
|
14
14
|
x?: Accessor<any, AxisValue>;
|
|
15
15
|
y?: Accessor<any, AxisValue>;
|
|
16
|
-
|
|
16
|
+
/** The key the "data" phase split the rows into series by, which an author marker inherits. */
|
|
17
|
+
seriesGrouping?: Accessor<any, unknown>;
|
|
17
18
|
color?: Accessor<any, unknown>;
|
|
18
19
|
statistics?: StatisticConfig[];
|
|
19
20
|
authorMarkers?: AxisBasedMarkersConfig[];
|
|
@@ -1,3 +1,4 @@
|
|
|
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
4
|
import type { ValueAnchor } from '../../plots/constants';
|
|
@@ -7,8 +8,8 @@ export type ValueLabelsOptions<TState> = {
|
|
|
7
8
|
show?: boolean;
|
|
8
9
|
/** Where a label sits when `styles.values.anchor` is unset. Defaults to `'outside'`. */
|
|
9
10
|
anchor?: ValueAnchor;
|
|
10
|
-
/** 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. */
|
|
11
|
-
format?: (value: number,
|
|
11
|
+
/** 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. */
|
|
12
|
+
format?: (value: number, number: (value: number) => string, context: PlotRowContext) => string;
|
|
12
13
|
/**
|
|
13
14
|
* Where the labels are expected to sit, from the whole data: boxes around
|
|
14
15
|
* the points they label, on the plot edges those points can reach (see
|
|
@@ -26,6 +26,11 @@ export type ProcessedData = {
|
|
|
26
26
|
/** What the shared "transforms" stage reads from and writes to a plot's state. */
|
|
27
27
|
export type TransformsStageState = {
|
|
28
28
|
resolvedSeries?: Series<any>[];
|
|
29
|
+
/** The series the legend took out of the rows, and how. */
|
|
30
|
+
removedSeries?: {
|
|
31
|
+
mode: 'omit' | 'rescale';
|
|
32
|
+
series: Series<any>[];
|
|
33
|
+
};
|
|
29
34
|
/** The style every segment of a series is drawn over, which the processed groups are cut with too. */
|
|
30
35
|
segmentBase?: (series: string) => any;
|
|
31
36
|
axes?: PlotAxes;
|
|
@@ -46,9 +51,15 @@ export type TransformsStageState = {
|
|
|
46
51
|
processedGroups?: VisualGroup<Series<ProcessedRow>, any>[];
|
|
47
52
|
};
|
|
48
53
|
/** What differs between plots in the shared "transforms" stage. */
|
|
49
|
-
export type TransformsStageOptions<TState extends TransformsStageState,
|
|
54
|
+
export type TransformsStageOptions<TState extends TransformsStageState, TEnv> = {
|
|
50
55
|
/** The transforms to run. Defaults to the plot's own `transforms`. */
|
|
51
|
-
transforms?: (state: TState,
|
|
56
|
+
transforms?: (state: TState, env: TEnv) => MarkerTransform[];
|
|
57
|
+
/**
|
|
58
|
+
* Whether a series the legend omits keeps its part of the whole (a treemap's tile): the transforms run over
|
|
59
|
+
* its rows too, so every other part keeps its share and its place, and its own rows are dropped after.
|
|
60
|
+
* Unset, an omitted series is not there for the transforms at all (a stack closes over it).
|
|
61
|
+
*/
|
|
62
|
+
keepsOmitted?: boolean;
|
|
52
63
|
/**
|
|
53
64
|
* How the processed rows split into `processedGroups`: one group per series
|
|
54
65
|
* (the default), or `'runs'` of consecutive rows from the same series, in
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
* of a pyramid bar from zero, right of a line's last point).
|
|
9
|
-
* - `'middle'` - centred on the mark.
|
|
10
|
-
* - `'end'` - at the baseline/zero end of the mark.
|
|
2
|
+
* Where something sits in a box, in a frame or on a shape: its middle, against one of its edges as they are drawn on
|
|
3
|
+
* the page, or in one of its corners. The anchors of a text marker's `frameAnchor`, and of a shape's `label`.
|
|
4
|
+
*/
|
|
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:
|
|
11
8
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* `
|
|
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
16
|
*/
|
|
17
|
-
export type ValueAnchor = 'outside' | 'start' | '
|
|
17
|
+
export type ValueAnchor = LabelAnchor | 'outside' | 'start' | 'end' | 'tip' | 'base';
|
|
18
18
|
/**
|
|
19
19
|
* Shared by two unrelated renderers: a `dot` mark's own point shape
|
|
20
20
|
* (delegated to svelteplot/d3-shape) and a discrete legend item's own icon
|
|
@@ -32,11 +32,9 @@ export type FontWeight = 'normal' | 'bold' | number;
|
|
|
32
32
|
/** `font-style` keyword accepted by any text styling. */
|
|
33
33
|
export type FontStyleKeyword = 'normal' | 'italic';
|
|
34
34
|
/**
|
|
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'`.
|
|
35
|
+
* Horizontal text anchor. `'outside'` leaves the side to the mark that writes
|
|
36
|
+
* the label, where it picks one per point (a Cleveland plot's labels take
|
|
37
|
+
* their own); elsewhere it's treated the same as `'start'`.
|
|
40
38
|
*/
|
|
41
39
|
export type TextAnchor = 'start' | 'middle' | 'end' | 'outside';
|
|
42
40
|
/** Vertical text anchor. */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { BasePlotProps, PlotCoreProps } from '../../props';
|
|
2
2
|
import type { AxisBasedScalesConfig } from '../../../layout/scales';
|
|
3
3
|
import type { AxisBasedMarkersConfig } from '../../../markers/common';
|
|
4
|
-
import type { SeriesProps,
|
|
4
|
+
import type { SeriesProps, DualAxisDataProps } from '../../data/common';
|
|
5
5
|
import type { AxisBasedStylesConfig } from '../../../layout/styles';
|
|
6
6
|
import type { CellSegmentStyle } from '../../segments/common';
|
|
7
7
|
/** `HeatmapPlot`'s public props. */
|
|
8
|
-
export type HeatmapPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> |
|
|
8
|
+
export type HeatmapPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, AxisBasedStylesConfig, CellSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
9
9
|
/** What `HeatmapPlot`'s core draws from. */
|
|
10
|
-
export type HeatmapPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> |
|
|
10
|
+
export type HeatmapPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, AxisBasedStylesConfig, 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,10 +1,10 @@
|
|
|
1
1
|
import type { BasePlotProps, PlotCoreProps } from '../../props';
|
|
2
2
|
import type { AxisBasedScalesConfig } from '../../../layout/scales';
|
|
3
3
|
import type { AxisBasedMarkersConfig } from '../../../markers/common';
|
|
4
|
-
import type { SeriesProps,
|
|
4
|
+
import type { SeriesProps, DualAxisDataProps } from '../../data/common';
|
|
5
5
|
import type { AxisBasedStylesConfig } from '../../../layout/styles';
|
|
6
6
|
import type { ScatterSegmentStyle } from '../../segments/common';
|
|
7
7
|
/** `ScatterPlot`'s public props. */
|
|
8
|
-
export type ScatterPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> |
|
|
8
|
+
export type ScatterPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, AxisBasedStylesConfig, ScatterSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
9
9
|
/** What `ScatterPlot`'s core draws from. */
|
|
10
|
-
export type ScatterPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> |
|
|
10
|
+
export type ScatterPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, AxisBasedStylesConfig, 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,4 +1,4 @@
|
|
|
1
|
-
import type { AxisValue, AxisChannelName, ChannelAccessors } from '../../layout/mapping';
|
|
1
|
+
import type { AxisValue, AxisChannelName, ChannelAccessors, ChannelName } from '../../layout/mapping';
|
|
2
2
|
/**
|
|
3
3
|
* A field key or accessor function. Mirrors the shorthand used across plots
|
|
4
4
|
* so chart-level encodings (`x`, `y`, `color`, facet, timeline) feel
|
|
@@ -27,7 +27,7 @@ export type Series<T extends Record<string, unknown> = Record<string, unknown>>
|
|
|
27
27
|
/** The channels a pre-built {@link Series} carries itself, so a plot given `series` takes none of them. */
|
|
28
28
|
type SeriesChannelName = AxisChannelName | 'color' | 'grouping';
|
|
29
29
|
/**
|
|
30
|
-
* Pre-built series. Mutually exclusive with {@link
|
|
30
|
+
* Pre-built series. Mutually exclusive with the data props ({@link DualAxisDataProps}...) - takes
|
|
31
31
|
* precedence when both could apply. Any channel a series doesn't carry
|
|
32
32
|
* itself is still a plot-level prop.
|
|
33
33
|
*/
|
|
@@ -37,12 +37,25 @@ export type SeriesProps<T extends Record<string, unknown>> = {
|
|
|
37
37
|
} & {
|
|
38
38
|
[K in SeriesChannelName]?: never;
|
|
39
39
|
} & Omit<ChannelAccessors<T>, SeriesChannelName>;
|
|
40
|
+
/** The channels of `TRequired` as required props. */
|
|
41
|
+
type RequiredChannels<T extends Record<string, unknown>, TRequired extends ChannelName> = Required<Pick<ChannelAccessors<T>, TRequired>>;
|
|
40
42
|
/**
|
|
41
|
-
* Flat rows to group into series, as an alternative to {@link SeriesProps}
|
|
42
|
-
*
|
|
43
|
+
* Flat rows to group into series, as an alternative to {@link SeriesProps}, on a plot with no axes (a treemap):
|
|
44
|
+
* every channel but the position ones. `TRequired` names the channels the plot cannot draw without. The base of
|
|
45
|
+
* {@link SingleAxisDataProps} and {@link DualAxisDataProps}.
|
|
43
46
|
*/
|
|
44
|
-
export type
|
|
47
|
+
export type NonAxisDataProps<T extends Record<string, unknown>, TRequired extends Exclude<ChannelName, AxisChannelName> = never> = {
|
|
45
48
|
series?: never;
|
|
46
49
|
data: T[];
|
|
47
|
-
|
|
50
|
+
x?: never;
|
|
51
|
+
y?: never;
|
|
52
|
+
} & Omit<ChannelAccessors<T>, AxisChannelName> & RequiredChannels<T, TRequired>;
|
|
53
|
+
/** Flat rows on one axis (a histogram): `x`, or `y` alone, besides every other channel. */
|
|
54
|
+
export type SingleAxisDataProps<T extends Record<string, unknown>, TRequired extends Exclude<ChannelName, AxisChannelName> = never> = Omit<NonAxisDataProps<T, TRequired>, AxisChannelName> & ((RequiredChannels<T, 'x'> & {
|
|
55
|
+
y?: never;
|
|
56
|
+
}) | (RequiredChannels<T, 'y'> & {
|
|
57
|
+
x?: never;
|
|
58
|
+
}));
|
|
59
|
+
/** Flat rows on both axes: `x` and `y`, besides every other channel. */
|
|
60
|
+
export type DualAxisDataProps<T extends Record<string, unknown>, TRequired extends Exclude<ChannelName, AxisChannelName> = never> = Omit<NonAxisDataProps<T, TRequired>, AxisChannelName> & RequiredChannels<T, AxisChannelName>;
|
|
48
61
|
export {};
|
|
@@ -25,7 +25,7 @@ export type Topology = {
|
|
|
25
25
|
bbox?: number[];
|
|
26
26
|
};
|
|
27
27
|
/**
|
|
28
|
-
* Data contract for GeoPlot - the geo analog of {@link
|
|
28
|
+
* Data contract for GeoPlot - the geo analog of {@link DualAxisDataProps}/{@link SeriesProps}
|
|
29
29
|
* (`$lib/types/plots/data/common`). There's no x/y axis pair for geographic data:
|
|
30
30
|
* `data` IS the map.
|
|
31
31
|
*/
|
|
@@ -1,10 +1,32 @@
|
|
|
1
|
+
import type { KindRowContext } from '../../../layout/context';
|
|
2
|
+
import type { AxisValue } from '../../../layout/mapping';
|
|
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
|
-
import type { SeriesProps,
|
|
6
|
+
import type { SeriesProps, DualAxisDataProps } from '../../data/common';
|
|
5
7
|
import type { AxisBasedStylesConfig } from '../../../layout/styles';
|
|
6
8
|
import type { AreaStyle } from '../../styling';
|
|
9
|
+
/**
|
|
10
|
+
* One box's summary: its category, its quartiles, the whisker ends (the farthest values within 1.5 IQR of the box),
|
|
11
|
+
* how many values it has and the ones past the whiskers.
|
|
12
|
+
*/
|
|
13
|
+
export type BoxSummary = {
|
|
14
|
+
category: AxisValue;
|
|
15
|
+
min: number;
|
|
16
|
+
p25: number;
|
|
17
|
+
median: number;
|
|
18
|
+
p75: number;
|
|
19
|
+
max: number;
|
|
20
|
+
count: number;
|
|
21
|
+
outliers: number[];
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* What a `BoxPlot` or a `ViolinPlot` knows of a row, which its tooltip's and value labels' `format`, its hover and
|
|
25
|
+
* `usePlot().contextOf` read: the summary of the box (or violin) it is in. A value's own `value` stays its own; a
|
|
26
|
+
* hovered box's is its median.
|
|
27
|
+
*/
|
|
28
|
+
export type BoxRowContext = KindRowContext<BoxSummary>;
|
|
7
29
|
/** `BoxPlot`'s public props. */
|
|
8
|
-
export type BoxPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> |
|
|
30
|
+
export type BoxPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, AxisBasedStylesConfig, AreaStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>, undefined, BoxRowContext>;
|
|
9
31
|
/** What `BoxPlot`'s core draws from. */
|
|
10
|
-
export type BoxPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> |
|
|
32
|
+
export type BoxPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, AxisBasedStylesConfig, 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,23 +1,15 @@
|
|
|
1
1
|
import type { BasePlotProps, PlotCoreProps } from '../../props';
|
|
2
2
|
import type { AxisBasedScalesConfig } from '../../../layout/scales';
|
|
3
3
|
import type { AxisBasedMarkersConfig } from '../../../markers/common';
|
|
4
|
-
import type { SeriesProps,
|
|
4
|
+
import type { SeriesProps, SingleAxisDataProps } from '../../data/common';
|
|
5
5
|
import type { CurveAwarePlotStylesConfig } from '../../../layout/styles';
|
|
6
6
|
import type { AreaStyle } from '../../styling';
|
|
7
|
-
import type { AxisChannelName, ChannelAccessors } from '../../../layout/mapping';
|
|
8
|
-
/** Flat rows estimated along one axis: `x` for a vertical curve, or `y` alone for a horizontal one. */
|
|
9
|
-
type DensityDataProps<TRow extends Record<string, unknown>> = Omit<DataProps<TRow>, AxisChannelName> & ((Required<Pick<ChannelAccessors<TRow>, 'x'>> & {
|
|
10
|
-
y?: never;
|
|
11
|
-
}) | (Required<Pick<ChannelAccessors<TRow>, 'y'>> & {
|
|
12
|
-
x?: never;
|
|
13
|
-
}));
|
|
14
7
|
/** `styles` of `DensityPlot`: the curve of the estimate, and the mark that draws it. */
|
|
15
8
|
export type DensityPlotStylesConfig = CurveAwarePlotStylesConfig & {
|
|
16
9
|
/** The mark drawing each estimate: a filled `'area'` or a `'line'`. Defaults to `'area'`. */
|
|
17
10
|
mark?: 'area' | 'line';
|
|
18
11
|
};
|
|
19
12
|
/** `DensityPlot`'s public props. */
|
|
20
|
-
export type DensityPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> |
|
|
13
|
+
export type DensityPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | SingleAxisDataProps<TData>, TData, DensityPlotStylesConfig, AreaStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
21
14
|
/** What `DensityPlot`'s core draws from. */
|
|
22
|
-
export type DensityPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> |
|
|
23
|
-
export {};
|
|
15
|
+
export type DensityPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | SingleAxisDataProps<TData>, TData, DensityPlotStylesConfig, 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
|
/** 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,18 +1,23 @@
|
|
|
1
|
+
import type { KindRowContext } from '../../../layout/context';
|
|
1
2
|
import type { BasePlotProps, PlotCoreProps } from '../../props';
|
|
2
3
|
import type { AxisBasedScalesConfig } from '../../../layout/scales';
|
|
3
4
|
import type { AxisBasedMarkersConfig } from '../../../markers/common';
|
|
4
|
-
import type { SeriesProps,
|
|
5
|
+
import type { SeriesProps, SingleAxisDataProps } from '../../data/common';
|
|
5
6
|
import type { AxisBasedStylesConfig } from '../../../layout/styles';
|
|
6
7
|
import type { AreaStyle } from '../../styling';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
/**
|
|
9
|
+
* What a `HistogramPlot` knows of a bin, which its tooltip's and value labels' `format`, its hover and
|
|
10
|
+
* `usePlot().contextOf` read: its `count` (also its `value`) and the edges it spans.
|
|
11
|
+
*/
|
|
12
|
+
export type HistogramRowContext = KindRowContext<{
|
|
13
|
+
/** How many values fall in the bin. */
|
|
14
|
+
count: number;
|
|
15
|
+
/** The bin's lower edge. */
|
|
16
|
+
from: number;
|
|
17
|
+
/** The bin's upper edge. */
|
|
18
|
+
to: number;
|
|
19
|
+
}>;
|
|
14
20
|
/** `HistogramPlot`'s public props. */
|
|
15
|
-
export type HistogramPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> |
|
|
21
|
+
export type HistogramPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | SingleAxisDataProps<TData>, TData, AxisBasedStylesConfig, AreaStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>, undefined, HistogramRowContext>;
|
|
16
22
|
/** What `HistogramPlot`'s core draws from. */
|
|
17
|
-
export type HistogramPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> |
|
|
18
|
-
export {};
|
|
23
|
+
export type HistogramPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | SingleAxisDataProps<TData>, TData, AxisBasedStylesConfig, 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,10 +1,10 @@
|
|
|
1
1
|
import type { BasePlotProps, PlotCoreProps } from '../../props';
|
|
2
2
|
import type { AxisBasedScalesConfig } from '../../../layout/scales';
|
|
3
3
|
import type { AxisBasedMarkersConfig } from '../../../markers/common';
|
|
4
|
-
import type { SeriesProps,
|
|
4
|
+
import type { SeriesProps, DualAxisDataProps } from '../../data/common';
|
|
5
5
|
import type { GapsAwarePlotStylesConfig } from '../../../layout/styles';
|
|
6
6
|
import type { BarSegmentStyle } from '../../segments/common';
|
|
7
7
|
/** `PyramidPlot`'s public props. */
|
|
8
|
-
export type PyramidPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> |
|
|
8
|
+
export type PyramidPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, GapsAwarePlotStylesConfig<BarSegmentStyle>, BarSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
9
9
|
/** What `PyramidPlot`'s core draws from. */
|
|
10
|
-
export type PyramidPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> |
|
|
10
|
+
export type PyramidPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, GapsAwarePlotStylesConfig<BarSegmentStyle>, 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,7 +1,8 @@
|
|
|
1
|
+
import type { BoxRowContext } from '../box/props';
|
|
1
2
|
import type { BasePlotProps, PlotCoreProps } from '../../props';
|
|
2
3
|
import type { AxisBasedScalesConfig } from '../../../layout/scales';
|
|
3
4
|
import type { AxisBasedMarkersConfig } from '../../../markers/common';
|
|
4
|
-
import type { SeriesProps,
|
|
5
|
+
import type { SeriesProps, DualAxisDataProps } from '../../data/common';
|
|
5
6
|
import type { AxisBasedStylesConfig } from '../../../layout/styles';
|
|
6
7
|
import type { AreaStyle } from '../../styling';
|
|
7
8
|
import type { DensityKernel } from '../../../transforms/density';
|
|
@@ -18,6 +19,6 @@ export type ViolinPlotStylesConfig = AxisBasedStylesConfig & {
|
|
|
18
19
|
box?: boolean | number;
|
|
19
20
|
};
|
|
20
21
|
/** `ViolinPlot`'s public props. */
|
|
21
|
-
export type ViolinPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> |
|
|
22
|
+
export type ViolinPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, ViolinPlotStylesConfig, AreaStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>, undefined, BoxRowContext>;
|
|
22
23
|
/** What `ViolinPlot`'s core draws from. */
|
|
23
|
-
export type ViolinPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> |
|
|
24
|
+
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,10 +1,10 @@
|
|
|
1
1
|
import type { BasePlotProps, PlotCoreProps } from '../../props';
|
|
2
2
|
import type { AxisBasedScalesConfig } from '../../../layout/scales';
|
|
3
3
|
import type { AxisBasedMarkersConfig } from '../../../markers/common';
|
|
4
|
-
import type { SeriesProps,
|
|
4
|
+
import type { SeriesProps, DualAxisDataProps } from '../../data/common';
|
|
5
5
|
import type { AxisBasedStylesConfig } from '../../../layout/styles';
|
|
6
6
|
import type { AreaStyle } from '../../styling';
|
|
7
7
|
/** `AreaPlot`'s public props. */
|
|
8
|
-
export type AreaPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> |
|
|
8
|
+
export type AreaPlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, AxisBasedStylesConfig, AreaStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
9
9
|
/** What `AreaPlot`'s core draws from. */
|
|
10
|
-
export type AreaPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> |
|
|
10
|
+
export type AreaPlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, AxisBasedStylesConfig, 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,10 +1,10 @@
|
|
|
1
1
|
import type { BasePlotProps, PlotCoreProps } from '../../props';
|
|
2
2
|
import type { AxisBasedScalesConfig } from '../../../layout/scales';
|
|
3
3
|
import type { AxisBasedMarkersConfig } from '../../../markers/common';
|
|
4
|
-
import type { SeriesProps,
|
|
4
|
+
import type { SeriesProps, DualAxisDataProps } from '../../data/common';
|
|
5
5
|
import type { CurveAwarePlotStylesConfig, GapsAwarePlotStylesConfig } from '../../../layout/styles';
|
|
6
6
|
import type { LineSegmentStyle } from '../../segments/common';
|
|
7
7
|
/** `LinePlot`'s public props. */
|
|
8
|
-
export type LinePlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> |
|
|
8
|
+
export type LinePlotProps<TData extends Record<string, unknown>> = BasePlotProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, GapsAwarePlotStylesConfig<LineSegmentStyle> & CurveAwarePlotStylesConfig, LineSegmentStyle, AxisBasedMarkersConfig, AxisBasedScalesConfig<TData>>;
|
|
9
9
|
/** What `LinePlot`'s core draws from. */
|
|
10
|
-
export type LinePlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> |
|
|
10
|
+
export type LinePlotCoreProps<TData extends Record<string, unknown>> = PlotCoreProps<SeriesProps<TData> | DualAxisDataProps<TData>, TData, GapsAwarePlotStylesConfig<LineSegmentStyle> & CurveAwarePlotStylesConfig, 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;
|
|
@@ -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;
|