@fundar/data-chart-telling 1.18.0 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +2 -1
  3. package/dist/configuration/config.svelte.js +1 -1
  4. package/dist/index.d.ts +3 -1
  5. package/dist/index.js +2 -1
  6. package/dist/layout/coordinates/CoordinatesLayout.svelte +3 -1
  7. package/dist/layout/geometry/GeometryLayout.svelte +57 -22
  8. package/dist/layout/geometry/ScaleFreeContext.d.ts +31 -0
  9. package/dist/layout/geometry/ScaleFreeContext.js +65 -0
  10. package/dist/layout/geometry/ScaleFreeMarks.svelte +14 -0
  11. package/dist/layout/geometry/ScaleFreeMarks.svelte.d.ts +7 -0
  12. package/dist/layout/geometry/ScaleGate.svelte.d.ts +8 -0
  13. package/dist/layout/geometry/ScaleGate.svelte.js +95 -0
  14. package/dist/layout/geometry/ScaleGateMarks.svelte +15 -0
  15. package/dist/layout/geometry/ScaleGateMarks.svelte.d.ts +7 -0
  16. package/dist/layout/hover/HoverShapes.d.ts +20 -8
  17. package/dist/layout/hover/HoverShapes.js +119 -59
  18. package/dist/layout/margins/Box.d.ts +4 -0
  19. package/dist/layout/margins/Box.js +14 -0
  20. package/dist/layout/margins/PlotMargins.svelte.js +26 -1
  21. package/dist/layout/plot/{Plot.svelte.d.ts → AbstractPlot.svelte.d.ts} +3 -3
  22. package/dist/layout/styles/ValueLabels.d.ts +109 -58
  23. package/dist/layout/styles/ValueLabels.js +299 -141
  24. package/dist/markers/MarkerKinds.d.ts +79 -1
  25. package/dist/markers/MarkerKinds.js +149 -23
  26. package/dist/markers/area/AreaMarker.svelte +1 -1
  27. package/dist/markers/bar/BarMarker.svelte +8 -6
  28. package/dist/markers/bollinger/BollingerMarker.svelte +1 -1
  29. package/dist/markers/box/BoxMarker.svelte +1 -1
  30. package/dist/markers/dot/DotRadius.d.ts +11 -0
  31. package/dist/markers/dot/DotRadius.js +21 -0
  32. package/dist/markers/labels/CurveLabel.svelte +56 -0
  33. package/dist/markers/labels/CurveLabel.svelte.d.ts +9 -0
  34. package/dist/markers/labels/LabelMerge.d.ts +11 -0
  35. package/dist/markers/labels/LabelMerge.js +87 -0
  36. package/dist/markers/labels/MarkerLabel.svelte +36 -0
  37. package/dist/markers/labels/MarkerLabel.svelte.d.ts +10 -0
  38. package/dist/markers/labels/MarkerLabels.d.ts +52 -0
  39. package/dist/markers/labels/MarkerLabels.js +97 -0
  40. package/dist/markers/labels/geometry/BoxGeometry.d.ts +8 -0
  41. package/dist/markers/labels/geometry/BoxGeometry.js +101 -0
  42. package/dist/markers/labels/geometry/CurveGeometry.d.ts +34 -0
  43. package/dist/markers/labels/geometry/CurveGeometry.js +193 -0
  44. package/dist/markers/labels/geometry/PointGeometry.d.ts +9 -0
  45. package/dist/markers/labels/geometry/PointGeometry.js +22 -0
  46. package/dist/markers/labels/layouts/BoxLayout.d.ts +10 -0
  47. package/dist/markers/labels/layouts/BoxLayout.js +49 -0
  48. package/dist/markers/labels/layouts/PathLayout.d.ts +11 -0
  49. package/dist/markers/labels/layouts/PathLayout.js +91 -0
  50. package/dist/markers/labels/layouts/PointLayout.d.ts +19 -0
  51. package/dist/markers/labels/layouts/PointLayout.js +94 -0
  52. package/dist/markers/regression/RegressionMarker.svelte +1 -1
  53. package/dist/markers/text/Covering.d.ts +13 -0
  54. package/dist/markers/text/Covering.js +29 -0
  55. package/dist/markers/text/Declutter.d.ts +24 -3
  56. package/dist/markers/text/Declutter.js +46 -3
  57. package/dist/markers/text/TextMarker.svelte +90 -17
  58. package/dist/markers/text/TextMarker.svelte.d.ts +1 -1
  59. package/dist/markers/tick/TickMarker.svelte +1 -1
  60. package/dist/markers/utils/MarkerChannels.d.ts +1 -1
  61. package/dist/markers/utils/MarkerChannels.js +3 -2
  62. package/dist/markers/violin/ViolinMarker.svelte +1 -1
  63. package/dist/markers/waffle/WaffleMarker.svelte +1 -1
  64. package/dist/phases/context/RowContext.d.ts +2 -0
  65. package/dist/phases/context/RowContext.js +2 -0
  66. package/dist/phases/markers/MarkerStyles.js +14 -11
  67. package/dist/phases/markers/MarkersPhase.d.ts +2 -3
  68. package/dist/phases/markers/MarkersPhase.js +17 -11
  69. package/dist/phases/statistics/MarkerGrouping.js +5 -32
  70. package/dist/phases/statistics/MarkerInheritance.d.ts +11 -0
  71. package/dist/phases/statistics/MarkerInheritance.js +25 -0
  72. package/dist/phases/statistics/MarkerOrientation.d.ts +26 -0
  73. package/dist/phases/statistics/MarkerOrientation.js +29 -0
  74. package/dist/phases/statistics/StatisticsPhase.js +15 -15
  75. package/dist/phases/transforms/TransformsPhase.js +5 -3
  76. package/dist/plots/correlation/heatmap/Plot.svelte +2 -2
  77. package/dist/plots/correlation/heatmap/Plot.svelte.d.ts +0 -1
  78. package/dist/plots/correlation/heatmap/defaults.js +14 -1
  79. package/dist/plots/correlation/heatmap/markers.d.ts +0 -6
  80. package/dist/plots/correlation/heatmap/markers.js +5 -9
  81. package/dist/plots/correlation/scatter/Plot.svelte +2 -2
  82. package/dist/plots/correlation/scatter/Plot.svelte.d.ts +0 -1
  83. package/dist/plots/correlation/scatter/defaults.js +9 -3
  84. package/dist/plots/correlation/scatter/markers.d.ts +0 -9
  85. package/dist/plots/correlation/scatter/markers.js +21 -28
  86. package/dist/plots/distribution/box/BoxSummaries.d.ts +5 -0
  87. package/dist/plots/distribution/box/BoxSummaries.js +9 -0
  88. package/dist/plots/distribution/box/Plot.svelte +2 -2
  89. package/dist/plots/distribution/box/Plot.svelte.d.ts +0 -1
  90. package/dist/plots/distribution/box/defaults.js +11 -0
  91. package/dist/plots/distribution/box/markers.js +10 -1
  92. package/dist/plots/distribution/density/Plot.svelte +2 -2
  93. package/dist/plots/distribution/density/Plot.svelte.d.ts +0 -1
  94. package/dist/plots/distribution/density/defaults.js +16 -0
  95. package/dist/plots/distribution/density/markers.js +5 -1
  96. package/dist/plots/distribution/histogram/Plot.svelte +2 -2
  97. package/dist/plots/distribution/histogram/Plot.svelte.d.ts +0 -1
  98. package/dist/plots/distribution/histogram/defaults.js +16 -11
  99. package/dist/plots/distribution/histogram/markers.js +3 -3
  100. package/dist/plots/distribution/pyramid/Plot.svelte +2 -2
  101. package/dist/plots/distribution/pyramid/Plot.svelte.d.ts +0 -1
  102. package/dist/plots/distribution/pyramid/defaults.js +9 -2
  103. package/dist/plots/distribution/pyramid/markers.d.ts +0 -8
  104. package/dist/plots/distribution/pyramid/markers.js +6 -16
  105. package/dist/plots/distribution/violin/Plot.svelte +2 -2
  106. package/dist/plots/distribution/violin/Plot.svelte.d.ts +0 -1
  107. package/dist/plots/distribution/violin/defaults.js +11 -0
  108. package/dist/plots/distribution/violin/markers.js +27 -3
  109. package/dist/plots/evolution/area/Plot.svelte +2 -2
  110. package/dist/plots/evolution/area/Plot.svelte.d.ts +0 -1
  111. package/dist/plots/evolution/area/defaults.js +4 -7
  112. package/dist/plots/evolution/area/markers.js +3 -1
  113. package/dist/plots/evolution/line/Plot.svelte +2 -2
  114. package/dist/plots/evolution/line/Plot.svelte.d.ts +0 -1
  115. package/dist/plots/evolution/line/defaults.js +4 -6
  116. package/dist/plots/evolution/line/markers.js +3 -1
  117. package/dist/plots/evolution/slope/Plot.svelte +2 -2
  118. package/dist/plots/evolution/slope/Plot.svelte.d.ts +0 -1
  119. package/dist/plots/evolution/slope/defaults.js +4 -3
  120. package/dist/plots/evolution/slope/markers.d.ts +4 -3
  121. package/dist/plots/evolution/slope/markers.js +16 -9
  122. package/dist/plots/evolution/sparkline/Plot.svelte +2 -2
  123. package/dist/plots/evolution/sparkline/Plot.svelte.d.ts +0 -1
  124. package/dist/plots/evolution/sparkline/defaults.js +1 -1
  125. package/dist/plots/evolution/sparkline/markers.js +3 -1
  126. package/dist/plots/generic/Plot.svelte +42 -0
  127. package/dist/plots/generic/Plot.svelte.d.ts +25 -0
  128. package/dist/plots/generic/defaults.d.ts +4 -0
  129. package/dist/plots/generic/defaults.js +7 -0
  130. package/dist/plots/map/geo/Plot.svelte +2 -2
  131. package/dist/plots/map/geo/Plot.svelte.d.ts +0 -1
  132. package/dist/plots/part-of-a-whole/treemap/Plot.svelte +2 -2
  133. package/dist/plots/part-of-a-whole/treemap/Plot.svelte.d.ts +0 -1
  134. package/dist/plots/part-of-a-whole/treemap/defaults.js +2 -2
  135. package/dist/plots/ranking/bar/Plot.svelte +2 -2
  136. package/dist/plots/ranking/bar/Plot.svelte.d.ts +0 -1
  137. package/dist/plots/ranking/bar/defaults.js +13 -3
  138. package/dist/plots/ranking/bar/markers.js +10 -27
  139. package/dist/plots/ranking/bullet/Plot.svelte +2 -2
  140. package/dist/plots/ranking/bullet/Plot.svelte.d.ts +0 -1
  141. package/dist/plots/ranking/bullet/defaults.js +20 -0
  142. package/dist/plots/ranking/bullet/markers.js +7 -1
  143. package/dist/plots/ranking/cleveland/ClevelandMarkers.d.ts +2 -9
  144. package/dist/plots/ranking/cleveland/ClevelandMarkers.js +65 -47
  145. package/dist/plots/ranking/cleveland/Plot.svelte +2 -2
  146. package/dist/plots/ranking/cleveland/Plot.svelte.d.ts +0 -1
  147. package/dist/plots/ranking/cleveland/defaults.js +33 -2
  148. package/dist/plots/ranking/dumbbell/Plot.svelte +2 -2
  149. package/dist/plots/ranking/dumbbell/Plot.svelte.d.ts +0 -1
  150. package/dist/plots/ranking/forest/Plot.svelte +2 -2
  151. package/dist/plots/ranking/forest/Plot.svelte.d.ts +0 -1
  152. package/dist/plots/ranking/lollipop/Plot.svelte +2 -2
  153. package/dist/plots/ranking/lollipop/Plot.svelte.d.ts +0 -1
  154. package/dist/types/layout/context.d.ts +2 -0
  155. package/dist/types/layout/styles/bullet.d.ts +4 -1
  156. package/dist/types/layout/styles/values.d.ts +51 -11
  157. package/dist/types/markers/axis/area.d.ts +5 -1
  158. package/dist/types/markers/axis/bar.d.ts +5 -2
  159. package/dist/types/markers/axis/bollinger.d.ts +2 -1
  160. package/dist/types/markers/axis/box.d.ts +2 -1
  161. package/dist/types/markers/axis/cell.d.ts +4 -1
  162. package/dist/types/markers/axis/line.d.ts +4 -1
  163. package/dist/types/markers/axis/rect.d.ts +4 -1
  164. package/dist/types/markers/axis/regression.d.ts +2 -1
  165. package/dist/types/markers/axis/tick.d.ts +2 -1
  166. package/dist/types/markers/axis/trail.d.ts +4 -1
  167. package/dist/types/markers/axis/violin.d.ts +2 -1
  168. package/dist/types/markers/axis/waffle.d.ts +5 -1
  169. package/dist/types/markers/basic/dot.d.ts +4 -1
  170. package/dist/types/markers/basic/text.d.ts +25 -21
  171. package/dist/types/markers/channels/commonMarkerConfigWithLabel.d.ts +5 -9
  172. package/dist/types/markers/channels/commonMarkerConfigWithOrientation.d.ts +5 -0
  173. package/dist/types/markers/channels/commonMarkerConfigWithOrientation.js +1 -0
  174. package/dist/types/markers/labels/box.d.ts +57 -0
  175. package/dist/types/markers/labels/box.js +1 -0
  176. package/dist/types/markers/labels/common.d.ts +15 -0
  177. package/dist/types/markers/labels/common.js +1 -0
  178. package/dist/types/markers/labels/path.d.ts +52 -0
  179. package/dist/types/markers/labels/path.js +1 -0
  180. package/dist/types/markers/labels/point.d.ts +40 -0
  181. package/dist/types/markers/labels/point.js +1 -0
  182. package/dist/types/markers/traits.d.ts +10 -0
  183. package/dist/types/phases/markers/phase.d.ts +1 -8
  184. package/dist/types/phases/statistics/phase.d.ts +8 -3
  185. package/dist/types/phases/styles/phase.d.ts +15 -3
  186. package/dist/types/phases/transforms/phase.d.ts +2 -0
  187. package/dist/types/plots/constants.d.ts +0 -12
  188. package/dist/types/plots/correlation/heatmap/props.d.ts +3 -2
  189. package/dist/types/plots/correlation/scatter/props.d.ts +3 -2
  190. package/dist/types/plots/distribution/box/props.d.ts +6 -2
  191. package/dist/types/plots/distribution/density/props.d.ts +2 -1
  192. package/dist/types/plots/distribution/histogram/props.d.ts +3 -2
  193. package/dist/types/plots/distribution/pyramid/props.d.ts +3 -2
  194. package/dist/types/plots/distribution/violin/props.d.ts +4 -1
  195. package/dist/types/plots/evolution/area/props.d.ts +3 -2
  196. package/dist/types/plots/evolution/line/props.d.ts +3 -2
  197. package/dist/types/plots/generic/props.d.ts +16 -0
  198. package/dist/types/plots/generic/props.js +1 -0
  199. package/dist/types/plots/generic/state.d.ts +4 -0
  200. package/dist/types/plots/generic/state.js +1 -0
  201. package/dist/types/plots/part-of-a-whole/treemap/props.d.ts +4 -2
  202. package/dist/types/plots/ranking/bar/props.d.ts +3 -2
  203. package/dist/types/plots/ranking/cleveland/props.d.ts +3 -2
  204. package/dist/types/plots/ranking/dumbbell/props.d.ts +3 -2
  205. package/dist/types/plots/ranking/forest/props.d.ts +5 -2
  206. package/dist/types/plots/ranking/lollipop/props.d.ts +3 -2
  207. package/docs/architecture.md +9 -9
  208. package/docs/markers.md +2 -4
  209. package/docs/plots/ranking/cleveland.md +1 -1
  210. package/docs/styles-and-segments.md +1 -14
  211. package/docs/value-labels.md +159 -0
  212. package/examples/BarValues.svelte +1 -1
  213. package/llms-full.txt +2 -2
  214. package/llms.txt +1 -0
  215. package/package.json +3 -1
  216. package/dist/markers/utils/BoxLabel.d.ts +0 -58
  217. package/dist/markers/utils/BoxLabel.js +0 -175
  218. package/dist/markers/utils/MarkerLabel.svelte +0 -33
  219. package/dist/markers/utils/MarkerLabel.svelte.d.ts +0 -10
  220. /package/dist/layout/plot/{Plot.svelte → AbstractPlot.svelte} +0 -0
