@pixerate/editor 0.52.0 → 0.54.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 (142) hide show
  1. package/dist/agent/index.cjs +37 -29
  2. package/dist/agent/index.cjs.map +1 -1
  3. package/dist/agent/index.d.cts +4 -3
  4. package/dist/agent/index.d.ts +4 -3
  5. package/dist/agent/index.js +16 -8
  6. package/dist/agent/index.js.map +1 -1
  7. package/dist/animation/index.cjs +15 -1
  8. package/dist/animation/index.cjs.map +1 -1
  9. package/dist/animation/index.d.cts +3 -226
  10. package/dist/animation/index.d.ts +3 -226
  11. package/dist/animation/index.js +14 -0
  12. package/dist/bridge/cli.cjs +36 -0
  13. package/dist/bridge/cli.cjs.map +1 -0
  14. package/dist/bridge/cli.d.cts +1 -0
  15. package/dist/bridge/cli.d.ts +1 -0
  16. package/dist/bridge/cli.js +36 -0
  17. package/dist/bridge/cli.js.map +1 -0
  18. package/dist/bridge/index.cjs +16 -0
  19. package/dist/bridge/index.cjs.map +1 -0
  20. package/dist/bridge/index.d.cts +65 -0
  21. package/dist/bridge/index.d.ts +65 -0
  22. package/dist/bridge/index.js +16 -0
  23. package/dist/bridge/index.js.map +1 -0
  24. package/dist/bridge-client-C5OziCRK.d.cts +148 -0
  25. package/dist/bridge-client-C5dRjrz5.d.ts +148 -0
  26. package/dist/canvas/index.cjs +1308 -528
  27. package/dist/canvas/index.cjs.map +1 -1
  28. package/dist/canvas/index.d.cts +309 -5
  29. package/dist/canvas/index.d.ts +309 -5
  30. package/dist/canvas/index.js +1295 -515
  31. package/dist/canvas/index.js.map +1 -1
  32. package/dist/chart/index.cjs +193 -192
  33. package/dist/chart/index.cjs.map +1 -1
  34. package/dist/chart/index.d.cts +77 -59
  35. package/dist/chart/index.d.ts +77 -59
  36. package/dist/chart/index.js +87 -86
  37. package/dist/chart/index.js.map +1 -1
  38. package/dist/{chunk-UAW5FEMD.js → chunk-3S72F46R.js} +66 -8
  39. package/dist/chunk-3S72F46R.js.map +1 -0
  40. package/dist/{chunk-5TWIN7ZJ.js → chunk-47WWV3LI.js} +34 -4
  41. package/dist/chunk-47WWV3LI.js.map +1 -0
  42. package/dist/{chunk-OV7UAKIY.js → chunk-633QC34G.js} +172 -1
  43. package/dist/chunk-633QC34G.js.map +1 -0
  44. package/dist/chunk-AWKPSOSX.js +401 -0
  45. package/dist/chunk-AWKPSOSX.js.map +1 -0
  46. package/dist/chunk-B6DSIEXA.js +96 -0
  47. package/dist/chunk-B6DSIEXA.js.map +1 -0
  48. package/dist/{chunk-5N6AQCVB.js → chunk-BQQZ6MOI.js} +3 -3
  49. package/dist/{chunk-M5Z77GFH.cjs → chunk-C3JHII3M.cjs} +53 -53
  50. package/dist/{chunk-M5Z77GFH.cjs.map → chunk-C3JHII3M.cjs.map} +1 -1
  51. package/dist/{chunk-JOX6MJW4.cjs → chunk-CKRNELPO.cjs} +176 -5
  52. package/dist/chunk-CKRNELPO.cjs.map +1 -0
  53. package/dist/{chunk-TGBCBQFV.cjs → chunk-DK6QBGCS.cjs} +45 -15
  54. package/dist/chunk-DK6QBGCS.cjs.map +1 -0
  55. package/dist/chunk-EGFUVXKK.cjs +96 -0
  56. package/dist/chunk-EGFUVXKK.cjs.map +1 -0
  57. package/dist/{chunk-AMWXSYCI.js → chunk-GPWNYQ7R.js} +2 -370
  58. package/dist/chunk-GPWNYQ7R.js.map +1 -0
  59. package/dist/chunk-H5K77C7Y.cjs +3848 -0
  60. package/dist/chunk-H5K77C7Y.cjs.map +1 -0
  61. package/dist/chunk-K73CKYUM.cjs +458 -0
  62. package/dist/chunk-K73CKYUM.cjs.map +1 -0
  63. package/dist/{chunk-GTZXF4BI.cjs → chunk-NK3WL5TJ.cjs} +298 -133
  64. package/dist/chunk-NK3WL5TJ.cjs.map +1 -0
  65. package/dist/{chunk-3ZBAXET6.cjs → chunk-NN3JGUSX.cjs} +80 -22
  66. package/dist/chunk-NN3JGUSX.cjs.map +1 -0
  67. package/dist/chunk-NV22EMOZ.cjs +401 -0
  68. package/dist/chunk-NV22EMOZ.cjs.map +1 -0
  69. package/dist/{chunk-YMKPMXZ4.js → chunk-OIKYP7XC.js} +4 -4
  70. package/dist/{chunk-FEMIVHN3.cjs → chunk-P43HUQRX.cjs} +16 -16
  71. package/dist/{chunk-FEMIVHN3.cjs.map → chunk-P43HUQRX.cjs.map} +1 -1
  72. package/dist/chunk-PTMIGXZ2.js +467 -0
  73. package/dist/chunk-PTMIGXZ2.js.map +1 -0
  74. package/dist/chunk-QIWFEEWG.cjs +467 -0
  75. package/dist/chunk-QIWFEEWG.cjs.map +1 -0
  76. package/dist/{chunk-QFTVLEVN.js → chunk-RIXTW3C4.js} +3 -3
  77. package/dist/{chunk-WBOAXDKD.js → chunk-VODBAO32.js} +222 -57
  78. package/dist/chunk-VODBAO32.js.map +1 -0
  79. package/dist/chunk-WWJNC7SX.js +3848 -0
  80. package/dist/chunk-WWJNC7SX.js.map +1 -0
  81. package/dist/{chunk-2DEBI6KU.cjs → chunk-YZZMX6V7.cjs} +10 -10
  82. package/dist/{chunk-2DEBI6KU.cjs.map → chunk-YZZMX6V7.cjs.map} +1 -1
  83. package/dist/commands/index.d.cts +1 -1
  84. package/dist/commands/index.d.ts +1 -1
  85. package/dist/{controller-DS3drIvy.d.cts → controller-CX0QfSv0.d.cts} +53 -2
  86. package/dist/{controller-BdKzaxs2.d.ts → controller-DscWQbjO.d.ts} +53 -2
  87. package/dist/diagram/index.cjs +1146 -0
  88. package/dist/diagram/index.cjs.map +1 -0
  89. package/dist/diagram/index.d.cts +787 -0
  90. package/dist/diagram/index.d.ts +787 -0
  91. package/dist/diagram/index.js +1146 -0
  92. package/dist/diagram/index.js.map +1 -0
  93. package/dist/{easing-DTmX99QG.d.cts → easing-CNGk-W6d.d.cts} +1 -1
  94. package/dist/{easing-DTmX99QG.d.ts → easing-CNGk-W6d.d.ts} +1 -1
  95. package/dist/export/index.cjs +4 -4
  96. package/dist/export/index.js +3 -3
  97. package/dist/extensions/index.cjs +6 -6
  98. package/dist/extensions/index.d.cts +2 -2
  99. package/dist/extensions/index.d.ts +2 -2
  100. package/dist/extensions/index.js +5 -5
  101. package/dist/generation/index.d.cts +2 -2
  102. package/dist/generation/index.d.ts +2 -2
  103. package/dist/image-editor/index.d.cts +1 -1
  104. package/dist/image-editor/index.d.ts +1 -1
  105. package/dist/{index-Dt9lzydb.d.ts → index-CALDD35B.d.ts} +1 -1
  106. package/dist/{index-DOy9HzfC.d.cts → index-DIWB6xMf.d.cts} +1 -1
  107. package/dist/index.cjs +13 -13
  108. package/dist/index.d.cts +3 -3
  109. package/dist/index.d.ts +3 -3
  110. package/dist/index.js +6 -6
  111. package/dist/parameters/index.d.cts +1 -1
  112. package/dist/parameters/index.d.ts +1 -1
  113. package/dist/player-DSMjdgQ9.d.cts +225 -0
  114. package/dist/player-DdfVrKWq.d.ts +225 -0
  115. package/dist/presence-Cb6WhcrQ.d.cts +77 -0
  116. package/dist/presence-Cb6WhcrQ.d.ts +77 -0
  117. package/dist/{registry-CSlH4iUn.d.ts → registry-7AZFuand.d.ts} +1 -1
  118. package/dist/{registry-B4l-lYts.d.cts → registry-DIpIaCkH.d.cts} +1 -1
  119. package/dist/tools/index.cjs +10 -2
  120. package/dist/tools/index.cjs.map +1 -1
  121. package/dist/tools/index.d.cts +3 -74
  122. package/dist/tools/index.d.ts +3 -74
  123. package/dist/tools/index.js +12 -4
  124. package/dist/types-BULrFyuQ.d.cts +316 -0
  125. package/dist/types-BULrFyuQ.d.ts +316 -0
  126. package/dist/vector/index.d.cts +1 -1
  127. package/dist/vector/index.d.ts +1 -1
  128. package/package.json +14 -1
  129. package/dist/chunk-3ZBAXET6.cjs.map +0 -1
  130. package/dist/chunk-5TWIN7ZJ.js.map +0 -1
  131. package/dist/chunk-AMWXSYCI.js.map +0 -1
  132. package/dist/chunk-GTZXF4BI.cjs.map +0 -1
  133. package/dist/chunk-JOX6MJW4.cjs.map +0 -1
  134. package/dist/chunk-OV7UAKIY.js.map +0 -1
  135. package/dist/chunk-TGBCBQFV.cjs.map +0 -1
  136. package/dist/chunk-UAW5FEMD.js.map +0 -1
  137. package/dist/chunk-WBOAXDKD.js.map +0 -1
  138. package/dist/chunk-XFYUFVAX.cjs +0 -826
  139. package/dist/chunk-XFYUFVAX.cjs.map +0 -1
  140. /package/dist/{chunk-5N6AQCVB.js.map → chunk-BQQZ6MOI.js.map} +0 -0
  141. /package/dist/{chunk-YMKPMXZ4.js.map → chunk-OIKYP7XC.js.map} +0 -0
  142. /package/dist/{chunk-QFTVLEVN.js.map → chunk-RIXTW3C4.js.map} +0 -0
