@weasel-js/plot 1.15.0 → 1.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,199 +1,9 @@
1
- import { Path } from '@weasel-js/geom';
1
+ import { P as PlotDatum, a as PlotMark, b as PlotPoint, S as Scale, L as LinearScale, T as TimeScale, B as BandScale, c as PolarScale, d as PlotMarkData, e as PlotMarkTrait, f as PlotBox } from './scales.entry-BoLQpsxi.js';
2
+ export { g as BandScaleOptions, C as ContinuousScale, h as ContinuousScaleFactory, i as LinearScaleOptions, j as LogScale, k as LogScaleOptions, M as MarkKind, O as OrdinalScale, l as OrdinalScaleOptions, m as PolarScaleOptions, n as SolidFill, o as SolidStroke, p as SpacedTickOptions, q as TickFormatCtx, r as TickFormatter, s as TickSet, t as TimeScaleOptions, u as bandScale, v as decimalsOf, w as formatInstant, x as formatNumber, y as formatTick, z as linearScale, A as logScale, D as niceDomain, E as niceStep, F as ordinalScale, G as polarScale, H as stepTicks, I as tickDecimals, J as tickStep, K as timeScale } from './scales.entry-BoLQpsxi.js';
2
3
  import { ResolvedTheme } from '@weasel-js/theme';
3
- import { AddNodeSpec, RectPose, Scene, NodeId, RenderLayer, InvocationCtx, Action, Contribution, Paint } from '@weasel-js/core';
4
+ import { AddNodeSpec, RectPose, Scene, NodeId, InvocationCtx, Action, SceneCanvasTextEditor, RenderLayer, Contribution, Paint } from '@weasel-js/core';
4
5
  import { ReactElement } from 'react';
5
-
6
- /** What every positional scale answers, and what an axis is drawn from: where a value sits along its range, the
7
- * values an axis marks, and how one reads. */
8
- interface Scale<T> {
9
- readonly kind: 'linear' | 'log' | 'band' | 'time';
10
- /** Where the scale's output runs, in drawing units: start to end, either way round. */
11
- readonly range: readonly [number, number];
12
- /** Where `value` sits along the range. A band scale answers its band's center. */
13
- position(value: T): number;
14
- /** The values an axis marks, about `count` of them where the scale chooses. */
15
- ticks(count?: number): T[];
16
- /** `value` as an axis label reads it. */
17
- format(value: T): string;
18
- }
19
- /** A scale over numbers that maps both ways. */
20
- interface ContinuousScale extends Scale<number> {
21
- readonly kind: 'linear' | 'log' | 'time';
22
- readonly domain: readonly [number, number];
23
- /** `value` along the range; the same as {@link Scale.position}. */
24
- map(value: number): number;
25
- /** The value at `at` along the range. */
26
- invert(at: number): number;
27
- }
28
-
29
- /** Options for {@link linearScale}. */
30
- interface LinearScaleOptions {
31
- domain: readonly [number, number];
32
- range: readonly [number, number];
33
- /** Widen the domain out to whole tick steps for about this many ticks. Default no widening. */
34
- nice?: number;
35
- }
36
- /** A scale that maps numbers proportionally, as a value axis does. */
37
- interface LinearScale extends ContinuousScale {
38
- readonly kind: 'linear';
39
- /** The distance between ticks when about `count` are asked for. */
40
- tickStep(count?: number): number;
41
- }
42
- /** The round step, 1, 2 or 5 times a power of ten, that cuts `lo`..`hi` into about `count` pieces. */
43
- declare function tickStep(lo: number, hi: number, count?: number): number;
44
- /** Every multiple of `step` from `lo` to `hi`, inclusive. */
45
- declare function stepTicks(lo: number, hi: number, step: number): number[];
46
- /** `value` written as plainly as a grid of `step` allows: no trailing zeros, no exponent. */
47
- declare function formatNumber(value: number, step: number): string;
48
- /** `domain` widened to whole steps of a tick grid of about `count` ticks. */
49
- declare function niceDomain(domain: readonly [number, number], count?: number): [number, number];
50
- /** A linear scale from `domain` onto `range`. */
51
- declare function linearScale(opts: LinearScaleOptions): LinearScale;
52
-
53
- /** Options for {@link logScale}. */
54
- interface LogScaleOptions {
55
- /** Both ends above zero. */
56
- domain: readonly [number, number];
57
- range: readonly [number, number];
58
- /** Default 10. */
59
- base?: number;
60
- }
61
- /** A scale that maps the logarithm of a value proportionally. */
62
- interface LogScale extends ContinuousScale {
63
- readonly kind: 'log';
64
- readonly base: number;
65
- }
66
- /** A logarithmic scale from `domain`, whose ends must both be above zero, onto `range`. */
67
- declare function logScale(opts: LogScaleOptions): LogScale;
68
-
69
- /** Options for {@link bandScale}. */
70
- interface BandScaleOptions {
71
- /** The categories, one band each, in order. */
72
- domain: readonly string[];
73
- range: readonly [number, number];
74
- /** The share of each step left empty between bands, 0 to 1. Default 0.2. */
75
- paddingInner?: number;
76
- /** The room before the first band and after the last, in steps. Default half of `paddingInner`. */
77
- paddingOuter?: number;
78
- }
79
- /** A scale that cuts its range into equal bands, one per category, as a bar chart's category axis does. */
80
- interface BandScale extends Scale<string> {
81
- readonly kind: 'band';
82
- readonly domain: readonly string[];
83
- /** The width of each band. */
84
- readonly bandwidth: number;
85
- /** From one band's start to the next's. */
86
- readonly step: number;
87
- /** Where `key`'s band starts, or `NaN` for a key not in the domain. */
88
- start(key: string): number;
89
- /** The key whose band is nearest `at`; `undefined` for an empty domain. */
90
- invert(at: number): string | undefined;
91
- }
92
- /** A band scale over `domain`. */
93
- declare function bandScale(opts: BandScaleOptions): BandScale;
94
-
95
- /** Options for {@link timeScale}. */
96
- interface TimeScaleOptions {
97
- /** Milliseconds since the epoch, as `Date.getTime` gives them. */
98
- domain: readonly [number, number];
99
- range: readonly [number, number];
100
- }
101
- /** A scale over instants, whose ticks fall on whole seconds, minutes, hours, days, months or years, in UTC. */
102
- interface TimeScale extends ContinuousScale {
103
- readonly kind: 'time';
104
- }
105
- type Unit = 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year';
106
- /** `t` written to the precision of `unit`. */
107
- declare function formatInstant(t: number, unit: Unit): string;
108
- /** A time scale from `domain`, in milliseconds since the epoch, onto `range`. */
109
- declare function timeScale(opts: TimeScaleOptions): TimeScale;
110
-
111
- /** Options for {@link ordinalScale}. */
112
- interface OrdinalScaleOptions<T> {
113
- /** The keys, in order. */
114
- domain: readonly string[];
115
- /** What each key maps to, in domain order, wrapping when there are fewer than keys. */
116
- range: readonly T[];
117
- }
118
- /** A scale from keys to values in turn, as a series' colors are chosen. */
119
- interface OrdinalScale<T> {
120
- readonly kind: 'ordinal';
121
- readonly domain: readonly string[];
122
- readonly range: readonly T[];
123
- /** `key`'s value; a key not in the domain takes the next value after the last, and joins the domain. */
124
- map(key: string): T;
125
- /** The keys a legend lists. */
126
- ticks(): string[];
127
- format(key: string): string;
128
- }
129
- /** An ordinal scale from `domain` to `range`. Throws on an empty range. */
130
- declare function ordinalScale<T>(opts: OrdinalScaleOptions<T>): OrdinalScale<T>;
131
-
132
- /** The kinds of mark a chart is drawn with. */
133
- type MarkKind = 'bar' | 'span' | 'line' | 'area' | 'point' | 'arc' | 'ribbon' | 'rule' | 'text';
134
- /** The value a mark stands for, as plain fields: a series and index, a category, a value. */
135
- type PlotDatum = Readonly<Record<string, string | number | boolean>>;
136
- /** What a mark's scene data says about it: its kind, and the datum it draws. */
137
- interface PlotMarkTrait {
138
- kind: MarkKind;
139
- datum?: PlotDatum;
140
- }
141
- /** A solid paint, as the kit's painters read one. */
142
- interface SolidFill {
143
- paint: {
144
- color: string;
145
- opacity?: number;
146
- };
147
- }
148
- /** A solid stroke, as the kit's painters read one. */
149
- interface SolidStroke {
150
- paint: {
151
- color: string;
152
- };
153
- width: number;
154
- dash?: number[];
155
- cap?: 'butt' | 'round' | 'square';
156
- join?: 'miter' | 'round' | 'bevel';
157
- }
158
- /**
159
- * A mark's scene data: the trait under `plotMark`, and the fields the kit's
160
- * painters draw it from — `path` for a shape, a line or a region, `text` for
161
- * a label.
162
- */
163
- interface PlotMarkData {
164
- plotMark: PlotMarkTrait;
165
- path?: Path;
166
- fill?: SolidFill;
167
- stroke?: SolidStroke;
168
- text?: string;
169
- style?: {
170
- fontFamily: string;
171
- fontSize: number;
172
- align?: 'left' | 'center' | 'right';
173
- fontWeight?: number;
174
- };
175
- verticalAlign?: 'top' | 'center' | 'bottom';
176
- }
177
- /** A box, in the plot's own coordinates: from its root's corner. */
178
- interface PlotBox {
179
- x: number;
180
- y: number;
181
- width: number;
182
- height: number;
183
- /** Radians about the box's center. */
184
- rotation?: number;
185
- }
186
- /** One mark, ready to be a scene node: a key unique within its plot, where it is drawn, and its data. */
187
- interface PlotMark {
188
- key: string;
189
- pose: PlotBox;
190
- data: PlotMarkData;
191
- }
192
- /** A point in the plot's coordinates. */
193
- interface PlotPoint {
194
- x: number;
195
- y: number;
196
- }
6
+ import '@weasel-js/geom';
197
7
 
198
8
  /** Options for {@link barMark}. */