@@ -1,3 +1,4 @@
1
+ import { isGapValue } from '../../utils/gaps';
1
2
  import { PlotAxes } from '../../../phases/data/PlotAxes';
2
3
  import { ProcessedPositions } from '../../../phases/transforms/ProcessedPositions';
3
4
  import { SERIES_KEY } from '../../../phases/transforms/TransformsPhase';
@@ -5,6 +6,7 @@ import { ValueLabels } from '../../../layout/styles/ValueLabels';
5
6
  import { ClevelandRanges } from './ClevelandRanges';
6
7
  import { ClevelandConnector } from './ClevelandConnector';
7
8
  import { BasicStyles } from '../../../layout/styles/BasicStyles';
9
+ import { PointLayout } from '../../../markers/labels/layouts/PointLayout';
8
10
  /** The messages already warned about, so a plot that redraws warns once. */
9
11
  const warned = new Set();
10
12
  /**
@@ -13,7 +15,7 @@ const warned = new Set();
13
15
  * highest value (from the baseline, for a lollipop) with a dot at each value.
14
16
  * A category with one dot gets a stem in that dot's series color, restyled by
15
17
  * the segment its dot belongs to; a category with several gets one neutral
16
- * connector. The "markers" phase takes its `marks`, `valueLabels` and `reach`.
18
+ * connector. The "markers" phase takes its `marks` and `reach`.
17
19
  */