@@ -1,7 +1,8 @@
1
- import { C as ChartNumberFormat, a as ChartValue, b as ChartRect, c as ChartScene, d as ChartSpec, e as ChartLayoutOptions, f as ChartTheme, g as ChartWarning, h as ChartAxis, i as ChartLegend, j as ChartType, k as ChartStacking, l as ChartSeries, m as ChartIssue, n as ChartController, o as ChartValueScale, p as ChartSelection, q as ChartSpecPatch } from '../controller-DS3drIvy.cjs';
2
- export { r as CHART_AXIS_KINDS, s as CHART_CURVES, t as CHART_LABEL_POSITIONS, u as CHART_LEGEND_POSITIONS, v as CHART_MARKERS, w as CHART_NUMBER_STYLES, x as CHART_ORIENTATIONS, y as CHART_SERIES_TYPES, z as CHART_STACKINGS, A as CHART_TRENDLINE_TYPES, B as CHART_TYPES, D as CHART_TYPE_LABELS, E as CSS_VARIABLE_CHART_THEME, F as ChartActionResult, G as ChartCircleMark, H as ChartControllerOptions, I as ChartCurve, J as ChartDomSpec, K as ChartEditOptions, L as ChartFamily, M as ChartLabelPosition, N as ChartLegendPosition, O as ChartLineMark, P as ChartMark, Q as ChartMarkRole, R as ChartMarker, S as ChartOrientation, T as ChartPathMark, U as ChartRectMark, V as ChartSeriesInput, W as ChartSeriesPatch, X as ChartSeriesType, Y as ChartSparklineKind, Z as ChartSparklineOptions, _ as ChartState, $ as ChartSvgOptions, a0 as ChartTableData, a1 as ChartTableOptions, a2 as ChartTextMark, a3 as ChartTextMeasure, a4 as ChartTrendFit, a5 as ChartTrendline, a6 as ChartTrendlineType, a7 as DEFAULT_CHART_PALETTE, a8 as DEFAULT_CHART_THEME, a9 as chartColorInputValue, aa as chartColorsByCategory, ab as chartDataFromTable, ac as chartDataToTable, ad as chartFamily, ae as chartMovingAverage, af as chartPointColor, ag as chartSceneToDomSpec, ah as chartSceneToSvg, ai as chartSeriesColor, aj as chartSeriesType, ak as chartSliceColor, al as chartSupportsTrendlines, am as chartTextBaseline, an as chartTextTransform, ao as chartToSvg, ap as chartTrendlineName, aq as cloneChartSeries, ar as cloneChartSpec, as as contrastingTextColor, at as createChartController, au as createChartSpec, av as defaultChartAxis, aw as estimateChartTextWidth, ax as fitChartTrendline, ay as isCartesianChart, az as isXyChart, aA as layoutSparkline, aB as normalizeChartAxis, aC as normalizeChartSpec, aD as normalizeChartTrendline, aE as normalizeChartValues, aF as parseChartValue, aG as sameChartSelection, aH as sparklineToSvg, aI as trendNumberText, aJ as uniqueChartSeriesId } from '../controller-DS3drIvy.cjs';
1
+ import { C as ChartValueScale, a as ChartNumberFormat, b as ChartValue, c as ChartRect, d as ChartErrorBars, e as ChartErrorBarType, f as ChartScene, g as ChartSpec, h as ChartLayoutOptions, i as ChartTheme, j as ChartWarning, k as ChartAxis, l as ChartLegend, m as ChartType, n as ChartStacking, o as ChartSeries, p as ChartIssue, q as ChartController, r as ChartSelection, s as ChartSpecPatch } from '../controller-CX0QfSv0.cjs';
2
+ export { t as CHART_AXIS_KINDS, u as CHART_AXIS_SCALES, v as CHART_CURVES, w as CHART_LABEL_POSITIONS, x as CHART_LEGEND_POSITIONS, y as CHART_MARKERS, z as CHART_NUMBER_STYLES, A as CHART_ORIENTATIONS, B as CHART_SERIES_TYPES, D as CHART_STACKINGS, E as CHART_TRENDLINE_TYPES, F as CHART_TYPES, G as CHART_TYPE_LABELS, H as CSS_VARIABLE_CHART_THEME, I as ChartActionResult, J as ChartCircleMark, K as ChartControllerOptions, L as ChartCurve, M as ChartDomSpec, N as ChartEditOptions, O as ChartFamily, P as ChartLabelPosition, Q as ChartLegendPosition, R as ChartLineMark, S as ChartMark, T as ChartMarkRole, U as ChartMarker, V as ChartOrientation, W as ChartPathMark, X as ChartRectMark, Y as ChartSeriesInput, Z as ChartSeriesPatch, _ as ChartSeriesType, $ as ChartSparklineKind, a0 as ChartSparklineOptions, a1 as ChartState, a2 as ChartSvgOptions, a3 as ChartTableData, a4 as ChartTableOptions, a5 as ChartTextMark, a6 as ChartTextMeasure, a7 as ChartTrendFit, a8 as ChartTrendline, a9 as ChartTrendlineType, aa as DEFAULT_CHART_PALETTE, ab as DEFAULT_CHART_THEME, ac as chartColorInputValue, ad as chartColorsByCategory, ae as chartDataFromTable, af as chartDataToTable, ag as chartFamily, ah as chartMovingAverage, ai as chartPointColor, aj as chartSceneToDomSpec, ak as chartSceneToSvg, al as chartSeriesColor, am as chartSeriesType, an as chartSliceColor, ao as chartSupportsTrendlines, ap as chartTextBaseline, aq as chartTextTransform, ar as chartToSvg, as as chartTrendlineName, at as cloneChartSeries, au as cloneChartSpec, av as contrastingTextColor, aw as createChartController, ax as createChartSpec, ay as defaultChartAxis, az as estimateChartTextWidth, aA as fitChartTrendline, aB as isCartesianChart, aC as isXyChart, aD as layoutSparkline, aE as normalizeChartAxis, aF as normalizeChartErrorBars, aG as normalizeChartSpec, aH as normalizeChartTrendline, aI as normalizeChartValues, aJ as parseChartValue, aK as sameChartSelection, aL as sparklineToSvg, aM as trendNumberText, aN as uniqueChartSeriesId } from '../controller-CX0QfSv0.cjs';
3
3
  import { C as CommandSpec } from '../registry-CaR7LC6W.cjs';