199
9
  interface BarMarkOptions {
@@ -400,6 +210,248 @@ declare function axisRoom<T>(opts: AxisOptions<T>): number;
400
210
  /** Every mark one axis is drawn with. Keys: `<key>:rule`, `<key>:tick:<i>`, `<key>:label:<i>`, `<key>:grid:<i>`, `<key>:title`. */
401
211
  declare function axisMarks<T>(opts: AxisOptions<T>): PlotMark[];
402
212
 
213
+ /** A tag on a task: finished, under way, on the critical path, or a milestone drawn as a diamond at its start. */
214
+ type GanttTag = 'done' | 'active' | 'crit' | 'milestone';
215
+ /** Where a task starts: a date written in the chart's `dateFormat`, when the last of some tasks ends, or (absent
216
+ * both) when the task before it ends. */
217
+ type GanttStart = {
218
+ kind: 'date';
219
+ date: string;
220
+ } | {
221
+ kind: 'after';
222
+ ids: readonly string[];
223
+ } | {
224
+ kind: 'previous';
225
+ };
226
+ /** A unit a duration counts in: milliseconds to weeks, or calendar months and years. */
227
+ type GanttUnit = 'ms' | 's' | 'm' | 'h' | 'd' | 'w' | 'M' | 'y';
228
+ /** Where a task ends: a date in the chart's `dateFormat`, a length from its start (days skip excluded days), or
229
+ * when the first of some tasks starts. */
230
+ type GanttEnd = {
231
+ kind: 'date';
232
+ date: string;
233
+ } | {
234
+ kind: 'duration';
235
+ amount: number;
236
+ unit: GanttUnit;
237
+ } | {
238
+ kind: 'until';
239
+ ids: readonly string[];
240
+ };
241
+ /** One task. Its start and end are stored as written, so a task after another moves with it. */
242
+ interface GanttTask {
243
+ name: string;
244
+ /** What `after` and `until` name it by. */
245
+ id?: string;
246
+ tags?: readonly GanttTag[];
247
+ start: GanttStart;
248
+ end: GanttEnd;
249
+ }
250
+ /** A run of tasks under one heading; the first may have none, holding the tasks before any `section`. */
251
+ interface GanttSection {
252
+ name?: string;
253
+ tasks: readonly GanttTask[];
254
+ }
255
+ /** A Gantt chart: tasks in sections, laid on a time axis. */
256
+ interface GanttData {
257
+ kind: 'gantt';
258
+ title?: string;
259
+ /** How dates are written, in Day.js tokens. Default `'YYYY-MM-DD'`. */
260
+ dateFormat?: string;
261
+ /** How the axis writes dates, in strftime tokens (`%Y-%m-%d`). Default the time scale's own. */
262
+ axisFormat?: string;
263
+ /** Days a duration in days skips: `'weekends'`, a weekday name (`'sunday'`), or a date in `dateFormat`. */
264
+ excludes?: readonly string[];
265
+ /** `'off'` hides the line at today; anything else is its style, as written. Default a line at today. */
266
+ todayMarker?: string;
267
+ sections: readonly GanttSection[];
268
+ }
269
+
270
+ /** How a commit is drawn: a plain dot, a crossed one for a revert, a square to stand out. */
271
+ type GitCommitType = 'NORMAL' | 'REVERSE' | 'HIGHLIGHT';
272
+ /** One line of a git graph, in the order it runs. */
273
+ type GitCommand = {
274
+ kind: 'commit';
275
+ id?: string;
276
+ type?: GitCommitType;
277
+ tag?: string;
278
+ message?: string;
279
+ } | {
280
+ kind: 'branch';
281
+ name: string;
282
+ order?: number;
283
+ } | {
284
+ kind: 'checkout';
285
+ name: string;
286
+ } | {
287
+ kind: 'merge';
288
+ branch: string;
289
+ id?: string;
290
+ type?: GitCommitType;
291
+ tag?: string;
292
+ } | {
293
+ kind: 'cherry-pick';
294
+ id: string;
295
+ tag?: string;
296
+ parent?: string;
297
+ };
298
+ /** A git graph: the commands that build its history, replayed to lay out a lane per branch. */
299
+ interface GitGraphData {
300
+ kind: 'gitgraph';
301
+ title?: string;
302
+ /** Default `'LR'`: commits run left to right, branches stack downward. */
303
+ orientation?: 'LR' | 'TB' | 'BT';
304
+ /** Default `'main'`. */
305
+ mainBranch?: string;
306
+ commands: readonly GitCommand[];
307
+ }
308
+
309
+ /** One step of a journey: how it went, 1 to 5, and who took part. */
310
+ interface JourneyTask {
311
+ name: string;
312
+ /** A whole number, 1 to 5. */
313
+ score: number;
314
+ actors: readonly string[];
315
+ }
316
+ /** A run of steps under one heading; the first may have none, holding the steps before any `section`. */
317
+ interface JourneySection {
318
+ name?: string;
319
+ tasks: readonly JourneyTask[];
320
+ }
321
+ /** A user journey: steps left to right in sections, each scored 1 to 5. */
322
+ interface JourneyData {
323
+ kind: 'journey';
324
+ title?: string;
325
+ sections: readonly JourneySection[];
326
+ }
327
+
328
+ /** One field: bits `start` to `end`, inclusive. */
329
+ interface PacketField {
330
+ start: number;
331
+ end: number;
332
+ label: string;
333
+ /** Written as a bit count (`+8`) after the field before it, rather than as a range. */
334
+ relative?: boolean;
335
+ }
336
+ /** A packet diagram: fields laid along rows of bits. */
337
+ interface PacketData {
338
+ kind: 'packet';
339
+ title?: string;
340
+ /** Default 32. */
341
+ bitsPerRow?: number;
342
+ fields: readonly PacketField[];
343
+ }
344
+
345
+ /** One slice: its label and value. */
346
+ interface PieSlice {
347
+ label: string;
348
+ value: number;
349
+ }
350
+ /** A pie chart: a slice per value, in order clockwise from twelve o'clock, with a legend. */
351
+ interface PieData {
352
+ kind: 'pie';
353
+ title?: string;
354
+ /** Write each slice's value in the legend, where a text edit can change it. */
355
+ showData?: boolean;
356
+ slices: readonly PieSlice[];
357
+ }
358
+
359
+ /** How a point is drawn. Any field absent takes the class's, then the theme's. */
360
+ interface QuadrantPointStyle {
361
+ radius?: number;
362
+ color?: string;
363
+ strokeColor?: string;
364
+ /** In pixels. */
365
+ strokeWidth?: number;
366
+ }
367
+ /** One point, at `x` and `y` from 0 to 1. */
368
+ interface QuadrantPoint {
369
+ name: string;
370
+ x: number;
371
+ y: number;
372
+ /** A key into the chart's `classes`. */
373
+ className?: string;
374
+ style?: QuadrantPointStyle;
375
+ }
376
+ /** An axis's two ends' labels. */
377
+ interface QuadrantAxis {
378
+ low?: string;
379
+ high?: string;
380
+ }
381
+ /** A quadrant chart: points in the unit square, cut into four labeled quadrants. */
382
+ interface QuadrantData {
383
+ kind: 'quadrant';
384
+ title?: string;
385
+ x?: QuadrantAxis;
386
+ y?: QuadrantAxis;
387
+ /** Quadrant labels, in Mermaid's order: top right, top left, bottom left, bottom right. */
388
+ quadrants?: readonly [string?, string?, string?, string?];
389
+ points: readonly QuadrantPoint[];
390
+ /** Named point styles. */
391
+ classes?: Readonly<Record<string, QuadrantPointStyle>>;
392
+ }
393
+
394
+ /** One spoke of a radar chart. */
395
+ interface RadarAxis {
396
+ id: string;
397
+ /** Default its id. */
398
+ label?: string;
399
+ }
400
+ /** One curve: a value on each axis, in axis order. */
401
+ interface RadarCurve {
402
+ id: string;
403
+ /** Default its id. */
404
+ label?: string;
405
+ values: readonly number[];
406
+ }
407
+ /** A radar chart: curves drawn as areas over spokes from a center. */
408
+ interface RadarData {
409
+ kind: 'radar';
410
+ title?: string;
411
+ axes: readonly RadarAxis[];
412
+ curves: readonly RadarCurve[];
413
+ /** The value at the center. Default 0. */
414
+ min?: number;
415
+ /** The value at the rim. Default the largest value. */
416
+ max?: number;
417
+ /** Default `'circle'`. */
418
+ graticule?: 'circle' | 'polygon';
419
+ /** How many rings the graticule has. Default 5. */
420
+ ticks?: number;
421
+ /** Default true. */
422
+ showLegend?: boolean;
423
+ }
424
+
425
+ /** A flow of `value` from one node to another, named by their labels. */
426
+ interface SankeyLink {
427
+ source: string;
428
+ target: string;
429
+ value: number;
430
+ }
431
+ /** A sankey diagram: nodes in columns by depth, joined by ribbons as thick as their flow. */
432
+ interface SankeyData {
433
+ kind: 'sankey';
434
+ title?: string;
435
+ links: readonly SankeyLink[];
436
+ }
437
+
438
+ /** One period on a timeline, and what happened in it. */
439
+ interface TimelinePeriod {
440
+ label: string;
441
+ events: readonly string[];
442
+ }
443
+ /** A run of periods under one heading; the first may have none, holding the periods before any `section`. */
444
+ interface TimelineSection {
445
+ name?: string;
446
+ periods: readonly TimelinePeriod[];
447
+ }
448
+ /** A timeline: periods left to right, each with its events stacked under it. */
449
+ interface TimelineData {
450
+ kind: 'timeline';
451
+ title?: string;
452
+ sections: readonly TimelineSection[];
453
+ }
454
+
403
455
  /** A category axis: one band per label, in order; with none, bands numbered from 1. */
404
456
  interface XyBandAxis {
405
457
  kind: 'band';
@@ -437,10 +489,8 @@ interface XyChartData {
437
489
  series: readonly XySeries[];
438
490
  }
439
491
 
440
- /** Chart specs, and the one table that compiles each kind to marks. */
441
-
442
492
  /** A chart, as data: one spec per kind, told apart by `kind`. */
443
- type PlotData = XyChartData;
493
+ type PlotData = XyChartData | GanttData | TimelineData | PieData | QuadrantData | JourneyData | GitGraphData | SankeyData | PacketData | RadarData;
444
494
  /** The kinds of chart {@link PlotData} holds. */
445
495
  type PlotKind = PlotData['kind'];
446
496
  /** What a kind's compiler is given and gives back: its spec laid out in a box of `size`, as marks. */
@@ -486,7 +536,10 @@ declare function compileXyChart(data: XyChartData, size: {
486
536
  layout: XyLayout;
487
537
  };
488
538
 
489
- /** `data` with series `series`'s value at `index` set to `value`. Throws on an index the series does not hold. */
539
+ /** How many rows the chart has: its categories, or its longest series where that is longer. */
540
+ declare const xyRows: (data: XyChartData) => number;
541
+ /** `data` with series `series`'s value at `index` set to `value`, a shorter series padded with zeros. Throws on a series
542
+ * the chart does not hold or an index past its last row. */
490
543
  declare function setXyValue(data: XyChartData, series: number, index: number, value: number): XyChartData;
491
544
  /** The value a point stands at along `layout`'s value axis, rounded to a tenth of its tick step. */
492
545
  declare function xyValueAt(layout: XyLayout, at: {
@@ -494,6 +547,374 @@ declare function xyValueAt(layout: XyLayout, at: {
494
547
  y: number;
495
548
  }): number;
496
549
 
550
+ /** Where one task runs, in milliseconds since the epoch. */
551
+ interface GanttSpan {
552
+ start: number;
553
+ end: number;
554
+ }
555
+ /** Every task's span, by section and place in it, and the instants they cover between them. */
556
+ interface GanttSchedule {
557
+ spans: readonly (readonly GanttSpan[])[];
558
+ domain: readonly [number, number];
559
+ }
560
+ /**
561
+ * Every task's span. A date that does not read in the `dateFormat`, an id no task holds, and the far end of a
562
+ * dependency cycle all resolve to the chart's first date: its earliest written start, else the start of `today`'s
563
+ * day. An end before its start is moved up to the start.
564
+ */
565
+ declare function scheduleGantt(data: GanttData, today?: number): GanttSchedule;
566
+
567
+ /** Where a gantt's parts landed: the plot area, its time scale, and every task's resolved span. */
568
+ interface GanttLayout {
569
+ /** The area the rows are drawn in, right of the section names and above the axis. */
570
+ plot: {
571
+ x: number;
572
+ y: number;
573
+ width: number;
574
+ height: number;
575
+ };
576
+ time: TimeScale;
577
+ schedule: GanttSchedule;
578
+ /** What a drag snaps to, in milliseconds: an hour when the `dateFormat` carries hours, else a day. */
579
+ snap: number;
580
+ }
581
+ /** Lays out a gantt in a box of `size`: its title, section bands and names, task spans and names, axis, and today. */
582
+ declare function compileGantt(data: GanttData, size: {
583
+ width: number;
584
+ height: number;
585
+ }, theme: PlotTheme, measure: PlotMeasure): {
586
+ marks: PlotMark[];
587
+ layout: GanttLayout;
588
+ };
589
+
590
+ /** Dates as a gantt writes them: Day.js formats read and written, strftime for the axis. Every instant is UTC. */
591
+ /** The default `dateFormat`. */
592
+ declare const GANTT_DATE_FORMAT = "YYYY-MM-DD";
593
+ /** `text` read strictly in Day.js `format`, as milliseconds since the epoch; `null` when it does not read. Fields the
594
+ * format lacks default to 1970-01-01 00:00. */
595
+ declare function parseGanttDate(text: string, format: string): number | null;
596
+ /** `t` written in Day.js `format`. */
597
+ declare function formatGanttDate(t: number, format: string): string;
598
+
599
+ /**
600
+ * `data` with a task starting at `start`, written in the chart's `dateFormat`. A task that started after others, or
601
+ * after the task before it, leaves that dependency: it starts on the date from then on. Its end is kept as written,
602
+ * so a duration moves with it and a date stays put.
603
+ */
604
+ declare function moveGanttTask(data: GanttData, section: number, task: number, start: number): GanttData;
605
+ /**
606
+ * `data` with a task ending at `end`. A duration keeps its unit and takes the whole number of units nearest the span,
607
+ * at least 1 (0 for a milestone), days and weeks counted past excluded days; a date takes the new date, not before the
608
+ * start; an `until` end becomes a duration in days.
609
+ */
610
+ declare function setGanttEnd(data: GanttData, section: number, task: number, end: number): GanttData;
611
+ /** `data` with section `section` named `name`, trimmed. An empty name changes nothing. */
612
+ declare function setGanttSectionName(data: GanttData, section: number, name: string): GanttData;
613
+ /** `data` with a task named `name`, trimmed. An empty name changes nothing. */
614
+ declare function setGanttTaskName(data: GanttData, section: number, task: number, name: string): GanttData;
615
+
616
+ /** Where a timeline's columns landed: one per period, counted flat across sections. */
617
+ interface TimelineLayout {
618
+ /** Each period's column center along x. */
619
+ slots: readonly number[];
620
+ columnWidth: number;
621
+ }
622
+ /** Lays out a timeline in a box of `size`: its title, section headers, period boxes, the line across, and events. */
623
+ declare function compileTimeline(data: TimelineData, size: {
624
+ width: number;
625
+ height: number;
626
+ }, theme: PlotTheme, measure: PlotMeasure): {
627
+ marks: PlotMark[];
628
+ layout: TimelineLayout;
629
+ };
630
+
631
+ /** Edits to a timeline, as plain data in and out. Periods are counted flat, left to right across every section. */
632
+
633
+ /** `data` with section `section` named `name`, trimmed. An empty name changes nothing. Throws on a section it does not hold. */
634
+ declare function setTimelineSectionName(data: TimelineData, section: number, name: string): TimelineData;
635
+ /** `data` with period `period`'s label set to `label`, trimmed. An empty label changes nothing. */
636
+ declare function setTimelinePeriodLabel(data: TimelineData, period: number, label: string): TimelineData;
637
+ /** `data` with event `event` of period `period` set to `text`, trimmed; an empty one removes the event. */
638
+ declare function setTimelineEvent(data: TimelineData, period: number, event: number, text: string): TimelineData;
639
+ /**
640
+ * `data` with the period at flat index `from` moved to flat index `to`, counted after it is taken out. Moved right,
641
+ * it joins the section of the period before it; moved left, the section of the period after it. A section the move
642
+ * leaves empty is dropped. Throws on an index the timeline does not hold.
643
+ */
644
+ declare function moveTimelinePeriod(data: TimelineData, from: number, to: number): TimelineData;
645
+
646
+ /** Where a pie's parts landed: its center and radius, and each slice's angles, clockwise from twelve o'clock. */
647
+ interface PieLayout {
648
+ center: PlotPoint;
649
+ radius: number;
650
+ /** One per slice; a zero-valued slice's two angles are equal. */
651
+ angles: readonly {
652
+ start: number;
653
+ end: number;
654
+ }[];
655
+ }
656
+ /** Lays out a pie in a box of `size`: its title, a slice per value with its share written on it where it fits, and
657
+ * a legend at the right. */
658
+ declare function compilePie(data: PieData, size: {
659
+ width: number;
660
+ height: number;
661
+ }, theme: PlotTheme, measure: PlotMeasure): {
662
+ marks: PlotMark[];
663
+ layout: PieLayout;
664
+ };
665
+
666
+ /** Edits to a pie, as plain data in and out. */
667
+
668
+ /** `data` with slice `slice`'s value set to `value`. Throws on a slice the pie does not hold. */
669
+ declare const setPieValue: (data: PieData, slice: number, value: number) => PieData;
670
+ /** `data` with slice `slice`'s label set to `label`. Throws on a slice the pie does not hold. */
671
+ declare const setPieLabel: (data: PieData, slice: number, label: string) => PieData;
672
+
673
+ /** Where a quadrant chart's unit square landed. */
674
+ interface QuadrantLayout {
675
+ plot: {
676
+ x: number;
677
+ y: number;
678
+ width: number;
679
+ height: number;
680
+ };
681
+ }
682
+ /** Lays out a quadrant chart in a box of `size`: its title, the four quadrants and their labels, the axis labels,
683
+ * and each point with its name beside it. */
684
+ declare function compileQuadrant(data: QuadrantData, size: {
685
+ width: number;
686
+ height: number;
687
+ }, theme: PlotTheme, measure: PlotMeasure): {
688
+ marks: PlotMark[];
689
+ layout: QuadrantLayout;
690
+ };
691
+
692
+ /** Edits to a quadrant chart, as plain data in and out. */
693
+
694
+ /** `data` with point `point` moved to `x`, `y`. Throws on a point the chart does not hold. */
695
+ declare const setQuadrantPoint: (data: QuadrantData, point: number, at: {
696
+ x: number;
697
+ y: number;
698
+ }) => QuadrantData;
699
+ /** `data` with point `point` named `name`. Throws on a point the chart does not hold. */
700
+ declare const setQuadrantPointName: (data: QuadrantData, point: number, name: string) => QuadrantData;
701
+ /** `data` with an axis's end labeled `text`; an empty one drops it. */
702
+ declare function setQuadrantAxisLabel(data: QuadrantData, axis: 'x' | 'y', end: 'low' | 'high', text: string): QuadrantData;
703
+ /** `data` with quadrant `quadrant` (1 to 4, Mermaid's numbering) labeled `text`; an empty one drops it. Throws on any other number. */
704
+ declare function setQuadrantLabel(data: QuadrantData, quadrant: number, text: string): QuadrantData;
705
+
706
+ /** Where a journey's parts landed: the plot area, the score scale up it, and each step's band across it. */
707
+ interface JourneyLayout {
708
+ plot: {
709
+ x: number;
710
+ y: number;
711
+ width: number;
712
+ height: number;
713
+ };
714
+ score: LinearScale;
715
+ /** Over every step in order, keyed by its place among them all from `'0'`. */
716
+ steps: BandScale;
717
+ }
718
+ /** Lays out a journey in a box of `size`: its title, its steps left to right under their sections' headers, each at
719
+ * its score up a 1-to-5 axis with its name and its actors' dots under it, and a legend of actors at the right. */
720
+ declare function compileJourney(data: JourneyData, size: {
721
+ width: number;
722
+ height: number;
723
+ }, theme: PlotTheme, measure: PlotMeasure): {
724
+ marks: PlotMark[];
725
+ layout: JourneyLayout;
726
+ };
727
+
728
+ /** Edits to a user journey, as plain data in and out. */
729
+
730
+ /** `data` with a step's score set to `score`. Throws on a step the journey does not hold. */
731
+ declare const setJourneyScore: (data: JourneyData, section: number, task: number, score: number) => JourneyData;
732
+ /** `data` with a step named `name`. Throws on a step the journey does not hold. */
733
+ declare const setJourneyTaskName: (data: JourneyData, section: number, task: number, name: string) => JourneyData;
734
+ /** `data` with section `section` named `name`. Throws on a section the journey does not hold. */
735
+ declare function setJourneySectionName(data: JourneyData, section: number, name: string): JourneyData;
736
+
737
+ /** A git graph's commands replayed into its history: the commits each made, and the branches they sit on. */
738
+
739
+ /** One commit, as the replay made it. */
740
+ interface GitCommit {
741
+ /** The index in `commands` of the command that made it. */
742
+ command: number;
743
+ /** The command's own id, else one the replay gave it. */
744
+ id: string;
745
+ branch: string;
746
+ /** Its place in the whole history, from 0. */
747
+ seq: number;
748
+ /** The commit it follows, then for a merge the one it merges. */
749
+ parents: readonly string[];
750
+ type: GitCommitType;
751
+ /** For a cherry-pick, the commit it copies. */
752
+ source?: string;
753
+ }
754
+ /** One branch: its name, where it forked, and its commits in order. */
755
+ interface GitBranch {
756
+ name: string;
757
+ order?: number;
758
+ /** The commit it was branched from; none for the main branch, or one branched before any commit. */
759
+ fork?: string;
760
+ commits: string[];
761
+ }
762
+ /** A replayed history. `branches` in lane order: the main branch first, then by `order`, then as created. */
763
+ interface GitHistory {
764
+ commits: GitCommit[];
765
+ branches: GitBranch[];
766
+ /** The first command that could not run, and why; the history holds what ran before it. */
767
+ error?: {
768
+ command: number;
769
+ message: string;
770
+ };
771
+ }
772
+ /** Replays `data`'s commands from an empty main branch, stopping at the first one that cannot run, as Mermaid does. */
773
+ declare function replayGitGraph(data: GitGraphData): GitHistory;
774
+
775
+ /** Where a gitgraph's parts landed: each lane's place across the run, and each commit's point. */
776
+ interface GitGraphLayout {
777
+ history: GitHistory;
778
+ /** Each branch's place across the run, in `history.branches` order: a y for `'LR'`, an x otherwise. */
779
+ lanes: readonly number[];
780
+ /** Each commit's point, in `history.commits` order. */
781
+ points: readonly PlotPoint[];
782
+ }
783
+ /** Lays out a gitgraph in a box of `size`: its title, a lane per branch with its name, commits along it, merge links. */
784
+ declare function compileGitGraph(data: GitGraphData, size: {
785
+ width: number;
786
+ height: number;
787
+ }, theme: PlotTheme, measure: PlotMeasure): {
788
+ marks: PlotMark[];
789
+ layout: GitGraphLayout;
790
+ };
791
+
792
+ /** Edits to a gitgraph, as plain data in and out. */
793
+
794
+ /** `data` with command `command`'s tag set to `text`, trimmed; an empty one removes it. Throws on a command that
795
+ * does not exist or makes no commit. */
796
+ declare function setGitTag(data: GitGraphData, command: number, text: string): GitGraphData;
797
+
798
+ /** Where a sankey's nodes and ribbons stand: columns by depth, heights by flow, ordered to cross less. */
799
+
800
+ /** One node, placed. */
801
+ interface SankeyNodeBox {
802
+ label: string;
803
+ column: number;
804
+ /** The larger of what flows in and what flows out. */
805
+ value: number;
806
+ x: number;
807
+ y: number;
808
+ width: number;
809
+ height: number;
810
+ }
811
+ /** One link's ribbon: the span it leaves its source across, and the span it reaches its target across. */
812
+ interface SankeyRibbon {
813
+ source: number;
814
+ target: number;
815
+ from: {
816
+ x: number;
817
+ y0: number;
818
+ y1: number;
819
+ };
820
+ to: {
821
+ x: number;
822
+ y0: number;
823
+ y1: number;
824
+ };
825
+ }
826
+ /** Where a sankey's parts landed. `nodes` in order of first mention; `links` in the spec's order. */
827
+ interface SankeyLayout {
828
+ nodes: SankeyNodeBox[];
829
+ links: SankeyRibbon[];
830
+ columns: number;
831
+ }
832
+ /** Lays `data` out in `box`: a column per depth, each node as tall as its flow, ribbons stacked within each node. */
833
+ declare function sankeyLayout(data: SankeyData, box: {
834
+ x: number;
835
+ y: number;
836
+ width: number;
837
+ height: number;
838
+ }): SankeyLayout;
839
+
840
+ /** Lays out a sankey in a box of `size`: its title, a bar per node with its label and value, a ribbon per link with its value. */
841
+ declare function compileSankey(data: SankeyData, size: {
842
+ width: number;
843
+ height: number;
844
+ }, theme: PlotTheme, measure: PlotMeasure): {
845
+ marks: PlotMark[];
846
+ layout: SankeyLayout;
847
+ };
848
+
849
+ /** `data` with link `link`'s value set to `value`. Throws on a link it does not hold. */
850
+ declare function setSankeyValue(data: SankeyData, link: number, value: number): SankeyData;
851
+ /** `data` with node `from` called `to` in every link. Throws on a node it does not hold, or a name another node has. */
852
+ declare function renameSankeyNode(data: SankeyData, from: string, to: string): SankeyData;
853
+
854
+ /** Where a packet's rows landed: a band per bit of a row across, and each row's box from `boxTop(row)` down. */
855
+ interface PacketLayout {
856
+ /** Over a row's bits, keyed `'0'` to one less than the bits per row. */
857
+ bits: BandScale;
858
+ bitsPerRow: number;
859
+ rows: number;
860
+ /** The top of row `row`'s field boxes, under its bit numbers. */
861
+ boxTop(row: number): number;
862
+ boxHeight: number;
863
+ }
864
+ /** One row's share of a field: its first and last bit there. */
865
+ interface PacketPiece {
866
+ row: number;
867
+ lo: number;
868
+ hi: number;
869
+ }
870
+ /** Lays out a packet in a box of `size`: its title, then its fields along rows of bits, each a box per row it covers
871
+ * with its label in the widest, and the bit numbers at each piece's ends above it. */
872
+ declare function compilePacket(data: PacketData, size: {
873
+ width: number;
874
+ height: number;
875
+ }, theme: PlotTheme, measure: PlotMeasure): {
876
+ marks: PlotMark[];
877
+ layout: PacketLayout;
878
+ };
879
+
880
+ /** Edits to a packet diagram, as plain data in and out. */
881
+
882
+ /** `data` with field `field` labeled `label`. Throws on a field the packet does not hold. */
883
+ declare function setPacketLabel(data: PacketData, field: number, label: string): PacketData;
884
+
885
+ /** Where a radar's parts landed: the scale its spokes are drawn on. */
886
+ interface RadarLayout {
887
+ scale: PolarScale;
888
+ }
889
+ /** Lays out a radar in a box of `size`: its title, graticule, axis labels, curves and legend. */
890
+ declare function compileRadar(data: RadarData, size: {
891
+ width: number;
892
+ height: number;
893
+ }, theme: PlotTheme, measure: PlotMeasure): {
894
+ marks: PlotMark[];
895
+ layout: RadarLayout;
896
+ };
897
+
898
+ /** `data` with curve `curve`'s value on axis `axis` set to `value`. Throws on a curve or axis it does not hold. */
899
+ declare function setRadarValue(data: RadarData, curve: number, axis: number, value: number): RadarData;
900
+ /** `data` with axis `axis`'s label set to `text`; an empty label falls back to the axis's id. Throws on an axis it does not hold. */
901
+ declare function setRadarAxisLabel(data: RadarData, axis: number, text: string): RadarData;
902
+ /** `data` with curve `curve`'s label set to `text`; an empty label falls back to the curve's id. Throws on a curve it does not hold. */
903
+ declare function setRadarCurveLabel(data: RadarData, curve: number, text: string): RadarData;
904
+
905
+ /** The room every chart leaves around its edge. */
906
+ declare const CHART_PAD = 12;
907
+ /** `title` centered across the top of a box `width` wide, keyed `title`, and where the rest of the chart starts below
908
+ * it: {@link CHART_PAD} down when there is no title. */
909
+ declare function chartTitle(title: string | undefined, width: number, theme: PlotTheme, measure: PlotMeasure): {
910
+ marks: PlotMark[];
911
+ top: number;
912
+ };
913
+ /** `data` with its title set to `text`, trimmed; an empty one drops it. `data` itself when that changes nothing. */
914
+ declare function withTitle<D extends {
915
+ title?: string;
916
+ }>(data: D, text: string): D;
917
+
497
918
  /**
498
919
  * A plot in a scene: one root node holding the spec, its marks derived
499
920
  * children rebuilt from it. An edit replaces the spec and rebuilds the marks
@@ -556,32 +977,99 @@ interface ReplacePlotOptions {
556
977
  }
557
978
  /** Replaces the spec of the plot rooted at `rootId` with `data` and rebuilds its marks, as one undo entry. */
558
979
  declare function replacePlotData<TData, TLayer extends string, TPose>(scene: Scene<TData, TLayer, TPose>, rootId: string, data: PlotData, opts?: ReplacePlotOptions): void;
980
+ /** The id of the plot root `id` is, or is a mark of; `null` for a node outside every plot. */
981
+ declare function plotRootContaining(scene: Scene<unknown, string, unknown>, id: string): NodeId | null;
559
982
  /** Every plot root in `scene`, in render order. */
560
983
  declare function plotRootsIn(scene: Scene<unknown, string, unknown>): NodeId[];
561
984
 
562
- /** What each chart kind lets a drag edit: which marks carry a handle, and the spec a drag of one proposes. */
563
-
564
985
  /** A handle a press can take: where it stands in the plot's coordinates, and the cursor over it. */
565
986
  interface PlotHandle {
566
987
  at: PlotPoint;
567
988
  cursor: 'ns-resize' | 'ew-resize' | 'move';
989
+ /** Which of a mark's handles this is, handed back to {@link PlotEditor.drag}; for a mark with more than one. */
990
+ part?: string;
991
+ /** Takes a press anywhere in this box, in the plot's coordinates, rather than near `at`. */
992
+ box?: PlotBox;
568
993
  }
569
994
  /** One chart kind's edits. */
570
995
  interface PlotEditor<D extends PlotData> {
571
- /** The handle on a mark, or `null` for a mark a drag does not edit. */
996
+ /** The handles on a mark, or `null` for a mark a drag does not edit. */
572
997
  handle(data: D, mark: {
573
998
  trait: PlotMarkTrait;
574
999
  pose: PlotBox;
575
- }): PlotHandle | null;
576
- /** A drag that took the handle on `mark`: the spec it proposes with the pointer at a point in the plot's coordinates.
577
- * `null` when the mark has nothing to edit. */
1000
+ }): PlotHandle | readonly PlotHandle[] | null;
1001
+ /** A drag that took the handle `part` on `mark`: the spec it proposes with the pointer at a point in the plot's
1002
+ * coordinates. `null` when the mark has nothing to edit. */
578
1003
  drag(data: D, mark: PlotMarkTrait, size: {
579
1004
  width: number;
580
1005
  height: number;
581
- }, theme: PlotTheme, measure: PlotMeasure): ((at: PlotPoint) => D) | null;
1006
+ }, theme: PlotTheme, measure: PlotMeasure, part?: string): ((at: PlotPoint) => D) | null;
1007
+ /** The spec with the text a text mark of `datum` stands for set to `text`; `data` itself when that changes
1008
+ * nothing or `text` does not read (a value that is not a number). Absent for a kind with no text edits. */
1009
+ text?(data: D, datum: PlotDatum, text: string): D;
582
1010
  }
583
1011
  /** The edits `data`'s kind allows, or `null` for a kind with none. */
584
1012
  declare const plotEditorOf: (data: PlotData) => PlotEditor<PlotData> | null;
1013
+ /** A handle list as an array, whatever {@link PlotEditor.handle} returned. */
1014
+ declare const handlesOf: (h: PlotHandle | readonly PlotHandle[] | null) => readonly PlotHandle[];
1015
+
1016
+ /**
1017
+ * Dragging a plot's handle to edit the value behind it. The handle layer
1018
+ * claims the press; this action previews every mark the proposed spec
1019
+ * redraws, and commits the spec as one edit of the plot's root.
1020
+ */
1021
+
1022
+ /** The action that drags a plot's handle. */
1023
+ declare const PLOT_DRAG_ACTION_ID = "plot.dragValue";
1024
+ /** A plot edited: the root, and the spec it now holds. */
1025
+ interface PlotEdit {
1026
+ rootId: string;
1027
+ data: PlotData;
1028
+ }
1029
+ /** Options for {@link createPlotDragAction}. */
1030
+ interface PlotDragOptions {
1031
+ id?: string;
1032
+ /** Default {@link textMeasure}. */
1033
+ measure?: PlotMeasure;
1034
+ /** Defaults to {@link replacePlotData} against `deps.scene`, labeled "Edit value". */
1035
+ commit?: (edit: PlotEdit, ctx: InvocationCtx) => void;
1036
+ }
1037
+ /** The default commit: the spec into the root, its marks rebuilt, as one history entry, "Edit value". */
1038
+ declare function commitPlotToScene(edit: PlotEdit, ctx: InvocationCtx, measure?: PlotMeasure): void;
1039
+ /** The `plot.dragValue` action: an ongoing drag that moves one value of a plot, previewing the marks it redraws. */
1040
+ declare function createPlotDragAction(opts?: PlotDragOptions): Action;
1041
+
1042
+ /**
1043
+ * Editing a chart's text in place, through a canvas's own text editor: a text
1044
+ * mark whose datum names an `edit` is the spec's text, and closing the editor
1045
+ * folds what was typed into one edit of the spec.
1046
+ */
1047
+
1048
+ type AnyScene$1 = Scene<unknown, string, unknown>;
1049
+ /** The datum of a text mark an edit can set: one naming what it edits under `edit`, or `null` for any other node. */
1050
+ declare function plotTextOf(node: {
1051
+ data: unknown;
1052
+ } | undefined): PlotDatum | null;
1053
+ /** Whether `data` is a chart's text an edit can set. */
1054
+ declare const isPlotText: (data: unknown) => boolean;
1055
+ /**
1056
+ * Folds a text edit just written to one of a chart's text marks into its
1057
+ * root's spec: the edit is undone and `commit` gets the spec with the new
1058
+ * text, so the change is one entry on the spec, not a mark the next compile
1059
+ * would overwrite. Does nothing for any other node, or text that changes
1060
+ * nothing. Text that does not read (a value that is not a number) is undone,
1061
+ * so the mark shows the spec again.
1062
+ */
1063
+ declare function foldPlotText(scene: AnyScene$1, textId: string, commit: (edit: PlotEdit & {
1064
+ label: string;
1065
+ }) => void): void;
1066
+ /**
1067
+ * The `<SceneCanvas textEditor>` options that open on a chart's text and, as
1068
+ * the edit closes, fold it into one edit of the spec for `commit`.
1069
+ */
1070
+ declare function usePlotTextEdit(scene: AnyScene$1, commit: (edit: PlotEdit & {
1071
+ label: string;
1072
+ }) => void): Exclude<SceneCanvasTextEditor<unknown>, false>;
585
1073
 
586
1074
  /**
587
1075
  * What makes a plot's editable marks grabbable: a hit-only point region at
@@ -599,6 +1087,8 @@ interface PlotHandleScratch {
599
1087
  markId: string;
600
1088
  /** The handle, in world coordinates. */
601
1089
  at: PlotPoint;
1090
+ /** Which of the mark's handles, for a mark with more than one. */
1091
+ part?: string;
602
1092
  }