18
20
  export class ClevelandMarkers {
19
21
  #options;
@@ -202,12 +204,24 @@ export class ClevelandMarkers {
202
204
  };
203
205
  });
204
206
  });
207
+ const values = state.valueLabels?.show ? state.valueLabels : undefined;
208
+ const labels = values?.writes('value') ? this.#valueLabels(values, state, env) : undefined;
209
+ // The other parts of a row it labels - an interval's ends - beside them; the dots write the value.
210
+ const processed = state.processedData;
211
+ const position = ProcessedPositions.of(processed, PlotAxes.valueOf(state));
212
+ const parts = values
213
+ ? values.partMarkers(env, processed.data.filter((row) => !isGapValue(position[PlotAxes.valueOf(state)](row))), ValueLabels.bandPoint(state, position[PlotAxes.categoryOf(state)]), {
214
+ skip: ['value'],
215
+ seriesColor: (row) => state.colorForSeries(String(row[SERIES_KEY]))
216
+ })
217
+ : [];
205
218
  return [
206
219
  ...rules,
207
220
  ...caps,
208
221
  ...arrows,
209
- ...dots,
210
- ...this.#connectorLabels(state, env, connector, looks, isHorizontal)
222
+ ...ValueLabels.onMarkers(dots, 'dot', labels),
223
+ ...this.#connectorLabels(state, env, connector, looks, isHorizontal),
224
+ ...parts
211
225
  ];
212
226
  };
213
227
  /** The dash, cap and join a connector is drawn with, leaving out what is not set. */
@@ -282,68 +296,72 @@ export class ClevelandMarkers {
282
296
  ];
283
297
  }
284
298
  /**
285
- * The value labels of the dots `styles.values.of` picks, one `'text'` marker
286
- * per place a dot can hold in its range - past the top end (above, or right
287
- * of it), past the bottom end (below, or left of it) and, for the dots
288
- * between, beside it - and per series, when they take their series' color.
299
+ * The value labels of the dots `styles.values` picks, placed by where each dot sits in its range - or on the
300
+ * `side` the author asks of them all, or around each dot's rim (`'path'`).
289
301
  */