4
- import { A as AgentToolProvider } from '../registry-B4l-lYts.cjs';
4
+ import { A as AgentToolProvider } from '../registry-DIpIaCkH.cjs';
5
+ import { e as PresenceClock, g as PresenceStore, d as PresenceActorInfo, c as PresenceActor, f as PresenceState, h as createInstantPresenceClock } from '../presence-Cb6WhcrQ.cjs';
5
6
  import { Z as ZipReadOptions } from '../zip-4nG0YAH7.cjs';
6
7
  import '../HistoryManager-DeQQMBCj.cjs';
7
8
  import '../types-DsiXGmjo.cjs';
@@ -31,6 +32,20 @@ declare function stepDecimals(step: number): number;
31
32
  declare function formatChartNumber(value: number | null | undefined, format?: ChartNumberFormat, fallbackDecimals?: number): string;
32
33
  /** Linear map from `domain` to `range`. */
33
34
  declare function linearMap(value: number, domain: readonly [number, number], range: readonly [number, number]): number;
35
+ /**
36
+ * A logarithmic scale over `[lo, hi]` (only positive values count): the ends extend to whole
37
+ * powers of `base` unless fixed, and ticks sit on the powers, thinned to about `count`, or, in
38
+ * base 10 over a few decades, on the 1-2-5 steps between them. `step` is the base. Non-positive
39
+ * or non-finite ends fall back to the data, and no positive data at all gives 1 to `base`.
40
+ */
41
+ declare function niceLogScale(lo: number, hi: number, count?: number, base?: number, fixedMin?: number | null, fixedMax?: number | null): NiceScale;
42
+ /**
43
+ * A data value's pixel on a value scale: linear, or by logarithm when `scale.logBase` is set
44
+ * (values of 0 or less have no pixel there and give NaN).
45
+ */
46
+ declare function chartScaleToPixel(value: number, scale: Pick<ChartValueScale, 'domain' | 'range' | 'logBase'>): number;
47
+ /** The data value at a pixel on a value scale (the inverse of `chartScaleToPixel`). */
48
+ declare function chartScaleFromPixel(px: number, scale: Pick<ChartValueScale, 'domain' | 'range' | 'logBase'>): number;
34
49
 
35
50
  /**
36
51
  * A compiled spreadsheet number format code for chart labels, e.g. `#,##0.00`, `0.0%`,
@@ -256,6 +271,39 @@ declare function summarizeChartSeries(series: {
256
271
  values: readonly ChartValue[];
257
272
  }, categories: readonly string[]): ChartSeriesSummary;
258
273
 
274
+ declare const CHART_ERROR_BAR_TYPES: readonly ChartErrorBarType[];
275
+ declare const CHART_ERROR_BAR_DIRECTIONS: readonly NonNullable<ChartErrorBars['direction']>[];
276
+ /** Labels for pickers, shared by the React and Svelte components. */
277
+ declare const CHART_ERROR_BAR_LABELS: Readonly<Record<ChartErrorBarType, string>>;
278
+ /** The default `value` per type (`fixed` 1, `percent` 5, `stddev` 1). */
279
+ declare function defaultChartErrorBarValue(type: ChartErrorBarType): number | undefined;
280
+ /** One point's error bar: where it is centred and how far it reaches each way (both 0 or more). */
281
+ interface ChartErrorAmount {
282
+ /** The point's value, or the series mean for `stddev` (as Excel draws it). */
283
+ center: number;
284
+ plus: number;
285
+ minus: number;
286
+ }
287
+ /**
288
+ * The error bar at each point of `values` (a series' values, or its x values for x error
289
+ * bars), following Excel's error amount types: `fixed` and `percent` from `value`, `stddev`
290
+ * around the series mean, `stderr` (sample standard deviation / √n) and `custom` amounts from
291
+ * `plus` / `minus`. Gaps (and custom points without an amount) give `null`.
292
+ */
293
+ declare function chartErrorAmounts(bars: ChartErrorBars, values: readonly ChartValue[]): (ChartErrorAmount | null)[];
294
+ /** A one-line description of error bars ("±5% error bars", "±1 standard deviation error bars"). */
295
+ declare function describeChartErrorBars(bars: ChartErrorBars): string;
296
+ /**
297
+ * Error bars for a picker change: `null` for none, else bars of `type` that keep the current
298
+ * direction and caps. Switching to `custom` starts from the amounts the current bars (or ±1)
299
+ * draw, so the picture does not jump. Shared by the React and Svelte inspectors.
300
+ */
301
+ declare function chartErrorBarsOfType(type: ChartErrorBarType | '' | null, current: ChartErrorBars | undefined, values: readonly ChartValue[]): ChartErrorBars | null;
302
+ /** Custom amounts as text for an input: "1, 2, -, 0.5" (`-` is a point without a bar). */
303
+ declare function formatChartAmountList(values: readonly ChartValue[] | undefined): string;
304
+ /** Reads amounts typed as "1, 2, -, 0.5" (commas, semicolons or spaces; `-` or blank for none). */
305
+ declare function parseChartAmountList(text: string): (string | null)[];
306
+
259
307
  /**
260
308
  * Lays a chart out as drawing primitives (rects, paths, circles, lines and text) in a
261
309
  * `width × height` box. Pure and DOM-free: the React and Svelte canvases render the marks
@@ -267,7 +315,7 @@ declare function layoutChart(spec: ChartSpec, options: ChartLayoutOptions): Char
267
315
  /**
268
316
  * The data value at a scene point along the value axis (for dragging a bar or point), or
269
317
  * `undefined` when the scene has no value scale or is percent-stacked. `secondary` reads the
270
- * secondary axis.
318
+ * secondary axis. Reversed and logarithmic axes are mapped as drawn.
271
319
  */