603
1093
  /** A press's scratch, read back off the hit an action was handed. */
604
1094
  declare function plotHandleScratchOf(hit: {
@@ -612,32 +1102,6 @@ declare function plotHandles(scene: AnyScene): Iterable<PlotHandleScratch & Plot
612
1102
  /** The handle layer, for `CanvasExtensionApi.registerLayer`. */
613
1103
  declare function plotHandleLayer(scene: Scene<unknown, string, unknown>): RenderLayer<unknown>;
614
1104
 
615
- /**
616
- * Dragging a plot's handle to edit the value behind it. The handle layer
617
- * claims the press; this action previews every mark the proposed spec
618
- * redraws, and commits the spec as one edit of the plot's root.
619
- */
620
-
621
- /** The action that drags a plot's handle. */
622
- declare const PLOT_DRAG_ACTION_ID = "plot.dragValue";
623
- /** A plot edited: the root, and the spec it now holds. */
624
- interface PlotEdit {
625
- rootId: string;
626
- data: PlotData;
627
- }
628
- /** Options for {@link createPlotDragAction}. */
629
- interface PlotDragOptions {
630
- id?: string;
631
- /** Default {@link textMeasure}. */
632
- measure?: PlotMeasure;
633
- /** Defaults to {@link replacePlotData} against `deps.scene`, labeled "Edit value". */
634
- commit?: (edit: PlotEdit, ctx: InvocationCtx) => void;
635
- }
636
- /** The default commit: the spec into the root, its marks rebuilt, as one history entry, "Edit value". */
637
- declare function commitPlotToScene(edit: PlotEdit, ctx: InvocationCtx, measure?: PlotMeasure): void;
638
- /** The `plot.dragValue` action: an ongoing drag that moves one value of a plot, previewing the marks it redraws. */
639
- declare function createPlotDragAction(opts?: PlotDragOptions): Action;
640
-
641
1105
  /** The action id that absorbs a press on a handle, so it reaches neither marquee nor pan. */
642
1106
  declare const GRAB_PLOT_HANDLE_ACTION_ID = "plot.grabHandle";
643
1107
  /**
@@ -658,7 +1122,7 @@ declare function plotEditing(opts: PlotDragOptions & {
658
1122
  interface PlotViewProps {
659
1123
  /** The chart. A new value redraws it, with no undo entry. */
660
1124
  data: PlotData;
661
- /** Hears each edit a drag commits, with the spec it leaves. Undo and redo in the view report too. */
1125
+ /** Hears each edit a drag or a text edit commits, with the spec it leaves. Undo and redo in the view report too. */
662
1126
  onChange?: (data: PlotData) => void;
663
1127
  width: number;
664
1128
  height: number;
@@ -670,10 +1134,324 @@ interface PlotViewProps {
670
1134
  'aria-label'?: string;
671
1135
  }
672
1136
  /**
673
- * A chart on its own canvas, edited by dragging its marks: a bar's end or a
674
- * line's point moves its value. Each drag is one undo entry. Text paints only
1137
+ * A chart on its own canvas, edited by dragging its marks (a bar's end, a
1138
+ * line's point, a task's span) and by double-clicking its text to edit it in
1139
+ * place. Each edit is one undo entry. Text paints only
675
1140
  * in a registered font family, so register the theme's (`registerCanvasFont`).
676
1141
  */
677
1142
  declare function PlotView(props: PlotViewProps): ReactElement;
678
1143
 
679
- export { type ArcMarkOptions, type AreaMarkOptions, type AxisOptions, type AxisSide, type BandScale, type BandScaleOptions, type BarMarkOptions, type ContinuousScale, GRAB_PLOT_HANDLE_ACTION_ID, type LineMarkOptions, type LinearScale, type LinearScaleOptions, type LogScale, type LogScaleOptions, type MarkKind, type OrdinalScale, type OrdinalScaleOptions, PLOT_DRAG_ACTION_ID, PLOT_FONT, PLOT_HANDLE_AFFORDANCE_KIND, PLOT_HANDLE_LAYER_ID, PLOT_THEME, type PlotBox, type PlotCompiler, type PlotData, type PlotDatum, type PlotDragOptions, type PlotEdit, type PlotEditor, type PlotFont, type PlotHandle, type PlotHandleScratch, type PlotKind, type PlotMark, type PlotMarkData, type PlotMarkTrait, type PlotMeasure, type PlotPoint, type PlotRootData, type PlotRootTrait, type PlotSceneData, type PlotSpec, type PlotSpecsOptions, type PlotTheme, PlotView, type PlotViewProps, type PointMarkOptions, type ReplacePlotOptions, type RibbonMarkOptions, type RuleMarkOptions, type Scale, type SolidFill, type SolidStroke, type SpanMarkOptions, type TextMarkOptions, type TimeScale, type TimeScaleOptions, type XyBandAxis, type XyChartData, type XyLayout, type XyRangeAxis, type XySeries, type XyValueAxis, arcMark, areaMark, axisMarks, axisRoom, bandScale, barMark, commitPlotToScene, compilePlot, compileXyChart, createPlotDragAction, formatInstant, formatNumber, lineMark, linearScale, logScale, markSpecs, niceDomain, ordinalScale, plotEditing, plotEditorOf, plotHandleLayer, plotHandleScratchOf, plotHandles, plotMarkId, plotMarkOf, plotOrigin, plotRootOf, plotRootsIn, plotSpecs, plotThemeFrom, pointMark, replacePlotData, ribbonMark, ruleMark, seriesColor, setXyValue, spanMark, stepTicks, textMark, textMeasure, tickStep, timeScale, xyLength, xyValueAt, xyValueDomain };
1144
+ /**
1145
+ * A chart's data as a host sees it to build a form or a grid: fields set once
1146
+ * per chart, and tables of rows, some holding further tables under each row.
1147
+ * Every read and write goes through the kind's own edits, so a host needs to
1148
+ * know no kind to author one.
1149
+ */
1150
+
1151
+ /** What a field or cell holds; `undefined` for one left unset. */
1152
+ type PlotValue = string | number | boolean | undefined;
1153
+ /** What a field or cell takes, and so the control a host gives it. */
1154
+ type PlotValueType = {
1155
+ kind: 'string';
1156
+ placeholder?: string;
1157
+ } | {
1158
+ kind: 'number';
1159
+ min?: number;
1160
+ max?: number;
1161
+ step?: number;
1162
+ } | {
1163
+ kind: 'boolean';
1164
+ } | {
1165
+ kind: 'enum';
1166
+ options: readonly string[];
1167
+ } | {
1168
+ kind: 'color';
1169
+ };
1170
+ /** Where a nested table sits: the row it hangs under in each table above it, outermost first. `[]` for a top-level table. */
1171
+ type PlotScope = readonly number[];
1172
+ /** One value per chart: a title, an axis's end, an option. */
1173
+ interface PlotField<D extends PlotData = PlotData> {
1174
+ key: string;
1175
+ label: string;
1176
+ type: PlotValueType;
1177
+ /** May be left unset: setting `undefined` clears it, and the chart falls back to a default. */
1178
+ optional?: boolean;
1179
+ /** Whether the field means anything for `data` as it stands (a range axis's ends, only on a range axis). Absent, always. */
1180
+ applies?(data: D): boolean;
1181
+ get(data: D): PlotValue;
1182
+ /** `data` with the field set to `value`; `data` itself when that changes nothing or does not read. */
1183
+ set(data: D, value: PlotValue): D;
1184
+ }
1185
+ /** One column of a table. */
1186
+ interface PlotColumn<D extends PlotData = PlotData> {
1187
+ key: string;
1188
+ label: string;
1189
+ type: PlotValueType;
1190
+ /** May be left unset; see {@link PlotField.optional}. */
1191
+ optional?: boolean;
1192
+ /** Shown and never set: a value derived from others. */
1193
+ readOnly?: boolean;
1194
+ /** Whether the column means anything on this row (a commit's message, not a checkout's). Absent, every row. */
1195
+ applies?(data: D, scope: PlotScope, row: number): boolean;
1196
+ get(data: D, scope: PlotScope, row: number): PlotValue;
1197
+ /** `data` with the cell set to `value`; `data` itself when that changes nothing or does not read. */
1198
+ set(data: D, scope: PlotScope, row: number, value: PlotValue): D;
1199
+ }
1200
+ /** A collection a chart holds: slices, series, tasks, links. Each missing edit is one the collection does not allow. */
1201
+ interface PlotTable<D extends PlotData = PlotData> {
1202
+ key: string;
1203
+ label: string;
1204
+ /** What one row is called, for a button or a handle's name: `'slice'`. */
1205
+ item: string;
1206
+ count(data: D, scope: PlotScope): number;
1207
+ columns(data: D, scope: PlotScope): readonly PlotColumn<D>[];
1208
+ /** `data` with a new row before row `at`; `at` equal to the count appends. */
1209
+ insert?(data: D, scope: PlotScope, at: number): D;
1210
+ remove?(data: D, scope: PlotScope, row: number): D;
1211
+ /** `data` with row `from` moved to index `to`, counted once it is taken out. */
1212
+ move?(data: D, scope: PlotScope, from: number, to: number): D;
1213
+ /** What row `row` is called, for a heading over its nested tables. */
1214
+ rowLabel?(data: D, scope: PlotScope, row: number): string;
1215
+ /** Tables held under each row of this one; their scope is this one's with the row appended. */
1216
+ children?: readonly PlotTable<D>[];
1217
+ }
1218
+ /** A chart kind's data, as fields and tables. */
1219
+ interface PlotSchema<D extends PlotData = PlotData> {
1220
+ fields: readonly PlotField<D>[];
1221
+ tables: readonly PlotTable<D>[];
1222
+ }
1223
+
1224
+ /** `data`'s kind as fields and tables. Throws on a kind with none. */
1225
+ declare function plotSchemaOf(data: PlotData): PlotSchema;
1226
+ /** Every table in `schema` with the scope of each place it appears in `data`, outermost first: a nested table once
1227
+ * under each row of its parent. */
1228
+ declare function plotTablesIn(schema: PlotSchema, data: PlotData): {
1229
+ table: PlotTable;
1230
+ scope: PlotScope;
1231
+ }[];
1232
+
1233
+ /** `data` with a row before row `at`: a zero in every series and, where rows are labeled, `label` (absent, a fresh one). */
1234
+ declare function insertXyRow(data: XyChartData, at: number, label?: string): XyChartData;
1235
+ /** `data` without row `at`, in every series and the labels. Throws on a row it does not hold. */
1236
+ declare function removeXyRow(data: XyChartData, at: number): XyChartData;
1237
+ /** `data` with row `from` moved to index `to`, counted once it is taken out, in every series and the labels. */
1238
+ declare const moveXyRow: (data: XyChartData, from: number, to: number) => XyChartData;
1239
+ /** `data` with row `index` labeled `label`, the axis turned to categories when it was numbered. */
1240
+ declare function setXyCategory(data: XyChartData, index: number, label: string): XyChartData;
1241
+ /** `data` with `series` inserted before series `at`; absent, a bar series of zeros under a fresh name. */
1242
+ declare function insertXySeries(data: XyChartData, at: number, series?: XySeries): XyChartData;
1243
+ /** `data` without series `series`. Throws on a series it does not hold. */
1244
+ declare const removeXySeries: (data: XyChartData, series: number) => XyChartData;
1245
+ /** `data` with series `from` moved to index `to`, counted once it is taken out. */
1246
+ declare const moveXySeries: (data: XyChartData, from: number, to: number) => XyChartData;
1247
+ /** `data` with series `series` named `name`, trimmed; an empty name drops it. */
1248
+ declare const setXySeriesName: (data: XyChartData, series: number, name: string | undefined) => XyChartData;
1249
+ /** `data` with series `series` drawn as bars or as a line. */
1250
+ declare const setXySeriesKind: (data: XyChartData, series: number, kind: XySeries["kind"]) => XyChartData;
1251
+ /** `data` with categories along x and values along y, or (`'horizontal'`) the other way round. */
1252
+ declare const setXyOrientation: (data: XyChartData, orientation: "vertical" | "horizontal") => XyChartData;
1253
+ /** `data` running along categories (each row labeled, numbered ones kept as written) or a numeric range from 0 to the
1254
+ * row count. The axis keeps its title. */
1255
+ declare function setXyXKind(data: XyChartData, kind: 'band' | 'range'): XyChartData;
1256
+ /** `data` with an axis titled `title`, trimmed; an empty one drops it. */
1257
+ declare function setXyAxisTitle(data: XyChartData, axis: 'x' | 'y', title: string | undefined): XyChartData;
1258
+ /** `data` with the value axis's end `end` at `value`; `undefined` lets it fit the values. */
1259
+ declare function setXyValueBound(data: XyChartData, end: 'min' | 'max', value: number | undefined): XyChartData;
1260
+ /** `data` with the range axis's end `end` at `value`. Throws on a chart not running along a range. */
1261
+ declare function setXyRangeBound(data: XyChartData, end: 'min' | 'max', value: number): XyChartData;
1262
+
1263
+ /** `data` with `section` inserted before section `at`; absent, a section of one fresh task under a fresh name. */
1264
+ declare function insertGanttSection(data: GanttData, at: number, section?: GanttSection): GanttData;
1265
+ /** `data` without section `section` and its tasks. Throws on a section it does not hold. */
1266
+ declare function removeGanttSection(data: GanttData, section: number): GanttData;
1267
+ /** `data` with section `from` moved to index `to`, counted once it is taken out. */
1268
+ declare const moveGanttSection: (data: GanttData, from: number, to: number) => GanttData;
1269
+ /** `data` with `task` inserted before task `at` of section `section`; absent, a day-long task after the one before. */
1270
+ declare const insertGanttTask: (data: GanttData, section: number, at: number, task?: GanttTask) => GanttData;
1271
+ /** `data` without task `task` of section `section`. Throws on a task it does not hold. */
1272
+ declare function removeGanttTask(data: GanttData, section: number, task: number): GanttData;
1273
+ /** `data` with task `from` of section `section` moved to index `to` in it, counted once it is taken out. */
1274
+ declare const reorderGanttTask: (data: GanttData, section: number, from: number, to: number) => GanttData;
1275
+ /** `data` with task `task` of section `from` moved into section `to` before its task `at` (absent, last). Its id and
1276
+ * every dependency on it are kept. Throws on a task or section it does not hold. */
1277
+ declare function moveGanttTaskToSection(data: GanttData, from: number, task: number, to: number, at?: number): GanttData;
1278
+ /**
1279
+ * `data` with a task's id set to `id`, trimmed, every dependency naming the old id following it; an empty id drops
1280
+ * it and the dependencies on it. Throws on an id another task holds.
1281
+ */
1282
+ declare function setGanttTaskId(data: GanttData, section: number, task: number, id: string | undefined): GanttData;
1283
+ /** `data` with a task carrying `tags`, kept in one order and each once; none drops them. */
1284
+ declare const setGanttTaskTags: (data: GanttData, section: number, task: number, tags: readonly GanttTag[]) => GanttData;
1285
+ /** `data` with a task starting at `start`, as written. */
1286
+ declare const setGanttTaskStart: (data: GanttData, section: number, task: number, start: GanttStart) => GanttData;
1287
+ /** `data` with a task ending at `end`, as written. */
1288
+ declare const setGanttTaskEnd: (data: GanttData, section: number, task: number, end: GanttEnd) => GanttData;
1289
+ /** `data` with one of its text settings set to `value`, trimmed; an empty one drops it, for the default. */
1290
+ declare function setGanttSetting(data: GanttData, key: 'dateFormat' | 'axisFormat' | 'todayMarker', value: string | undefined): GanttData;
1291
+ /** `data` skipping `excludes` in durations counted in days, each trimmed; none drops them. */
1292
+ declare function setGanttExcludes(data: GanttData, excludes: readonly string[]): GanttData;
1293
+
1294
+ /** A task's start and end as written in Mermaid: `after a b`, `until a b`, a duration (`3d`, `1.5h`), or a date. */
1295
+
1296
+ /** `start` as written: `after a b`, a date, or `''` for one that follows the task before it. */
1297
+ declare const formatGanttStart: (start: GanttStart) => string;
1298
+ /** Text read as a start: `after a b` as its ids, `''` as following the task before, anything else as a date. */
1299
+ declare function parseGanttStart(text: string): GanttStart;
1300
+ /** `end` as written: `until a b`, a duration, or a date. */
1301
+ declare function formatGanttEnd(end: GanttEnd): string;
1302
+ /** Text read as an end: `until a b` as its ids, a duration as its amount and unit, anything else as a date. */
1303
+ declare function parseGanttEnd(text: string): GanttEnd;
1304
+
1305
+ /** The flat index, counted across every section, of period `index` of section `section`. */
1306
+ declare function timelineFlatIndex(data: TimelineData, section: number, index: number): number;
1307
+ /** `data` with `section` inserted before section `at`; absent, one fresh period under a fresh name. */
1308
+ declare function insertTimelineSection(data: TimelineData, at: number, section?: TimelineSection): TimelineData;
1309
+ /** `data` without section `section` and its periods. Throws on a section it does not hold. */
1310
+ declare const removeTimelineSection: (data: TimelineData, section: number) => TimelineData;
1311
+ /** `data` with section `from` moved to index `to`, counted once it is taken out. */
1312
+ declare const moveTimelineSection: (data: TimelineData, from: number, to: number) => TimelineData;
1313
+ /** `data` with `period` inserted before period `at` of section `section`; absent, a fresh period with no events. */
1314
+ declare const insertTimelinePeriod: (data: TimelineData, section: number, at: number, period?: TimelinePeriod) => TimelineData;
1315
+ /** `data` without period `period` of section `section`. Throws on a period it does not hold. */
1316
+ declare const removeTimelinePeriod: (data: TimelineData, section: number, period: number) => TimelineData;
1317
+ /** `data` with period `from` of section `section` moved to index `to` in it, counted once it is taken out. */
1318
+ declare const reorderTimelinePeriod: (data: TimelineData, section: number, from: number, to: number) => TimelineData;
1319
+ /** `data` with event `text` inserted before event `at` of one period; absent, a fresh one. */
1320
+ declare const insertTimelineEvent: (data: TimelineData, section: number, period: number, at: number, text?: string) => TimelineData;
1321
+ /** `data` without event `event` of one period. Throws on an event it does not hold. */
1322
+ declare const removeTimelineEvent: (data: TimelineData, section: number, period: number, event: number) => TimelineData;
1323
+ /** `data` with event `from` of one period moved to index `to` in it, counted once it is taken out. */
1324
+ declare const moveTimelineEvent: (data: TimelineData, section: number, period: number, from: number, to: number) => TimelineData;
1325
+
1326
+ /** `data` with `slice` inserted before slice `at`; absent, a slice of 1 under a label no slice holds. */
1327
+ declare function insertPieSlice(data: PieData, at: number, slice?: PieSlice): PieData;
1328
+ /** `data` without slice `slice`. Throws on a slice it does not hold. */
1329
+ declare const removePieSlice: (data: PieData, slice: number) => PieData;
1330
+ /** `data` with slice `from` moved to index `to`, counted once it is taken out. */
1331
+ declare const movePieSlice: (data: PieData, from: number, to: number) => PieData;
1332
+ /** `data` writing, or not, each slice's value in the legend. */
1333
+ declare const setPieShowData: (data: PieData, show: boolean) => PieData;
1334
+
1335
+ /** `data` with `point` inserted before point `at`; absent, a point at the center under a fresh name. */
1336
+ declare function insertQuadrantPoint(data: QuadrantData, at: number, point?: QuadrantPoint): QuadrantData;
1337
+ /** `data` without point `point`. Throws on a point it does not hold. */
1338
+ declare const removeQuadrantPoint: (data: QuadrantData, point: number) => QuadrantData;
1339
+ /** `data` with point `from` moved to index `to`, counted once it is taken out. */
1340
+ declare const moveQuadrantPoint: (data: QuadrantData, from: number, to: number) => QuadrantData;
1341
+ /** `data` with a point's style `key` set to `value`; `undefined` drops it, for its class's or the theme's. */
1342
+ declare const setQuadrantPointStyle: <K extends keyof QuadrantPointStyle>(data: QuadrantData, point: number, key: K, value: QuadrantPointStyle[K] | undefined) => QuadrantData;
1343
+ /** `data` with a point drawn in class `className`; `undefined` drops it. Throws on a class the chart does not hold. */
1344
+ declare function setQuadrantPointClass(data: QuadrantData, point: number, className: string | undefined): QuadrantData;
1345
+ /** The names of the chart's classes, in order. */
1346
+ declare const quadrantClassNames: (data: QuadrantData) => string[];
1347
+ /** `data` with a class `name` (absent, a fresh one) of `style` inserted before class `at`. Throws on a name it holds. */
1348
+ declare function insertQuadrantClass(data: QuadrantData, at: number, name?: string, style?: QuadrantPointStyle): QuadrantData;
1349
+ /** `data` without class `index`, every point that used it drawn in its own style. Throws on a class it does not hold. */
1350
+ declare function removeQuadrantClass(data: QuadrantData, index: number): QuadrantData;
1351
+ /** `data` with class `from` moved to index `to`, counted once it is taken out. */
1352
+ declare const moveQuadrantClass: (data: QuadrantData, from: number, to: number) => QuadrantData;
1353
+ /** `data` with class `index` called `name`, on every point that used it too. Throws on a name another class holds. */
1354
+ declare function renameQuadrantClass(data: QuadrantData, index: number, name: string): QuadrantData;
1355
+ /** `data` with class `index`'s style `key` set to `value`; `undefined` drops it, for the theme's. */
1356
+ declare function setQuadrantClassStyle<K extends keyof QuadrantPointStyle>(data: QuadrantData, index: number, key: K, value: QuadrantPointStyle[K] | undefined): QuadrantData;
1357
+
1358
+ /** `data` with `section` inserted before section `at`; absent, one fresh step under a fresh name. */
1359
+ declare function insertJourneySection(data: JourneyData, at: number, section?: JourneySection): JourneyData;
1360
+ /** `data` without section `section` and its steps. Throws on a section it does not hold. */
1361
+ declare const removeJourneySection: (data: JourneyData, section: number) => JourneyData;
1362
+ /** `data` with section `from` moved to index `to`, counted once it is taken out. */
1363
+ declare const moveJourneySection: (data: JourneyData, from: number, to: number) => JourneyData;
1364
+ /** `data` with `task` inserted before step `at` of section `section`; absent, a fresh step scored 3 with no actors. */
1365
+ declare const insertJourneyTask: (data: JourneyData, section: number, at: number, task?: JourneyTask) => JourneyData;
1366
+ /** `data` without step `task` of section `section`. Throws on a step it does not hold. */
1367
+ declare const removeJourneyTask: (data: JourneyData, section: number, task: number) => JourneyData;
1368
+ /** `data` with step `from` of section `section` moved to index `to` in it, counted once it is taken out. */
1369
+ declare const moveJourneyTask: (data: JourneyData, section: number, from: number, to: number) => JourneyData;
1370
+ /** `data` with a step taken part in by `actors`, each trimmed and once. */
1371
+ declare function setJourneyActors(data: JourneyData, section: number, task: number, actors: readonly string[]): JourneyData;
1372
+
1373
+ /** The kinds of command a graph runs. */
1374
+ declare const GIT_COMMAND_KINDS: readonly ["commit", "branch", "checkout", "merge", "cherry-pick"];
1375
+ /** A command's fields besides its kind. */
1376
+ type GitCommandField = 'id' | 'type' | 'tag' | 'message' | 'name' | 'branch' | 'order' | 'parent';
1377
+ /** The fields each kind of command holds; `id` on a cherry-pick names the commit it picks. */
1378
+ declare const GIT_COMMAND_FIELDS: {
1379
+ readonly [K in GitCommand['kind']]: readonly GitCommandField[];
1380
+ };
1381
+ /** The branches the graph names, its main branch first. */
1382
+ declare const gitBranchNames: (data: GitGraphData) => string[];
1383
+ /** `data` with `command` inserted before command `at`; absent, a plain commit. */
1384
+ declare const insertGitCommand: (data: GitGraphData, at: number, command?: GitCommand) => GitGraphData;
1385
+ /** `data` without command `command`. Throws on a command it does not hold. */
1386
+ declare const removeGitCommand: (data: GitGraphData, command: number) => GitGraphData;
1387
+ /** `data` with command `from` moved to index `to`, counted once it is taken out. */
1388
+ declare const moveGitCommand: (data: GitGraphData, from: number, to: number) => GitGraphData;
1389
+ /** `data` with command `at` replaced by `command`. Throws on a command it does not hold. */
1390
+ declare const setGitCommand: (data: GitGraphData, at: number, command: GitCommand) => GitGraphData;
1391
+ /**
1392
+ * `data` with command `at` turned into a command of `kind`, keeping the fields both kinds hold. What the new kind needs
1393
+ * and the old did not hold is filled in: a fresh name for a branch, the main branch to check out, the last branch
1394
+ * created to merge, the last commit id to pick.
1395
+ */
1396
+ declare function setGitCommandKind(data: GitGraphData, at: number, kind: GitCommand['kind']): GitGraphData;
1397
+ /**
1398
+ * `data` with field `field` of command `at` set to `value`; `undefined` drops an optional field. Throws on a field its
1399
+ * kind does not hold, a value of the wrong type, or dropping a field the kind needs.
1400
+ */
1401
+ declare function setGitCommandField(data: GitGraphData, at: number, field: GitCommandField, value: string | number | undefined): GitGraphData;
1402
+ /** `data` drawn left to right (the default), top to bottom, or bottom to top. */
1403
+ declare const setGitOrientation: (data: GitGraphData, orientation: "LR" | "TB" | "BT") => GitGraphData;
1404
+ /** `data` with its main branch called `name`, trimmed, every checkout and merge of it renamed too. Throws on an empty
1405
+ * name or one another branch holds. */
1406
+ declare function setGitMainBranch(data: GitGraphData, name: string): GitGraphData;
1407
+
1408
+ /** `data` with `link` inserted before link `at`; absent, a flow of 1 from the last link's target to a fresh node. */
1409
+ declare function insertSankeyLink(data: SankeyData, at: number, link?: SankeyLink): SankeyData;
1410
+ /** `data` without link `link`. Throws on a link it does not hold. */
1411
+ declare const removeSankeyLink: (data: SankeyData, link: number) => SankeyData;
1412
+ /** `data` with link `from` moved to index `to`, counted once it is taken out. */
1413
+ declare const moveSankeyLink: (data: SankeyData, from: number, to: number) => SankeyData;
1414
+ /** `data` with link `link` running from (`'source'`) or to (`'target'`) node `name`, trimmed; a node it names that no
1415
+ * link did is added. Throws on an empty name. */
1416
+ declare function setSankeyEnd(data: SankeyData, link: number, end: 'source' | 'target', name: string): SankeyData;
1417
+ /** `data` without node `name`: every link to or from it is taken out. Throws on a node it does not hold. */
1418
+ declare function removeSankeyNode(data: SankeyData, name: string): SankeyData;
1419
+
1420
+ /** `data` with `field` inserted before field `at`, the fields after it moved along by its width; absent, an 8-bit
1421
+ * field just after the one before, under a fresh label. */
1422
+ declare function insertPacketField(data: PacketData, at: number, field?: PacketField): PacketData;
1423
+ /** `data` without field `field`, the fields after it moved back by its width. Throws on a field it does not hold. */
1424
+ declare function removePacketField(data: PacketData, field: number): PacketData;
1425
+ /** `data` with field `from` moved to index `to`, counted once it is taken out. Each field keeps its width and the
1426
+ * gap before each place is kept, so the fields are laid again from the first one's start. */
1427
+ declare function movePacketField(data: PacketData, from: number, to: number): PacketData;
1428
+ /** `data` with field `field` `bits` wide, a whole number at least 1, the fields after it moved by the change. */
1429
+ declare function setPacketBits(data: PacketData, field: number, bits: number): PacketData;
1430
+ /** `data` with field `field` starting at bit `start`, the fields after it moved along with it. Throws on a start
1431
+ * inside the field before it. */
1432
+ declare function setPacketStart(data: PacketData, field: number, start: number): PacketData;
1433
+ /** `data` with field `field` written as a count of bits after the field before (`+8`), or as a range. */
1434
+ declare const setPacketRelative: (data: PacketData, field: number, relative: boolean) => PacketData;
1435
+ /** `data` with `bits` to a row; `undefined` for the default 32. */
1436
+ declare function setPacketBitsPerRow(data: PacketData, bits: number | undefined): PacketData;
1437
+
1438
+ /** `data` with `axis` inserted before axis `at`, every curve 0 on it; absent, an axis under a fresh id. */
1439
+ declare function insertRadarAxis(data: RadarData, at: number, axis?: RadarAxis): RadarData;
1440
+ /** `data` without axis `axis` and each curve's value on it. Throws on an axis it does not hold. */
1441
+ declare function removeRadarAxis(data: RadarData, axis: number): RadarData;
1442
+ /** `data` with axis `from` moved to index `to`, counted once it is taken out, each curve's value on it moving too. */
1443
+ declare function moveRadarAxis(data: RadarData, from: number, to: number): RadarData;
1444
+ /** `data` with `curve` inserted before curve `at`; absent, a curve of zeros under a fresh id. */
1445
+ declare function insertRadarCurve(data: RadarData, at: number, curve?: RadarCurve): RadarData;
1446
+ /** `data` without curve `curve`. Throws on a curve it does not hold. */
1447
+ declare const removeRadarCurve: (data: RadarData, curve: number) => RadarData;
1448
+ /** `data` with curve `from` moved to index `to`, counted once it is taken out. */
1449
+ declare const moveRadarCurve: (data: RadarData, from: number, to: number) => RadarData;
1450
+ /** `data` with axis `axis`'s id set to `id`. Throws on an id that is not a word or another axis holds. */
1451
+ declare function setRadarAxisId(data: RadarData, axis: number, id: string): RadarData;
1452
+ /** `data` with curve `curve`'s id set to `id`. Throws on an id that is not a word or another curve holds. */
1453
+ declare function setRadarCurveId(data: RadarData, curve: number, id: string): RadarData;
1454
+ /** `data` with option `key` set to `value`; `undefined` drops it, for its default. */
1455
+ declare function setRadarOption<K extends 'min' | 'max' | 'ticks' | 'graticule' | 'showLegend'>(data: RadarData, key: K, value: RadarData[K] | undefined): RadarData;
1456
+
1457
+ export { type ArcMarkOptions, type AreaMarkOptions, type AxisOptions, type AxisSide, BandScale, type BarMarkOptions, CHART_PAD, GANTT_DATE_FORMAT, GIT_COMMAND_FIELDS, GIT_COMMAND_KINDS, GRAB_PLOT_HANDLE_ACTION_ID, type GanttData, type GanttEnd, type GanttLayout, type GanttSchedule, type GanttSection, type GanttSpan, type GanttStart, type GanttTag, type GanttTask, type GanttUnit, type GitBranch, type GitCommand, type GitCommandField, type GitCommit, type GitCommitType, type GitGraphData, type GitGraphLayout, type GitHistory, type JourneyData, type JourneyLayout, type JourneySection, type JourneyTask, type LineMarkOptions, LinearScale, PLOT_DRAG_ACTION_ID, PLOT_FONT, PLOT_HANDLE_AFFORDANCE_KIND, PLOT_HANDLE_LAYER_ID, PLOT_THEME, type PacketData, type PacketField, type PacketLayout, type PacketPiece, type PieData, type PieLayout, type PieSlice, PlotBox, type PlotColumn, type PlotCompiler, type PlotData, PlotDatum, type PlotDragOptions, type PlotEdit, type PlotEditor, type PlotField, type PlotFont, type PlotHandle, type PlotHandleScratch, type PlotKind, PlotMark, PlotMarkData, PlotMarkTrait, type PlotMeasure, PlotPoint, type PlotRootData, type PlotRootTrait, type PlotSceneData, type PlotSchema, type PlotScope, type PlotSpec, type PlotSpecsOptions, type PlotTable, type PlotTheme, type PlotValue, type PlotValueType, PlotView, type PlotViewProps, type PointMarkOptions, PolarScale, type QuadrantAxis, type QuadrantData, type QuadrantLayout, type QuadrantPoint, type QuadrantPointStyle, type RadarAxis, type RadarCurve, type RadarData, type RadarLayout, type ReplacePlotOptions, type RibbonMarkOptions, type RuleMarkOptions, type SankeyData, type SankeyLayout, type SankeyLink, type SankeyNodeBox, type SankeyRibbon, Scale, type SpanMarkOptions, type TextMarkOptions, TimeScale, type TimelineData, type TimelineLayout, type TimelinePeriod, type TimelineSection, type XyBandAxis, type XyChartData, type XyLayout, type XyRangeAxis, type XySeries, type XyValueAxis, arcMark, areaMark, axisMarks, axisRoom, barMark, chartTitle, commitPlotToScene, compileGantt, compileGitGraph, compileJourney, compilePacket, compilePie, compilePlot, compileQuadrant, compileRadar, compileSankey, compileTimeline, compileXyChart, createPlotDragAction, foldPlotText, formatGanttDate, formatGanttEnd, formatGanttStart, gitBranchNames, handlesOf, insertGanttSection, insertGanttTask, insertGitCommand, insertJourneySection, insertJourneyTask, insertPacketField, insertPieSlice, insertQuadrantClass, insertQuadrantPoint, insertRadarAxis, insertRadarCurve, insertSankeyLink, insertTimelineEvent, insertTimelinePeriod, insertTimelineSection, insertXyRow, insertXySeries, isPlotText, lineMark, markSpecs, moveGanttSection, moveGanttTask, moveGanttTaskToSection, moveGitCommand, moveJourneySection, moveJourneyTask, movePacketField, movePieSlice, moveQuadrantClass, moveQuadrantPoint, moveRadarAxis, moveRadarCurve, moveSankeyLink, moveTimelineEvent, moveTimelinePeriod, moveTimelineSection, moveXyRow, moveXySeries, parseGanttDate, parseGanttEnd, parseGanttStart, plotEditing, plotEditorOf, plotHandleLayer, plotHandleScratchOf, plotHandles, plotMarkId, plotMarkOf, plotOrigin, plotRootContaining, plotRootOf, plotRootsIn, plotSchemaOf, plotSpecs, plotTablesIn, plotTextOf, plotThemeFrom, pointMark, quadrantClassNames, removeGanttSection, removeGanttTask, removeGitCommand, removeJourneySection, removeJourneyTask, removePacketField, removePieSlice, removeQuadrantClass, removeQuadrantPoint, removeRadarAxis, removeRadarCurve, removeSankeyLink, removeSankeyNode, removeTimelineEvent, removeTimelinePeriod, removeTimelineSection, removeXyRow, removeXySeries, renameQuadrantClass, renameSankeyNode, reorderGanttTask, reorderTimelinePeriod, replacePlotData, replayGitGraph, ribbonMark, ruleMark, sankeyLayout, scheduleGantt, seriesColor, setGanttEnd, setGanttExcludes, setGanttSectionName, setGanttSetting, setGanttTaskEnd, setGanttTaskId, setGanttTaskName, setGanttTaskStart, setGanttTaskTags, setGitCommand, setGitCommandField, setGitCommandKind, setGitMainBranch, setGitOrientation, setGitTag, setJourneyActors, setJourneyScore, setJourneySectionName, setJourneyTaskName, setPacketBits, setPacketBitsPerRow, setPacketLabel, setPacketRelative, setPacketStart, setPieLabel, setPieShowData, setPieValue, setQuadrantAxisLabel, setQuadrantClassStyle, setQuadrantLabel, setQuadrantPoint, setQuadrantPointClass, setQuadrantPointName, setQuadrantPointStyle, setRadarAxisId, setRadarAxisLabel, setRadarCurveId, setRadarCurveLabel, setRadarOption, setRadarValue, setSankeyEnd, setSankeyValue, setTimelineEvent, setTimelinePeriodLabel, setTimelineSectionName, setXyAxisTitle, setXyCategory, setXyOrientation, setXyRangeBound, setXySeriesKind, setXySeriesName, setXyValue, setXyValueBound, setXyXKind, spanMark, textMark, textMeasure, timelineFlatIndex, usePlotTextEdit, withTitle, xyLength, xyRows, xyValueAt, xyValueDomain };