290
- valueLabels = (labels, state, env) => {
302
+ #valueLabels(labels, state, env) {
291
303
  if (!state.processedData?.data.length)
292
304
  return [];
293
305
  const { isHorizontal } = ClevelandMarkers.#geometry(state);
294
- const { category, value } = ClevelandMarkers.#channels(state);
295
306
  const { font, format } = labels;
296
307
  const read = ValueLabels.valueOf(state);
297
308
  const valueOf = ProcessedPositions.of(state.processedData, PlotAxes.valueOf(state))[PlotAxes.valueOf(state)];
298
- const gap = labels.offset(isHorizontal ? 'x' : 'y', env.cfg[this.#options.config].labelGap);
309
+ const gap = labels.offset(env.cfg[this.#options.config].labelGap);
299
310
  const nameOf = (d) => String(d[SERIES_KEY]);
300
311
  const picked = this.#picked(state);
301
- // Where a label sits from its dot, by role: along the range (past an end) or across it (between).
302
- const placement = {
303
- max: isHorizontal
304
- ? { dx: gap, dy: 0, textAnchor: 'start', lineAnchor: 'middle' }
305
- : { dx: 0, dy: -gap, textAnchor: 'middle', lineAnchor: 'bottom' },
306
- min: isHorizontal
307
- ? { dx: -gap, dy: 0, textAnchor: 'end', lineAnchor: 'middle' }
308
- : { dx: 0, dy: gap, textAnchor: 'middle', lineAnchor: 'top' },
309
- between: isHorizontal
310
- ? { dx: 0, dy: -gap, textAnchor: 'middle', lineAnchor: 'bottom' }
311
- : { dx: gap, dy: 0, textAnchor: 'start', lineAnchor: 'middle' }
312
- };
313
- // What fills the labels of a series: the one fill all share, its own color, or the axis'.
314
- const fillOf = (series) => labels.fill ??
315
- (labels.color === 'series' ? state.colorForSeries(series) : undefined) ??
316
- 'currentColor';
317
- const names = labels.color === 'series' && !labels.fill
318
- ? (state.resolvedSeries ?? []).map((s) => s.name)
319
- : [''];
320
- return ['max', 'min', 'between'].flatMap((role) => names.flatMap((name) => {
321
- const data = picked
322
- .filter(({ entry, dot }) => ClevelandRanges.roleOf(entry, dot.value) === role &&
323
- (name === '' || dot.series === name))
324
- .map(({ dot }) => dot.row);
325
- if (data.length === 0)
312
+ // Along the range past an end, across it between them.
313
+ const side = labels.placement.side;
314
+ const own = side && { ...PointLayout.sideOf(side, gap) };
315
+ const placement = own
316
+ ? { max: own, min: own, between: own }
317
+ : {
318
+ max: isHorizontal
319
+ ? { dx: gap, dy: 0, textAnchor: 'start', lineAnchor: 'middle' }
320
+ : { dx: 0, dy: -gap, textAnchor: 'middle', lineAnchor: 'bottom' },
321
+ min: isHorizontal
322
+ ? { dx: -gap, dy: 0, textAnchor: 'end', lineAnchor: 'middle' }
323
+ : { dx: 0, dy: gap, textAnchor: 'middle', lineAnchor: 'top' },
324
+ between: isHorizontal
325
+ ? { dx: 0, dy: -gap, textAnchor: 'middle', lineAnchor: 'bottom' }
326
+ : { dx: gap, dy: 0, textAnchor: 'start', lineAnchor: 'middle' }
327
+ };
328
+ const fill = labels.fill ??
329
+ (labels.color === 'series'
330
+ ? (d) => state.colorForSeries(nameOf(d))
331
+ : 'currentColor');
332
+ if (labels.layout === 'path') {
333
+ const text = (d) => format(Number(read(d) ?? valueOf(d)), d, nameOf(d));
334
+ const rim = labels.label(env, text, { fontSize: 12 });
335
+ return [{ ...rim, styles: { ...rim.styles, fill: font?.fill ?? fill } }];
336
+ }
337
+ const { styles: shared, ...hooks } = labels.hooks(env);
338
+ return ['max', 'min', 'between'].flatMap((role) => {
339
+ const rows = new Set(picked
340
+ .filter(({ entry, dot }) => ClevelandRanges.roleOf(entry, dot.value) === role)
341
+ .map(({ dot }) => dot.row));
342
+ if (rows.size === 0)
326
343
  return [];
327
344
  const at = placement[role];
328
345
  return [
329
346
  {
330
- type: 'text',
331
- data,
332
- ...(isHorizontal ? { x: value, y: category } : { x: category, y: value }),
347
+ ...hooks,
348
+ layout: 'point',
349
+ select: (row) => rows.has(row),
333
350
  text: (d) => format(Number(read(d) ?? valueOf(d)), d, nameOf(d)),
334
351
  styles: {
352
+ ...shared,
335
353
  ...font,
336
- fill: fillOf(name),
354
+ fill,
337
355
  fontSize: font?.fontSize ?? 12,
338
- dx: font?.dx ?? at.dx,
339
- dy: font?.dy ?? at.dy,
340
- textAnchor: labels.textAnchor ?? at.textAnchor,
341
- lineAnchor: font?.lineAnchor ?? at.lineAnchor
356
+ dx: at.dx,
357
+ dy: at.dy,
358
+ textAnchor: at.textAnchor,
359
+ lineAnchor: at.lineAnchor
342
360
  }
343
361
  }
344
362
  ];
345
- }));
346
- };
363
+ });
364
+ }
347
365
  /**
348
366
  * Room for the labels past the dots at the end of the value axis, so the
349
367
  * farthest one fits inside the figure instead of crossing its edge. Only the
@@ -355,10 +373,10 @@ export class ClevelandMarkers {
355
373
  if (top.length === 0)
356
374
  return [];
357
375
  if (!state.axes?.isHorizontal) {
358
- const at = { y: -labels.offset('y', gap) };
376
+ const at = { y: -labels.offset(gap) };
359
377
  return [labels.edgeBox('0', { x: 'middle', y: 'before' }, at, ['top'])];
360
378
  }
361
- const at = { x: labels.offset('x', gap) };
379
+ const at = { x: labels.offset(gap) };
362
380
  const texts = new Set(top.map(({ dot }) => labels.format(dot.value, dot.row, dot.series)));
363
381
  return [...texts].map((text) => labels.edgeBox(text, { x: 'after', y: 'middle' }, at, ['right']));
364
382
  };
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" generics="TData extends Record<string, unknown>">
2
- import Plot from '../../../layout/plot/Plot.svelte';
2
+ import AbstractPlot from '../../../layout/plot/AbstractPlot.svelte';
3
3
  import { buildClevelandDefaults } from './defaults';
4
4
  import type {
5
5
  ClevelandPlotProps,
@@ -28,7 +28,7 @@
28
28
  }: ClevelandPlotProps<TData> = $props();
29
29
  </script>
30
30
 
31
- <Plot
31
+ <AbstractPlot
32
32
  core={core as ClevelandPlotCoreProps<TData>}
33
33
  defaults={buildClevelandDefaults}
34
34
  bind:margins
@@ -1,4 +1,3 @@
1
- import Plot from '../../../layout/plot/Plot.svelte';
2
1
  import type { ClevelandPlotProps } from '../../../types/plots/ranking/cleveland/props';
3
2
  declare function $$render<TData extends Record<string, unknown>>(): {
4
3
  props: ClevelandPlotProps<TData>;
@@ -1,3 +1,5 @@
1
+ import { ValueLabels } from '../../../layout/styles/ValueLabels';
2
+ import { RowNumbers } from '../../utils/RowNumbers';
1
3
  import { ClevelandMarkers } from './ClevelandMarkers';
2
4
  import { HoverDefaults } from '../../../layout/hover/HoverDefaults';
3
5
  import { ClevelandRanges } from './ClevelandRanges';
@@ -63,8 +65,37 @@ export function buildClevelandDefaults(options = { name: 'ClevelandPlot', config
63
65
  },
64
66
  // A dot is labelled by what its category's dots say: the first, the highest... of each.
65
67
  transforms: { labels: { group: 'category', skip: ClevelandRanges.skipGaps } },
66
- styles: { values: { reach: markers.reach } },
67
- markers: { marks: markers.marks, valueLabels: markers.valueLabels },
68
+ // An interval's ends, for its tooltip, hover and value labels to read.
69
+ context: options.interval
70
+ ? (state) => {
71
+ const valueOf = ValueLabels.valueOf(state);
72
+ return ((row) => {
73
+ const [lower, upper] = RowNumbers.interval(state, row, Number(valueOf(row)));
74
+ return { lower, upper };
75
+ });
76
+ }
77
+ : undefined,
78
+ styles: {
79
+ values: {
80
+ layout: 'point',
81
+ layouts: { path: { side: 'outside' } },
82
+ // An interval's ends sit past it, each on its own side.
83
+ parts: options.interval
84
+ ? {
85
+ placements: (state) => {
86
+ const sideways = state.axes?.isHorizontal;
87
+ return {
88
+ lower: { side: sideways ? 'before' : 'below' },
89
+ upper: { side: sideways ? 'after' : 'above' }
90
+ };
91
+ },
92
+ default: ['value']
93
+ }
94
+ : undefined,
95
+ reach: (labels, state) => (labels.layout === 'point' ? markers.reach(labels, state) : [])
96
+ }
97
+ },
98
+ markers: { marks: markers.marks },
68
99
  // A rule along the value axis at the hovered dot, and a dot and a label on each one of its category.
69
100
  hover: { marker: (state) => HoverDefaults.valueRule(PlotAxes.valueOf(state)) }
70
101
  };
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" generics="TData extends Record<string, unknown>">
2
- import Plot from '../../../layout/plot/Plot.svelte';
2
+ import AbstractPlot from '../../../layout/plot/AbstractPlot.svelte';
3
3
  import { buildDumbbellDefaults } from './defaults';
4
4
  import type {
5
5
  DumbbellPlotProps,
@@ -28,7 +28,7 @@
28
28
  }: DumbbellPlotProps<TData> = $props();
29
29
  </script>
30
30
 
31
- <Plot
31
+ <AbstractPlot
32
32
  core={core as DumbbellPlotCoreProps<TData>}
33
33
  defaults={buildDumbbellDefaults}
34
34
  bind:margins
@@ -1,4 +1,3 @@
1
- import Plot from '../../../layout/plot/Plot.svelte';
2
1
  import type { DumbbellPlotProps } from '../../../types/plots/ranking/dumbbell/props';
3
2
  declare function $$render<TData extends Record<string, unknown>>(): {
4
3
  props: DumbbellPlotProps<TData>;
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" generics="TData extends Record<string, unknown>">
2
- import Plot from '../../../layout/plot/Plot.svelte';
2
+ import AbstractPlot from '../../../layout/plot/AbstractPlot.svelte';
3
3
  import { buildForestDefaults } from './defaults';
4
4
  import type { ForestPlotProps, ForestPlotCoreProps } from '../../../types/plots/ranking/forest/props';
5
5
 
@@ -25,7 +25,7 @@
25
25
  }: ForestPlotProps<TData> = $props();
26
26
  </script>
27
27
 
28
- <Plot
28
+ <AbstractPlot
29
29
  core={core as ForestPlotCoreProps<TData>}
30
30
  defaults={buildForestDefaults}
31
31
  bind:margins
@@ -1,4 +1,3 @@
1
- import Plot from '../../../layout/plot/Plot.svelte';
2
1
  import type { ForestPlotProps } from '../../../types/plots/ranking/forest/props';
3
2
  declare function $$render<TData extends Record<string, unknown>>(): {
4
3
  props: ForestPlotProps<TData>;
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" generics="TData extends Record<string, unknown>">
2
- import Plot from '../../../layout/plot/Plot.svelte';
2
+ import AbstractPlot from '../../../layout/plot/AbstractPlot.svelte';
3
3
  import { buildLollipopDefaults } from './defaults';
4
4
  import type {
5
5
  LollipopPlotProps,
@@ -28,7 +28,7 @@
28
28
  }: LollipopPlotProps<TData> = $props();
29
29
  </script>
30
30
 
31
- <Plot
31
+ <AbstractPlot
32
32
  core={core as LollipopPlotCoreProps<TData>}
33
33
  defaults={buildLollipopDefaults}
34
34
  bind:margins
@@ -1,4 +1,3 @@
1
- import Plot from '../../../layout/plot/Plot.svelte';
2
1
  import type { LollipopPlotProps } from '../../../types/plots/ranking/lollipop/props';
3
2
  declare function $$render<TData extends Record<string, unknown>>(): {
4
3
  props: LollipopPlotProps<TData>;
@@ -16,6 +16,8 @@ export type PlotRowContext<TRow = Record<string, unknown>> = {
16
16
  value?: number;
17
17
  /** The row itself, as the plot drew it: the data's fields, plus whatever its transforms added. */
18
18
  row?: TRow;
19
+ /** Which of the row's values a label writes, on a plot whose rows have several (`styles.values.parts`). */
20
+ part?: string;
19
21
  };
20
22
  /** A plot kind's own context of a row: the shared one, with what the kind works out for it. */
21
23
  export type KindRowContext<TExtra extends object, TRow = Record<string, unknown>> = PlotRowContext<TRow> & TExtra;
@@ -1,7 +1,10 @@
1
+ import type { WithValues, BarValueLabel } from './values';
1
2
  import type { GapsAwarePlotStylesConfig } from './gaps';
2
3
  import type { BarSegmentStyle } from '../../plots/segments/common';
4
+ /** The values of a bullet's row its value labels can write: its bar's, its target, its ranges' bounds. */
5
+ export type BulletValuePart = 'value' | 'target' | 'ranges';
3
6
  /** `BulletPlot`'s `styles`: a bar plot's, with the look of its ranges and its target. Each field falls back to `bullet` in the configuration. */
4
- export type BulletStylesConfig = GapsAwarePlotStylesConfig<BarSegmentStyle> & {
7
+ export type BulletStylesConfig = WithValues<GapsAwarePlotStylesConfig<BarSegmentStyle>, BarValueLabel, BulletValuePart> & {
5
8
  /** The bar that shows the value. */
6
9
  bar?: {
7
10
  /** Its thickness across the category band, in px. */
@@ -1,4 +1,7 @@
1
- import type { ValueAnchor } from '../../plots/constants';
1
+ import type { MarkerLabelConfig } from '../../markers/labels/common';
2
+ import type { BoxLabelConfig } from '../../markers/labels/box';
3
+ import type { PointLabelConfig } from '../../markers/labels/point';
4
+ import type { AreaEdgeLabelConfig, PageEdge, PathLabelConfig, RimLabelConfig, StrokeLabelConfig, ValueEdge } from '../../markers/labels/path';
2
5
  import type { FontStyle, StrokeStyle } from '../../plots/styling';
3
6
  import type { NumberDisplay } from '../numbers';
4
7
  import type { PlotRowContext } from '../context';
@@ -14,17 +17,42 @@ export type ValueSelect = 'first' | 'last' | 'min' | 'max';
14
17
  * marker over the rows the plot itself draws (after its own `transforms`):
15
18
  * one at the end of each series on a line or area plot, one per bar on a bar,
16
19
  * pyramid or histogram plot, one per point on a scatter plot and one per cell
17
- * on a heatmap. The high-level `anchor` sets sensible defaults for placement;
18
- * `fontStyle` (`dx`, `dy`, `textAnchor`, `lineAnchor`, `lineHeight`, `rotate`,
19
- * `class`, `textClass`, `fill`, …) overrides those defaults field-by-field when
20
- * provided - mirrors {@link DeltaConfig}'s `fontStyle`/`strokeStyle` split, so
21
- * label text and connector-line styling never mix into one flat bag of props.
20
+ * on a heatmap. `layout` and its options place them as a marker's `label` would (each
21
+ * plot kind takes the layouts its shapes do, with defaults of its own for each);
22
+ * `fontStyle` (`fill`, `fontSize`, `lineHeight`, `rotate`, `class`, …) styles
23
+ * the text, never where it sits - mirrors {@link DeltaConfig}'s
24
+ * `fontStyle`/`strokeStyle` split, so label text and connector-line styling
25
+ * never mix into one flat bag of props.
22
26
  */
23
- export type ValuesStyle = NumberDisplay & {
24
- /** Whether the labels are drawn. Off by default, except on a heatmap. */
27
+ /** The options of a label that place it, as `styles.values` takes them: its `layout` optional, the kind's by default. */
28
+ type LayoutKey = 'anchor' | 'edge' | 'side' | 'offset' | 'gap';
29
+ export type ValueLayoutOf<TLabel> = TLabel extends {
30
+ layout?: infer TLayout;
31
+ } ? Pick<TLabel, Extract<keyof TLabel, LayoutKey>> & {
32
+ layout?: TLayout;
33
+ } : never;
34
+ /**
35
+ * `TStyles` with its `values` taking only the labels of `TLabel` - the layouts a plot kind's shapes write - and, on a
36
+ * kind whose rows have several values, the `TPart`s it can label.
37
+ */
38
+ export type WithValues<TStyles, TLabel extends MarkerLabelConfig, TPart extends string = 'value'> = Omit<TStyles, 'values'> & {
39
+ values?: ValuesStyle<TLabel, TPart>;
40
+ };
41
+ export type ValuesStyle<TLabel extends MarkerLabelConfig = MarkerLabelConfig, TPart extends string = string> = ValuesOptions & ValueLayoutOf<TLabel> & {
42
+ parts?: ValueParts<TPart, TLabel>;
43
+ };
44
+ /** What a part's own label sets, over the plot's: where it sits and its text. */
45
+ export type ValuePartOptions<TLabel = MarkerLabelConfig> = Omit<ValueLayoutOf<TLabel>, 'layout'> & Pick<ValuesOptions, 'format'>;
46
+ /**
47
+ * The parts of each row a plot kind with several values per row labels - a box's `median`, a bullet's `target`: a
48
+ * list of them, or a record turning each on (`true`) or setting its own options.
49
+ */
50
+ export type ValueParts<TPart extends string, TLabel = MarkerLabelConfig> = TPart[] | Partial<Record<TPart, boolean | ValuePartOptions<TLabel>>>;
51
+ /** A value label's text style, without what places it: the layout's options do that. */
52
+ export type ValuesFontStyle = Omit<FontStyle, 'textAnchor' | 'lineAnchor' | 'dx' | 'dy'>;
53
+ type ValuesOptions = NumberDisplay & {
54
+ /** Whether the labels are drawn. Setting any other option of them turns them on; off by default, except on a heatmap. */
25
55
  show?: boolean;
26
- /** Where each label sits on its mark - see {@link ValueAnchor}. */
27
- anchor?: ValueAnchor;
28
56
  /**
29
57
  * Which rows of each group are labelled: one selector, or a list of them (a
30
58
  * row picked by any is labelled) - see {@link ValueSelect}. Each plot has its
@@ -48,7 +76,19 @@ export type ValuesStyle = NumberDisplay & {
48
76
  format?: (value: number, number: (value: number) => string, context: PlotRowContext) => string;
49
77
  /** Hovering a label dims every other series, like toggling them off in the legend. */
50
78
  hoverIsolate?: boolean;
51
- fontStyle?: FontStyle;
79
+ /** The text's look; where it sits is the layout's (`side`, `gap`, `offset`...). */
80
+ fontStyle?: ValuesFontStyle;
52
81
  /** The connectors a line or area plot routes back from labels that had to move apart. */
53
82
  strokeStyle?: StrokeStyle;
54
83
  };
84
+ /** The labels a plot of bars writes on them: in each, along an edge (its `tip` too) or beside a point of it. */
85
+ export type BarValueLabel = BoxLabelConfig | PathLabelConfig<PageEdge | ValueEdge> | PointLabelConfig;
86
+ /** The labels a plot of boxes with no value direction (a heatmap's cells, a histogram's bins) writes on them. */
87
+ export type CellValueLabel = BoxLabelConfig | PathLabelConfig<PageEdge> | PointLabelConfig;
88
+ /** The labels a plot of lines writes: beside its points, or along its lines. */
89
+ export type LineValueLabel = PointLabelConfig | StrokeLabelConfig;
90
+ /** The labels a plot of areas writes: beside its points, or along their top or bottom edge. */
91
+ export type AreaValueLabel = PointLabelConfig | AreaEdgeLabelConfig;
92
+ /** The labels a plot of dots writes: beside them, or around their rim. */
93
+ export type DotValueLabel = PointLabelConfig | RimLabelConfig;
94
+ export {};
@@ -1,3 +1,7 @@
1
+ import type { AreaEdgeLabelConfig } from '../labels/path';
2
+ import type { CommonMarkerConfigWithOrientation } from '../channels/commonMarkerConfigWithOrientation';
3
+ import type { PointLabelConfig } from '../labels/point';
4
+ import type { CommonMarkerConfigWithLabel } from '../channels/commonMarkerConfigWithLabel';
1
5
  import type { AreaStyle } from '../../plots/styling';
2
6
  import type { CommonMarkerConfigWithArea } from '../channels/commonMarkerConfigWithArea';
3
7
  import type { CommonMarkerConfigWithColor } from '../channels/commonMarkerConfigWithColor';
@@ -9,4 +13,4 @@ export type AreaMarkerConfig = {
9
13
  curve?: CurveName;
10
14
  tension?: number;
11
15
  styles?: AreaStyle;
12
- } & CommonMarkerConfigWithArea & CommonMarkerConfigWithColor & CommonMarkerConfigWithInterval;
16
+ } & CommonMarkerConfigWithOrientation & CommonMarkerConfigWithArea & CommonMarkerConfigWithColor & CommonMarkerConfigWithInterval & CommonMarkerConfigWithLabel<AreaEdgeLabelConfig | PointLabelConfig>;
@@ -1,3 +1,7 @@
1
+ import type { PathLabelConfig, PageEdge, ValueEdge } from '../labels/path';
2
+ import type { BoxLabelConfig } from '../labels/box';
3
+ import type { PointLabelConfig } from '../labels/point';
4
+ import type { CommonMarkerConfigWithOrientation } from '../channels/commonMarkerConfigWithOrientation';
1
5
  import type { AxisValue } from '../../layout/mapping';
2
6
  import type { AreaStyle, PerRow, InsetStyle } from '../../plots/styling';
3
7
  import type { CommonMarkerConfigWithLabel } from '../channels/commonMarkerConfigWithLabel';
@@ -7,8 +11,7 @@ import type { CommonMarkerConfigWithInterval } from '../channels/commonMarkerCon
7
11
  export type BarMarkerConfig = {
8
12
  type: 'bar';
9
13
  role: 'segment' | 'hitArea';
10
- isHorizontal: boolean;
11
14
  thickness?: number;
12
15
  styles?: PerRow<AreaStyle> & InsetStyle;
13
16
  category?: AxisValue;
14
- } & CommonMarkerConfigWithColor & CommonMarkerConfigWithInterval & CommonMarkerConfigWithLabel;
17
+ } & CommonMarkerConfigWithOrientation & CommonMarkerConfigWithColor & CommonMarkerConfigWithInterval & CommonMarkerConfigWithLabel<BoxLabelConfig | PathLabelConfig<PageEdge | ValueEdge> | PointLabelConfig>;
@@ -1,6 +1,7 @@
1
+ import type { CommonMarkerConfigWithOrientation } from '../channels/commonMarkerConfigWithOrientation';
1
2
  import type { BollingerStatisticOptions } from '../../layout/statistics';
2
3
  import type { CommonMarkerConfig } from '../channels/commonMarkerConfig';
3
4
  /** A moving-average band (svelteplot's `BollingerX`/`BollingerY`). */
4
5
  export type BollingerMarkerConfig = {
5
6
  type: 'bollinger';
6
- } & BollingerStatisticOptions & CommonMarkerConfig;
7
+ } & CommonMarkerConfigWithOrientation & BollingerStatisticOptions & CommonMarkerConfig;
@@ -1,3 +1,4 @@
1
+ import type { CommonMarkerConfigWithOrientation } from '../channels/commonMarkerConfigWithOrientation';
1
2
  import type { CommonMarkerConfig } from '../channels/commonMarkerConfig';
2
3
  /**
3
4
  * A box plot (svelteplot's `BoxX`/`BoxY`). Styled per sub-mark through `bar`,
@@ -16,4 +17,4 @@ export type BoxMarkerConfig = {
16
17
  index: number;
17
18
  count: number;
18
19
  };
19
- } & CommonMarkerConfig;
20
+ } & CommonMarkerConfigWithOrientation & CommonMarkerConfig;
@@ -1,3 +1,6 @@
1
+ import type { PathLabelConfig, PageEdge } from '../labels/path';
2
+ import type { BoxLabelConfig } from '../labels/box';
3
+ import type { PointLabelConfig } from '../labels/point';
1
4
  import type { AreaStyle, PerRow, InsetStyle } from '../../plots/styling';
2
5
  import type { CommonMarkerConfigWithArea } from '../channels/commonMarkerConfigWithArea';
3
6
  import type { CommonMarkerConfigWithLabel } from '../channels/commonMarkerConfigWithLabel';
@@ -6,4 +9,4 @@ import type { CommonMarkerConfigWithColor } from '../channels/commonMarkerConfig
6
9
  export type CellMarkerConfig = {
7
10
  type: 'cell';
8
11
  styles?: PerRow<AreaStyle & Pick<InsetStyle, 'inset'>>;
9
- } & CommonMarkerConfigWithColor & CommonMarkerConfigWithArea & CommonMarkerConfigWithLabel;
12
+ } & CommonMarkerConfigWithColor & CommonMarkerConfigWithArea & CommonMarkerConfigWithLabel<BoxLabelConfig | PathLabelConfig<PageEdge> | PointLabelConfig>;
@@ -1,3 +1,6 @@
1
+ import type { StrokeLabelConfig } from '../labels/path';
2
+ import type { PointLabelConfig } from '../labels/point';
3
+ import type { CommonMarkerConfigWithLabel } from '../channels/commonMarkerConfigWithLabel';
1
4
  import type { StrokeStyle } from '../../plots/styling';
2
5
  import type { CurveName } from '../../layout/styles/curve';
3
6
  import type { CommonMarkerConfigWithColor } from '../channels/commonMarkerConfigWithColor';
@@ -6,4 +9,4 @@ export type LineMarkerConfig = {
6
9
  type: 'line';
7
10
  curve?: CurveName;
8
11
  styles?: StrokeStyle;
9
- } & CommonMarkerConfigWithColor;
12
+ } & CommonMarkerConfigWithColor & CommonMarkerConfigWithLabel<StrokeLabelConfig | PointLabelConfig>;
@@ -1,3 +1,6 @@
1
+ import type { PathLabelConfig, PageEdge } from '../labels/path';
2
+ import type { BoxLabelConfig } from '../labels/box';
3
+ import type { PointLabelConfig } from '../labels/point';
1
4
  import type { AreaStyle, PerRow, InsetStyle } from '../../plots/styling';
2
5
  import type { CommonMarkerConfigWithArea } from '../channels/commonMarkerConfigWithArea';
3
6
  import type { CommonMarkerConfigWithColor } from '../channels/commonMarkerConfigWithColor';
@@ -8,4 +11,4 @@ export type RectMarkerConfig = {
8
11
  type: 'rect';
9
12
  interval?: number | string;
10
13
  styles?: PerRow<AreaStyle & InsetStyle>;
11
- } & CommonMarkerConfigWithArea & CommonMarkerConfigWithColor & CommonMarkerConfigWithInterval & CommonMarkerConfigWithLabel;
14
+ } & CommonMarkerConfigWithArea & CommonMarkerConfigWithColor & CommonMarkerConfigWithInterval & CommonMarkerConfigWithLabel<BoxLabelConfig | PathLabelConfig<PageEdge> | PointLabelConfig>;
@@ -1,6 +1,7 @@
1
+ import type { CommonMarkerConfigWithOrientation } from '../channels/commonMarkerConfigWithOrientation';
1
2
  import type { RegressionStatisticOptions } from '../../layout/statistics';
2
3
  import type { CommonMarkerConfig } from '../channels/commonMarkerConfig';
3
4
  /** A fitted regression curve (svelteplot's `RegressionX`/`RegressionY`). */
4
5
  export type RegressionMarkerConfig = {
5
6
  type: 'regression';
6
- } & RegressionStatisticOptions & CommonMarkerConfig;
7
+ } & CommonMarkerConfigWithOrientation & RegressionStatisticOptions & CommonMarkerConfig;
@@ -1,3 +1,4 @@
1
+ import type { CommonMarkerConfigWithOrientation } from '../channels/commonMarkerConfigWithOrientation';
1
2
  import type { StrokeStyle, PerRow } from '../../plots/styling';
2
3
  import type { CommonMarkerConfigWithColor } from '../channels/commonMarkerConfigWithColor';
3
4
  /** A short tick per row along one axis (svelteplot's `TickX`/`TickY`). */
@@ -5,4 +6,4 @@ export type TickMarkerConfig = {
5
6
  type: 'tick';
6
7
  tickLength?: number | ((d: any) => number);
7
8
  styles?: PerRow<StrokeStyle>;
8
- } & CommonMarkerConfigWithColor;
9
+ } & CommonMarkerConfigWithOrientation & CommonMarkerConfigWithColor;
@@ -1,3 +1,6 @@
1
+ import type { StrokeLabelConfig } from '../labels/path';
2
+ import type { PointLabelConfig } from '../labels/point';
3
+ import type { CommonMarkerConfigWithLabel } from '../channels/commonMarkerConfigWithLabel';
1
4
  import type { AreaStyle } from '../../plots/styling';