272
320
  declare function chartValueAtPoint(scene: ChartScene, point: {
273
321
  x: number;
@@ -278,8 +326,12 @@ declare function chartXAtPoint(scene: ChartScene, point: {
278
326
  x: number;
279
327
  y: number;
280
328
  }): number | undefined;
281
- /** The value a drag should store: snapped to a tenth of the tick step (or `step`) and kept finite. */
282
- declare function snapChartValue(scene: ChartScene, value: number, step?: number, ticks?: readonly number[]): number;
329
+ /**
330
+ * The value a drag should store: snapped to a tenth of the tick step (or `step`) and kept
331
+ * finite. On a logarithmic axis (`logBase`, without a `step`) ticks are not evenly spaced, so
332
+ * the value is rounded to two significant digits instead.
333
+ */
334
+ declare function snapChartValue(scene: ChartScene, value: number, step?: number, ticks?: readonly number[], logBase?: number): number;
283
335
 
284
336
  /** Data labels are skipped on series with more points than this. */
285
337
  declare const MAX_CHART_DATA_LABELS = 200;
@@ -368,27 +420,23 @@ declare function downloadChartPng(spec: ChartSpec, options?: DownloadChartPngOpt
368
420
  filename: string;
369
421
  }>;
370
422
 
423
+ /** An axis as drawn. `logBase` is set on a logarithmic axis, `reversed` when it runs the other way. */
424
+ interface ChartAxisSummary {
425
+ min: number;
426
+ max: number;
427
+ ticks: number[];
428
+ logBase?: number;
429
+ reversed?: boolean;
430
+ }
371
431
  interface ChartSummary {
372
432
  type: ChartSpec['type'];
373
433
  title: string;
374
434
  categories: number;
375
435
  series: ChartSeriesSummary[];
376
436
  /** The value axis as drawn: range and ticks (absent for pies and treemaps). */
377
- valueAxis?: {
378
- min: number;
379
- max: number;
380
- ticks: number[];
381
- };
382
- secondaryAxis?: {
383
- min: number;
384
- max: number;
385
- ticks: number[];
386
- };
387
- xAxis?: {
388
- min: number;
389
- max: number;
390
- ticks: number[];
391
- };
437
+ valueAxis?: ChartAxisSummary;
438
+ secondaryAxis?: ChartAxisSummary;
439
+ xAxis?: ChartAxisSummary;
392
440
  /** What the layout left out at this size (hidden labels, thinned lines, …). */
393
441
  warnings: ChartWarning[];
394
442
  /** Whether the series colours can be told apart (also with colour-blindness). */
@@ -727,42 +775,17 @@ interface ChartOoxmlWriteResult {
727
775
  */
728
776
  declare function chartToOoxml(spec: ChartSpec): ChartOoxmlWriteResult;
729
777
 
730
- interface ChartPresenceActor {
731
- id: string;
732
- name: string;
733
- color: string;
734
- /** Cursor position in scene coordinates. */
735
- x: number;
736
- y: number;
737
- /** The button is down (dragging). */
738
- pressed: boolean;
739
- /** A short note shown next to the cursor (what the agent is doing). */
740
- message?: string;
741
- }
742
- interface ChartPresenceState {
743
- actors: readonly ChartPresenceActor[];
744
- }
778
+ type ChartPresenceActor = PresenceActor;
779
+ type ChartPresenceState = PresenceState;
745
780
  /** Cursor positions and notes of agents acting on a chart, for an overlay. */
746
- declare class ChartPresence {
747
- private state;
748
- private readonly listeners;
749
- getState: () => ChartPresenceState;
750
- subscribe: (listener: (state: ChartPresenceState) => void) => (() => void);
751
- /** Adds or changes an actor. */
752
- set(actor: Pick<ChartPresenceActor, 'id'> & Partial<ChartPresenceActor>): void;
753
- remove(id: string): void;
781
+ declare class ChartPresence extends PresenceStore {
754
782
  }
755
783
  declare const CHART_PRESENCE_COLORS: readonly string[];
756
784
  /** Time for performances: real timers, or an instant clock for tests and recordings. */
757
- interface ChartClock {
758
- now(): number;
759
- wait(ms: number): Promise<void>;
760
- }
785
+ type ChartClock = PresenceClock;
761
786
  declare const realChartClock: ChartClock;
762
787
  /** A clock whose waits finish at once while its time still advances (repeatable performances). */
763
- declare function createInstantChartClock(start?: number): ChartClock & {
764
- elapsed(): number;
765
- };
788
+ declare const createInstantChartClock: typeof createInstantPresenceClock;
766
789
  /** What an agent asks for. Each command commits as one undo step. */
767
790
  type ChartAgentCommand = {
768
791
  kind: 'setValue';
@@ -830,11 +853,7 @@ interface ChartDirectorOptions {
830
853
  /** Hide each actor's cursor this long after its last command (ms, default 1500; 0 keeps it). */
831
854
  linger?: number;
832
855
  }
833
- interface ChartDirectorActor {
834
- id: string;
835
- name?: string;
836
- color?: string;
837
- }
856
+ type ChartDirectorActor = PresenceActorInfo;
838
857
  type ChartPerformanceResult = {
839
858
  ok: true;
840
859
  command: ChartAgentCommand;
@@ -853,9 +872,8 @@ declare class ChartDirector {
853
872
  private readonly controller;
854
873
  readonly presence: ChartPresence;
855
874
  private readonly options;
856
- private readonly queues;
857
875
  private readonly clock;
858
- private calls;
876
+ private readonly queue;
859
877
  constructor(controller: ChartController, presence: ChartPresence, options: ChartDirectorOptions);
860
878
  /** Acts out `commands` in order for `actor`. Resolves with one result per command. */
861
879
  perform(actor: ChartDirectorActor, commands: readonly ChartAgentCommand[]): Promise<ChartPerformanceResult[]>;
@@ -1064,4 +1082,4 @@ interface OfficeChartToolProviderOptions {
1064
1082
  */
1065
1083
  declare function createOfficeChartToolProvider(options?: OfficeChartToolProviderOptions): AgentToolProvider;
1066
1084
 
1067
- export { CHART_COLOR_SCHEMES, CHART_DATE_STEPS, CHART_LAYOUT_PRESETS, CHART_MERMAID_META_PREFIX, CHART_OOXML_CONTENT_TYPE, CHART_OOXML_NS, CHART_OOXML_RELATIONSHIP, CHART_PALETTE_SHADES, CHART_PRESENCE_COLORS, CHART_RASTER_MAX_SIZE, type ChartAgentCommand, ChartAxis, type ChartBoxStats, type ChartClock, type ChartColorCheck, type ChartColorCheckOptions, type ChartColorPair, type ChartColorScheme, type ChartCommandOptions, ChartController, type ChartDateLabels, type ChartDateStep, ChartDirector, type ChartDirectorActor, type ChartDirectorOptions, type ChartDragMoveOptions, type ChartFormatCode, type ChartFromTable, type ChartHistogramBin, ChartIssue, type ChartKeyInput, ChartLayoutOptions, type ChartLayoutPreset, ChartLegend, type ChartMermaidFamily, type ChartMermaidOptions, type ChartMermaidParseOptions, type ChartMermaidResult, ChartNumberFormat, type ChartOoxmlReadOptions, type ChartOoxmlReadResult, type ChartOoxmlWriteResult, type ChartPaintScope, type ChartPerformanceResult, type ChartPerformanceStep, type ChartPointDrag, ChartPresence, type ChartPresenceActor, type ChartPresenceState, type ChartPresetPatch, type ChartRasterImage, type ChartRecommendation, ChartRect, type ChartRgb, ChartScene, ChartSelection, ChartSeries, type ChartSeriesSummary, type ChartSnapOptions, ChartSpec, ChartSpecPatch, ChartStacking, ChartStream, type ChartStreamFormat, type ChartStreamResult, type ChartSummary, type ChartTableShape, ChartTheme, type ChartToolProviderOptions, ChartType, ChartValue, ChartValueScale, type ChartVision, ChartWarning, type DownloadChartPngOptions, type FoundChartMermaid, MAX_CHART_DATA_LABELS, MAX_CHART_LINE_POINTS, MAX_CHART_MARKERS, type NiceScale, type OfficeChartFile, type OfficeChartFileFormat, type OfficeChartToolProviderOptions, OfficeChartsError, type OfficeChartsReadOptions, type OfficeChartsResult, type OfficeFileChart, RENDER_CHART_INSTRUCTIONS, type RasterizeChartOptions, analyzeChartTable, blendChartScenes, canDragChartPoint, chartBoxStats, chartClientToScene, chartColorDistance, chartContrastRatio, chartDateLabels, chartDateToSerial, chartFileName, chartFormatToCode, chartFromMermaid, chartFromOoxml, chartFromTable, chartHistogram, chartHitTest, chartLuminance, chartMermaidFamily, chartPointAnchor, chartPresetPatch, chartQuantile, chartRasterSize, chartRgbToHex, chartRgbToOklab, chartSerialToDate, chartSquarify, chartTextOn, chartToMermaid, chartToOoxml, chartValueAtPoint, chartXAtPoint, checkChartColors, compileChartFormatCode, createChartCommands, createChartRasterizer, createChartToolProvider, createInstantChartClock, createOfficeChartToolProvider, cyclePaletteColor, decimateChartPoints, describeChart, describeChartSelection, describeOfficeChartPlace, downloadChartPng, easeChartTween, extractDocxCharts, extractOfficeCharts, extractPptxCharts, extractXlsxCharts, findMermaidCharts, formatChartDate, formatChartNumber, formatChartValueWithCode, handleChartKey, layoutChart, linearMap, monochromeChartPalette, niceScale, niceStep, parseChartColor, parseChartDate, parsePartialChartJson, planChartCommand, rasterizeChartSvg, realChartClock, recommendChartTypes, recommendForShape, resolveChartSvgPaints, shadeChartColor, simulateChartVision, snapChartDragValue, snapChartValue, startChartPointDrag, stepDecimals, summarizeChart, summarizeChartSeries };
1085
+ export { CHART_COLOR_SCHEMES, CHART_DATE_STEPS, CHART_ERROR_BAR_DIRECTIONS, CHART_ERROR_BAR_LABELS, CHART_ERROR_BAR_TYPES, CHART_LAYOUT_PRESETS, CHART_MERMAID_META_PREFIX, CHART_OOXML_CONTENT_TYPE, CHART_OOXML_NS, CHART_OOXML_RELATIONSHIP, CHART_PALETTE_SHADES, CHART_PRESENCE_COLORS, CHART_RASTER_MAX_SIZE, type ChartAgentCommand, ChartAxis, type ChartAxisSummary, type ChartBoxStats, type ChartClock, type ChartColorCheck, type ChartColorCheckOptions, type ChartColorPair, type ChartColorScheme, type ChartCommandOptions, ChartController, type ChartDateLabels, type ChartDateStep, ChartDirector, type ChartDirectorActor, type ChartDirectorOptions, type ChartDragMoveOptions, type ChartErrorAmount, ChartErrorBarType, ChartErrorBars, type ChartFormatCode, type ChartFromTable, type ChartHistogramBin, ChartIssue, type ChartKeyInput, ChartLayoutOptions, type ChartLayoutPreset, ChartLegend, type ChartMermaidFamily, type ChartMermaidOptions, type ChartMermaidParseOptions, type ChartMermaidResult, ChartNumberFormat, type ChartOoxmlReadOptions, type ChartOoxmlReadResult, type ChartOoxmlWriteResult, type ChartPaintScope, type ChartPerformanceResult, type ChartPerformanceStep, type ChartPointDrag, ChartPresence, type ChartPresenceActor, type ChartPresenceState, type ChartPresetPatch, type ChartRasterImage, type ChartRecommendation, ChartRect, type ChartRgb, ChartScene, ChartSelection, ChartSeries, type ChartSeriesSummary, type ChartSnapOptions, ChartSpec, ChartSpecPatch, ChartStacking, ChartStream, type ChartStreamFormat, type ChartStreamResult, type ChartSummary, type ChartTableShape, ChartTheme, type ChartToolProviderOptions, ChartType, ChartValue, ChartValueScale, type ChartVision, ChartWarning, type DownloadChartPngOptions, type FoundChartMermaid, MAX_CHART_DATA_LABELS, MAX_CHART_LINE_POINTS, MAX_CHART_MARKERS, type NiceScale, type OfficeChartFile, type OfficeChartFileFormat, type OfficeChartToolProviderOptions, OfficeChartsError, type OfficeChartsReadOptions, type OfficeChartsResult, type OfficeFileChart, RENDER_CHART_INSTRUCTIONS, type RasterizeChartOptions, analyzeChartTable, blendChartScenes, canDragChartPoint, chartBoxStats, chartClientToScene, chartColorDistance, chartContrastRatio, chartDateLabels, chartDateToSerial, chartErrorAmounts, chartErrorBarsOfType, chartFileName, chartFormatToCode, chartFromMermaid, chartFromOoxml, chartFromTable, chartHistogram, chartHitTest, chartLuminance, chartMermaidFamily, chartPointAnchor, chartPresetPatch, chartQuantile, chartRasterSize, chartRgbToHex, chartRgbToOklab, chartScaleFromPixel, chartScaleToPixel, chartSerialToDate, chartSquarify, chartTextOn, chartToMermaid, chartToOoxml, chartValueAtPoint, chartXAtPoint, checkChartColors, compileChartFormatCode, createChartCommands, createChartRasterizer, createChartToolProvider, createInstantChartClock, createOfficeChartToolProvider, cyclePaletteColor, decimateChartPoints, defaultChartErrorBarValue, describeChart, describeChartErrorBars, describeChartSelection, describeOfficeChartPlace, downloadChartPng, easeChartTween, extractDocxCharts, extractOfficeCharts, extractPptxCharts, extractXlsxCharts, findMermaidCharts, formatChartAmountList, formatChartDate, formatChartNumber, formatChartValueWithCode, handleChartKey, layoutChart, linearMap, monochromeChartPalette, niceLogScale, niceScale, niceStep, parseChartAmountList, parseChartColor, parseChartDate, parsePartialChartJson, planChartCommand, rasterizeChartSvg, realChartClock, recommendChartTypes, recommendForShape, resolveChartSvgPaints, shadeChartColor, simulateChartVision, snapChartDragValue, snapChartValue, startChartPointDrag, stepDecimals, summarizeChart, summarizeChartSeries };
@@ -1,7 +1,8 @@
1
- import { C as ChartNumberFormat, a as ChartValue, b as ChartRect, c as ChartScene, d as ChartSpec, e as ChartLayoutOptions, f as ChartTheme, g as ChartWarning, h as ChartAxis, i as ChartLegend, j as ChartType, k as ChartStacking, l as ChartSeries, m as ChartIssue, n as ChartController, o as ChartValueScale, p as ChartSelection, q as ChartSpecPatch } from '../controller-BdKzaxs2.js';
2
- export { r as CHART_AXIS_KINDS, s as CHART_CURVES, t as CHART_LABEL_POSITIONS, u as CHART_LEGEND_POSITIONS, v as CHART_MARKERS, w as CHART_NUMBER_STYLES, x as CHART_ORIENTATIONS, y as CHART_SERIES_TYPES, z as CHART_STACKINGS, A as CHART_TRENDLINE_TYPES, B as CHART_TYPES, D as CHART_TYPE_LABELS, E as CSS_VARIABLE_CHART_THEME, F as ChartActionResult, G as ChartCircleMark, H as ChartControllerOptions, I as ChartCurve, J as ChartDomSpec, K as ChartEditOptions, L as ChartFamily, M as ChartLabelPosition, N as ChartLegendPosition, O as ChartLineMark, P as ChartMark, Q as ChartMarkRole, R as ChartMarker, S as ChartOrientation, T as ChartPathMark, U as ChartRectMark, V as ChartSeriesInput, W as ChartSeriesPatch, X as ChartSeriesType, Y as ChartSparklineKind, Z as ChartSparklineOptions, _ as ChartState, $ as ChartSvgOptions, a0 as ChartTableData, a1 as ChartTableOptions, a2 as ChartTextMark, a3 as ChartTextMeasure, a4 as ChartTrendFit, a5 as ChartTrendline, a6 as ChartTrendlineType, a7 as DEFAULT_CHART_PALETTE, a8 as DEFAULT_CHART_THEME, a9 as chartColorInputValue, aa as chartColorsByCategory, ab as chartDataFromTable, ac as chartDataToTable, ad as chartFamily, ae as chartMovingAverage, af as chartPointColor, ag as chartSceneToDomSpec, ah as chartSceneToSvg, ai as chartSeriesColor, aj as chartSeriesType, ak as chartSliceColor, al as chartSupportsTrendlines, am as chartTextBaseline, an as chartTextTransform, ao as chartToSvg, ap as chartTrendlineName, aq as cloneChartSeries, ar as cloneChartSpec, as as contrastingTextColor, at as createChartController, au as createChartSpec, av as defaultChartAxis, aw as estimateChartTextWidth, ax as fitChartTrendline, ay as isCartesianChart, az as isXyChart, aA as layoutSparkline, aB as normalizeChartAxis, aC as normalizeChartSpec, aD as normalizeChartTrendline, aE as normalizeChartValues, aF as parseChartValue, aG as sameChartSelection, aH as sparklineToSvg, aI as trendNumberText, aJ as uniqueChartSeriesId } from '../controller-BdKzaxs2.js';
1
+ import { C as ChartValueScale, a as ChartNumberFormat, b as ChartValue, c as ChartRect, d as ChartErrorBars, e as ChartErrorBarType, f as ChartScene, g as ChartSpec, h as ChartLayoutOptions, i as ChartTheme, j as ChartWarning, k as ChartAxis, l as ChartLegend, m as ChartType, n as ChartStacking, o as ChartSeries, p as ChartIssue, q as ChartController, r as ChartSelection, s as ChartSpecPatch } from '../controller-DscWQbjO.js';
2
+ export { t as CHART_AXIS_KINDS, u as CHART_AXIS_SCALES, v as CHART_CURVES, w as CHART_LABEL_POSITIONS, x as CHART_LEGEND_POSITIONS, y as CHART_MARKERS, z as CHART_NUMBER_STYLES, A as CHART_ORIENTATIONS, B as CHART_SERIES_TYPES, D as CHART_STACKINGS, E as CHART_TRENDLINE_TYPES, F as CHART_TYPES, G as CHART_TYPE_LABELS, H as CSS_VARIABLE_CHART_THEME, I as ChartActionResult, J as ChartCircleMark, K as ChartControllerOptions, L as ChartCurve, M as ChartDomSpec, N as ChartEditOptions, O as ChartFamily, P as ChartLabelPosition, Q as ChartLegendPosition, R as ChartLineMark, S as ChartMark, T as ChartMarkRole, U as ChartMarker, V as ChartOrientation, W as ChartPathMark, X as ChartRectMark, Y as ChartSeriesInput, Z as ChartSeriesPatch, _ as ChartSeriesType, $ as ChartSparklineKind, a0 as ChartSparklineOptions, a1 as ChartState, a2 as ChartSvgOptions, a3 as ChartTableData, a4 as ChartTableOptions, a5 as ChartTextMark, a6 as ChartTextMeasure, a7 as ChartTrendFit, a8 as ChartTrendline, a9 as ChartTrendlineType, aa as DEFAULT_CHART_PALETTE, ab as DEFAULT_CHART_THEME, ac as chartColorInputValue, ad as chartColorsByCategory, ae as chartDataFromTable, af as chartDataToTable, ag as chartFamily, ah as chartMovingAverage, ai as chartPointColor, aj as chartSceneToDomSpec, ak as chartSceneToSvg, al as chartSeriesColor, am as chartSeriesType, an as chartSliceColor, ao as chartSupportsTrendlines, ap as chartTextBaseline, aq as chartTextTransform, ar as chartToSvg, as as chartTrendlineName, at as cloneChartSeries, au as cloneChartSpec, av as contrastingTextColor, aw as createChartController, ax as createChartSpec, ay as defaultChartAxis, az as estimateChartTextWidth, aA as fitChartTrendline, aB as isCartesianChart, aC as isXyChart, aD as layoutSparkline, aE as normalizeChartAxis, aF as normalizeChartErrorBars, aG as normalizeChartSpec, aH as normalizeChartTrendline, aI as normalizeChartValues, aJ as parseChartValue, aK as sameChartSelection, aL as sparklineToSvg, aM as trendNumberText, aN as uniqueChartSeriesId } from '../controller-DscWQbjO.js';
3
3
  import { C as CommandSpec } from '../registry-rVtFJjRM.js';
4
- import { A as AgentToolProvider } from '../registry-CSlH4iUn.js';
4
+ import { A as AgentToolProvider } from '../registry-7AZFuand.js';
5
+ import { e as PresenceClock, g as PresenceStore, d as PresenceActorInfo, c as PresenceActor, f as PresenceState, h as createInstantPresenceClock } from '../presence-Cb6WhcrQ.js';
5
6
  import { Z as ZipReadOptions } from '../zip-4nG0YAH7.js';
6
7
  import '../HistoryManager-DWSLd6Tf.js';
7
8
  import '../types-DsiXGmjo.js';
@@ -31,6 +32,20 @@ declare function stepDecimals(step: number): number;
31
32
  declare function formatChartNumber(value: number | null | undefined, format?: ChartNumberFormat, fallbackDecimals?: number): string;
32
33
  /** Linear map from `domain` to `range`. */
33
34
  declare function linearMap(value: number, domain: readonly [number, number], range: readonly [number, number]): number;
35
+ /**
36
+ * A logarithmic scale over `[lo, hi]` (only positive values count): the ends extend to whole
37
+ * powers of `base` unless fixed, and ticks sit on the powers, thinned to about `count`, or, in
38
+ * base 10 over a few decades, on the 1-2-5 steps between them. `step` is the base. Non-positive
39
+ * or non-finite ends fall back to the data, and no positive data at all gives 1 to `base`.
40
+ */
41
+ declare function niceLogScale(lo: number, hi: number, count?: number, base?: number, fixedMin?: number | null, fixedMax?: number | null): NiceScale;
42
+ /**
43
+ * A data value's pixel on a value scale: linear, or by logarithm when `scale.logBase` is set
44
+ * (values of 0 or less have no pixel there and give NaN).
45
+ */
46
+ declare function chartScaleToPixel(value: number, scale: Pick<ChartValueScale, 'domain' | 'range' | 'logBase'>): number;
47
+ /** The data value at a pixel on a value scale (the inverse of `chartScaleToPixel`). */
48
+ declare function chartScaleFromPixel(px: number, scale: Pick<ChartValueScale, 'domain' | 'range' | 'logBase'>): number;
34
49
 
35
50
  /**
36
51
  * A compiled spreadsheet number format code for chart labels, e.g. `#,##0.00`, `0.0%`,
@@ -256,6 +271,39 @@ declare function summarizeChartSeries(series: {
256
271
  values: readonly ChartValue[];
257
272
  }, categories: readonly string[]): ChartSeriesSummary;
258
273
 
274
+ declare const CHART_ERROR_BAR_TYPES: readonly ChartErrorBarType[];
275
+ declare const CHART_ERROR_BAR_DIRECTIONS: readonly NonNullable<ChartErrorBars['direction']>[];
276
+ /** Labels for pickers, shared by the React and Svelte components. */
277
+ declare const CHART_ERROR_BAR_LABELS: Readonly<Record<ChartErrorBarType, string>>;
278
+ /** The default `value` per type (`fixed` 1, `percent` 5, `stddev` 1). */
279
+ declare function defaultChartErrorBarValue(type: ChartErrorBarType): number | undefined;
280
+ /** One point's error bar: where it is centred and how far it reaches each way (both 0 or more). */
281
+ interface ChartErrorAmount {
282
+ /** The point's value, or the series mean for `stddev` (as Excel draws it). */
283
+ center: number;
284
+ plus: number;
285
+ minus: number;
286
+ }
287
+ /**
288
+ * The error bar at each point of `values` (a series' values, or its x values for x error
289
+ * bars), following Excel's error amount types: `fixed` and `percent` from `value`, `stddev`
290
+ * around the series mean, `stderr` (sample standard deviation / √n) and `custom` amounts from
291
+ * `plus` / `minus`. Gaps (and custom points without an amount) give `null`.
292
+ */
293
+ declare function chartErrorAmounts(bars: ChartErrorBars, values: readonly ChartValue[]): (ChartErrorAmount | null)[];
294
+ /** A one-line description of error bars ("±5% error bars", "±1 standard deviation error bars"). */
295
+ declare function describeChartErrorBars(bars: ChartErrorBars): string;
296
+ /**
297
+ * Error bars for a picker change: `null` for none, else bars of `type` that keep the current
298
+ * direction and caps. Switching to `custom` starts from the amounts the current bars (or ±1)
299
+ * draw, so the picture does not jump. Shared by the React and Svelte inspectors.
300
+ */
301
+ declare function chartErrorBarsOfType(type: ChartErrorBarType | '' | null, current: ChartErrorBars | undefined, values: readonly ChartValue[]): ChartErrorBars | null;
302
+ /** Custom amounts as text for an input: "1, 2, -, 0.5" (`-` is a point without a bar). */
303
+ declare function formatChartAmountList(values: readonly ChartValue[] | undefined): string;
304
+ /** Reads amounts typed as "1, 2, -, 0.5" (commas, semicolons or spaces; `-` or blank for none). */
305
+ declare function parseChartAmountList(text: string): (string | null)[];
306
+
259
307
  /**
260
308
  * Lays a chart out as drawing primitives (rects, paths, circles, lines and text) in a
261
309
  * `width × height` box. Pure and DOM-free: the React and Svelte canvases render the marks
@@ -267,7 +315,7 @@ declare function layoutChart(spec: ChartSpec, options: ChartLayoutOptions): Char
267
315
  /**
268
316
  * The data value at a scene point along the value axis (for dragging a bar or point), or
269
317
  * `undefined` when the scene has no value scale or is percent-stacked. `secondary` reads the
270
- * secondary axis.
318
+ * secondary axis. Reversed and logarithmic axes are mapped as drawn.
271
319
  */
272
320
  declare function chartValueAtPoint(scene: ChartScene, point: {
273
321
  x: number;
@@ -278,8 +326,12 @@ declare function chartXAtPoint(scene: ChartScene, point: {
278
326
  x: number;
279
327
  y: number;
280
328
  }): number | undefined;
281
- /** The value a drag should store: snapped to a tenth of the tick step (or `step`) and kept finite. */
282
- declare function snapChartValue(scene: ChartScene, value: number, step?: number, ticks?: readonly number[]): number;
329
+ /**
330
+ * The value a drag should store: snapped to a tenth of the tick step (or `step`) and kept
331
+ * finite. On a logarithmic axis (`logBase`, without a `step`) ticks are not evenly spaced, so
332
+ * the value is rounded to two significant digits instead.
333
+ */
334
+ declare function snapChartValue(scene: ChartScene, value: number, step?: number, ticks?: readonly number[], logBase?: number): number;
283
335
 
284
336
  /** Data labels are skipped on series with more points than this. */
285
337
  declare const MAX_CHART_DATA_LABELS = 200;
@@ -368,27 +420,23 @@ declare function downloadChartPng(spec: ChartSpec, options?: DownloadChartPngOpt
368
420
  filename: string;
369
421
  }>;
370
422
 
423
+ /** An axis as drawn. `logBase` is set on a logarithmic axis, `reversed` when it runs the other way. */
424
+ interface ChartAxisSummary {
425
+ min: number;
426
+ max: number;
427
+ ticks: number[];
428
+ logBase?: number;
429
+ reversed?: boolean;
430
+ }
371
431
  interface ChartSummary {
372
432
  type: ChartSpec['type'];
373
433
  title: string;
374
434
  categories: number;
375
435
  series: ChartSeriesSummary[];
376
436
  /** The value axis as drawn: range and ticks (absent for pies and treemaps). */
377
- valueAxis?: {
378
- min: number;
379
- max: number;
380
- ticks: number[];
381
- };
382
- secondaryAxis?: {
383
- min: number;
384
- max: number;
385
- ticks: number[];
386
- };
387
- xAxis?: {
388
- min: number;
389
- max: number;
390
- ticks: number[];
391
- };
437
+ valueAxis?: ChartAxisSummary;
438
+ secondaryAxis?: ChartAxisSummary;
439
+ xAxis?: ChartAxisSummary;
392
440
  /** What the layout left out at this size (hidden labels, thinned lines, …). */
393
441
  warnings: ChartWarning[];
394
442
  /** Whether the series colours can be told apart (also with colour-blindness). */
@@ -727,42 +775,17 @@ interface ChartOoxmlWriteResult {
727
775
  */
728
776
  declare function chartToOoxml(spec: ChartSpec): ChartOoxmlWriteResult;
729
777
 
730
- interface ChartPresenceActor {
731
- id: string;
732
- name: string;
733
- color: string;
734
- /** Cursor position in scene coordinates. */
735
- x: number;
736
- y: number;
737
- /** The button is down (dragging). */
738
- pressed: boolean;
739
- /** A short note shown next to the cursor (what the agent is doing). */
740
- message?: string;
741
- }
742
- interface ChartPresenceState {
743
- actors: readonly ChartPresenceActor[];
744
- }
778
+ type ChartPresenceActor = PresenceActor;
779
+ type ChartPresenceState = PresenceState;
745
780
  /** Cursor positions and notes of agents acting on a chart, for an overlay. */
746
- declare class ChartPresence {
747
- private state;
748
- private readonly listeners;
749
- getState: () => ChartPresenceState;
750
- subscribe: (listener: (state: ChartPresenceState) => void) => (() => void);
751
- /** Adds or changes an actor. */
752
- set(actor: Pick<ChartPresenceActor, 'id'> & Partial<ChartPresenceActor>): void;
753
- remove(id: string): void;
781
+ declare class ChartPresence extends PresenceStore {
754
782
  }
755
783
  declare const CHART_PRESENCE_COLORS: readonly string[];
756
784
  /** Time for performances: real timers, or an instant clock for tests and recordings. */
757
- interface ChartClock {
758
- now(): number;
759
- wait(ms: number): Promise<void>;
760
- }
785
+ type ChartClock = PresenceClock;
761
786
  declare const realChartClock: ChartClock;
762
787
  /** A clock whose waits finish at once while its time still advances (repeatable performances). */
763
- declare function createInstantChartClock(start?: number): ChartClock & {
764
- elapsed(): number;
765
- };
788
+ declare const createInstantChartClock: typeof createInstantPresenceClock;
766
789
  /** What an agent asks for. Each command commits as one undo step. */
767
790
  type ChartAgentCommand = {
768
791
  kind: 'setValue';
@@ -830,11 +853,7 @@ interface ChartDirectorOptions {
830
853
  /** Hide each actor's cursor this long after its last command (ms, default 1500; 0 keeps it). */
831
854
  linger?: number;
832
855
  }
833
- interface ChartDirectorActor {
834
- id: string;
835
- name?: string;
836
- color?: string;
837
- }
856
+ type ChartDirectorActor = PresenceActorInfo;
838
857
  type ChartPerformanceResult = {
839
858
  ok: true;
840
859
  command: ChartAgentCommand;
@@ -853,9 +872,8 @@ declare class ChartDirector {
853
872
  private readonly controller;
854
873
  readonly presence: ChartPresence;
855
874
  private readonly options;
856
- private readonly queues;
857
875
  private readonly clock;
858
- private calls;
876
+ private readonly queue;
859
877
  constructor(controller: ChartController, presence: ChartPresence, options: ChartDirectorOptions);
860
878
  /** Acts out `commands` in order for `actor`. Resolves with one result per command. */
861
879
  perform(actor: ChartDirectorActor, commands: readonly ChartAgentCommand[]): Promise<ChartPerformanceResult[]>;
@@ -1064,4 +1082,4 @@ interface OfficeChartToolProviderOptions {
1064
1082
  */
1065
1083
  declare function createOfficeChartToolProvider(options?: OfficeChartToolProviderOptions): AgentToolProvider;
1066
1084
 
1067
- export { CHART_COLOR_SCHEMES, CHART_DATE_STEPS, CHART_LAYOUT_PRESETS, CHART_MERMAID_META_PREFIX, CHART_OOXML_CONTENT_TYPE, CHART_OOXML_NS, CHART_OOXML_RELATIONSHIP, CHART_PALETTE_SHADES, CHART_PRESENCE_COLORS, CHART_RASTER_MAX_SIZE, type ChartAgentCommand, ChartAxis, type ChartBoxStats, type ChartClock, type ChartColorCheck, type ChartColorCheckOptions, type ChartColorPair, type ChartColorScheme, type ChartCommandOptions, ChartController, type ChartDateLabels, type ChartDateStep, ChartDirector, type ChartDirectorActor, type ChartDirectorOptions, type ChartDragMoveOptions, type ChartFormatCode, type ChartFromTable, type ChartHistogramBin, ChartIssue, type ChartKeyInput, ChartLayoutOptions, type ChartLayoutPreset, ChartLegend, type ChartMermaidFamily, type ChartMermaidOptions, type ChartMermaidParseOptions, type ChartMermaidResult, ChartNumberFormat, type ChartOoxmlReadOptions, type ChartOoxmlReadResult, type ChartOoxmlWriteResult, type ChartPaintScope, type ChartPerformanceResult, type ChartPerformanceStep, type ChartPointDrag, ChartPresence, type ChartPresenceActor, type ChartPresenceState, type ChartPresetPatch, type ChartRasterImage, type ChartRecommendation, ChartRect, type ChartRgb, ChartScene, ChartSelection, ChartSeries, type ChartSeriesSummary, type ChartSnapOptions, ChartSpec, ChartSpecPatch, ChartStacking, ChartStream, type ChartStreamFormat, type ChartStreamResult, type ChartSummary, type ChartTableShape, ChartTheme, type ChartToolProviderOptions, ChartType, ChartValue, ChartValueScale, type ChartVision, ChartWarning, type DownloadChartPngOptions, type FoundChartMermaid, MAX_CHART_DATA_LABELS, MAX_CHART_LINE_POINTS, MAX_CHART_MARKERS, type NiceScale, type OfficeChartFile, type OfficeChartFileFormat, type OfficeChartToolProviderOptions, OfficeChartsError, type OfficeChartsReadOptions, type OfficeChartsResult, type OfficeFileChart, RENDER_CHART_INSTRUCTIONS, type RasterizeChartOptions, analyzeChartTable, blendChartScenes, canDragChartPoint, chartBoxStats, chartClientToScene, chartColorDistance, chartContrastRatio, chartDateLabels, chartDateToSerial, chartFileName, chartFormatToCode, chartFromMermaid, chartFromOoxml, chartFromTable, chartHistogram, chartHitTest, chartLuminance, chartMermaidFamily, chartPointAnchor, chartPresetPatch, chartQuantile, chartRasterSize, chartRgbToHex, chartRgbToOklab, chartSerialToDate, chartSquarify, chartTextOn, chartToMermaid, chartToOoxml, chartValueAtPoint, chartXAtPoint, checkChartColors, compileChartFormatCode, createChartCommands, createChartRasterizer, createChartToolProvider, createInstantChartClock, createOfficeChartToolProvider, cyclePaletteColor, decimateChartPoints, describeChart, describeChartSelection, describeOfficeChartPlace, downloadChartPng, easeChartTween, extractDocxCharts, extractOfficeCharts, extractPptxCharts, extractXlsxCharts, findMermaidCharts, formatChartDate, formatChartNumber, formatChartValueWithCode, handleChartKey, layoutChart, linearMap, monochromeChartPalette, niceScale, niceStep, parseChartColor, parseChartDate, parsePartialChartJson, planChartCommand, rasterizeChartSvg, realChartClock, recommendChartTypes, recommendForShape, resolveChartSvgPaints, shadeChartColor, simulateChartVision, snapChartDragValue, snapChartValue, startChartPointDrag, stepDecimals, summarizeChart, summarizeChartSeries };
1085
+ export { CHART_COLOR_SCHEMES, CHART_DATE_STEPS, CHART_ERROR_BAR_DIRECTIONS, CHART_ERROR_BAR_LABELS, CHART_ERROR_BAR_TYPES, CHART_LAYOUT_PRESETS, CHART_MERMAID_META_PREFIX, CHART_OOXML_CONTENT_TYPE, CHART_OOXML_NS, CHART_OOXML_RELATIONSHIP, CHART_PALETTE_SHADES, CHART_PRESENCE_COLORS, CHART_RASTER_MAX_SIZE, type ChartAgentCommand, ChartAxis, type ChartAxisSummary, type ChartBoxStats, type ChartClock, type ChartColorCheck, type ChartColorCheckOptions, type ChartColorPair, type ChartColorScheme, type ChartCommandOptions, ChartController, type ChartDateLabels, type ChartDateStep, ChartDirector, type ChartDirectorActor, type ChartDirectorOptions, type ChartDragMoveOptions, type ChartErrorAmount, ChartErrorBarType, ChartErrorBars, type ChartFormatCode, type ChartFromTable, type ChartHistogramBin, ChartIssue, type ChartKeyInput, ChartLayoutOptions, type ChartLayoutPreset, ChartLegend, type ChartMermaidFamily, type ChartMermaidOptions, type ChartMermaidParseOptions, type ChartMermaidResult, ChartNumberFormat, type ChartOoxmlReadOptions, type ChartOoxmlReadResult, type ChartOoxmlWriteResult, type ChartPaintScope, type ChartPerformanceResult, type ChartPerformanceStep, type ChartPointDrag, ChartPresence, type ChartPresenceActor, type ChartPresenceState, type ChartPresetPatch, type ChartRasterImage, type ChartRecommendation, ChartRect, type ChartRgb, ChartScene, ChartSelection, ChartSeries, type ChartSeriesSummary, type ChartSnapOptions, ChartSpec, ChartSpecPatch, ChartStacking, ChartStream, type ChartStreamFormat, type ChartStreamResult, type ChartSummary, type ChartTableShape, ChartTheme, type ChartToolProviderOptions, ChartType, ChartValue, ChartValueScale, type ChartVision, ChartWarning, type DownloadChartPngOptions, type FoundChartMermaid, MAX_CHART_DATA_LABELS, MAX_CHART_LINE_POINTS, MAX_CHART_MARKERS, type NiceScale, type OfficeChartFile, type OfficeChartFileFormat, type OfficeChartToolProviderOptions, OfficeChartsError, type OfficeChartsReadOptions, type OfficeChartsResult, type OfficeFileChart, RENDER_CHART_INSTRUCTIONS, type RasterizeChartOptions, analyzeChartTable, blendChartScenes, canDragChartPoint, chartBoxStats, chartClientToScene, chartColorDistance, chartContrastRatio, chartDateLabels, chartDateToSerial, chartErrorAmounts, chartErrorBarsOfType, chartFileName, chartFormatToCode, chartFromMermaid, chartFromOoxml, chartFromTable, chartHistogram, chartHitTest, chartLuminance, chartMermaidFamily, chartPointAnchor, chartPresetPatch, chartQuantile, chartRasterSize, chartRgbToHex, chartRgbToOklab, chartScaleFromPixel, chartScaleToPixel, chartSerialToDate, chartSquarify, chartTextOn, chartToMermaid, chartToOoxml, chartValueAtPoint, chartXAtPoint, checkChartColors, compileChartFormatCode, createChartCommands, createChartRasterizer, createChartToolProvider, createInstantChartClock, createOfficeChartToolProvider, cyclePaletteColor, decimateChartPoints, defaultChartErrorBarValue, describeChart, describeChartErrorBars, describeChartSelection, describeOfficeChartPlace, downloadChartPng, easeChartTween, extractDocxCharts, extractOfficeCharts, extractPptxCharts, extractXlsxCharts, findMermaidCharts, formatChartAmountList, formatChartDate, formatChartNumber, formatChartValueWithCode, handleChartKey, layoutChart, linearMap, monochromeChartPalette, niceLogScale, niceScale, niceStep, parseChartAmountList, parseChartColor, parseChartDate, parsePartialChartJson, planChartCommand, rasterizeChartSvg, realChartClock, recommendChartTypes, recommendForShape, resolveChartSvgPaints, shadeChartColor, simulateChartVision, snapChartDragValue, snapChartValue, startChartPointDrag, stepDecimals, summarizeChart, summarizeChartSeries };