@fundar/data-chart-telling 0.0.25 → 0.0.27

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.
Files changed (198) hide show
  1. package/dist/charts/BaseChart.svelte +18 -10
  2. package/dist/charts/BaseChart.svelte.d.ts +4 -2
  3. package/dist/charts/bar/Chart.svelte +2 -0
  4. package/dist/charts/heatmap/Chart.svelte +5 -3
  5. package/dist/charts/heatmap/Chart.svelte.d.ts +1 -2
  6. package/dist/charts/line/Chart.svelte +2 -0
  7. package/dist/charts/pyramid/Chart.svelte +5 -3
  8. package/dist/charts/pyramid/Chart.svelte.d.ts +1 -2
  9. package/dist/charts/scatter/Chart.svelte +95 -0
  10. package/dist/charts/scatter/Chart.svelte.d.ts +28 -0
  11. package/dist/configuration/config.svelte.js +28 -0
  12. package/dist/configuration/themes/dark.js +4 -0
  13. package/dist/configuration/themes/index.d.ts +112 -0
  14. package/dist/index.d.ts +26 -16
  15. package/dist/index.js +11 -3
  16. package/dist/layout/coordinates/CoordinatesLayout.svelte +93 -0
  17. package/dist/layout/{plot/RuleLayout.svelte.d.ts → coordinates/CoordinatesLayout.svelte.d.ts} +13 -16
  18. package/dist/layout/coordinates/margins.d.ts +16 -0
  19. package/dist/layout/coordinates/margins.js +11 -0
  20. package/dist/{plots/geo → layout/coordinates}/projections/argentina.d.ts +1 -1
  21. package/dist/layout/{geo → coordinates}/resolveProjection.d.ts +1 -1
  22. package/dist/layout/coordinates/resolveProjection.js +24 -0
  23. package/dist/{plots/geo → layout/coordinates}/zoom.svelte.d.ts +1 -1
  24. package/dist/layout/facet/FacetIndicator.svelte +31 -0
  25. package/dist/layout/facet/FacetIndicator.svelte.d.ts +8 -0
  26. package/dist/layout/facet/FacetLayout.svelte +249 -24
  27. package/dist/layout/facet/FacetLayout.svelte.d.ts +7 -1
  28. package/dist/layout/geometry/GeometryLayout.svelte +231 -0
  29. package/dist/layout/geometry/GeometryLayout.svelte.d.ts +62 -0
  30. package/dist/layout/legend/ContinuousSection.svelte +1 -1
  31. package/dist/layout/legend/ContinuousSection.svelte.d.ts +1 -1
  32. package/dist/layout/legend/DiscreteSection.svelte +1 -1
  33. package/dist/layout/legend/DiscreteSection.svelte.d.ts +1 -1
  34. package/dist/layout/legend/LegendLayout.svelte +1 -1
  35. package/dist/layout/legend/LegendLayout.svelte.d.ts +1 -1
  36. package/dist/layout/legend/interaction.svelte.d.ts +9 -1
  37. package/dist/layout/legend/interaction.svelte.js +9 -1
  38. package/dist/layout/plot/BasePlotLayout.svelte +142 -155
  39. package/dist/layout/plot/BasePlotLayout.svelte.d.ts +61 -51
  40. package/dist/layout/plot/margins.d.ts +0 -16
  41. package/dist/layout/plot/margins.js +0 -11
  42. package/dist/layout/{plot/AxisLayout.svelte → scales/ScalesLayout.svelte} +23 -16
  43. package/dist/layout/{plot/AxisLayout.svelte.d.ts → scales/ScalesLayout.svelte.d.ts} +4 -5
  44. package/dist/layout/scales/buildScale.d.ts +8 -0
  45. package/dist/layout/scales/buildScale.js +43 -0
  46. package/dist/layout/styles/StylesLayout.svelte +75 -0
  47. package/dist/layout/styles/StylesLayout.svelte.d.ts +15 -0
  48. package/dist/{plots/geo → layout/styles}/TileLayer.svelte +2 -2
  49. package/dist/{plots/geo → layout/styles}/TileLayer.svelte.d.ts +1 -1
  50. package/dist/layout/timeline/Timeline.svelte +1 -1
  51. package/dist/layout/timeline/Timeline.svelte.d.ts +1 -1
  52. package/dist/layout/timeline/TimelineLayout.svelte +1 -1
  53. package/dist/layout/timeline/TimelineLayout.svelte.d.ts +1 -1
  54. package/dist/layout/tooltip/Tooltip.svelte +16 -20
  55. package/dist/layout/tooltip/Tooltip.svelte.d.ts +5 -0
  56. package/dist/layout/tooltip/TooltipLayout.svelte +7 -1
  57. package/dist/layout/tooltip/TooltipLayout.svelte.d.ts +4 -0
  58. package/dist/layout/tooltip/controller.svelte.d.ts +4 -5
  59. package/dist/layout/tooltip/controller.svelte.js +42 -16
  60. package/dist/layout/tooltip/resolveTooltipPlacement.d.ts +24 -0
  61. package/dist/layout/tooltip/resolveTooltipPlacement.js +49 -0
  62. package/dist/layout/tooltip/utils.d.ts +27 -19
  63. package/dist/layout/tooltip/utils.js +16 -15
  64. package/dist/markers/BarMarker.svelte +92 -0
  65. package/dist/markers/BarMarker.svelte.d.ts +7 -0
  66. package/dist/markers/CellMarker.svelte +21 -0
  67. package/dist/markers/CellMarker.svelte.d.ts +7 -0
  68. package/dist/markers/ContourMarker.svelte +28 -0
  69. package/dist/markers/ContourMarker.svelte.d.ts +7 -0
  70. package/dist/markers/DeltaMarker.svelte +32 -39
  71. package/dist/markers/DeltaMarker.svelte.d.ts +4 -5
  72. package/dist/markers/DotMarker.svelte +35 -6
  73. package/dist/markers/DotMarker.svelte.d.ts +11 -2
  74. package/dist/markers/GeoFeaturesMarker.svelte +19 -0
  75. package/dist/markers/GeoFeaturesMarker.svelte.d.ts +7 -0
  76. package/dist/markers/GeoHoverMarker.svelte +25 -0
  77. package/dist/markers/GeoHoverMarker.svelte.d.ts +9 -0
  78. package/dist/markers/GraticuleMarker.svelte +18 -0
  79. package/dist/markers/GraticuleMarker.svelte.d.ts +7 -0
  80. package/dist/markers/HoverMarker.svelte +34 -35
  81. package/dist/markers/HoverMarker.svelte.d.ts +15 -9
  82. package/dist/markers/LineMarker.svelte +19 -0
  83. package/dist/markers/LineMarker.svelte.d.ts +7 -0
  84. package/dist/markers/LinkMarker.svelte +42 -0
  85. package/dist/markers/LinkMarker.svelte.d.ts +7 -0
  86. package/dist/markers/RuleMarker.svelte +24 -0
  87. package/dist/markers/RuleMarker.svelte.d.ts +10 -0
  88. package/dist/markers/SphereMarker.svelte +15 -0
  89. package/dist/markers/SphereMarker.svelte.d.ts +7 -0
  90. package/dist/markers/TextMarker.svelte +1 -1
  91. package/dist/markers/TextMarker.svelte.d.ts +1 -1
  92. package/dist/markers/VectorMarker.svelte +20 -0
  93. package/dist/markers/VectorMarker.svelte.d.ts +7 -0
  94. package/dist/markers/inset/InsetMarker.svelte +38 -45
  95. package/dist/markers/inset/InsetMarker.svelte.d.ts +6 -2
  96. package/dist/plots/bar/Plot.svelte +96 -87
  97. package/dist/plots/bar/Plot.svelte.d.ts +4 -5
  98. package/dist/plots/bar/ValueLabels.svelte +70 -24
  99. package/dist/plots/bar/ValueLabels.svelte.d.ts +11 -2
  100. package/dist/plots/bar/buildBarMarkers.d.ts +30 -0
  101. package/dist/plots/bar/buildBarMarkers.js +100 -0
  102. package/dist/plots/bar/layout.svelte.d.ts +1 -2
  103. package/dist/plots/bar/layout.svelte.js +1 -1
  104. package/dist/plots/geo/Plot.svelte +113 -387
  105. package/dist/plots/geo/Plot.svelte.d.ts +5 -4
  106. package/dist/plots/geo/buildGeoMarkers.d.ts +33 -0
  107. package/dist/plots/geo/buildGeoMarkers.js +47 -0
  108. package/dist/plots/heatmap/Plot.svelte +27 -52
  109. package/dist/plots/heatmap/Plot.svelte.d.ts +4 -5
  110. package/dist/plots/heatmap/ValueLabels.svelte +5 -5
  111. package/dist/plots/heatmap/ValueLabels.svelte.d.ts +3 -3
  112. package/dist/plots/heatmap/buildCellMarkers.d.ts +21 -0
  113. package/dist/plots/heatmap/buildCellMarkers.js +25 -0
  114. package/dist/plots/line/Plot.svelte +73 -141
  115. package/dist/plots/line/Plot.svelte.d.ts +4 -4
  116. package/dist/plots/line/ValueLabels.svelte +84 -85
  117. package/dist/plots/line/ValueLabels.svelte.d.ts +10 -1
  118. package/dist/plots/line/buildLineMarkers.d.ts +15 -0
  119. package/dist/plots/line/buildLineMarkers.js +57 -0
  120. package/dist/plots/pyramid/Plot.svelte +80 -121
  121. package/dist/plots/pyramid/Plot.svelte.d.ts +4 -5
  122. package/dist/plots/pyramid/ValueLabels.svelte +71 -25
  123. package/dist/plots/pyramid/ValueLabels.svelte.d.ts +11 -2
  124. package/dist/plots/pyramid/buildPyramidBarMarkers.d.ts +19 -0
  125. package/dist/plots/pyramid/buildPyramidBarMarkers.js +32 -0
  126. package/dist/plots/scatter/Plot.svelte +242 -0
  127. package/dist/{layout/plot/GridLayout.svelte.d.ts → plots/scatter/Plot.svelte.d.ts} +9 -7
  128. package/dist/plots/scatter/ValueLabels.svelte +149 -0
  129. package/dist/plots/{bar/BarSegments.svelte.d.ts → scatter/ValueLabels.svelte.d.ts} +17 -15
  130. package/dist/plots/scatter/buildScatterMarkers.d.ts +11 -0
  131. package/dist/plots/scatter/buildScatterMarkers.js +37 -0
  132. package/dist/plots/scatter/resolveRadiusPaddedDomain.d.ts +10 -0
  133. package/dist/plots/scatter/resolveRadiusPaddedDomain.js +23 -0
  134. package/dist/plots/utils/declutter.d.ts +55 -37
  135. package/dist/plots/utils/declutter.js +79 -64
  136. package/dist/plots/utils/geoAccessors.d.ts +1 -1
  137. package/dist/plots/utils/geoAccessors.js +1 -1
  138. package/dist/plots/utils/labelOverflow.svelte.d.ts +51 -0
  139. package/dist/plots/utils/labelOverflow.svelte.js +116 -0
  140. package/dist/plots/utils/legendDisabled.d.ts +1 -1
  141. package/dist/plots/utils/segments.d.ts +17 -10
  142. package/dist/plots/utils/segments.js +26 -16
  143. package/dist/types/charts/common.d.ts +3 -50
  144. package/dist/types/charts/props.d.ts +8 -8
  145. package/dist/types/configuration/styling.d.ts +26 -2
  146. package/dist/types/{plots/scales/geo.d.ts → layout/coordinates.d.ts} +33 -1
  147. package/dist/types/layout/facet.d.ts +41 -0
  148. package/dist/types/layout/geometry.d.ts +17 -0
  149. package/dist/types/layout/legend.d.ts +65 -1
  150. package/dist/types/{plots/axis.d.ts → layout/scales.d.ts} +11 -0
  151. package/dist/types/layout/styles.d.ts +115 -0
  152. package/dist/types/layout/timeline.d.ts +32 -0
  153. package/dist/types/layout/tooltip.d.ts +20 -1
  154. package/dist/types/markers/all.d.ts +11 -0
  155. package/dist/types/markers/all.js +1 -0
  156. package/dist/types/markers/base.d.ts +45 -0
  157. package/dist/types/markers/base.js +1 -0
  158. package/dist/types/markers/common.d.ts +64 -16
  159. package/dist/types/markers/geo.d.ts +75 -100
  160. package/dist/types/markers/line.d.ts +34 -0
  161. package/dist/types/markers/line.js +1 -0
  162. package/dist/types/markers/props.d.ts +1 -1
  163. package/dist/types/plots/data/common.d.ts +1 -1
  164. package/dist/types/plots/data/scatter.d.ts +13 -0
  165. package/dist/types/plots/data/scatter.js +1 -0
  166. package/dist/types/plots/props.d.ts +46 -74
  167. package/dist/types/plots/segments/common.d.ts +6 -12
  168. package/dist/types/plots/segments/config.d.ts +1 -1
  169. package/dist/types/plots/styling.d.ts +10 -0
  170. package/dist/{plots/utils → utils}/delta.d.ts +2 -2
  171. package/dist/{plots/utils → utils}/delta.js +1 -1
  172. package/dist/utils/edgeAwareAnchor.d.ts +37 -0
  173. package/dist/utils/edgeAwareAnchor.js +65 -0
  174. package/dist/utils/grouping.d.ts +1 -1
  175. package/dist/utils/interpolate.d.ts +2 -2
  176. package/package.json +3 -1
  177. package/dist/layout/geo/GeoLayout.svelte +0 -51
  178. package/dist/layout/geo/GeoLayout.svelte.d.ts +0 -24
  179. package/dist/layout/geo/resolveProjection.js +0 -48
  180. package/dist/layout/plot/GridLayout.svelte +0 -30
  181. package/dist/layout/plot/RuleLayout.svelte +0 -111
  182. package/dist/plots/bar/BarSegments.svelte +0 -69
  183. package/dist/types/charts/legend.d.ts +0 -60
  184. package/dist/types/plots/delta.d.ts +0 -19
  185. package/dist/types/plots/styles/common.d.ts +0 -52
  186. package/dist/types/plots/styles/geo.d.ts +0 -42
  187. /package/dist/{plots/geo → layout/coordinates}/projections/argentina.js +0 -0
  188. /package/dist/{plots/geo → layout/coordinates}/projections/fit.d.ts +0 -0
  189. /package/dist/{plots/geo → layout/coordinates}/projections/fit.js +0 -0
  190. /package/dist/{plots/geo → layout/coordinates}/rotate.svelte.d.ts +0 -0
  191. /package/dist/{plots/geo → layout/coordinates}/rotate.svelte.js +0 -0
  192. /package/dist/{plots/geo → layout/coordinates}/zoom.svelte.js +0 -0
  193. /package/dist/types/{charts/legend.js → layout/coordinates.js} +0 -0
  194. /package/dist/types/{plots/axis.js → layout/facet.js} +0 -0
  195. /package/dist/types/{plots/delta.js → layout/geometry.js} +0 -0
  196. /package/dist/types/{plots/scales/geo.js → layout/scales.js} +0 -0
  197. /package/dist/types/{plots/styles/common.js → layout/styles.js} +0 -0
  198. /package/dist/types/{plots/styles/geo.js → layout/timeline.js} +0 -0