2
5
  import type { CommonMarkerConfigWithColor } from '../channels/commonMarkerConfigWithColor';
3
6
  import type { CommonMarkerConfigWithRadius } from '../channels/commonMarkerConfigWithRadius';
@@ -10,4 +13,4 @@ export type TrailMarkerConfig = {
10
13
  cap?: 'butt' | 'round';
11
14
  resolution?: number | 'auto';
12
15
  styles?: Pick<AreaStyle, 'fill' | 'fillOpacity'>;
13
- } & CommonMarkerConfigWithRadius & CommonMarkerConfigWithColor;
16
+ } & CommonMarkerConfigWithRadius & CommonMarkerConfigWithColor & CommonMarkerConfigWithLabel<StrokeLabelConfig | PointLabelConfig>;
@@ -1,3 +1,4 @@
1
+ import type { CommonMarkerConfigWithOrientation } from '../channels/commonMarkerConfigWithOrientation';
1
2
  import type { AreaStyle } from '../../plots/styling';
2
3
  import type { DensityKernel } from '../../transforms/density';
3
4
  import type { CommonMarkerConfig } from '../channels/commonMarkerConfig';
@@ -22,4 +23,4 @@ export type ViolinMarkerConfig = {
22
23
  count: number;
23
24
  };
24
25
  styles?: AreaStyle;
