@pixerate/editor 0.164.0 → 0.166.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.cjs +54 -39
- package/dist/agent/index.js +24 -9
- package/dist/animation/index.cjs +6 -5
- package/dist/animation/index.js +5 -4
- package/dist/animation-editor/index.cjs +65 -64
- package/dist/animation-editor/index.js +8 -7
- package/dist/bridge/cli.cjs +3 -3
- package/dist/bridge/cli.js +2 -2
- package/dist/bridge/index.cjs +3 -3
- package/dist/bridge/index.js +2 -2
- package/dist/canvas/index.cjs +89 -87
- package/dist/canvas/index.js +11 -9
- package/dist/chart/controller.d.cts +60 -2
- package/dist/chart/controller.d.ts +60 -2
- package/dist/chart/index.cjs +657 -163
- package/dist/chart/index.d.cts +3 -0
- package/dist/chart/index.d.ts +3 -0
- package/dist/chart/index.js +512 -18
- package/dist/chart/layout-families.d.cts +14 -0
- package/dist/chart/layout-families.d.ts +14 -0
- package/dist/chart/layout-shared.d.cts +5 -0
- package/dist/chart/layout-shared.d.ts +5 -0
- package/dist/chart/links.d.cts +34 -0
- package/dist/chart/links.d.ts +34 -0
- package/dist/chart/mermaid.d.cts +9 -6
- package/dist/chart/mermaid.d.ts +9 -6
- package/dist/chart/race.d.cts +26 -0
- package/dist/chart/race.d.ts +26 -0
- package/dist/chart/schemas.d.cts +5 -0
- package/dist/chart/schemas.d.ts +5 -0
- package/dist/chart/spec.d.cts +3 -2
- package/dist/chart/spec.d.ts +3 -2
- package/dist/chart/style.d.cts +33 -0
- package/dist/chart/style.d.ts +33 -0
- package/dist/chart/types.d.cts +28 -2
- package/dist/chart/types.d.ts +28 -2
- package/dist/{chunk-ZVNAMTFO.cjs → chunk-3FSUJIXN.cjs} +18 -174
- package/dist/{chunk-RQCMSEM5.cjs → chunk-4QUUHTGJ.cjs} +2 -2
- package/dist/{chunk-CIPIESX4.cjs → chunk-4ZC5QJE2.cjs} +3 -3
- package/dist/{chunk-S6X2QRVU.cjs → chunk-5UEFBM2M.cjs} +1 -138
- package/dist/{chunk-5FNGLV2D.js → chunk-5UNQDC3Q.js} +18 -3
- package/dist/{chunk-YSAGBIRW.cjs → chunk-6FYIFGBW.cjs} +16 -16
- package/dist/{chunk-QYZGBVNC.js → chunk-7272D3K2.js} +10 -8
- package/dist/{chunk-462WGGXX.cjs → chunk-AMX23CSN.cjs} +27 -16
- package/dist/{chunk-3VLOOO3G.js → chunk-BDIM6NVW.js} +1 -1
- package/dist/{chunk-R3P2M7HU.cjs → chunk-BPX4Z3N3.cjs} +355 -207
- package/dist/{chunk-D54JHQK2.cjs → chunk-CHLV7UFP.cjs} +51 -51
- package/dist/{chunk-OXERWBKE.js → chunk-DFCAR7AW.js} +3 -3
- package/dist/{chunk-GZ2FM3ZB.js → chunk-DKNEQX7T.js} +6 -162
- package/dist/{chunk-JCXMJUQO.cjs → chunk-EGZM52EO.cjs} +3 -3
- package/dist/{chunk-ES3UEVUT.cjs → chunk-EUIDTZNQ.cjs} +112 -110
- package/dist/{chunk-H3OEM3Q2.js → chunk-F6R67I3A.js} +1 -1
- package/dist/{chunk-3NEZJCBY.js → chunk-FR432ROA.js} +349 -201
- package/dist/chunk-HIDFL5LQ.js +484 -0
- package/dist/{chunk-22KLZZGH.cjs → chunk-HXOBOHH2.cjs} +8 -8
- package/dist/{chunk-MKTDELCD.js → chunk-I5MRJW7B.js} +1 -1
- package/dist/{chunk-SDHZG5TF.js → chunk-ILP77UD6.js} +160 -2
- package/dist/{chunk-Z4P2RBMJ.js → chunk-ITANXMZD.js} +177 -3
- package/dist/chunk-KGRZMHZB.js +204 -0
- package/dist/{chunk-SET6KJOP.js → chunk-LPIKXPBM.js} +1 -1
- package/dist/{chunk-BQWGN5WH.js → chunk-M2TPMYJE.js} +1 -1
- package/dist/{chunk-GTELFJRE.cjs → chunk-M5GLQQWG.cjs} +2 -2
- package/dist/{chunk-4VU4CP7R.js → chunk-MHLU6GRJ.js} +1 -138
- package/dist/{chunk-NZD2MZJC.cjs → chunk-MZFZSVUJ.cjs} +38 -23
- package/dist/{chunk-DAPQGA55.js → chunk-NQQDGGXY.js} +2 -2
- package/dist/chunk-O6OGNDND.js +164 -0
- package/dist/{chunk-PA3IMPPS.cjs → chunk-OVYQAYGH.cjs} +81 -81
- package/dist/{chunk-YXOW456B.js → chunk-PPEDZ5WR.js} +1 -1
- package/dist/{chunk-24M7VD6M.cjs → chunk-S4EIAIEW.cjs} +7 -7
- package/dist/{chunk-M4MIZPQI.cjs → chunk-SJ2CPTQC.cjs} +189 -15
- package/dist/{chunk-YGG7WDWT.cjs → chunk-SZWVMB3B.cjs} +24 -18
- package/dist/chunk-TFF2GTGN.cjs +153 -0
- package/dist/chunk-TTCJPX4U.cjs +204 -0
- package/dist/{chunk-SBQVEBSU.cjs → chunk-UUUTEVX6.cjs} +242 -68
- package/dist/{chunk-WI7QJA7A.cjs → chunk-UXETV2NC.cjs} +161 -3
- package/dist/{chunk-GKNEJ6EN.cjs → chunk-V5L2G22R.cjs} +321 -107
- package/dist/{chunk-TALQONZ5.js → chunk-VB2CY6EG.js} +3 -3
- package/dist/{chunk-QY4KUDMY.js → chunk-VRXXAXUT.js} +2 -2
- package/dist/chunk-VU6WQSMB.cjs +164 -0
- package/dist/{chunk-NHLYK3AX.js → chunk-XBQX76CT.js} +182 -8
- package/dist/{chunk-5AARIS3R.cjs → chunk-XCDGM7TD.cjs} +37 -37
- package/dist/{chunk-POR54B55.js → chunk-XNU45TYA.js} +7 -1
- package/dist/{chunk-EVXQNQND.js → chunk-XZB3TJ6K.js} +16 -5
- package/dist/chunk-YBAPT7NL.js +153 -0
- package/dist/{chunk-SZA42R4N.js → chunk-YUFTVNLX.js} +230 -16
- package/dist/chunk-Z2UQYMPS.cjs +484 -0
- package/dist/color/index.cjs +5 -3
- package/dist/color/index.js +12 -10
- package/dist/diagram/index.cjs +55 -243
- package/dist/diagram/index.js +12 -200
- package/dist/export/index.cjs +7 -6
- package/dist/export/index.js +6 -5
- package/dist/extensions/index.cjs +12 -9
- package/dist/extensions/index.js +11 -8
- package/dist/gradient/index.cjs +29 -27
- package/dist/gradient/index.js +6 -4
- package/dist/image-editor/index.cjs +644 -643
- package/dist/image-editor/index.js +7 -6
- package/dist/index.cjs +21 -18
- package/dist/index.js +14 -11
- package/dist/paint-editor/index.cjs +19 -18
- package/dist/paint-editor/index.js +7 -6
- package/dist/parameters/index.cjs +2 -2
- package/dist/parameters/index.js +1 -1
- package/dist/persistence/assetWrites.d.cts +22 -0
- package/dist/persistence/assetWrites.d.ts +22 -0
- package/dist/persistence/assets.d.cts +71 -0
- package/dist/persistence/assets.d.ts +71 -0
- package/dist/persistence/documentStore.d.cts +17 -1
- package/dist/persistence/documentStore.d.ts +17 -1
- package/dist/persistence/documentTools.d.cts +5 -1
- package/dist/persistence/documentTools.d.ts +5 -1
- package/dist/persistence/editorAutosave.d.cts +7 -0
- package/dist/persistence/editorAutosave.d.ts +7 -0
- package/dist/persistence/index.cjs +141 -21
- package/dist/persistence/index.js +130 -10
- package/dist/persistence/storage.d.cts +13 -1
- package/dist/persistence/storage.d.ts +13 -1
- package/dist/spreadsheet/index.cjs +3 -3
- package/dist/spreadsheet/index.js +2 -2
- package/dist/tokens/index.cjs +11 -3
- package/dist/tokens/index.d.cts +1 -0
- package/dist/tokens/index.d.ts +1 -0
- package/dist/tokens/index.js +10 -2
- package/dist/tokens/style.d.cts +36 -0
- package/dist/tokens/style.d.ts +36 -0
- package/dist/tools/index.cjs +15 -3
- package/dist/tools/index.d.cts +2 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.js +14 -2
- package/dist/tools/style-tools.d.cts +19 -0
- package/dist/tools/style-tools.d.ts +19 -0
- package/dist/tools/style.d.cts +212 -0
- package/dist/tools/style.d.ts +212 -0
- package/dist/tools/view.d.cts +6 -0
- package/dist/tools/view.d.ts +6 -0
- package/dist/typography/index.cjs +8 -6
- package/dist/typography/index.js +5 -3
- package/dist/vector/index.cjs +953 -952
- package/dist/vector/index.js +7 -6
- package/dist/video-editor/index.cjs +8 -7
- package/dist/video-editor/index.js +6 -5
- package/package.json +1 -1
- package/skills/pixerate-chart/SKILL.md +20 -2
- package/dist/chunk-ERAGQL2N.cjs +0 -68
- package/dist/chunk-KMU6QJB7.js +0 -68
package/dist/canvas/index.js
CHANGED
|
@@ -53,14 +53,14 @@ import {
|
|
|
53
53
|
shiftEndpoint,
|
|
54
54
|
textWidth,
|
|
55
55
|
timelineGeometry
|
|
56
|
-
} from "../chunk-
|
|
56
|
+
} from "../chunk-DKNEQX7T.js";
|
|
57
57
|
import {
|
|
58
58
|
TokenError,
|
|
59
59
|
getTokenCollection,
|
|
60
60
|
getTokenVariable,
|
|
61
61
|
isTokenInScope,
|
|
62
62
|
resolveToken
|
|
63
|
-
} from "../chunk-
|
|
63
|
+
} from "../chunk-ILP77UD6.js";
|
|
64
64
|
import {
|
|
65
65
|
DEFAULT_NODE_HEIGHT,
|
|
66
66
|
DEFAULT_NODE_WIDTH,
|
|
@@ -113,10 +113,11 @@ import {
|
|
|
113
113
|
} from "../chunk-5ED73EC6.js";
|
|
114
114
|
import {
|
|
115
115
|
layoutChart
|
|
116
|
-
} from "../chunk-
|
|
116
|
+
} from "../chunk-ITANXMZD.js";
|
|
117
117
|
import {
|
|
118
118
|
createChartSpec
|
|
119
|
-
} from "../chunk-
|
|
119
|
+
} from "../chunk-FR432ROA.js";
|
|
120
|
+
import "../chunk-O6OGNDND.js";
|
|
120
121
|
import "../chunk-II2WIF5Z.js";
|
|
121
122
|
import {
|
|
122
123
|
PathOpsError,
|
|
@@ -215,7 +216,7 @@ import {
|
|
|
215
216
|
} from "../chunk-ODBT55Q7.js";
|
|
216
217
|
import {
|
|
217
218
|
defineEditorDocument
|
|
218
|
-
} from "../chunk-
|
|
219
|
+
} from "../chunk-XBQX76CT.js";
|
|
219
220
|
import "../chunk-HF5QZS7Z.js";
|
|
220
221
|
import {
|
|
221
222
|
ANIMATION_TIME_EPSILON,
|
|
@@ -229,7 +230,7 @@ import {
|
|
|
229
230
|
pageHidden,
|
|
230
231
|
realClock,
|
|
231
232
|
wrapAnimationTime
|
|
232
|
-
} from "../chunk-
|
|
233
|
+
} from "../chunk-F6R67I3A.js";
|
|
233
234
|
import {
|
|
234
235
|
ANIMATION_EASING_LABELS,
|
|
235
236
|
ANIMATION_EASING_PRESETS,
|
|
@@ -254,12 +255,13 @@ import {
|
|
|
254
255
|
oklabToRgb,
|
|
255
256
|
parseOklab,
|
|
256
257
|
rgbToOklab
|
|
257
|
-
} from "../chunk-
|
|
258
|
+
} from "../chunk-M2TPMYJE.js";
|
|
258
259
|
import {
|
|
259
260
|
normalizeTokenColor
|
|
260
261
|
} from "../chunk-2WPNAGHI.js";
|
|
261
|
-
import "../chunk-
|
|
262
|
-
import "../chunk-
|
|
262
|
+
import "../chunk-7272D3K2.js";
|
|
263
|
+
import "../chunk-YBAPT7NL.js";
|
|
264
|
+
import "../chunk-MHLU6GRJ.js";
|
|
263
265
|
import "../chunk-6ONMQ6WF.js";
|
|
264
266
|
|
|
265
267
|
// src/canvas/trajectory.ts
|
|
@@ -2,7 +2,7 @@ import { HistoryManager } from '../history/HistoryManager.cjs';
|
|
|
2
2
|
import { type ChartTrendFit } from './trend.cjs';
|
|
3
3
|
import { type ChartTreeRow } from './tree.cjs';
|
|
4
4
|
import { type ChartTableOptions } from './spec.cjs';
|
|
5
|
-
import type { ChartAxis, ChartIssue, ChartCurve, ChartErrorBars, ChartLegend, ChartMarker, ChartNumberFormat, ChartReferenceBand, ChartReferenceLine, ChartSelection, ChartSeries, ChartSeriesType, ChartSpec, ChartTrendline, ChartType } from './types.cjs';
|
|
5
|
+
import type { ChartAxis, ChartIssue, ChartCurve, ChartErrorBars, ChartLegend, ChartLink, ChartMarker, ChartNumberFormat, ChartReferenceBand, ChartReferenceLine, ChartSelection, ChartSeries, ChartSeriesType, ChartSpec, ChartTrendline, ChartType } from './types.cjs';
|
|
6
6
|
export interface ChartControllerOptions {
|
|
7
7
|
/** Starting chart (any partial or saved spec; problems are reported in `state.issues`). */
|
|
8
8
|
spec?: Partial<ChartSpec> | unknown;
|
|
@@ -10,6 +10,13 @@ export interface ChartControllerOptions {
|
|
|
10
10
|
history?: HistoryManager;
|
|
11
11
|
/** Called after the spec changes (edit, undo, redo, load). */
|
|
12
12
|
onChange?: (spec: Readonly<ChartSpec>) => void;
|
|
13
|
+
/** Time and frames for playing a bar race (default: `performance.now` / `requestAnimationFrame`, else timers). */
|
|
14
|
+
raceTicker?: ChartRaceTicker;
|
|
15
|
+
}
|
|
16
|
+
/** Drives bar race playback: the current time in ms, and a way to run `step` on the next frame (returns a cancel). */
|
|
17
|
+
export interface ChartRaceTicker {
|
|
18
|
+
now(): number;
|
|
19
|
+
next(step: () => void): () => void;
|
|
13
20
|
}
|
|
14
21
|
/** A snapshot of the controller. The same object is returned until something changes. */
|
|
15
22
|
export interface ChartState {
|
|
@@ -27,6 +34,10 @@ export interface ChartState {
|
|
|
27
34
|
canRedo: boolean;
|
|
28
35
|
undoLabel: string;
|
|
29
36
|
redoLabel: string;
|
|
37
|
+
/** Bar race: the moment shown, a fractional category index (null: the last time point). View state, not undone. */
|
|
38
|
+
raceFrame: number | null;
|
|
39
|
+
/** Bar race: playback is running. */
|
|
40
|
+
racePlaying: boolean;
|
|
30
41
|
/** Bumped on every change. */
|
|
31
42
|
revision: number;
|
|
32
43
|
}
|
|
@@ -109,6 +120,9 @@ export declare class ChartController {
|
|
|
109
120
|
private revision;
|
|
110
121
|
private applying;
|
|
111
122
|
private readonly onChange?;
|
|
123
|
+
private readonly raceTicker;
|
|
124
|
+
private raceFrame;
|
|
125
|
+
private raceStop;
|
|
112
126
|
private readonly listeners;
|
|
113
127
|
private unsubscribeHistory?;
|
|
114
128
|
private state;
|
|
@@ -220,7 +234,7 @@ export declare class ChartController {
|
|
|
220
234
|
}): ChartActionResult & {
|
|
221
235
|
issues?: ChartIssue[];
|
|
222
236
|
};
|
|
223
|
-
/** A refusal while the data is a tree (cell edits would be overwritten by
|
|
237
|
+
/** A refusal while the data is a tree or flows (cell edits would be overwritten by their totals), else null. */
|
|
224
238
|
private treeLocked;
|
|
225
239
|
/** Replaces the grouped data (an empty list goes back to the table, keeping the totals as values). One undo step. */
|
|
226
240
|
setTree(tree: unknown, options?: ChartEditOptions): ChartActionResult;
|
|
@@ -268,6 +282,35 @@ export declare class ChartController {
|
|
|
268
282
|
};
|
|
269
283
|
/** Removes a node (with everything under it). A group left empty becomes an item with value 0. */
|
|
270
284
|
removeTreeNode(path: readonly string[]): ChartActionResult;
|
|
285
|
+
/**
|
|
286
|
+
* Replaces the flows (and, when given, the node order). An empty list goes back to the
|
|
287
|
+
* table, keeping how much passed through each node as values. One undo step, all-or-nothing.
|
|
288
|
+
*/
|
|
289
|
+
setLinks(links: unknown, options?: ChartEditOptions & {
|
|
290
|
+
nodes?: readonly string[];
|
|
291
|
+
}): ChartActionResult;
|
|
292
|
+
/** Replaces the data with flows from a table of source, target and value columns. */
|
|
293
|
+
importLinksTable(rows: ReadonlyArray<ReadonlyArray<unknown>>, options?: {
|
|
294
|
+
header?: boolean | 'auto';
|
|
295
|
+
}): ChartActionResult;
|
|
296
|
+
private badLink;
|
|
297
|
+
/** Adds a flow and returns its index. */
|
|
298
|
+
addLink(link: ChartLink): {
|
|
299
|
+
ok: true;
|
|
300
|
+
index: number;
|
|
301
|
+
} | {
|
|
302
|
+
ok: false;
|
|
303
|
+
message: string;
|
|
304
|
+
issues?: ChartIssue[];
|
|
305
|
+
};
|
|
306
|
+
/** Changes a flow's source, target, value or colour (`color: null` goes back to the default). */
|
|
307
|
+
updateLink(index: number, patch: {
|
|
308
|
+
source?: string;
|
|
309
|
+
target?: string;
|
|
310
|
+
value?: number;
|
|
311
|
+
color?: string | null;
|
|
312
|
+
}): ChartActionResult;
|
|
313
|
+
removeLink(index: number): ChartActionResult;
|
|
271
314
|
/** Sets the note written under the chart ("" removes it). */
|
|
272
315
|
setNote(note: string): ChartActionResult;
|
|
273
316
|
/**
|
|
@@ -345,6 +388,21 @@ export declare class ChartController {
|
|
|
345
388
|
* undo step). Series colours, types and other per-series settings are dropped.
|
|
346
389
|
*/
|
|
347
390
|
transpose(): ChartActionResult;
|
|
391
|
+
/**
|
|
392
|
+
* Shows a bar race at a moment: a category index, fractional between time points (`null`:
|
|
393
|
+
* the last one). View state like the selection, so not an undo step. Stops playback.
|
|
394
|
+
*/
|
|
395
|
+
setRaceFrame(frame: number | null): ChartActionResult;
|
|
396
|
+
/**
|
|
397
|
+
* Plays the bar race from the moment shown (from the start when it is at the end), moving
|
|
398
|
+
* one time point every `msPerStep` (default 1000) until the last. Not an undo step.
|
|
399
|
+
*/
|
|
400
|
+
playRace(options?: {
|
|
401
|
+
msPerStep?: number;
|
|
402
|
+
}): ChartActionResult;
|
|
403
|
+
/** Pauses bar race playback where it is. */
|
|
404
|
+
pauseRace(): void;
|
|
405
|
+
private stopRace;
|
|
348
406
|
/** Selects a chart element (view state; not an undo step). */
|
|
349
407
|
select(selection: ChartSelection | null): void;
|
|
350
408
|
/**
|
|
@@ -2,7 +2,7 @@ import { HistoryManager } from '../history/HistoryManager.js';
|
|
|
2
2
|
import { type ChartTrendFit } from './trend.js';
|
|
3
3
|
import { type ChartTreeRow } from './tree.js';
|
|
4
4
|
import { type ChartTableOptions } from './spec.js';
|
|
5
|
-
import type { ChartAxis, ChartIssue, ChartCurve, ChartErrorBars, ChartLegend, ChartMarker, ChartNumberFormat, ChartReferenceBand, ChartReferenceLine, ChartSelection, ChartSeries, ChartSeriesType, ChartSpec, ChartTrendline, ChartType } from './types.js';
|
|
5
|
+
import type { ChartAxis, ChartIssue, ChartCurve, ChartErrorBars, ChartLegend, ChartLink, ChartMarker, ChartNumberFormat, ChartReferenceBand, ChartReferenceLine, ChartSelection, ChartSeries, ChartSeriesType, ChartSpec, ChartTrendline, ChartType } from './types.js';
|
|
6
6
|
export interface ChartControllerOptions {
|
|
7
7
|
/** Starting chart (any partial or saved spec; problems are reported in `state.issues`). */
|
|
8
8
|
spec?: Partial<ChartSpec> | unknown;
|
|
@@ -10,6 +10,13 @@ export interface ChartControllerOptions {
|
|
|
10
10
|
history?: HistoryManager;
|
|
11
11
|
/** Called after the spec changes (edit, undo, redo, load). */
|
|
12
12
|
onChange?: (spec: Readonly<ChartSpec>) => void;
|
|
13
|
+
/** Time and frames for playing a bar race (default: `performance.now` / `requestAnimationFrame`, else timers). */
|
|
14
|
+
raceTicker?: ChartRaceTicker;
|
|
15
|
+
}
|
|
16
|
+
/** Drives bar race playback: the current time in ms, and a way to run `step` on the next frame (returns a cancel). */
|
|
17
|
+
export interface ChartRaceTicker {
|
|
18
|
+
now(): number;
|
|
19
|
+
next(step: () => void): () => void;
|
|
13
20
|
}
|
|
14
21
|
/** A snapshot of the controller. The same object is returned until something changes. */
|
|
15
22
|
export interface ChartState {
|
|
@@ -27,6 +34,10 @@ export interface ChartState {
|
|
|
27
34
|
canRedo: boolean;
|
|
28
35
|
undoLabel: string;
|
|
29
36
|
redoLabel: string;
|
|
37
|
+
/** Bar race: the moment shown, a fractional category index (null: the last time point). View state, not undone. */
|
|
38
|
+
raceFrame: number | null;
|
|
39
|
+
/** Bar race: playback is running. */
|
|
40
|
+
racePlaying: boolean;
|
|
30
41
|
/** Bumped on every change. */
|
|
31
42
|
revision: number;
|
|
32
43
|
}
|
|
@@ -109,6 +120,9 @@ export declare class ChartController {
|
|
|
109
120
|
private revision;
|
|
110
121
|
private applying;
|
|
111
122
|
private readonly onChange?;
|
|
123
|
+
private readonly raceTicker;
|
|
124
|
+
private raceFrame;
|
|
125
|
+
private raceStop;
|
|
112
126
|
private readonly listeners;
|
|
113
127
|
private unsubscribeHistory?;
|
|
114
128
|
private state;
|
|
@@ -220,7 +234,7 @@ export declare class ChartController {
|
|
|
220
234
|
}): ChartActionResult & {
|
|
221
235
|
issues?: ChartIssue[];
|
|
222
236
|
};
|
|
223
|
-
/** A refusal while the data is a tree (cell edits would be overwritten by
|
|
237
|
+
/** A refusal while the data is a tree or flows (cell edits would be overwritten by their totals), else null. */
|
|
224
238
|
private treeLocked;
|
|
225
239
|
/** Replaces the grouped data (an empty list goes back to the table, keeping the totals as values). One undo step. */
|
|
226
240
|
setTree(tree: unknown, options?: ChartEditOptions): ChartActionResult;
|
|
@@ -268,6 +282,35 @@ export declare class ChartController {
|
|
|
268
282
|
};
|
|
269
283
|
/** Removes a node (with everything under it). A group left empty becomes an item with value 0. */
|
|
270
284
|
removeTreeNode(path: readonly string[]): ChartActionResult;
|
|
285
|
+
/**
|
|
286
|
+
* Replaces the flows (and, when given, the node order). An empty list goes back to the
|
|
287
|
+
* table, keeping how much passed through each node as values. One undo step, all-or-nothing.
|
|
288
|
+
*/
|
|
289
|
+
setLinks(links: unknown, options?: ChartEditOptions & {
|
|
290
|
+
nodes?: readonly string[];
|
|
291
|
+
}): ChartActionResult;
|
|
292
|
+
/** Replaces the data with flows from a table of source, target and value columns. */
|
|
293
|
+
importLinksTable(rows: ReadonlyArray<ReadonlyArray<unknown>>, options?: {
|
|
294
|
+
header?: boolean | 'auto';
|
|
295
|
+
}): ChartActionResult;
|
|
296
|
+
private badLink;
|
|
297
|
+
/** Adds a flow and returns its index. */
|
|
298
|
+
addLink(link: ChartLink): {
|
|
299
|
+
ok: true;
|
|
300
|
+
index: number;
|
|
301
|
+
} | {
|
|
302
|
+
ok: false;
|
|
303
|
+
message: string;
|
|
304
|
+
issues?: ChartIssue[];
|
|
305
|
+
};
|
|
306
|
+
/** Changes a flow's source, target, value or colour (`color: null` goes back to the default). */
|
|
307
|
+
updateLink(index: number, patch: {
|
|
308
|
+
source?: string;
|
|
309
|
+
target?: string;
|
|
310
|
+
value?: number;
|
|
311
|
+
color?: string | null;
|
|
312
|
+
}): ChartActionResult;
|
|
313
|
+
removeLink(index: number): ChartActionResult;
|
|
271
314
|
/** Sets the note written under the chart ("" removes it). */
|
|
272
315
|
setNote(note: string): ChartActionResult;
|
|
273
316
|
/**
|
|
@@ -345,6 +388,21 @@ export declare class ChartController {
|
|
|
345
388
|
* undo step). Series colours, types and other per-series settings are dropped.
|
|
346
389
|
*/
|
|
347
390
|
transpose(): ChartActionResult;
|
|
391
|
+
/**
|
|
392
|
+
* Shows a bar race at a moment: a category index, fractional between time points (`null`:
|
|
393
|
+
* the last one). View state like the selection, so not an undo step. Stops playback.
|
|
394
|
+
*/
|
|
395
|
+
setRaceFrame(frame: number | null): ChartActionResult;
|
|
396
|
+
/**
|
|
397
|
+
* Plays the bar race from the moment shown (from the start when it is at the end), moving
|
|
398
|
+
* one time point every `msPerStep` (default 1000) until the last. Not an undo step.
|
|
399
|
+
*/
|
|
400
|
+
playRace(options?: {
|
|
401
|
+
msPerStep?: number;
|
|
402
|
+
}): ChartActionResult;
|
|
403
|
+
/** Pauses bar race playback where it is. */
|
|
404
|
+
pauseRace(): void;
|
|
405
|
+
private stopRace;
|
|
348
406
|
/** Selects a chart element (view state; not an undo step). */
|
|
349
407
|
select(selection: ChartSelection | null): void;
|
|
350
408
|
/**
|