@@ -1,21 +1,18 @@
1
- import type { AxisValue } from '../plots/axis';
2
- import type { DotStyle, FontStyle, StrokeStyle } from '../plots/styling';
1
+ import type { AxisValue } from '../layout/scales';
2
+ import type { FontStyle, StrokeStyle, DotStyle, AreaStyle } from '../plots/styling';
3
3
  import type { HoverStrategy, HoverDisplayPoint } from '../layout/tooltip';
4
- export type RuleXMarker = {
5
- type: 'ruleX';
6
- x: AxisValue;
7
- style?: StrokeStyle;
8
- };
9
- export type RuleYMarker = {
10
- type: 'ruleY';
11
- y: AxisValue;
4
+ import type { BaseMarkersConfig } from './base';
5
+ export type { DotMarkerConfig } from './base';
6
+ export type RuleMarkerConfig = {
7
+ type: 'rule';
8
+ axis: 'x' | 'y';
9
+ value: AxisValue;
12
10
  style?: StrokeStyle;
13
11
  };
14
12
  /**
15
- * The in-SVG hover highlight (crosshair + dot + label), opt-in via `markers`
16
- * so it can be combined freely with or used entirely without — the HTML
17
- * tooltip. Omitting `series` mounts it unscoped (all series); scoping it to
18
- * one series follows the same targeting fields as {@link CustomComponentMarker}.
13
+ * In-SVG hover highlight (crosshair + dot + label). Omitting `series`
14
+ * applies it to all series; scoping follows the same fields as
15
+ * {@link CustomComponentMarkerConfig}.
19
16
  */
20
17
  export type HoverMarkerConfig = {
21
18
  type: 'hover';
@@ -31,7 +28,51 @@ export type HoverMarkerConfig = {
31
28
  dotStyle?: DotStyle;
32
29
  fontStyle?: FontStyle;
33
30
  };
34
- export type CustomComponentMarker = {
31
+ /** A single line-segment stroke. Endpoint dots are a separate `'dot'` marker rather than a field here. */
32
+ export type LineMarkerConfig = {
33
+ type: 'line';
34
+ data: Record<string, unknown>[];
35
+ x: (d: any) => AxisValue;
36
+ y: (d: any) => AxisValue;
37
+ style?: StrokeStyle;
38
+ };
39
+ /**
40
+ * A single bar mark. `role: 'segment'` is a visible bar
41
+ * (`x`/`y`/`x1`/`x2`/`y1`/`y2` map to svelteplot's `<BarX>`/`<BarY>` per
42
+ * `isHorizontal`); `role: 'hitArea'` is an invisible per-category hit region
43
+ * for hover, resolved against the live scale at render time.
44
+ */
45
+ export type BarMarkerConfig = {
46
+ type: 'bar';
47
+ role: 'segment' | 'hitArea';
48
+ isHorizontal: boolean;
49
+ data: Record<string, unknown>[];
50
+ x?: (d: any) => AxisValue;
51
+ y?: (d: any) => AxisValue;
52
+ x1?: number | ((d: any) => number);
53
+ x2?: number | ((d: any) => number);
54
+ y1?: number | ((d: any) => number);
55
+ y2?: number | ((d: any) => number);
56
+ insetTop?: number;
57
+ insetBottom?: number;
58
+ insetLeft?: number;
59
+ insetRight?: number;
60
+ style?: AreaStyle;
61
+ category?: AxisValue;
62
+ onpointerenter?: () => void;
63
+ onpointerleave?: () => void;
64
+ };
65
+ /** A single heatmap cell mark. `fill` stays a per-row accessor; the rest of the style is constant per call. */
66
+ export type CellMarkerConfig = {
67
+ type: 'cell';
68
+ data: Record<string, unknown>[];
69
+ x: (d: any) => AxisValue;
70
+ y: (d: any) => AxisValue;
71
+ fill: (d: any) => string;
72
+ style?: AreaStyle;
73
+ inset?: number;
74
+ };
75
+ export type CustomComponentMarkerConfig = {
35
76
  type: 'component';
36
77
  series?: string;
37
78
  component: any;
@@ -39,4 +80,11 @@ export type CustomComponentMarker = {
39
80
  data?: any[];
40
81
  scope?: 'series' | 'segment';
41
82
  };
42
- export type Marker = RuleXMarker | RuleYMarker | HoverMarkerConfig | CustomComponentMarker;
83
+ /**
84
+ * Every marker kind any axis-based plot can render: {@link BaseMarkersConfig}
85
+ * plus every axis-based-only kind. `BarPlot`/`HeatmapPlot`/`PyramidPlot` use
86
+ * this directly as their `markers` prop type; `LinePlot`'s own
87
+ * `LineMarkersConfig` (`types/markers/line.ts`) unions it with the line-only
88
+ * `delta` annotation instead.
89
+ */
90
+ export type AxisBasedMarkersConfig = BaseMarkersConfig | RuleMarkerConfig | HoverMarkerConfig | LineMarkerConfig | BarMarkerConfig | CellMarkerConfig | CustomComponentMarkerConfig;
@@ -1,65 +1,36 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  import type { Accessor } from '../plots/data/common';
3
- import type { ColorsStyle } from '../plots/styles/common';
4
- import type { DotStyle, FontStyle, StrokeStyle } from '../plots/styling';
5
- import type { HoverDisplayPoint } from '../layout/tooltip';
3
+ import type { AreaStyle, StrokeStyle } from '../plots/styling';
6
4
  import type { GeoFeature, GeoJsonInput } from '../plots/data/geo';
7
5
  import type { GeoSegmentStyle } from '../plots/segments/common';
8
- import type { GeoProjectionName } from '../plots/scales/geo';
6
+ import type { GeoProjectionName } from '../layout/coordinates';
7
+ import type { TooltipAnchorX, TooltipAnchorY } from '../layout/tooltip';
8
+ import type { BaseMarkersConfig } from './base';
9
9
  /** Longitude/latitude gridlines — svelteplot's `Graticule`. */
10
- export type GeoGraticuleMarker = {
10
+ export type GeoGraticuleMarkerConfig = {
11
11
  type: 'graticule';
12
12
  step?: number;
13
13
  stepX?: number;
14
14
  stepY?: number;
15
15
  style?: StrokeStyle;
16
- /**
17
- * Renders behind the base map's own fill/stroke instead of on top of it
18
- * (markers otherwise always draw over the base map, regardless of their
19
- * position in the `markers` array). Useful for a graticule meant to read
20
- * as a faint background reference frame rather than an overlay obscuring
21
- * the geometry above it.
22
- */
16
+ /** Renders behind the base map's own fill/stroke instead of on top of it (markers otherwise draw over the base map). */
23
17
  behind?: boolean;
24
18
  };
25
19
  /** The outer globe outline (for orthographic-type projections) — svelteplot's `Sphere`. */
26
- export type GeoSphereMarker = {
20
+ export type GeoSphereMarkerConfig = {
27
21
  type: 'sphere';
28
22
  style?: StrokeStyle & {
29
23
  fill?: string;
30
24
  fillOpacity?: number;
31
25
  };
32
- /**
33
- * Renders behind the base map's own fill/stroke instead of on top of it —
34
- * needed any time `style.fill` is set, since a filled sphere otherwise
35
- * covers every feature drawn under it (the sphere is the full globe
36
- * outline, larger than any geometry on it). Off by default so an
37
- * unfilled/stroke-only sphere (the common case, tracing just the globe's
38
- * edge) keeps drawing on top where it stays visible over ocean fills.
39
- */
26
+ /** Renders behind the base map's own fill/stroke instead of on top of it — needed when `style.fill` is set. */
40
27
  behind?: boolean;
41
28
  };
42
- /**
43
- * Point markers by longitude/latitude, sized/colored by value —
44
- * svelteplot's `Dot`. https://svelteplot.dev/examples/dot/weather
45
- */
46
- export type GeoDotMarker<TRow extends Record<string, unknown> = Record<string, unknown>> = {
47
- type: 'dot';
48
- data: TRow[];
49
- x: Accessor<TRow, number>;
50
- y: Accessor<TRow, number>;
51
- r?: Accessor<TRow, number> | number;
52
- /** Continuous value used to color each dot through a ramp — see `style.colors`. */
53
- value?: Accessor<TRow, number>;
54
- style?: DotStyle & {
55
- colors?: ColorsStyle;
56
- };
57
- };
58
29
  /**
59
30
  * Arrows/spikes at points — svelteplot's `Vector`.
60
31
  * https://svelteplot.dev/examples/vector/shift-map
61
32
  */
62
- export type GeoVectorMarker<TRow extends Record<string, unknown> = Record<string, unknown>> = {
33
+ export type GeoVectorMarkerConfig<TRow extends Record<string, unknown> = Record<string, unknown>> = {
63
34
  type: 'vector';
64
35
  data: TRow[];
65
36
  x: Accessor<TRow, number>;
@@ -79,7 +50,7 @@ export type GeoVectorMarker<TRow extends Record<string, unknown> = Record<string
79
50
  * `curve: 'auto'` traces a great-circle arc on a geographic projection).
80
51
  * https://svelteplot.dev/examples/link/spherical-link
81
52
  */
82
- export type GeoLinkMarker<TRow extends Record<string, unknown> = Record<string, unknown>> = {
53
+ export type GeoLinkMarkerConfig<TRow extends Record<string, unknown> = Record<string, unknown>> = {
83
54
  type: 'link';
84
55
  data: TRow[];
85
56
  x1: Accessor<TRow, number>;
@@ -97,7 +68,7 @@ export type GeoLinkMarker<TRow extends Record<string, unknown> = Record<string,
97
68
  * spatially interpolate a scatter of samples, or omit `data` and pass
98
69
  * `value` as an `(x, y) => number` sampling function.
99
70
  */
100
- export type GeoContourMarker<TRow extends Record<string, unknown> = Record<string, unknown>> = {
71
+ export type GeoContourMarkerConfig<TRow extends Record<string, unknown> = Record<string, unknown>> = {
101
72
  type: 'contour';
102
73
  data?: TRow[];
103
74
  x?: Accessor<TRow, number>;
@@ -113,65 +84,48 @@ export type GeoContourMarker<TRow extends Record<string, unknown> = Record<strin
113
84
  fillOpacity?: number;
114
85
  strokeOpacity?: number;
115
86
  };
116
- /**
117
- * Masks the contour to just the base map's landmass (`'land'`) or just
118
- * its water (`'ocean'`) — e.g. a temperature contour that should only
119
- * shade land, leaving the ocean bare (or the reverse).
120
- */
87
+ /** Masks the contour to just the base map's landmass (`'land'`) or water (`'ocean'`). */
121
88
  clip?: 'land' | 'ocean';
122
- /**
123
- * Renders behind the base map's own fill/stroke instead of on top of it —
124
- * lets a filled contour read as background shading with the base map's
125
- * feature borders drawn crisply over it, rather than the contour
126
- * obscuring them.
127
- */
89
+ /** Renders behind the base map's own fill/stroke instead of on top of it. */
128
90
  behind?: boolean;
129
91
  };
130
92
  /**
131
- * The in-map hover highlight. `strategy` chooses which candidate point set
132
- * drives matching: `'nearest-feature'` (base-map feature centroids
133
- * choropleth-style hover) or `'nearest-point'` (a `dot` marker's own rows).
93
+ * The in-map hover highlight restyles the hovered feature's own shape.
94
+ * Its own `type: 'geo-hover'` tag (rather than the axis-based `'hover'`)
95
+ * keeps it unambiguous: both configs are all-optional, so an author writing
96
+ * `{ type: 'hover' }` for a `GeoPlot` would otherwise be structurally
97
+ * indistinguishable from the axis-based marker.
134
98
  */
135
99
  export type GeoHoverMarkerConfig = {
136
- type: 'hover';
137
- strategy?: 'nearest-feature' | 'nearest-point';
138
- showLabels?: boolean;
139
- format?: (point: HoverDisplayPoint) => string;
140
- dotStyle?: DotStyle;
141
- fontStyle?: FontStyle;
100
+ type: 'geo-hover';
101
+ style?: AreaStyle;
142
102
  };
143
- /** Mounts an arbitrary Svelte component as a mark — the geo analog of `CustomComponentMarker` (no `series` concept here). */
144
- export type GeoCustomComponentMarker = {
145
- type: 'component';
103
+ /**
104
+ * Mounts an arbitrary Svelte component as a mark — the geo analog of
105
+ * `CustomComponentMarkerConfig` (no `series` concept here). Its own
106
+ * `type: 'geo-component'` tag (rather than the axis-based `'component'`)
107
+ * keeps the two unambiguous at `GeometryLayout`'s dispatch — same reasoning
108
+ * as `GeoHoverMarkerConfig`'s `'geo-hover'` tag.
109
+ */
110
+ export type GeoCustomComponentMarkerConfig = {
111
+ type: 'geo-component';
146
112
  component: any;
147
113
  props?: Record<string, unknown>;
148
114
  data?: any[];
149
115
  };
150
116
  /**
151
- * Which edge of the plot frame an inset is anchored to, and where along that
152
- * edge — a `side-anchor` pair joined by `-`, in either word order (so
153
- * `'bottom-right'` and `'right-bottom'` are the same corner). `side` is
154
- * `top`/`bottom`/`left`/`right`; `anchor` is the same four plus `middle`
155
- * (e.g. `'right-middle'` centers the inset vertically along the right edge).
117
+ * Which edge of the plot frame an inset is anchored to, and where along it
118
+ * — a `side-anchor` pair in either word order (`'bottom-right'` ==
119
+ * `'right-bottom'`). `side` is `top`/`bottom`/`left`/`right`; `anchor` is
120
+ * the same four plus `middle`.
156
121
  */
157
122
  export type GeoInsetLocation = 'top-left' | 'left-top' | 'top-middle' | 'middle-top' | 'top-right' | 'right-top' | 'middle-left' | 'left-middle' | 'middle-middle' | 'middle-right' | 'right-middle' | 'bottom-left' | 'left-bottom' | 'bottom-middle' | 'middle-bottom' | 'bottom-right' | 'right-bottom';
158
- /**
159
- * Named projections an `inset` marker can use for its own independently-fit
160
- * mini-map — everything `GeoProjectionName` offers except `'identity'`/
161
- * `'reflect-y'`, which have no scale/translate of their own to fit (see
162
- * `GeoProjectionConfig.domain`'s doc comment) and so can't auto-fit the way
163
- * every inset needs to.
164
- */
123
+ /** Named projections an `inset` marker can use, minus `'identity'`/`'reflect-y'`, which have no scale/translate to auto-fit. */
165
124
  export type GeoInsetProjectionName = Exclude<GeoProjectionName, 'identity' | 'reflect-y'>;
166
125
  /**
167
126
  * Independent hover tooltip scoped to just one `inset` marker's own rendered
168
- * features. Matched by nearest projected centroid within the inset's own
169
- * local mini-projection/box entirely decoupled from the plot's own
170
- * top-level `tooltip`, which only ever matches the main map's own features
171
- * (an inset draws in its own coordinate space, at its own scale, so the
172
- * main map's hover has no way to reach it). No `facetId`/`sync`/`strategy`
173
- * here, unlike the top-level `TooltipConfig` — an inset never broadcasts
174
- * its hover to other facets and always matches punctually.
127
+ * features, matched by nearest projected centroid within the inset's own
128
+ * local mini-projection. Decoupled from the plot's own top-level `tooltip`.
175
129
  */
176
130
  export type GeoInsetTooltipConfig = {
177
131
  /** Tooltip text for the nearest feature (by centroid) to the cursor, within this inset. */
@@ -180,6 +134,13 @@ export type GeoInsetTooltipConfig = {
180
134
  content?: Snippet<[{
181
135
  rows: GeoFeature<Record<string, unknown>>[];
182
136
  }]>;
137
+ /**
138
+ * Preferred anchor for this inset's own tooltip. Unset falls back to the
139
+ * plot's own top-level `tooltip.anchorX`/`anchorY` when explicitly set
140
+ * there, then to the system default — see {@link TooltipAnchorX}.
141
+ */
142
+ anchorX?: TooltipAnchorX;
143
+ anchorY?: TooltipAnchorY;
183
144
  };
184
145
  /** Projection config for an `inset` marker — like `GeoProjectionConfig`, minus `inset`/`domain` (insets always auto-fit to their own content) and custom factories (which can't guarantee `fitExtent`). */
185
146
  export type GeoInsetProjectionConfig = GeoInsetProjectionName | {
@@ -191,29 +152,21 @@ export type GeoInsetProjectionConfig = GeoInsetProjectionName | {
191
152
  };
192
153
  /**
193
154
  * A small, independently-projected map panel anchored to a corner/edge of
194
- * the plot — for showing a region at a different, more legible scale than
195
- * the main map (a disjoint territory, a dense metro area, etc.), the way
196
- * national mapping agencies commonly draw insets for exactly this reason.
197
- *
198
- * What it shows is either a filtered subset of the plot's own `data` (via
199
- * `features`, matched the same way `segments` keys are) or a wholly
200
- * separate dataset (`data`, which takes precedence over `features` when
201
- * both are given) — the inset's own mini-projection is fit to whichever one
202
- * applies, independently of the main map's projection/zoom.
155
+ * the plot, showing a region at a different scale than the main map. Shows
156
+ * either a filtered subset of the plot's own `data` (via `features`) or a
157
+ * wholly separate dataset (`data`, which takes precedence when both are
158
+ * given).
203
159
  */
204
- export type GeoInsetMarker<TProps extends Record<string, unknown> = Record<string, unknown>> = {
160
+ export type GeoInsetMarkerConfig<TProps extends Record<string, unknown> = Record<string, unknown>> = {
205
161
  type: 'inset';
206
162
  location: GeoInsetLocation;
207
163
  /** Feature ids (matching the plot's own `featureId`) to filter from the plot's own `data`. Ignored when `data` is set. */
208
164
  features?: string[];
209
165
  /**
210
- * Narrows each `features`-matched feature down to just the geometry parts
211
- * that pass this predicate (each polygon of a `MultiPolygon`, each line of
212
- * a `MultiLineString`) same `(part, feature)` signature as
213
- * `GeoDataProps.excludeParts`, so the same predicate can be passed to both
214
- * to split one feature's geometry between the main map and this inset
215
- * without preprocessing the source data. Omitted → every part of each
216
- * matched feature renders, as before. Ignored when `data` is set.
166
+ * Narrows each `features`-matched feature to just the geometry parts that
167
+ * pass this predicate same signature as `GeoDataProps.excludeParts`, so
168
+ * one feature's geometry can be split between the main map and this inset.
169
+ * Ignored when `data` is set.
217
170
  */
218
171
  featurePartsFilter?: (part: {
219
172
  centroid: [number, number];
@@ -234,4 +187,26 @@ export type GeoInsetMarker<TProps extends Record<string, unknown> = Record<strin
234
187
  /** Independent hover tooltip for just this inset's own rendered features — see `GeoInsetTooltipConfig`. */
235
188
  tooltip?: GeoInsetTooltipConfig;
236
189
  };
237
- export type GeoMarker = GeoGraticuleMarker | GeoSphereMarker | GeoDotMarker | GeoVectorMarker | GeoLinkMarker | GeoContourMarker | GeoHoverMarkerConfig | GeoCustomComponentMarker | GeoInsetMarker;
190
+ /**
191
+ * `GeoPlot`'s own `markers` prop type — unions {@link BaseMarkersConfig} with
192
+ * every geo-only kind. Independent of `AxisBasedMarkersConfig`
193
+ * (`types/markers/common.ts`): geo has no axis to `rule` against, and its
194
+ * `hover`/`component` variants differ in shape from the axis-based kinds'.
195
+ */
196
+ export type GeoMarkersConfig = BaseMarkersConfig | GeoGraticuleMarkerConfig | GeoSphereMarkerConfig | GeoVectorMarkerConfig | GeoLinkMarkerConfig | GeoContourMarkerConfig | GeoHoverMarkerConfig | GeoCustomComponentMarkerConfig | GeoInsetMarkerConfig;
197
+ /**
198
+ * The base choropleth/base-map mark — one per distinct resolved feature
199
+ * style. Never author-facing: `buildGeoMarkers` builds it from `GeoPlot`'s
200
+ * own `styleGroups`.
201
+ */
202
+ export type GeoFeaturesMarkerConfig = {
203
+ type: 'geo';
204
+ data: Record<string, unknown>[];
205
+ fill: (d: any) => string;
206
+ fillOpacity?: number;
207
+ stroke?: string;
208
+ strokeWidth?: number;
209
+ onclick?: (e: Event, d: any) => void;
210
+ onpointerenter?: (e: Event, d: any) => void;
211
+ onpointerleave?: (e: Event) => void;
212
+ };
@@ -0,0 +1,34 @@
1
+ import type { AxisValue } from '../layout/scales';
2
+ import type { StrokeStyle, FontStyle, DotStyle } from '../plots/styling';
3
+ import type { AxisBasedMarkersConfig } from './common';
4
+ /** Which endpoint a delta measures from/to: a named series, or a fixed axis value (defaults to `0`). */
5
+ export type DeltaTarget = {
6
+ type: 'series';
7
+ series: string;
8
+ } | {
9
+ type: 'axis';
10
+ value?: number;
11
+ };
12
+ /** How far apart two points are on a line chart: a given x (or y), or a series' distance from a fixed axis value. */
13
+ export type DeltaConfig = {
14
+ axis: 'x' | 'y';
15
+ at: AxisValue;
16
+ from: DeltaTarget;
17
+ to?: DeltaTarget;
18
+ formatDiff?: (diff: number) => string;
19
+ strokeStyle?: StrokeStyle;
20
+ fontStyle?: FontStyle;
21
+ dotStyle?: DotStyle;
22
+ };
23
+ /**
24
+ * A delta annotation between two points on a line chart, resolved against
25
+ * series data (`utils/delta.ts`). `xDomain`/`yDomain` optionally clamp
26
+ * the varying endpoint to the plot's own axis range.
27
+ */
28
+ export type DeltaMarkerConfig = {
29
+ type: 'delta';
30
+ xDomain?: (number | string | Date)[];
31
+ yDomain?: (number | string | Date)[];
32
+ } & DeltaConfig;
33
+ /** `LinePlot`'s own `markers` prop type — every {@link AxisBasedMarkersConfig} kind plus the line-only `'delta'` annotation. */
34
+ export type LineMarkersConfig = AxisBasedMarkersConfig | DeltaMarkerConfig;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Baseline props every marker component receives when mounted by a plot:
3
3
  * `data` for the points/values it draws, plus `series`/`seriesColor` when
4
- * mounted per-series via a `CustomComponentMarker`. Marker components extend
4
+ * mounted per-series via a `CustomComponentMarkerConfig`. Marker components extend
5
5
  * this with whatever else they need (e.g. PeakMarker's `mode`, `label`).
6
6
  */
7
7
  export interface MarkerProps<TData = Record<string, unknown>> {
@@ -1,4 +1,4 @@
1
- import type { AxisValue } from '../axis';
1
+ import type { AxisValue } from '../../layout/scales';
2
2
  /**
3
3
  * A field key or accessor function. Mirrors the shorthand used across plots
4
4
  * so chart-level encodings (`x`, `y`, `z`, facet, timeline) feel consistent
@@ -0,0 +1,13 @@
1
+ import type { Accessor, SeriesProps, DataProps } from './common';
2
+ /**
3
+ * `SeriesProps`/`DataProps`, plus an optional per-row bubble radius —
4
+ * ScatterPlot's own data contract. A field key or accessor function is
5
+ * bound to svelteplot's own auto sqrt scale (mirroring how `x`/`y` are
6
+ * bound to their own scales), so bubble *area* — not radius — ends up
7
+ * proportional to the raw values with no manual scaling needed; feeding it
8
+ * an already-scaled value double-scales it. A literal number bypasses
9
+ * scaling entirely (a fixed pixel radius, same as the default dot size).
10
+ */
11
+ export type ScatterDataProps<T extends Record<string, unknown>> = (SeriesProps<T> | DataProps<T>) & {
12
+ r?: Accessor<T, number> | number;
13
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,41 +1,23 @@
1
- import type { TooltipOptions } from '../layout/tooltip';
1
+ import type { HoverPoint, HoverStrategy, TooltipOptions } from '../layout/tooltip';
2
2
  import type { Segment } from './segments/config';
3
- import type { AxisScale } from './axis';
4
- import type { GeoProjectionConfig } from './scales/geo';
3
+ import type { AxisBasedScalesConfig } from '../layout/scales';
4
+ import type { GeoScalesConfig } from '../layout/coordinates';
5
5
  /** The `styles` prop accepted by every plot kind — its own
6
- * styles shape ({@link BasePlotStyles}, `GeoStyles`, …). */
6
+ * styles shape ({@link BasePlotStylesConfig}, `GeoStylesConfig`, …). */
7
7
  export type StylesConfig<TStyles extends object> = TStyles;
8
- /** The `markers` prop accepted by every plot kind — a list of that
9
- * kind's own marker union ({@link Marker}, `GeoMarker`, …). */
8
+ /** The `markers` prop accepted by every plot kind — a list of that kind's own marker union. */
10
9
  export type MarkersConfig<TMarker> = TMarker[];
11
10
  /**
12
- * The `segments` prop accepted by every plot kind.
13
- *
14
- * A record mapping series names (or `'default'` for all series) to lists of
15
- * {@link Segment}s. Segments in a named key apply only to that series;
16
- * segments under `'default'` apply to every series.
17
- *
18
- * ```ts
19
- * segments: {
20
- * female: [{ style: { stroke: { stroke: 'tomato' } } }], // catch-all for female
21
- * male: [{ style: { stroke: { stroke: 'steelblue' } } }], // catch-all for male
22
- * default: [{ areas: [{ x: { from: 2012, to: 2014 } }], style: { dots: { dotSymbol: 'circle' } } }],
23
- * }
24
- * ```
25
- *
26
- * Within each resolved series list, catch-alls (no `areas`) are evaluated last
27
- * so that area-specific segments always override them, regardless of position.
28
- * Area-specific segments also inherit any style key absent from their own style
29
- * by merging the catch-all as a baseline — the area's own style wins on conflict.
30
- * This lets you set a series colour once in a catch-all and add per-range dots
31
- * or dash patterns without repeating the colour on every area segment.
11
+ * The `segments` prop accepted by every plot kind — series name (or
12
+ * `'default'` for all series) to a list of {@link Segment}s. Within a
13
+ * series, catch-all segments (no `areas`) evaluate first as a baseline;
14
+ * area-specific segments merge on top and win on conflict.
32
15
  */
33
16
  export type SegmentsConfig<TStyle> = Record<string, Segment<TStyle>[]>;
34
17
  /**
35
- * Partial margin override — only the sides you specify are overridden; the
36
- * rest come from the theme (which itself defaults every side to `'auto'`).
37
- * `'auto'` sizes that side to fit its rendered content (tick labels, axis
38
- * title, rotated ticks); a number pins it exactly.
18
+ * Partial margin override — unset sides fall back to the theme (itself
19
+ * `'auto'` by default). `'auto'` fits the side to its rendered content; a
20
+ * number pins it exactly.
39
21
  */
40
22
  export type MarginConfig = Partial<{
41
23
  top: number | 'auto';
@@ -44,69 +26,59 @@ export type MarginConfig = Partial<{
44
26
  left: number | 'auto';
45
27
  }>;
46
28
  /**
47
- * The `tooltip` prop a plot actually receives — the chart's resolved form of
48
- * the author-facing {@link TooltipOptions} (which a chart accepts as a bare
49
- * `boolean` or the full object via `TooltipProp`): `format`/`sync` become
50
- * required once resolved, and `facetId` identifies the originating facet
51
- * (`''` when not faceted). Presence of this object on a plot is what turns
52
- * hovering on.
29
+ * The `tooltip` prop a plot actually receives — the resolved form of the
30
+ * author-facing {@link TooltipOptions}. `format`/`sync` become required;
31
+ * `facetId` identifies the originating facet (`''` when not faceted).
32
+ * Presence of this object is what turns hovering on.
53
33
  */
54
34
  export type TooltipConfig<TRow extends Record<string, unknown>> = Omit<TooltipOptions<TRow>, 'format' | 'sync'> & {
55
35
  format: (row: TRow) => string;
56
36
  sync: boolean;
57
37
  facetId: string;
58
38
  };
59
- /**
60
- * Per-axis scale overrides, passed as a single `scales` prop to every
61
- * axis-based plot kind (`GeoPlot` uses {@link GeoScalesConfig} instead — a
62
- * map has no x/y/z axis pair). `TData` threads through to
63
- * {@link AxisScale.sort} on each axis.
64
- */
65
- export type AxisBasedScalesConfig<TData = Record<string, unknown>> = {
66
- x?: AxisScale<TData>;
67
- y?: AxisScale<TData>;
68
- z?: AxisScale<TData>;
69
- };
70
- /**
71
- * `scales` prop for GeoPlot the geo analog of {@link AxisBasedScalesConfig}.
72
- * A map has no x/y/z axis pair, so this configures the projection and the
73
- * choropleth colour domain instead.
74
- */
75
- export type GeoScalesConfig = {
76
- /** Which map projection to draw with. Defaults to `'equal-earth'`. */
77
- projection?: GeoProjectionConfig;
78
- /** Continuous choropleth value domain mirrors heatmap's `scales.z.domain`. */
79
- color?: {
80
- domain?: [number, number];
81
- };
39
+ /** How a pointer event resolves to a candidate point: `'nearest'` (closest within a distance threshold) or `'contains'` (whichever candidate's own rendered shape contains the cursor). */
40
+ export type PointMatchingStrategy = 'nearest' | 'contains';
41
+ /** `BasePlotLayout`'s single `hover` prop — every plot kind's own resolved hover/tooltip wiring. */
42
+ export type HoverConfig<TRow extends Record<string, unknown>> = {
43
+ /** Whether the pointer/hover/tooltip machinery should mount at all. */
44
+ active: boolean;
45
+ /** Candidate points hover matching searches against. */
46
+ points: HoverPoint<TRow>[];
47
+ /** Short label drawn next to the highlight dot (e.g. the value). */
48
+ label: (row: TRow) => string;
49
+ /** Resolved hover strategy for the *local* hover store (ignored once a shared store is in scope). */
50
+ strategy?: HoverStrategy;
51
+ /** Resolved sync flag for the *local* hover store (ignored once a shared store is in scope). */
52
+ sync?: boolean;
53
+ tooltip?: TooltipConfig<TRow>;
54
+ /** When it returns `true`, that pointer event is treated as a leave instead of a move — lets a nested layout opt part of the plot out of hover matching. */
55
+ exclude?: (e: PointerEvent) => boolean;
56
+ /** How to resolve a pointer event to a candidate point — see {@link PointMatchingStrategy}. Defaults to `'nearest'`. */
57
+ pointMatching?: PointMatchingStrategy;
58
+ /** Forces the crosshair rule(s) a `hover` marker draws off entirely, overriding whatever `strategy` implies. */
59
+ crosshair?: boolean;
82
60
  };
83
61
  /**
84
62
  * The `scales` prop accepted by every plot kind — either flavor of scale
85
- * config a plot kind can have ({@link AxisBasedScalesConfig} for the
86
- * axis-based kinds, {@link GeoScalesConfig} for `GeoPlot`). Each concrete
87
- * `Plot.svelte` narrows `BasePlotProps`'s `TScales` to exactly the one
88
- * that applies to it, rather than accepting this whole union.
63
+ * config a plot kind can have. Each concrete `Plot.svelte` narrows
64
+ * `BasePlotProps`'s `TScales` to exactly the one that applies to it.
89
65
  */
90
66
  export type ScalesConfig<TData = Record<string, unknown>> = AxisBasedScalesConfig<TData> | GeoScalesConfig;
91
67
  /**
92
- * The shared "prop bag" every plot component accepts, parameterized over
93
- * everything that varies by plot kind: `TDataContract` is the kind's own
94
- * data shape ({@link SeriesProps}`|`{@link DataProps} for the axis-based
95
- * kinds, `GeoDataProps` for `GeoPlot`), `TRow` is what `tooltip` resolves
96
- * against, and `TStyles`/`TSegmentStyle`/`TMarker`/`TScales` are that kind's
97
- * own segment/style/marker/scale shapes. Each `Plot.svelte` instantiates
98
- * this directly with its own concrete arguments rather than going through a
99
- * shared per-kind alias — segments/styles/markers already diverge in shape
100
- * across kinds today (or will soon), so a shared alias would just be an
101
- * extra layer to keep in sync.
68
+ * The shared prop bag every plot component accepts, parameterized over
69
+ * everything that varies by plot kind: `TDataContract` is its own data
70
+ * shape, `TRow` is what `tooltip` resolves against, and the rest are its
71
+ * own segment/style/marker/scale/coordinate-system shapes. `TCoordinates`
72
+ * defaults to `undefined` only `GeoPlot` instantiates it.
102
73
  */
103
- export type BasePlotProps<TDataContract, TRow extends Record<string, unknown>, TStyles extends object, TSegmentStyle extends object, TMarker, TScales extends ScalesConfig<TRow>> = TDataContract & {
74
+ export type BasePlotProps<TDataContract, TRow extends Record<string, unknown>, TStyles extends object, TSegmentStyle extends object, TMarker, TScales extends ScalesConfig<TRow>, TCoordinates = undefined> = TDataContract & {
104
75
  width: number;
105
76
  height: number;
106
77
  styles?: StylesConfig<TStyles>;
107
78
  segments?: SegmentsConfig<TSegmentStyle>;
108
79
  markers?: MarkersConfig<TMarker>;
109
80
  scales?: TScales;
81
+ coordinates?: TCoordinates;
110
82
  margins?: MarginConfig;
111
83
  tooltip?: TooltipConfig<TRow>;
112
84
  };
@@ -1,21 +1,15 @@
1
- import type { StrokeStyle, DotStyle } from '../styling';
1
+ import type { StrokeStyle, DotStyle, AreaStyle } from '../styling';
2
2
  /** Per-segment styling for a line: its stroke and/or its endpoint dots. */
3
3
  export type LineSegmentStyle = {
4
4
  stroke?: StrokeStyle;
5
5
  dots?: DotStyle;
6
6
  };
7
- /** Per-segment styling for a bar-shaped mark: its fill. Shared by `BarPlot` and `PyramidPlot`. */
8
- export type BarSegmentStyle = {
9
- fill?: string;
10
- fillOpacity?: number;
11
- };
7
+ /** Per-segment styling for a bar-shaped mark. Shared by `BarPlot` and `PyramidPlot`. */
8
+ export type BarSegmentStyle = AreaStyle;
12
9
  /** Per-cell styling override for a heatmap cell. */
13
- export type CellSegmentStyle = {
14
- fill?: string;
15
- fillOpacity?: number;
16
- stroke?: string;
17
- strokeWidth?: number;
18
- };
10
+ export type CellSegmentStyle = AreaStyle;
11
+ /** Per-segment styling for a scatter point cloud. */
12
+ export type ScatterSegmentStyle = DotStyle;
19
13
  /** Per-feature styling override for `GeoPlot` — the geo analog of `CellSegmentStyle`. */
20
14
  export type GeoSegmentStyle = {
21
15
  fill?: string;
@@ -1,4 +1,4 @@
1
- import type { AxisValue } from '../axis';
1
+ import type { AxisValue } from '../../layout/scales';
2
2
  import type { Series } from '../data/common';
3
3
  import type { LineSegmentStyle } from './common';
4
4
  /** A half-open interval on one axis. Both bounds are inclusive; omit either to leave that end open. */