25
- } & CommonMarkerConfig;
26
+ } & CommonMarkerConfigWithOrientation & CommonMarkerConfig;
@@ -1,3 +1,7 @@
1
+ import type { PathLabelConfig, PageEdge, ValueEdge } from '../labels/path';
2
+ import type { BoxLabelConfig } from '../labels/box';
3
+ import type { PointLabelConfig } from '../labels/point';
4
+ import type { CommonMarkerConfigWithOrientation } from '../channels/commonMarkerConfigWithOrientation';
1
5
  import type { AreaStyle, PerRow } from '../../plots/styling';
2
6
  import type { CommonMarkerConfigWithLabel } from '../channels/commonMarkerConfigWithLabel';
3
7
  import type { CommonMarkerConfigWithColor } from '../channels/commonMarkerConfigWithColor';
@@ -11,4 +15,4 @@ export type WaffleMarkerConfig = {
11
15
  gap?: number;
12
16
  round?: boolean;
13
17
  styles?: PerRow<AreaStyle>;
14
- } & CommonMarkerConfigWithColor & CommonMarkerConfigWithInterval & CommonMarkerConfigWithLabel;
18
+ } & CommonMarkerConfigWithOrientation & CommonMarkerConfigWithColor & CommonMarkerConfigWithInterval & CommonMarkerConfigWithLabel<BoxLabelConfig | PathLabelConfig<PageEdge | ValueEdge> | PointLabelConfig>;
@@ -1,3 +1,6 @@
1
+ import type { RimLabelConfig } from '../labels/path';
2
+ import type { PointLabelConfig } from '../labels/point';
3
+ import type { CommonMarkerConfigWithLabel } from '../channels/commonMarkerConfigWithLabel';
1
4
  import type { DotStyle, PerRow } from '../../plots/styling';
2
5
  import type { CommonMarkerConfigWithColor } from '../channels/commonMarkerConfigWithColor';
3
6
  import type { CommonMarkerConfigWithRadius } from '../channels/commonMarkerConfigWithRadius';
@@ -7,4 +10,4 @@ import type { CommonMarkerConfigWithSymbol } from '../channels/commonMarkerConfi
7
10
  export type DotMarkerConfig = CommonMarkerConfigWithRowOffset<{
8
11
  type: 'dot';
9
12
  styles?: PerRow<DotStyle>;
10
- } & CommonMarkerConfigWithRadius & CommonMarkerConfigWithColor & CommonMarkerConfigWithSymbol>;
13
+ } & CommonMarkerConfigWithRadius & CommonMarkerConfigWithColor & CommonMarkerConfigWithSymbol & CommonMarkerConfigWithLabel<RimLabelConfig | PointLabelConfig>>;