@pixerate/editor 0.165.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 +34 -34
- package/dist/agent/index.js +5 -5
- package/dist/canvas/index.cjs +6 -6
- package/dist/canvas/index.js +2 -2
- package/dist/chart/controller.d.cts +29 -0
- package/dist/chart/controller.d.ts +29 -0
- package/dist/chart/index.cjs +301 -179
- package/dist/chart/index.d.cts +1 -0
- package/dist/chart/index.d.ts +1 -0
- package/dist/chart/index.js +132 -10
- package/dist/chart/layout-families.d.cts +7 -0
- package/dist/chart/layout-families.d.ts +7 -0
- package/dist/chart/layout-shared.d.cts +5 -0
- package/dist/chart/layout-shared.d.ts +5 -0
- package/dist/chart/race.d.cts +26 -0
- package/dist/chart/race.d.ts +26 -0
- package/dist/chart/schemas.d.cts +2 -0
- package/dist/chart/schemas.d.ts +2 -0
- package/dist/chart/spec.d.cts +1 -1
- package/dist/chart/spec.d.ts +1 -1
- package/dist/chart/types.d.cts +6 -2
- package/dist/chart/types.d.ts +6 -2
- package/dist/{chunk-FEU2XVQH.js → chunk-5UNQDC3Q.js} +5 -2
- package/dist/{chunk-64VWWR5U.cjs → chunk-6FYIFGBW.cjs} +16 -16
- package/dist/{chunk-UVXTOZ2B.cjs → chunk-BPX4Z3N3.cjs} +12 -3
- package/dist/{chunk-MKXK6E4O.cjs → chunk-CHLV7UFP.cjs} +51 -51
- package/dist/{chunk-X5W645RI.js → chunk-DFCAR7AW.js} +3 -3
- package/dist/{chunk-2ZRN43IN.js → chunk-FR432ROA.js} +12 -3
- package/dist/{chunk-ODFCS7HF.cjs → chunk-HXOBOHH2.cjs} +8 -8
- package/dist/{chunk-V5GSY3NC.js → chunk-ITANXMZD.js} +78 -2
- package/dist/{chunk-TVQW26AV.cjs → chunk-MZFZSVUJ.cjs} +26 -23
- package/dist/{chunk-N7NBGT2Y.js → chunk-NQQDGGXY.js} +2 -2
- package/dist/{chunk-Q25WAFTD.cjs → chunk-SZWVMB3B.cjs} +21 -18
- package/dist/{chunk-QO2T6KA5.cjs → chunk-UUUTEVX6.cjs} +116 -40
- package/dist/{chunk-IMRXC7OA.cjs → chunk-V5L2G22R.cjs} +153 -77
- package/dist/{chunk-2J5VLJHC.js → chunk-VB2CY6EG.js} +3 -3
- package/dist/{chunk-CRFSQWKQ.js → chunk-XNU45TYA.js} +4 -1
- package/dist/{chunk-FRBRLKNQ.js → chunk-YUFTVNLX.js} +78 -2
- package/dist/export/index.cjs +4 -4
- package/dist/export/index.js +3 -3
- package/dist/extensions/index.cjs +7 -7
- package/dist/extensions/index.js +6 -6
- package/dist/index.cjs +13 -13
- package/dist/index.js +7 -7
- package/package.json +1 -1
- package/skills/pixerate-chart/SKILL.md +20 -2
package/dist/chart/index.cjs
CHANGED
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var _chunkTVQW26AVcjs = require('../chunk-TVQW26AV.cjs');
|
|
20
19
|
|
|
20
|
+
var _chunkMZFZSVUJcjs = require('../chunk-MZFZSVUJ.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
var _chunkQ25WAFTDcjs = require('../chunk-Q25WAFTD.cjs');
|
|
28
27
|
|
|
28
|
+
var _chunkSZWVMB3Bcjs = require('../chunk-SZWVMB3B.cjs');
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
@@ -46,7 +46,8 @@ var _chunkQ25WAFTDcjs = require('../chunk-Q25WAFTD.cjs');
|
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
|
|
50
|
+
var _chunkV5L2G22Rcjs = require('../chunk-V5L2G22R.cjs');
|
|
50
51
|
require('../chunk-TTCJPX4U.cjs');
|
|
51
52
|
|
|
52
53
|
|
|
@@ -87,10 +88,12 @@ require('../chunk-TTCJPX4U.cjs');
|
|
|
87
88
|
|
|
88
89
|
|
|
89
90
|
|
|
90
|
-
var _chunkQO2T6KA5cjs = require('../chunk-QO2T6KA5.cjs');
|
|
91
91
|
|
|
92
92
|
|
|
93
93
|
|
|
94
|
+
var _chunkUUUTEVX6cjs = require('../chunk-UUUTEVX6.cjs');
|
|
95
|
+
|
|
96
|
+
|
|
94
97
|
|
|
95
98
|
|
|
96
99
|
|
|
@@ -181,7 +184,8 @@ var _chunkQO2T6KA5cjs = require('../chunk-QO2T6KA5.cjs');
|
|
|
181
184
|
|
|
182
185
|
|
|
183
186
|
|
|
184
|
-
|
|
187
|
+
|
|
188
|
+
var _chunkBPX4Z3N3cjs = require('../chunk-BPX4Z3N3.cjs');
|
|
185
189
|
require('../chunk-VU6WQSMB.cjs');
|
|
186
190
|
require('../chunk-55AKPTLM.cjs');
|
|
187
191
|
|
|
@@ -316,7 +320,7 @@ function chartFileName(spec, extension) {
|
|
|
316
320
|
}
|
|
317
321
|
async function downloadChartPng(spec, options = {}) {
|
|
318
322
|
const { width = 800, height = 450, filename = chartFileName(spec, "png"), theme, ...raster } = options;
|
|
319
|
-
const svg =
|
|
323
|
+
const svg = _chunkV5L2G22Rcjs.chartToSvg.call(void 0, spec, { width, height, theme });
|
|
320
324
|
const { url, width: w, height: h } = await svgToPngDataUrl(svg, { ...raster, width, height });
|
|
321
325
|
const doc = _nullishCoalesce(raster.document, () => ( globalThis.document));
|
|
322
326
|
const link = doc.createElement("a");
|
|
@@ -331,7 +335,7 @@ async function downloadChartPng(spec, options = {}) {
|
|
|
331
335
|
|
|
332
336
|
// src/chart/recommend.ts
|
|
333
337
|
var blank = (c) => c === null || c === void 0 || String(c).trim() === "";
|
|
334
|
-
var isText = (c) => blank(c) ||
|
|
338
|
+
var isText = (c) => blank(c) || _chunkBPX4Z3N3cjs.parseChartValue.call(void 0, c) === void 0;
|
|
335
339
|
function analyzeChartTable(rows) {
|
|
336
340
|
const grid = rows.filter((r) => r.some((c) => !blank(c)));
|
|
337
341
|
const height = grid.length;
|
|
@@ -349,7 +353,7 @@ function analyzeChartTable(rows) {
|
|
|
349
353
|
let anyPositive = false;
|
|
350
354
|
for (let r = headerRow ? 1 : 0; r < height; r++)
|
|
351
355
|
for (let c = labelColumn ? 1 : 0; c < width; c++) {
|
|
352
|
-
const v =
|
|
356
|
+
const v = _chunkBPX4Z3N3cjs.parseChartValue.call(void 0, cell(r, c));
|
|
353
357
|
if (typeof v !== "number") continue;
|
|
354
358
|
anyNumber = true;
|
|
355
359
|
if (v < 0) {
|
|
@@ -358,7 +362,7 @@ function analyzeChartTable(rows) {
|
|
|
358
362
|
} else if (v > 0) anyPositive = true;
|
|
359
363
|
}
|
|
360
364
|
const labels = byRows ? _nullishCoalesce(_optionalChain([grid, 'access', _20 => _20[0], 'optionalAccess', _21 => _21.slice, 'call', _22 => _22(labelColumn ? 1 : 0)]), () => ( [])) : grid.slice(headerRow ? 1 : 0).map((r) => r[0]);
|
|
361
|
-
const dates = (byRows ? headerRow : labelColumn) && labels.length > 1 && labels.filter((l) => !blank(l) &&
|
|
365
|
+
const dates = (byRows ? headerRow : labelColumn) && labels.length > 1 && labels.filter((l) => !blank(l) && _chunkUUUTEVX6cjs.parseChartDate.call(void 0, String(l)) !== null).length >= labels.length * 0.8;
|
|
362
366
|
return {
|
|
363
367
|
headerRow,
|
|
364
368
|
labelColumn,
|
|
@@ -396,6 +400,7 @@ function recommendForShape(shape) {
|
|
|
396
400
|
add("area", "Area", "Shows change over time with volume.");
|
|
397
401
|
add("bar", "Column", "Compares each period.");
|
|
398
402
|
if (shape.series > 1) add("area", "Stacked area", "Shows how the parts add up over time.", "stacked");
|
|
403
|
+
if (shape.series >= 5 && shape.points >= 3) add("barrace", "Bar race", "Many series over time: an animated ranking shows who leads when.");
|
|
399
404
|
return out;
|
|
400
405
|
}
|
|
401
406
|
if (shape.series === 1) {
|
|
@@ -430,6 +435,7 @@ function recommendForShape(shape) {
|
|
|
430
435
|
add("bar", "Stacked column", "Shows how the series add up.", "stacked");
|
|
431
436
|
add("line", "Line", "Shows the series in order.");
|
|
432
437
|
if (shape.points >= 3 && shape.series <= 6) add("radar", "Radar", "Compares several measures across the series.");
|
|
438
|
+
if (shape.nonNegative && shape.series >= 5 && shape.points >= 3) add("barrace", "Bar race", "Many series across ordered categories (such as years): an animated ranking shows who leads when.");
|
|
433
439
|
if (shape.nonNegative && shape.series >= 3 && shape.series <= 7) add("likert", "Likert", "Survey answers per question (columns from most negative to most positive): shows agreement against disagreement.");
|
|
434
440
|
}
|
|
435
441
|
return out;
|
|
@@ -448,7 +454,7 @@ function chartFromTable(rows, options = {}) {
|
|
|
448
454
|
if (xFromFirst) {
|
|
449
455
|
table = table.map((r) => [r[1], ...r.slice(2)]);
|
|
450
456
|
}
|
|
451
|
-
const data =
|
|
457
|
+
const data = _chunkBPX4Z3N3cjs.chartDataFromTable.call(void 0, table, { seriesIn: shape.byRows ? "rows" : "columns", header: true, xFromFirstColumn: xFromFirst });
|
|
452
458
|
return { type, stacking, categories: data.categories, series: data.series, issues: data.issues, shape };
|
|
453
459
|
}
|
|
454
460
|
|
|
@@ -475,6 +481,12 @@ function createChartCommands(controller, options = {}) {
|
|
|
475
481
|
if (index < 0 || index >= categories.length || !Number.isInteger(index)) fail(`There is no category ${JSON.stringify(ref)}; expected an index from 0 to ${categories.length - 1} or one of the labels.`);
|
|
476
482
|
return index;
|
|
477
483
|
};
|
|
484
|
+
const raceFrame = (time) => {
|
|
485
|
+
const cats = controller.getSpec().categories;
|
|
486
|
+
const frame = typeof time === "number" ? time : cats.indexOf(time);
|
|
487
|
+
if (!(Number.isFinite(frame) && frame >= 0 && frame <= cats.length - 1)) fail(`There is no time point ${JSON.stringify(time)}; expected an index from 0 to ${Math.max(0, cats.length - 1)} or a category label.`);
|
|
488
|
+
return frame;
|
|
489
|
+
};
|
|
478
490
|
const object = (properties, required) => ({ type: "object", properties, ...required ? { required } : {}, additionalProperties: false });
|
|
479
491
|
return [
|
|
480
492
|
{
|
|
@@ -484,10 +496,10 @@ function createChartCommands(controller, options = {}) {
|
|
|
484
496
|
readOnly: true,
|
|
485
497
|
keywords: ["chart", "data", "spec", "get", "summary"],
|
|
486
498
|
description: "Returns the chart spec, its data as a table (series names in the header row) and a summary: per-series min / max / mean / trend, axes as drawn, layout warnings and a colour check.",
|
|
487
|
-
params: object({ width:
|
|
499
|
+
params: object({ width: _chunkMZFZSVUJcjs.WIDTH, height: _chunkMZFZSVUJcjs.HEIGHT }),
|
|
488
500
|
run: (_ctx, params = {}) => {
|
|
489
501
|
const spec = controller.getSpec();
|
|
490
|
-
return { spec: controller.toJSON(), table:
|
|
502
|
+
return { spec: controller.toJSON(), table: _chunkBPX4Z3N3cjs.chartDataToTable.call(void 0, spec), summary: _chunkV5L2G22Rcjs.summarizeChart.call(void 0, controller.toJSON(), { width: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _25 => _25.width]), () => ( 640)), height: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _26 => _26.height]), () => ( 400)) }), issues: controller.getState().issues };
|
|
491
503
|
}
|
|
492
504
|
},
|
|
493
505
|
{
|
|
@@ -496,7 +508,7 @@ function createChartCommands(controller, options = {}) {
|
|
|
496
508
|
label: "Change Chart\u2026",
|
|
497
509
|
keywords: ["chart", "title", "axis", "legend", "stack", "style", "format", "type"],
|
|
498
510
|
description: 'Changes chart presentation as one undo step: type, titles, axes (xAxis = categories, yAxis = values, yAxis2 = secondary values; reverse, and scale "log" on value axes), legend, stacking, orientation, curve, points, data labels, palette, donut hole, bar spacing, histogram bins, waterfall total, or radar rings and grid shape, note, highlight, reference lines and bands, or colour by category (varyColors). Invalid values change nothing and return why.',
|
|
499
|
-
params: object(
|
|
511
|
+
params: object(_chunkMZFZSVUJcjs.CHART_UPDATE_PROPERTIES),
|
|
500
512
|
run: (_ctx, params) => {
|
|
501
513
|
check(controller.update(params));
|
|
502
514
|
return { spec: controller.toJSON() };
|
|
@@ -510,11 +522,11 @@ function createChartCommands(controller, options = {}) {
|
|
|
510
522
|
description: "Replaces the categories and series as one undo step. Each series has one value per category (padded with gaps).",
|
|
511
523
|
params: object({
|
|
512
524
|
categories: { type: "array", items: { type: "string" }, description: "Category labels in order." },
|
|
513
|
-
series: { type: "array", description: "The new series.", items: object({ id: { type: "string", description: "Stable id (optional)." }, ...
|
|
525
|
+
series: { type: "array", description: "The new series.", items: object({ id: { type: "string", description: "Stable id (optional)." }, ..._chunkMZFZSVUJcjs.SERIES_PROPS }, ["name", "values"]) }
|
|
514
526
|
}),
|
|
515
527
|
run: (_ctx, params) => {
|
|
516
528
|
check(controller.setData(params));
|
|
517
|
-
return { table:
|
|
529
|
+
return { table: _chunkBPX4Z3N3cjs.chartDataToTable.call(void 0, controller.getSpec()) };
|
|
518
530
|
}
|
|
519
531
|
},
|
|
520
532
|
{
|
|
@@ -523,10 +535,10 @@ function createChartCommands(controller, options = {}) {
|
|
|
523
535
|
label: "Set Chart Values\u2026",
|
|
524
536
|
keywords: ["chart", "value", "cell", "edit"],
|
|
525
537
|
description: "Sets individual values as one undo step. Series by id or name; category by index or label.",
|
|
526
|
-
params: object({ cells: { type: "array", minItems: 1, description: "Values to set.", items: object({ series:
|
|
538
|
+
params: object({ cells: { type: "array", minItems: 1, description: "Values to set.", items: object({ series: _chunkMZFZSVUJcjs.SERIES_REF, category: _chunkMZFZSVUJcjs.CATEGORY_REF, value: _chunkMZFZSVUJcjs.VALUE }, ["series", "category", "value"]) } }, ["cells"]),
|
|
527
539
|
run: (_ctx, params) => {
|
|
528
540
|
check(controller.setValues(params.cells.map((c) => ({ seriesId: resolveSeries(c.series).id, index: resolveCategory(c.category), value: c.value }))));
|
|
529
|
-
return { table:
|
|
541
|
+
return { table: _chunkBPX4Z3N3cjs.chartDataToTable.call(void 0, controller.getSpec()) };
|
|
530
542
|
}
|
|
531
543
|
},
|
|
532
544
|
{
|
|
@@ -535,7 +547,7 @@ function createChartCommands(controller, options = {}) {
|
|
|
535
547
|
label: "Add Series",
|
|
536
548
|
keywords: ["chart", "series", "new"],
|
|
537
549
|
description: "Adds a series (default: an empty one at the end). Returns its id.",
|
|
538
|
-
params: object({ ...
|
|
550
|
+
params: object({ ..._chunkMZFZSVUJcjs.SERIES_PROPS, id: { type: "string", description: "Id to use (default series-N)." }, at: { type: "integer", minimum: 0, description: "Position (default: last)." } }),
|
|
539
551
|
run: (_ctx, params = {}) => {
|
|
540
552
|
const { at, ...input } = _nullishCoalesce(params, () => ( {}));
|
|
541
553
|
const clean = Object.fromEntries(Object.entries(input).filter(([, v]) => v !== null));
|
|
@@ -550,7 +562,7 @@ function createChartCommands(controller, options = {}) {
|
|
|
550
562
|
label: "Change Series\u2026",
|
|
551
563
|
keywords: ["chart", "series", "rename", "colour", "color", "hide", "axis", "marker"],
|
|
552
564
|
description: "Renames, recolours, hides, moves to the secondary axis or changes how a series is drawn, including error bars (null resets a field).",
|
|
553
|
-
params: object({ series:
|
|
565
|
+
params: object({ series: _chunkMZFZSVUJcjs.SERIES_REF, ...Object.fromEntries(Object.entries(_chunkMZFZSVUJcjs.SERIES_PROPS).filter(([k]) => k !== "values")) }, ["series"]),
|
|
554
566
|
run: (_ctx, params) => {
|
|
555
567
|
const { series, ...patch } = params;
|
|
556
568
|
const id = resolveSeries(series).id;
|
|
@@ -564,7 +576,7 @@ function createChartCommands(controller, options = {}) {
|
|
|
564
576
|
label: "Delete Series",
|
|
565
577
|
keywords: ["chart", "series", "remove"],
|
|
566
578
|
description: "Deletes a series by id or name.",
|
|
567
|
-
params: object({ series:
|
|
579
|
+
params: object({ series: _chunkMZFZSVUJcjs.SERIES_REF }, ["series"]),
|
|
568
580
|
run: (_ctx, params) => {
|
|
569
581
|
check(controller.removeSeries(resolveSeries(params.series).id));
|
|
570
582
|
return { series: seriesIds() };
|
|
@@ -589,7 +601,7 @@ function createChartCommands(controller, options = {}) {
|
|
|
589
601
|
label: "Delete Category",
|
|
590
602
|
keywords: ["chart", "category", "row", "remove"],
|
|
591
603
|
description: "Deletes a category (and its values) by index or label.",
|
|
592
|
-
params: object({ category:
|
|
604
|
+
params: object({ category: _chunkMZFZSVUJcjs.CATEGORY_REF }, ["category"]),
|
|
593
605
|
run: (_ctx, params) => {
|
|
594
606
|
check(controller.removeCategory(resolveCategory(params.category)));
|
|
595
607
|
return { categories: controller.getSpec().categories };
|
|
@@ -601,7 +613,7 @@ function createChartCommands(controller, options = {}) {
|
|
|
601
613
|
label: "Add Trendline\u2026",
|
|
602
614
|
keywords: ["chart", "trend", "regression", "fit", "forecast", "moving average"],
|
|
603
615
|
description: "Fits a trendline to a series (linear, exponential, logarithmic, power, polynomial or moving average). Returns its index and the fit.",
|
|
604
|
-
params: object({ series:
|
|
616
|
+
params: object({ series: _chunkMZFZSVUJcjs.SERIES_REF, ..._chunkMZFZSVUJcjs.TRENDLINE_PROPS }, ["series", "type"]),
|
|
605
617
|
run: (_ctx, params) => {
|
|
606
618
|
const { series, ...line } = params;
|
|
607
619
|
const result = controller.addTrendline(resolveSeries(series).id, line);
|
|
@@ -616,7 +628,7 @@ function createChartCommands(controller, options = {}) {
|
|
|
616
628
|
label: "Delete Trendline",
|
|
617
629
|
keywords: ["chart", "trend", "remove"],
|
|
618
630
|
description: "Deletes a trendline from a series.",
|
|
619
|
-
params: object({ series:
|
|
631
|
+
params: object({ series: _chunkMZFZSVUJcjs.SERIES_REF, index: { type: "integer", minimum: 0, description: "Trendline index (0 = first)." } }, ["series", "index"]),
|
|
620
632
|
run: (_ctx, params) => {
|
|
621
633
|
check(controller.removeTrendline(resolveSeries(params.series).id, params.index));
|
|
622
634
|
return { trendlines: _nullishCoalesce(_optionalChain([controller, 'access', _29 => _29.getSeries, 'call', _30 => _30(resolveSeries(params.series).id), 'optionalAccess', _31 => _31.trendlines]), () => ( [])) };
|
|
@@ -628,7 +640,7 @@ function createChartCommands(controller, options = {}) {
|
|
|
628
640
|
label: "Add Reference Line\u2026",
|
|
629
641
|
keywords: ["chart", "target", "goal", "threshold", "average", "reference", "line", "annotation"],
|
|
630
642
|
description: "Draws a dashed line across the plot at one value (a target, floor or average). Returns its index.",
|
|
631
|
-
params: object(
|
|
643
|
+
params: object(_chunkMZFZSVUJcjs.REFERENCE_LINE_PROPS, ["value"]),
|
|
632
644
|
run: (_ctx, params) => {
|
|
633
645
|
const result = controller.addReferenceLine(params);
|
|
634
646
|
check(result);
|
|
@@ -641,7 +653,7 @@ function createChartCommands(controller, options = {}) {
|
|
|
641
653
|
label: "Change Reference Line\u2026",
|
|
642
654
|
keywords: ["chart", "target", "reference", "line", "annotation"],
|
|
643
655
|
description: "Changes a reference line by index; label, axis and color take null to remove them.",
|
|
644
|
-
params: object({ index:
|
|
656
|
+
params: object({ index: _chunkMZFZSVUJcjs.REFERENCE_INDEX.call(void 0, "Reference line"), ..._chunkMZFZSVUJcjs.REFERENCE_LINE_PATCH }, ["index"]),
|
|
645
657
|
run: (_ctx, params) => {
|
|
646
658
|
const { index, ...patch } = params;
|
|
647
659
|
check(controller.updateReferenceLine(index, patch));
|
|
@@ -654,7 +666,7 @@ function createChartCommands(controller, options = {}) {
|
|
|
654
666
|
label: "Delete Reference Line",
|
|
655
667
|
keywords: ["chart", "target", "reference", "line", "remove"],
|
|
656
668
|
description: "Deletes a reference line by index.",
|
|
657
|
-
params: object({ index:
|
|
669
|
+
params: object({ index: _chunkMZFZSVUJcjs.REFERENCE_INDEX.call(void 0, "Reference line") }, ["index"]),
|
|
658
670
|
run: (_ctx, params) => {
|
|
659
671
|
check(controller.removeReferenceLine(params.index));
|
|
660
672
|
return { referenceLines: controller.getSpec().referenceLines };
|
|
@@ -666,7 +678,7 @@ function createChartCommands(controller, options = {}) {
|
|
|
666
678
|
label: "Add Reference Band\u2026",
|
|
667
679
|
keywords: ["chart", "target", "range", "band", "reference", "shade", "annotation"],
|
|
668
680
|
description: "Shades a band across the plot between two values (a target or normal range). Returns its index.",
|
|
669
|
-
params: object(
|
|
681
|
+
params: object(_chunkMZFZSVUJcjs.REFERENCE_BAND_PROPS, ["from", "to"]),
|
|
670
682
|
run: (_ctx, params) => {
|
|
671
683
|
const result = controller.addReferenceBand(params);
|
|
672
684
|
check(result);
|
|
@@ -679,7 +691,7 @@ function createChartCommands(controller, options = {}) {
|
|
|
679
691
|
label: "Change Reference Band\u2026",
|
|
680
692
|
keywords: ["chart", "range", "band", "reference", "annotation"],
|
|
681
693
|
description: "Changes a reference band by index; label, axis and color take null to remove them.",
|
|
682
|
-
params: object({ index:
|
|
694
|
+
params: object({ index: _chunkMZFZSVUJcjs.REFERENCE_INDEX.call(void 0, "Reference band"), ..._chunkMZFZSVUJcjs.REFERENCE_BAND_PATCH }, ["index"]),
|
|
683
695
|
run: (_ctx, params) => {
|
|
684
696
|
const { index, ...patch } = params;
|
|
685
697
|
check(controller.updateReferenceBand(index, patch));
|
|
@@ -692,7 +704,7 @@ function createChartCommands(controller, options = {}) {
|
|
|
692
704
|
label: "Delete Reference Band",
|
|
693
705
|
keywords: ["chart", "range", "band", "reference", "remove"],
|
|
694
706
|
description: "Deletes a reference band by index.",
|
|
695
|
-
params: object({ index:
|
|
707
|
+
params: object({ index: _chunkMZFZSVUJcjs.REFERENCE_INDEX.call(void 0, "Reference band") }, ["index"]),
|
|
696
708
|
run: (_ctx, params) => {
|
|
697
709
|
check(controller.removeReferenceBand(params.index));
|
|
698
710
|
return { referenceBands: controller.getSpec().referenceBands };
|
|
@@ -704,7 +716,7 @@ function createChartCommands(controller, options = {}) {
|
|
|
704
716
|
label: "Pin Label to Point\u2026",
|
|
705
717
|
keywords: ["chart", "callout", "annotation", "label", "note", "point"],
|
|
706
718
|
description: 'Pins a short label to one bar or point (label null or "" removes it).',
|
|
707
|
-
params: object({ series:
|
|
719
|
+
params: object({ series: _chunkMZFZSVUJcjs.SERIES_REF, category: _chunkMZFZSVUJcjs.CATEGORY_REF, label: { type: ["string", "null"], description: "The label (a few words), or null to remove it." } }, ["series", "category", "label"]),
|
|
708
720
|
run: (_ctx, params) => {
|
|
709
721
|
const series = resolveSeries(params.series);
|
|
710
722
|
const index = resolveCategory(params.category);
|
|
@@ -732,10 +744,10 @@ function createChartCommands(controller, options = {}) {
|
|
|
732
744
|
label: "Replace Grouped Data\u2026",
|
|
733
745
|
keywords: ["chart", "tree", "hierarchy", "groups", "treemap", "sunburst", "nested"],
|
|
734
746
|
description: "Replaces the data with groups of items (a tree) for treemaps and sunbursts; [] goes back to plain data.",
|
|
735
|
-
params: { type: "object", properties: { tree: { type: "array", items: { $ref: "#/$defs/chartTreeNode" }, description: "The top-level nodes; [] removes the grouping." } }, required: ["tree"], additionalProperties: false, $defs:
|
|
747
|
+
params: { type: "object", properties: { tree: { type: "array", items: { $ref: "#/$defs/chartTreeNode" }, description: "The top-level nodes; [] removes the grouping." } }, required: ["tree"], additionalProperties: false, $defs: _chunkMZFZSVUJcjs.TREE_DEFS },
|
|
736
748
|
run: (_ctx, params) => {
|
|
737
749
|
check(controller.setTree(params.tree));
|
|
738
|
-
return { groups: controller.getSpec().tree.map((n) => ({ name: n.name, total:
|
|
750
|
+
return { groups: controller.getSpec().tree.map((n) => ({ name: n.name, total: _chunkBPX4Z3N3cjs.chartTreeTotal.call(void 0, n) })) };
|
|
739
751
|
}
|
|
740
752
|
},
|
|
741
753
|
{
|
|
@@ -771,7 +783,7 @@ function createChartCommands(controller, options = {}) {
|
|
|
771
783
|
},
|
|
772
784
|
required: ["node"],
|
|
773
785
|
additionalProperties: false,
|
|
774
|
-
$defs:
|
|
786
|
+
$defs: _chunkMZFZSVUJcjs.TREE_DEFS
|
|
775
787
|
},
|
|
776
788
|
run: (_ctx, params) => {
|
|
777
789
|
const result = controller.addTreeNode(_nullishCoalesce(params.parent, () => ( [])), params.node, { at: params.at });
|
|
@@ -787,7 +799,7 @@ function createChartCommands(controller, options = {}) {
|
|
|
787
799
|
description: "Renames a node, sets an item's value or sets a node's colour (null for the palette).",
|
|
788
800
|
params: object(
|
|
789
801
|
{
|
|
790
|
-
path:
|
|
802
|
+
path: _chunkMZFZSVUJcjs.TREE_PATH,
|
|
791
803
|
name: { type: "string", description: "New name." },
|
|
792
804
|
value: { type: "number", minimum: 0, description: "Items only: the new amount." },
|
|
793
805
|
color: { type: ["string", "null"], description: "CSS colour, or null for the palette colour." }
|
|
@@ -807,10 +819,10 @@ function createChartCommands(controller, options = {}) {
|
|
|
807
819
|
label: "Delete Item or Group",
|
|
808
820
|
keywords: ["chart", "tree", "group", "item", "remove", "delete"],
|
|
809
821
|
description: "Deletes a node of the grouped data with everything under it.",
|
|
810
|
-
params: object({ path:
|
|
822
|
+
params: object({ path: _chunkMZFZSVUJcjs.TREE_PATH }, ["path"]),
|
|
811
823
|
run: (_ctx, params) => {
|
|
812
824
|
check(controller.removeTreeNode(params.path));
|
|
813
|
-
return { groups: controller.getSpec().tree.map((n) => ({ name: n.name, total:
|
|
825
|
+
return { groups: controller.getSpec().tree.map((n) => ({ name: n.name, total: _chunkBPX4Z3N3cjs.chartTreeTotal.call(void 0, n) })) };
|
|
814
826
|
}
|
|
815
827
|
},
|
|
816
828
|
{
|
|
@@ -821,7 +833,7 @@ function createChartCommands(controller, options = {}) {
|
|
|
821
833
|
description: "Replaces the data with flows between named nodes for a Sankey diagram; [] goes back to plain data.",
|
|
822
834
|
params: object(
|
|
823
835
|
{
|
|
824
|
-
links: { type: "array", items: { type: "object", properties:
|
|
836
|
+
links: { type: "array", items: { type: "object", properties: _chunkMZFZSVUJcjs.LINK_PROPS, required: ["source", "target", "value"], additionalProperties: false }, description: "All the flows; [] removes them." },
|
|
825
837
|
nodes: { type: "array", items: { type: "string" }, description: "Node names in stacking order." }
|
|
826
838
|
},
|
|
827
839
|
["links"]
|
|
@@ -855,7 +867,7 @@ function createChartCommands(controller, options = {}) {
|
|
|
855
867
|
label: "Add Flow\u2026",
|
|
856
868
|
keywords: ["chart", "sankey", "flow", "link", "add"],
|
|
857
869
|
description: "Adds a flow between two nodes. Returns its index.",
|
|
858
|
-
params: object(
|
|
870
|
+
params: object(_chunkMZFZSVUJcjs.LINK_PROPS, ["source", "target", "value"]),
|
|
859
871
|
run: (_ctx, params) => {
|
|
860
872
|
const result = controller.addLink(params);
|
|
861
873
|
check(result);
|
|
@@ -868,7 +880,7 @@ function createChartCommands(controller, options = {}) {
|
|
|
868
880
|
label: "Change Flow\u2026",
|
|
869
881
|
keywords: ["chart", "sankey", "flow", "link", "value"],
|
|
870
882
|
description: "Changes a flow by index (color null for the default).",
|
|
871
|
-
params: object({ index:
|
|
883
|
+
params: object({ index: _chunkMZFZSVUJcjs.LINK_INDEX, ..._chunkMZFZSVUJcjs.LINK_PROPS, color: { type: ["string", "null"], description: "CSS colour, or null for the default." } }, ["index"]),
|
|
872
884
|
run: (_ctx, params) => {
|
|
873
885
|
const { index, ...patch } = params;
|
|
874
886
|
check(controller.updateLink(index, patch));
|
|
@@ -881,12 +893,63 @@ function createChartCommands(controller, options = {}) {
|
|
|
881
893
|
label: "Delete Flow",
|
|
882
894
|
keywords: ["chart", "sankey", "flow", "link", "remove"],
|
|
883
895
|
description: "Deletes a flow by index.",
|
|
884
|
-
params: object({ index:
|
|
896
|
+
params: object({ index: _chunkMZFZSVUJcjs.LINK_INDEX }, ["index"]),
|
|
885
897
|
run: (_ctx, params) => {
|
|
886
898
|
check(controller.removeLink(params.index));
|
|
887
899
|
return { links: controller.getSpec().links };
|
|
888
900
|
}
|
|
889
901
|
},
|
|
902
|
+
{
|
|
903
|
+
...base,
|
|
904
|
+
id: `${prefix}raceRanking`,
|
|
905
|
+
label: "Bar Race Ranking",
|
|
906
|
+
readOnly: true,
|
|
907
|
+
keywords: ["chart", "race", "ranking", "leader", "time"],
|
|
908
|
+
description: "Returns the top names of a bar race at a moment (default: the one shown).",
|
|
909
|
+
params: object({ time: _chunkMZFZSVUJcjs.RACE_TIME }),
|
|
910
|
+
run: (_ctx, params = {}) => {
|
|
911
|
+
const spec = controller.getSpec();
|
|
912
|
+
const frame = _optionalChain([params, 'optionalAccess', _36 => _36.time]) !== void 0 ? raceFrame(params.time) : _nullishCoalesce(controller.getState().raceFrame, () => ( spec.categories.length - 1));
|
|
913
|
+
return { frame, ranking: _chunkUUUTEVX6cjs.chartRaceRanking.call(void 0, spec, frame).slice(0, spec.raceTopN).map((e) => ({ rank: e.rank + 1, series: e.seriesId, name: e.name, value: e.value })) };
|
|
914
|
+
}
|
|
915
|
+
},
|
|
916
|
+
{
|
|
917
|
+
...base,
|
|
918
|
+
id: `${prefix}setRaceFrame`,
|
|
919
|
+
label: "Show Bar Race Moment\u2026",
|
|
920
|
+
keywords: ["chart", "race", "frame", "time", "scrub"],
|
|
921
|
+
description: "Shows the bar race at a time point (null for the last) and stops playback. View state, not an undo step.",
|
|
922
|
+
params: object({ time: { ..._chunkMZFZSVUJcjs.RACE_TIME, type: ["string", "number", "null"], description: `${_chunkMZFZSVUJcjs.RACE_TIME.description} null shows the last time point.` } }, ["time"]),
|
|
923
|
+
run: (_ctx, params) => {
|
|
924
|
+
const frame = params.time === null ? null : raceFrame(params.time);
|
|
925
|
+
check(controller.setRaceFrame(frame));
|
|
926
|
+
return { frame };
|
|
927
|
+
}
|
|
928
|
+
},
|
|
929
|
+
{
|
|
930
|
+
...base,
|
|
931
|
+
id: `${prefix}playRace`,
|
|
932
|
+
label: "Play Bar Race",
|
|
933
|
+
keywords: ["chart", "race", "play", "animate"],
|
|
934
|
+
description: "Plays the bar race from the moment shown, one time point every msPerStep ms.",
|
|
935
|
+
params: object({ msPerStep: { type: "number", minimum: 50, maximum: 1e4, description: "Milliseconds per time point (default 1000)." } }),
|
|
936
|
+
run: (_ctx, params = {}) => {
|
|
937
|
+
check(controller.playRace({ msPerStep: _optionalChain([params, 'optionalAccess', _37 => _37.msPerStep]) }));
|
|
938
|
+
return { playing: true };
|
|
939
|
+
}
|
|
940
|
+
},
|
|
941
|
+
{
|
|
942
|
+
...base,
|
|
943
|
+
id: `${prefix}pauseRace`,
|
|
944
|
+
label: "Pause Bar Race",
|
|
945
|
+
keywords: ["chart", "race", "pause", "stop"],
|
|
946
|
+
description: "Pauses bar race playback where it is.",
|
|
947
|
+
enabled: () => controller.getState().racePlaying || "The race is not playing",
|
|
948
|
+
run: () => {
|
|
949
|
+
controller.pauseRace();
|
|
950
|
+
return { frame: controller.getState().raceFrame };
|
|
951
|
+
}
|
|
952
|
+
},
|
|
890
953
|
{
|
|
891
954
|
...base,
|
|
892
955
|
id: `${prefix}applyPreset`,
|
|
@@ -894,8 +957,8 @@ function createChartCommands(controller, options = {}) {
|
|
|
894
957
|
keywords: ["chart", "quick layout", "style", "colours", "colors", "monochrome", "theme"],
|
|
895
958
|
description: "Applies a quick layout and / or colour scheme as one undo step.",
|
|
896
959
|
params: object({
|
|
897
|
-
layout: { type: "string", enum:
|
|
898
|
-
colors: { type: "string", enum:
|
|
960
|
+
layout: { type: "string", enum: _chunkV5L2G22Rcjs.CHART_LAYOUT_PRESETS.map((p) => p.id), description: "Quick layout id." },
|
|
961
|
+
colors: { type: "string", enum: _chunkV5L2G22Rcjs.CHART_COLOR_SCHEMES.map((p) => p.id), description: "Colour scheme id." }
|
|
899
962
|
}),
|
|
900
963
|
run: (_ctx, params = {}) => {
|
|
901
964
|
check(controller.applyPreset(_nullishCoalesce(params, () => ( {}))));
|
|
@@ -910,7 +973,7 @@ function createChartCommands(controller, options = {}) {
|
|
|
910
973
|
description: "Swaps series and categories as one undo step.",
|
|
911
974
|
run: () => {
|
|
912
975
|
check(controller.transpose());
|
|
913
|
-
return { table:
|
|
976
|
+
return { table: _chunkBPX4Z3N3cjs.chartDataToTable.call(void 0, controller.getSpec()) };
|
|
914
977
|
}
|
|
915
978
|
},
|
|
916
979
|
{
|
|
@@ -930,7 +993,7 @@ function createChartCommands(controller, options = {}) {
|
|
|
930
993
|
run: (_ctx, params) => {
|
|
931
994
|
const result = controller.importCsv(params.csv, { seriesIn: params.seriesIn, header: params.header });
|
|
932
995
|
check(result);
|
|
933
|
-
return { table:
|
|
996
|
+
return { table: _chunkBPX4Z3N3cjs.chartDataToTable.call(void 0, controller.getSpec()), issues: _nullishCoalesce(result.issues, () => ( [])) };
|
|
934
997
|
}
|
|
935
998
|
},
|
|
936
999
|
{
|
|
@@ -941,7 +1004,7 @@ function createChartCommands(controller, options = {}) {
|
|
|
941
1004
|
description: "Replaces the chart with Mermaid xychart-beta, pie, radar-beta, sankey-beta or treemap-beta text (one undo step). Unreadable lines are listed with line numbers.",
|
|
942
1005
|
params: object({ mermaid: { type: "string", description: "Mermaid text." } }, ["mermaid"]),
|
|
943
1006
|
run: (_ctx, params) => {
|
|
944
|
-
const read =
|
|
1007
|
+
const read = _chunkV5L2G22Rcjs.chartFromMermaid.call(void 0, params.mermaid);
|
|
945
1008
|
if (!read.family) fail(read.issues.map((i) => i.message).join(" ") || "Expected Mermaid starting with xychart-beta, pie, radar-beta, sankey-beta or treemap-beta.");
|
|
946
1009
|
check(controller.update({ ...read.spec }, { label: "Import Mermaid chart" }));
|
|
947
1010
|
return { spec: controller.toJSON(), issues: read.issues };
|
|
@@ -955,7 +1018,7 @@ function createChartCommands(controller, options = {}) {
|
|
|
955
1018
|
keywords: ["chart", "mermaid", "markdown", "export"],
|
|
956
1019
|
description: "Returns the chart as Mermaid text (with a round-trip comment unless meta is false).",
|
|
957
1020
|
params: object({ meta: { type: "boolean", description: "Include the %% @pixerate round-trip comment (default true)." } }),
|
|
958
|
-
run: (_ctx, params = {}) => ({ mermaid:
|
|
1021
|
+
run: (_ctx, params = {}) => ({ mermaid: _chunkV5L2G22Rcjs.chartToMermaid.call(void 0, controller.toJSON(), { meta: _optionalChain([params, 'optionalAccess', _38 => _38.meta]) }) })
|
|
959
1022
|
},
|
|
960
1023
|
{
|
|
961
1024
|
...base,
|
|
@@ -964,7 +1027,7 @@ function createChartCommands(controller, options = {}) {
|
|
|
964
1027
|
readOnly: true,
|
|
965
1028
|
keywords: ["chart", "office", "word", "powerpoint", "docx", "pptx", "xml", "export"],
|
|
966
1029
|
description: "Returns the chart as a DrawingML chart part (c:chartSpace) and what could not be written.",
|
|
967
|
-
run: () =>
|
|
1030
|
+
run: () => _chunkSZWVMB3Bcjs.chartToOoxml.call(void 0, controller.toJSON())
|
|
968
1031
|
},
|
|
969
1032
|
{
|
|
970
1033
|
...base,
|
|
@@ -973,9 +1036,9 @@ function createChartCommands(controller, options = {}) {
|
|
|
973
1036
|
readOnly: true,
|
|
974
1037
|
keywords: ["chart", "svg", "export", "image"],
|
|
975
1038
|
description: "Returns the chart drawn as a standalone, accessible SVG string (with <title> and <desc>).",
|
|
976
|
-
params: object({ width:
|
|
1039
|
+
params: object({ width: _chunkMZFZSVUJcjs.WIDTH, height: _chunkMZFZSVUJcjs.HEIGHT }),
|
|
977
1040
|
run: (_ctx, params = {}) => ({
|
|
978
|
-
svg:
|
|
1041
|
+
svg: _chunkV5L2G22Rcjs.chartToSvg.call(void 0, controller.toJSON(), { width: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _39 => _39.width]), () => ( 640)), height: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _40 => _40.height]), () => ( 400)) })
|
|
979
1042
|
})
|
|
980
1043
|
},
|
|
981
1044
|
{
|
|
@@ -987,7 +1050,7 @@ function createChartCommands(controller, options = {}) {
|
|
|
987
1050
|
description: "Suggests chart types for the current data (or CSV), best first, each with a reason.",
|
|
988
1051
|
params: object({ csv: { type: "string", description: "CSV text to analyse instead of the current data." } }),
|
|
989
1052
|
run: (_ctx, params = {}) => ({
|
|
990
|
-
recommendations: recommendChartTypes(_optionalChain([params, 'optionalAccess',
|
|
1053
|
+
recommendations: recommendChartTypes(_optionalChain([params, 'optionalAccess', _41 => _41.csv]) !== void 0 ? _chunkN3KJFGXTcjs.parseCsv.call(void 0, params.csv) : _chunkBPX4Z3N3cjs.chartDataToTable.call(void 0, controller.getSpec()))
|
|
991
1054
|
})
|
|
992
1055
|
},
|
|
993
1056
|
{
|
|
@@ -1000,8 +1063,8 @@ function createChartCommands(controller, options = {}) {
|
|
|
1000
1063
|
run: () => {
|
|
1001
1064
|
const s = controller.getSpec();
|
|
1002
1065
|
const visible = s.series.filter((x) => !x.hidden);
|
|
1003
|
-
const colors =
|
|
1004
|
-
return { colors, ...
|
|
1066
|
+
const colors = _chunkBPX4Z3N3cjs.chartSpecColorsByCategory.call(void 0, s) ? s.categories.map((_, i) => _optionalChain([visible, 'access', _42 => _42[0], 'optionalAccess', _43 => _43.pointColors, 'optionalAccess', _44 => _44[i]]) || _chunkBPX4Z3N3cjs.chartSliceColor.call(void 0, s, i)) : visible.map((x) => _chunkBPX4Z3N3cjs.chartSeriesColor.call(void 0, s, s.series.indexOf(x)));
|
|
1067
|
+
return { colors, ..._chunkBPX4Z3N3cjs.checkChartColors.call(void 0, colors) };
|
|
1005
1068
|
}
|
|
1006
1069
|
},
|
|
1007
1070
|
{
|
|
@@ -1030,9 +1093,9 @@ function chartClientToScene(scene, box, clientX, clientY) {
|
|
|
1030
1093
|
return { x: (clientX - box.left) * sx, y: (clientY - box.top) * sy };
|
|
1031
1094
|
}
|
|
1032
1095
|
function canDragChartPoint(controller, scene, target) {
|
|
1033
|
-
if (_optionalChain([target, 'optionalAccess',
|
|
1096
|
+
if (_optionalChain([target, 'optionalAccess', _45 => _45.kind]) !== "point" || !scene.valueScale || scene.percent) return false;
|
|
1034
1097
|
const spec = controller.getSpec();
|
|
1035
|
-
const family =
|
|
1098
|
+
const family = _chunkBPX4Z3N3cjs.chartFamily.call(void 0, spec);
|
|
1036
1099
|
if (family !== "cartesian" && family !== "xy" && family !== "waterfall") return false;
|
|
1037
1100
|
const series = controller.getSeries(target.seriesId);
|
|
1038
1101
|
return !!series && !series.hidden && series.values[target.index] !== null;
|
|
@@ -1041,7 +1104,7 @@ function snapChartDragValue(scene, value, options = {}) {
|
|
|
1041
1104
|
const scale = _nullishCoalesce(options.scale, () => ( scene.valueScale));
|
|
1042
1105
|
const tolerance = _nullishCoalesce(options.tolerancePx, () => ( 6));
|
|
1043
1106
|
if (scale) {
|
|
1044
|
-
const px = (v) =>
|
|
1107
|
+
const px = (v) => _chunkUUUTEVX6cjs.chartScaleToPixel.call(void 0, v, scale);
|
|
1045
1108
|
const at = px(value);
|
|
1046
1109
|
let best = null;
|
|
1047
1110
|
let bestDist = tolerance;
|
|
@@ -1056,7 +1119,7 @@ function snapChartDragValue(scene, value, options = {}) {
|
|
|
1056
1119
|
}
|
|
1057
1120
|
if (best !== null) return best;
|
|
1058
1121
|
}
|
|
1059
|
-
return
|
|
1122
|
+
return _chunkUUUTEVX6cjs.snapChartValue.call(void 0, scene, value, options.step, _optionalChain([scale, 'optionalAccess', _46 => _46.ticks]), _optionalChain([scale, 'optionalAccess', _47 => _47.logBase]));
|
|
1060
1123
|
}
|
|
1061
1124
|
function startChartPointDrag(controller, scene, target, start, options = {}) {
|
|
1062
1125
|
if (!canDragChartPoint(controller, scene, target)) return null;
|
|
@@ -1065,11 +1128,11 @@ function startChartPointDrag(controller, scene, target, start, options = {}) {
|
|
|
1065
1128
|
const series = controller.getSeries(seriesId);
|
|
1066
1129
|
const secondary = series.axis === "secondary" && !!scene.valueScale2;
|
|
1067
1130
|
const scale = secondary ? scene.valueScale2 : scene.valueScale;
|
|
1068
|
-
const xy =
|
|
1131
|
+
const xy = _chunkBPX4Z3N3cjs.chartFamily.call(void 0, spec) === "xy" && !!scene.xScale;
|
|
1069
1132
|
const startValue = _nullishCoalesce(series.values[index], () => ( 0));
|
|
1070
|
-
const startX = _nullishCoalesce(_optionalChain([series, 'access',
|
|
1071
|
-
const startAt =
|
|
1072
|
-
const startAtX = xy ?
|
|
1133
|
+
const startX = _nullishCoalesce(_optionalChain([series, 'access', _48 => _48.x, 'optionalAccess', _49 => _49[index]]), () => ( null));
|
|
1134
|
+
const startAt = _chunkUUUTEVX6cjs.chartValueAtPoint.call(void 0, scene, start, secondary);
|
|
1135
|
+
const startAtX = xy ? _chunkUUUTEVX6cjs.chartXAtPoint.call(void 0, scene, start) : void 0;
|
|
1073
1136
|
if (startAt === void 0) return null;
|
|
1074
1137
|
const candidates = [0, startValue];
|
|
1075
1138
|
if (!xy) {
|
|
@@ -1087,7 +1150,7 @@ function startChartPointDrag(controller, scene, target, start, options = {}) {
|
|
|
1087
1150
|
target: { seriesId, index },
|
|
1088
1151
|
move(point, moveOptions = {}) {
|
|
1089
1152
|
if (ended) return;
|
|
1090
|
-
const at =
|
|
1153
|
+
const at = _chunkUUUTEVX6cjs.chartValueAtPoint.call(void 0, scene, point, secondary);
|
|
1091
1154
|
if (at === void 0) return;
|
|
1092
1155
|
const factor = moveOptions.fine ? 0.1 : 1;
|
|
1093
1156
|
const moved = (from, to, s, value) => s.logBase && value > 0 && from > 0 && to > 0 ? value * Math.pow(to / from, factor) : value + (to - from) * factor;
|
|
@@ -1095,7 +1158,7 @@ function startChartPointDrag(controller, scene, target, start, options = {}) {
|
|
|
1095
1158
|
let moveX = false;
|
|
1096
1159
|
let atX;
|
|
1097
1160
|
if (xy && startX !== null && startAtX !== void 0) {
|
|
1098
|
-
atX =
|
|
1161
|
+
atX = _chunkUUUTEVX6cjs.chartXAtPoint.call(void 0, scene, point);
|
|
1099
1162
|
moveX = atX !== void 0;
|
|
1100
1163
|
if (moveOptions.lockAxis) {
|
|
1101
1164
|
if (Math.abs(point.x - start.x) >= Math.abs(point.y - start.y)) moveY = false;
|
|
@@ -1107,7 +1170,7 @@ function startChartPointDrag(controller, scene, target, start, options = {}) {
|
|
|
1107
1170
|
if (moveOptions.fine) {
|
|
1108
1171
|
if (s.logBase && !options.step) return v > 0 ? Number(v.toPrecision(3)) : v;
|
|
1109
1172
|
const unit = options.step ? options.step / 10 : s.ticks.length > 1 ? (s.ticks[1] - s.ticks[0]) / 100 : void 0;
|
|
1110
|
-
return
|
|
1173
|
+
return _chunkUUUTEVX6cjs.snapChartValue.call(void 0, scene, v, unit, s.ticks);
|
|
1111
1174
|
}
|
|
1112
1175
|
return snapChartDragValue(scene, v, { candidates: c, tolerancePx: options.tolerancePx, step: options.step, scale: s });
|
|
1113
1176
|
};
|
|
@@ -1118,7 +1181,7 @@ function startChartPointDrag(controller, scene, target, start, options = {}) {
|
|
|
1118
1181
|
const xs = [..._nullishCoalesce(series.x, () => ( []))];
|
|
1119
1182
|
xs[index] = x;
|
|
1120
1183
|
controller.setValue(seriesId, index, y, { label });
|
|
1121
|
-
if (x !== _optionalChain([controller, 'access',
|
|
1184
|
+
if (x !== _optionalChain([controller, 'access', _50 => _50.getSeries, 'call', _51 => _51(seriesId), 'optionalAccess', _52 => _52.x, 'optionalAccess', _53 => _53[index]])) controller.updateSeries(seriesId, { x: xs });
|
|
1122
1185
|
} else controller.setValue(seriesId, index, y, { label });
|
|
1123
1186
|
},
|
|
1124
1187
|
end() {
|
|
@@ -1152,7 +1215,7 @@ function handleChartKey(controller, scene, event) {
|
|
|
1152
1215
|
return true;
|
|
1153
1216
|
case "ArrowLeft":
|
|
1154
1217
|
case "ArrowRight": {
|
|
1155
|
-
if (event.altKey || _optionalChain([selection, 'optionalAccess',
|
|
1218
|
+
if (event.altKey || _optionalChain([selection, 'optionalAccess', _54 => _54.kind]) !== "point" && _optionalChain([selection, 'optionalAccess', _55 => _55.kind]) !== "category") return false;
|
|
1156
1219
|
const n = spec.categories.length;
|
|
1157
1220
|
const index = Math.max(0, Math.min(n - 1, selection.index + (event.key === "ArrowRight" ? 1 : -1)));
|
|
1158
1221
|
controller.select({ ...selection, index });
|
|
@@ -1160,14 +1223,14 @@ function handleChartKey(controller, scene, event) {
|
|
|
1160
1223
|
}
|
|
1161
1224
|
case "ArrowUp":
|
|
1162
1225
|
case "ArrowDown": {
|
|
1163
|
-
if (_optionalChain([selection, 'optionalAccess',
|
|
1226
|
+
if (_optionalChain([selection, 'optionalAccess', _56 => _56.kind]) !== "point" || _optionalChain([scene, 'optionalAccess', _57 => _57.percent])) return false;
|
|
1164
1227
|
const series = controller.getSeries(selection.seriesId);
|
|
1165
|
-
const secondary = _optionalChain([series, 'optionalAccess',
|
|
1166
|
-
const scale = _nullishCoalesce((secondary ? _optionalChain([scene, 'optionalAccess',
|
|
1167
|
-
const ticks = _nullishCoalesce(_optionalChain([scale, 'optionalAccess',
|
|
1228
|
+
const secondary = _optionalChain([series, 'optionalAccess', _58 => _58.axis]) === "secondary";
|
|
1229
|
+
const scale = _nullishCoalesce((secondary ? _optionalChain([scene, 'optionalAccess', _59 => _59.valueScale2]) : null), () => ( _optionalChain([scene, 'optionalAccess', _60 => _60.valueScale])));
|
|
1230
|
+
const ticks = _nullishCoalesce(_optionalChain([scale, 'optionalAccess', _61 => _61.ticks]), () => ( []));
|
|
1168
1231
|
const up = event.key === "ArrowUp";
|
|
1169
|
-
const current = _nullishCoalesce(_optionalChain([series, 'optionalAccess',
|
|
1170
|
-
if (_optionalChain([scale, 'optionalAccess',
|
|
1232
|
+
const current = _nullishCoalesce(_optionalChain([series, 'optionalAccess', _62 => _62.values, 'access', _63 => _63[selection.index]]), () => ( null));
|
|
1233
|
+
if (_optionalChain([scale, 'optionalAccess', _64 => _64.logBase]) && current !== null && current > 0) {
|
|
1171
1234
|
const power = event.shiftKey ? 1 : event.altKey ? 0.01 : 0.1;
|
|
1172
1235
|
const next = Number((current * Math.pow(scale.logBase, up ? power : -power)).toPrecision(event.altKey ? 4 : 3));
|
|
1173
1236
|
controller.nudgeValue(selection.seriesId, selection.index, next - current);
|
|
@@ -1195,22 +1258,22 @@ function describeChartSelection(controller, selection = controller.getState().se
|
|
|
1195
1258
|
case "legend":
|
|
1196
1259
|
return "Legend";
|
|
1197
1260
|
case "axis":
|
|
1198
|
-
return selection.axis === "x" ?
|
|
1261
|
+
return selection.axis === "x" ? _chunkBPX4Z3N3cjs.chartFamily.call(void 0, spec) === "xy" ? "X axis" : "Category axis" : selection.axis === "y" ? "Value axis" : "Secondary value axis";
|
|
1199
1262
|
case "series":
|
|
1200
|
-
return `Series "${_nullishCoalesce(_optionalChain([controller, 'access',
|
|
1263
|
+
return `Series "${_nullishCoalesce(_optionalChain([controller, 'access', _65 => _65.getSeries, 'call', _66 => _66(selection.seriesId), 'optionalAccess', _67 => _67.name]), () => ( selection.seriesId))}"`;
|
|
1201
1264
|
case "category":
|
|
1202
1265
|
return `Category "${_nullishCoalesce(spec.categories[selection.index], () => ( selection.index))}"`;
|
|
1203
1266
|
case "trendline": {
|
|
1204
1267
|
const series = controller.getSeries(selection.seriesId);
|
|
1205
|
-
const line = _optionalChain([series, 'optionalAccess',
|
|
1206
|
-
return `${line ? line.type.replace("-", " ") : "Trendline"} trendline on "${_nullishCoalesce(_optionalChain([series, 'optionalAccess',
|
|
1268
|
+
const line = _optionalChain([series, 'optionalAccess', _68 => _68.trendlines, 'optionalAccess', _69 => _69[selection.index]]);
|
|
1269
|
+
return `${line ? line.type.replace("-", " ") : "Trendline"} trendline on "${_nullishCoalesce(_optionalChain([series, 'optionalAccess', _70 => _70.name]), () => ( selection.seriesId))}"`;
|
|
1207
1270
|
}
|
|
1208
1271
|
case "point": {
|
|
1209
1272
|
const series = controller.getSeries(selection.seriesId);
|
|
1210
|
-
const value = _optionalChain([series, 'optionalAccess',
|
|
1211
|
-
const x = _optionalChain([series, 'optionalAccess',
|
|
1212
|
-
if (x !== void 0 && x !== null &&
|
|
1213
|
-
return `${_nullishCoalesce(_optionalChain([series, 'optionalAccess',
|
|
1273
|
+
const value = _optionalChain([series, 'optionalAccess', _71 => _71.values, 'access', _72 => _72[selection.index]]);
|
|
1274
|
+
const x = _optionalChain([series, 'optionalAccess', _73 => _73.x, 'optionalAccess', _74 => _74[selection.index]]);
|
|
1275
|
+
if (x !== void 0 && x !== null && _chunkBPX4Z3N3cjs.chartFamily.call(void 0, spec) === "xy") return `${_nullishCoalesce(_optionalChain([series, 'optionalAccess', _75 => _75.name]), () => ( selection.seriesId))}: (${x}, ${_nullishCoalesce(value, () => ( "blank"))})`;
|
|
1276
|
+
return `${_nullishCoalesce(_optionalChain([series, 'optionalAccess', _76 => _76.name]), () => ( selection.seriesId))} \xB7 ${_nullishCoalesce(spec.categories[selection.index], () => ( selection.index))}: ${_nullishCoalesce(value, () => ( "blank"))}`;
|
|
1214
1277
|
}
|
|
1215
1278
|
}
|
|
1216
1279
|
}
|
|
@@ -1257,7 +1320,7 @@ var CHART_PRESENCE_COLORS = _chunkSWTUM32Hcjs.PRESENCE_COLORS;
|
|
|
1257
1320
|
var realChartClock = _chunkSWTUM32Hcjs.realPresenceClock;
|
|
1258
1321
|
var createInstantChartClock = _chunkSWTUM32Hcjs.createInstantPresenceClock;
|
|
1259
1322
|
function chartPointAnchor(scene, seriesId, index) {
|
|
1260
|
-
const mark = scene.marks.find((m) => (m.role === "bar" || m.role === "point") && _optionalChain([m, 'access',
|
|
1323
|
+
const mark = scene.marks.find((m) => (m.role === "bar" || m.role === "point") && _optionalChain([m, 'access', _77 => _77.target, 'optionalAccess', _78 => _78.kind]) === "point" && m.target.seriesId === seriesId && m.target.index === index);
|
|
1261
1324
|
if (!mark) return null;
|
|
1262
1325
|
if (mark.kind === "rect") return { x: mark.x + mark.width / 2, y: mark.y };
|
|
1263
1326
|
if (mark.kind === "circle") return { x: mark.cx, y: mark.cy };
|
|
@@ -1283,10 +1346,10 @@ function planChartCommand(spec, scene, command, speed = 1) {
|
|
|
1283
1346
|
case "setValue": {
|
|
1284
1347
|
const at = chartPointAnchor(scene, command.seriesId, command.index);
|
|
1285
1348
|
const series = spec.series.find((s) => s.id === command.seriesId);
|
|
1286
|
-
const from = _nullishCoalesce(_optionalChain([series, 'optionalAccess',
|
|
1287
|
-
const scale = _optionalChain([series, 'optionalAccess',
|
|
1349
|
+
const from = _nullishCoalesce(_optionalChain([series, 'optionalAccess', _79 => _79.values, 'access', _80 => _80[command.index]]), () => ( 0));
|
|
1350
|
+
const scale = _optionalChain([series, 'optionalAccess', _81 => _81.axis]) === "secondary" ? _nullishCoalesce(scene.valueScale2, () => ( scene.valueScale)) : scene.valueScale;
|
|
1288
1351
|
if (at && scale) {
|
|
1289
|
-
const px =
|
|
1352
|
+
const px = _chunkUUUTEVX6cjs.linearMap.call(void 0, command.value, scale.domain, scale.range);
|
|
1290
1353
|
const to = scale.axis === "y" ? { x: at.x, y: px } : { x: px, y: at.y };
|
|
1291
1354
|
steps.push({ type: "move", to: at, ms: ms(380) }, { type: "press" }, { type: "drag", to, ms: ms(520), from, value: command.value }, { type: "release" });
|
|
1292
1355
|
} else steps.push({ type: "drag", to: { x: scene.plot.x + scene.plot.width / 2, y: scene.plot.y + scene.plot.height / 2 }, ms: ms(200), from, value: command.value });
|
|
@@ -1296,12 +1359,12 @@ function planChartCommand(spec, scene, command, speed = 1) {
|
|
|
1296
1359
|
case "select": {
|
|
1297
1360
|
const sel = command.selection;
|
|
1298
1361
|
let to = null;
|
|
1299
|
-
if (_optionalChain([sel, 'optionalAccess',
|
|
1362
|
+
if (_optionalChain([sel, 'optionalAccess', _82 => _82.kind]) === "point") to = chartPointAnchor(scene, sel.seriesId, sel.index);
|
|
1300
1363
|
else if (sel) {
|
|
1301
1364
|
const m = scene.marks.find((x) => x.target && JSON.stringify(x.target) === JSON.stringify(sel));
|
|
1302
|
-
if (_optionalChain([m, 'optionalAccess',
|
|
1303
|
-
else if (_optionalChain([m, 'optionalAccess',
|
|
1304
|
-
else if (_optionalChain([m, 'optionalAccess',
|
|
1365
|
+
if (_optionalChain([m, 'optionalAccess', _83 => _83.kind]) === "text") to = { x: m.x, y: m.y };
|
|
1366
|
+
else if (_optionalChain([m, 'optionalAccess', _84 => _84.kind]) === "rect") to = { x: m.x + m.width / 2, y: m.y + m.height / 2 };
|
|
1367
|
+
else if (_optionalChain([m, 'optionalAccess', _85 => _85.kind]) === "circle") to = { x: m.cx, y: m.cy };
|
|
1305
1368
|
}
|
|
1306
1369
|
if (to) steps.push({ type: "move", to, ms: ms(380) }, { type: "press" }, { type: "release" });
|
|
1307
1370
|
steps.push({ type: "commit" });
|
|
@@ -1383,7 +1446,7 @@ var ChartDirector = class {
|
|
|
1383
1446
|
if (command.kind !== "setValue") break;
|
|
1384
1447
|
const stale2 = this.stale(command);
|
|
1385
1448
|
if (stale2) return { ok: false, command, message: stale2 };
|
|
1386
|
-
const label = `${_nullishCoalesce(_optionalChain([this, 'access',
|
|
1449
|
+
const label = `${_nullishCoalesce(_optionalChain([this, 'access', _86 => _86.presence, 'access', _87 => _87.getState, 'call', _88 => _88(), 'access', _89 => _89.actors, 'access', _90 => _90.find, 'call', _91 => _91((a) => a.id === id), 'optionalAccess', _92 => _92.name]), () => ( "Agent"))}: edit value`;
|
|
1387
1450
|
await this.move(id, where(), step.to, step.ms, (e) => {
|
|
1388
1451
|
const v = step.from + (step.value - step.from) * e;
|
|
1389
1452
|
this.controller.setValue(command.seriesId, command.index, Number(v.toPrecision(12)), { label });
|
|
@@ -1484,6 +1547,10 @@ function planChartToolPlayback(tool, args) {
|
|
|
1484
1547
|
return click(control("series.callout"));
|
|
1485
1548
|
case "highlight_chart":
|
|
1486
1549
|
return click(control("highlight"));
|
|
1550
|
+
case "set_chart_race_frame":
|
|
1551
|
+
return click(control("raceFrame"));
|
|
1552
|
+
case "play_chart_race":
|
|
1553
|
+
return click({ kind: "action", id: "race-play" });
|
|
1487
1554
|
case "render_chart":
|
|
1488
1555
|
return [{ type: "target", ref: { kind: "action", id: "download-png" } }];
|
|
1489
1556
|
case "undo_chart":
|
|
@@ -1542,20 +1609,36 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1542
1609
|
fail2(`There is no category ${JSON.stringify(ref)}; expected an index from 0 to ${categories.length - 1} or one of ${categories.slice(0, 20).map((c) => JSON.stringify(c)).join(", ")}.`);
|
|
1543
1610
|
return index;
|
|
1544
1611
|
};
|
|
1545
|
-
const table = () =>
|
|
1612
|
+
const table = () => _chunkBPX4Z3N3cjs.chartDataToTable.call(void 0, spec());
|
|
1546
1613
|
const treeTable = () => {
|
|
1547
|
-
const rows =
|
|
1548
|
-
const depth =
|
|
1614
|
+
const rows = _chunkBPX4Z3N3cjs.chartTreeToRows.call(void 0, spec().tree);
|
|
1615
|
+
const depth = _chunkBPX4Z3N3cjs.chartTreeDepth.call(void 0, spec().tree);
|
|
1549
1616
|
return [[...Array.from({ length: depth }, (_, k) => k === 0 ? "Group" : k === depth - 1 ? "Item" : `Level ${k + 1}`), "Value"], ...rows.map((r) => [...r.path, ...Array(depth - r.path.length).fill(""), r.value])];
|
|
1550
1617
|
};
|
|
1551
|
-
const
|
|
1552
|
-
|
|
1618
|
+
const raceFrameOf = (time) => {
|
|
1619
|
+
const cats = spec().categories;
|
|
1620
|
+
const frame = typeof time === "number" ? time : cats.indexOf(time);
|
|
1621
|
+
if (!(Number.isFinite(frame) && frame >= 0 && frame <= cats.length - 1))
|
|
1622
|
+
fail2(`There is no time point ${JSON.stringify(time)}; expected an index from 0 to ${Math.max(0, cats.length - 1)} or one of ${cats.slice(0, 20).map((c) => JSON.stringify(c)).join(", ")}.`);
|
|
1623
|
+
return frame;
|
|
1624
|
+
};
|
|
1625
|
+
const raceAt = (frame) => {
|
|
1626
|
+
const s = spec();
|
|
1627
|
+
const at = _nullishCoalesce(frame, () => ( s.categories.length - 1));
|
|
1628
|
+
return {
|
|
1629
|
+
frame: at,
|
|
1630
|
+
time: _nullishCoalesce(s.categories[Math.round(at)], () => ( null)),
|
|
1631
|
+
ranking: _chunkUUUTEVX6cjs.chartRaceRanking.call(void 0, s, at).slice(0, s.raceTopN).map((e) => ({ rank: e.rank + 1, series: e.seriesId, name: e.name, value: e.value }))
|
|
1632
|
+
};
|
|
1633
|
+
};
|
|
1634
|
+
const linksSummary = () => ({ links: spec().links, nodes: spec().sankeyNodes.map((name, i) => ({ name, value: _chunkBPX4Z3N3cjs.chartSankeyNodeValues.call(void 0, spec().links, spec().sankeyNodes)[i] })) });
|
|
1635
|
+
const treeSummary = () => ({ tree: spec().tree, groups: spec().tree.map((n) => ({ name: n.name, total: _chunkBPX4Z3N3cjs.chartTreeTotal.call(void 0, n) })), depth: _chunkBPX4Z3N3cjs.chartTreeDepth.call(void 0, spec().tree) });
|
|
1553
1636
|
const Parser = () => _nullishCoalesce(options.DOMParser, () => ( globalThis.DOMParser));
|
|
1554
1637
|
const getChart = {
|
|
1555
1638
|
name: "get_chart",
|
|
1556
1639
|
title: "Read the chart",
|
|
1557
1640
|
description: "Returns the chart spec (type, titles, axes, legend, series with ids and settings), its data as a table (header row of series names, then one row per category), grouped data as treeTable (path of names to each item, then its value) when the chart has a tree, the current selection, and a summary at the given size: per-series min / max / mean / trend, the axes as drawn, layout warnings (hidden labels, thinned lines), a colour check and a plain-language description. Use the series ids and category indexes it returns with the write tools.",
|
|
1558
|
-
inputSchema: { type: "object", properties: { width:
|
|
1641
|
+
inputSchema: { type: "object", properties: { width: _chunkMZFZSVUJcjs.WIDTH, height: _chunkMZFZSVUJcjs.HEIGHT }, additionalProperties: false },
|
|
1559
1642
|
annotations: { title: "Read the chart", ...READ },
|
|
1560
1643
|
handler: ({ width = size.width, height = size.height }) => {
|
|
1561
1644
|
const reason = readOnlyReason();
|
|
@@ -1563,7 +1646,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1563
1646
|
spec: controller.toJSON(),
|
|
1564
1647
|
table: table(),
|
|
1565
1648
|
selection: controller.getState().selection,
|
|
1566
|
-
summary:
|
|
1649
|
+
summary: _chunkV5L2G22Rcjs.summarizeChart.call(void 0, controller.toJSON(), { width, height }),
|
|
1567
1650
|
...spec().tree.length ? { treeTable: treeTable() } : {},
|
|
1568
1651
|
issues: controller.getState().issues,
|
|
1569
1652
|
...reason ? { readOnly: reason } : {}
|
|
@@ -1577,17 +1660,19 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1577
1660
|
inputSchema: {
|
|
1578
1661
|
type: "object",
|
|
1579
1662
|
properties: {
|
|
1580
|
-
width:
|
|
1581
|
-
height:
|
|
1582
|
-
format: { type: "string", enum: ["svg", "png"], description: "svg (default): the SVG document as text. png: an image to look at (only when the host can rasterize; costs image tokens)." }
|
|
1663
|
+
width: _chunkMZFZSVUJcjs.WIDTH,
|
|
1664
|
+
height: _chunkMZFZSVUJcjs.HEIGHT,
|
|
1665
|
+
format: { type: "string", enum: ["svg", "png"], description: "svg (default): the SVG document as text. png: an image to look at (only when the host can rasterize; costs image tokens)." },
|
|
1666
|
+
time: { ..._chunkMZFZSVUJcjs.RACE_TIME, description: `Bar race only: the moment to draw (default: the one shown). ${_chunkMZFZSVUJcjs.RACE_TIME.description}` }
|
|
1583
1667
|
},
|
|
1584
1668
|
additionalProperties: false
|
|
1585
1669
|
},
|
|
1586
1670
|
annotations: { title: "Render the chart", ...READ },
|
|
1587
|
-
handler: async ({ width = size.width, height = size.height, format = "svg" }) => {
|
|
1671
|
+
handler: async ({ width = size.width, height = size.height, format = "svg", time }) => {
|
|
1588
1672
|
const json = controller.toJSON();
|
|
1589
|
-
const
|
|
1590
|
-
const
|
|
1673
|
+
const raceFrame = time !== void 0 ? raceFrameOf(time) : controller.getState().raceFrame;
|
|
1674
|
+
const scene = _chunkUUUTEVX6cjs.layoutChart.call(void 0, json, { width, height, selection: null, raceFrame });
|
|
1675
|
+
const svg = _chunkV5L2G22Rcjs.chartSceneToSvg.call(void 0, scene, { ariaLabel: json.title || void 0, description: _chunkV5L2G22Rcjs.describeChart.call(void 0, json) });
|
|
1591
1676
|
const warnings = scene.warnings;
|
|
1592
1677
|
if (format === "png") {
|
|
1593
1678
|
if (!options.rasterize) fail2('This host cannot rasterize charts; call render_chart with format "svg", or get_chart for the layout warnings.');
|
|
@@ -1621,8 +1706,8 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1621
1706
|
handler: ({ colors, surface }) => {
|
|
1622
1707
|
const s = spec();
|
|
1623
1708
|
const visible = s.series.filter((x) => !x.hidden);
|
|
1624
|
-
const own =
|
|
1625
|
-
return { colors: _nullishCoalesce(colors, () => ( own)), ...
|
|
1709
|
+
const own = _chunkBPX4Z3N3cjs.chartSpecColorsByCategory.call(void 0, s) ? s.categories.map((_, i) => _optionalChain([visible, 'access', _93 => _93[0], 'optionalAccess', _94 => _94.pointColors, 'optionalAccess', _95 => _95[i]]) || _chunkBPX4Z3N3cjs.chartSliceColor.call(void 0, s, i)) : visible.map((x) => _chunkBPX4Z3N3cjs.chartSeriesColor.call(void 0, s, s.series.indexOf(x)));
|
|
1710
|
+
return { colors: _nullishCoalesce(colors, () => ( own)), ..._chunkBPX4Z3N3cjs.checkChartColors.call(void 0, _nullishCoalesce(colors, () => ( own)), { surface }) };
|
|
1626
1711
|
}
|
|
1627
1712
|
};
|
|
1628
1713
|
const recommend = {
|
|
@@ -1644,21 +1729,29 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1644
1729
|
description: "Returns a trendline's fitted coefficients (in x for category charts, x = 1, 2, 3, \u2026), R\xB2, equation and the number of points, or the moving-average points.",
|
|
1645
1730
|
inputSchema: {
|
|
1646
1731
|
type: "object",
|
|
1647
|
-
properties: { series:
|
|
1732
|
+
properties: { series: _chunkMZFZSVUJcjs.SERIES_REF, index: { type: "integer", minimum: 0, description: "Trendline index on the series (0 = first)." } },
|
|
1648
1733
|
required: ["series", "index"],
|
|
1649
1734
|
additionalProperties: false
|
|
1650
1735
|
},
|
|
1651
1736
|
annotations: { title: "Read a trendline fit", ...READ },
|
|
1652
1737
|
handler: ({ series, index }) => {
|
|
1653
1738
|
const s = seriesById(series);
|
|
1654
|
-
const line = _optionalChain([s, 'access',
|
|
1655
|
-
if (!line) fail2(`"${s.name}" has no trendline ${index}; it has ${_nullishCoalesce(_optionalChain([s, 'access',
|
|
1739
|
+
const line = _optionalChain([s, 'access', _96 => _96.trendlines, 'optionalAccess', _97 => _97[index]]);
|
|
1740
|
+
if (!line) fail2(`"${s.name}" has no trendline ${index}; it has ${_nullishCoalesce(_optionalChain([s, 'access', _98 => _98.trendlines, 'optionalAccess', _99 => _99.length]), () => ( 0))}.`);
|
|
1656
1741
|
if (line.type === "moving-average") return { trendline: line, points: controller.trendlineMovingAverage(s.id, index) };
|
|
1657
1742
|
const fit = controller.trendlineFit(s.id, index);
|
|
1658
1743
|
if (!fit) fail2(`The ${line.type} trendline on "${s.name}" cannot be fitted: it needs more points (and positive values for log, exponential and power fits).`);
|
|
1659
1744
|
return { trendline: line, coefficients: fit.coefficients, r2: fit.r2, equation: fit.equation, points: fit.points };
|
|
1660
1745
|
}
|
|
1661
1746
|
};
|
|
1747
|
+
const raceRanking = {
|
|
1748
|
+
name: "get_chart_race_ranking",
|
|
1749
|
+
title: "Read a bar race ranking",
|
|
1750
|
+
description: "Returns who leads a bar race at a moment without changing what is shown: the top raceTopN names with their rank, series id and value (eased between time points). Defaults to the moment shown. Works for any chart, reading categories as time points and series as names.",
|
|
1751
|
+
inputSchema: { type: "object", properties: { time: _chunkMZFZSVUJcjs.RACE_TIME }, additionalProperties: false },
|
|
1752
|
+
annotations: { title: "Read a bar race ranking", ...READ },
|
|
1753
|
+
handler: ({ time }) => raceAt(time !== void 0 ? raceFrameOf(time) : controller.getState().raceFrame)
|
|
1754
|
+
};
|
|
1662
1755
|
const listPresets = {
|
|
1663
1756
|
name: "list_chart_presets",
|
|
1664
1757
|
title: "List chart presets",
|
|
@@ -1666,8 +1759,8 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1666
1759
|
inputSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
1667
1760
|
annotations: { title: "List chart presets", ...READ },
|
|
1668
1761
|
handler: () => ({
|
|
1669
|
-
layouts:
|
|
1670
|
-
colorSchemes:
|
|
1762
|
+
layouts: _chunkV5L2G22Rcjs.CHART_LAYOUT_PRESETS.map(({ id, label, description }) => ({ id, label, description })),
|
|
1763
|
+
colorSchemes: _chunkV5L2G22Rcjs.CHART_COLOR_SCHEMES.map(({ id, label, description, palette }) => ({ id, label, description, palette }))
|
|
1671
1764
|
})
|
|
1672
1765
|
};
|
|
1673
1766
|
const exportMermaid = {
|
|
@@ -1676,7 +1769,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1676
1769
|
description: 'Returns the chart as Mermaid text for Markdown or chat: xychart-beta, pie or radar-beta, sankey-beta for Sankey diagrams with flows, treemap-beta for treemaps and sunbursts (with their levels). With meta (default true) one "%% @pixerate {\u2026}" comment keeps what Mermaid cannot express, so import_chart_mermaid gets the chart back exactly.',
|
|
1677
1770
|
inputSchema: { type: "object", properties: { meta: { type: "boolean", description: "Include the round-trip comment (default true)." } }, additionalProperties: false },
|
|
1678
1771
|
annotations: { title: "Export chart as Mermaid", ...READ },
|
|
1679
|
-
handler: ({ meta = true }) => ({ mermaid:
|
|
1772
|
+
handler: ({ meta = true }) => ({ mermaid: _chunkV5L2G22Rcjs.chartToMermaid.call(void 0, controller.toJSON(), { meta }) })
|
|
1680
1773
|
};
|
|
1681
1774
|
const exportOoxml = {
|
|
1682
1775
|
name: "export_chart_ooxml",
|
|
@@ -1684,7 +1777,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1684
1777
|
description: "Returns the chart as a DrawingML chart part (c:chartSpace) for Word or PowerPoint files, with what could not be written as sentences.",
|
|
1685
1778
|
inputSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
1686
1779
|
annotations: { title: "Export chart as Office XML", ...READ },
|
|
1687
|
-
handler: () =>
|
|
1780
|
+
handler: () => _chunkSZWVMB3Bcjs.chartToOoxml.call(void 0, controller.toJSON())
|
|
1688
1781
|
};
|
|
1689
1782
|
const updateChart = {
|
|
1690
1783
|
name: "update_chart",
|
|
@@ -1692,7 +1785,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1692
1785
|
description: 'Changes how the chart looks, as one undo step: type, titles, axes (xAxis = categories or numeric x, yAxis = values, yAxis2 = secondary values; each can be reversed, and value axes can be logarithmic with scale "log"), legend, stacking, orientation, curve, points, data labels and their position, palette, donut hole, bar spacing, histogram bins, waterfall total, radar rings (radarTicks) and grid shape (radarGraticule), note, highlight, reference lines and bands (whole lists), and varyColors. All-or-nothing: invalid values change nothing and come back as sentences. Returns the new spec.',
|
|
1693
1786
|
inputSchema: {
|
|
1694
1787
|
type: "object",
|
|
1695
|
-
properties:
|
|
1788
|
+
properties: _chunkMZFZSVUJcjs.CHART_UPDATE_PROPERTIES,
|
|
1696
1789
|
additionalProperties: false
|
|
1697
1790
|
},
|
|
1698
1791
|
annotations: { title: "Change chart presentation", ...WRITE_IDEMPOTENT },
|
|
@@ -1713,7 +1806,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1713
1806
|
series: {
|
|
1714
1807
|
type: "array",
|
|
1715
1808
|
description: "The new series (replaces all).",
|
|
1716
|
-
items: { type: "object", properties: { id: { type: "string", description: "Stable id (optional)." }, ...
|
|
1809
|
+
items: { type: "object", properties: { id: { type: "string", description: "Stable id (optional)." }, ..._chunkMZFZSVUJcjs.SERIES_PROPS }, required: ["name", "values"], additionalProperties: false }
|
|
1717
1810
|
}
|
|
1718
1811
|
},
|
|
1719
1812
|
additionalProperties: false
|
|
@@ -1736,7 +1829,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1736
1829
|
type: "array",
|
|
1737
1830
|
minItems: 1,
|
|
1738
1831
|
description: "Values to set.",
|
|
1739
|
-
items: { type: "object", properties: { series:
|
|
1832
|
+
items: { type: "object", properties: { series: _chunkMZFZSVUJcjs.SERIES_REF, category: _chunkMZFZSVUJcjs.CATEGORY_REF, value: _chunkMZFZSVUJcjs.VALUE }, required: ["series", "category", "value"], additionalProperties: false }
|
|
1740
1833
|
}
|
|
1741
1834
|
},
|
|
1742
1835
|
required: ["cells"],
|
|
@@ -1745,7 +1838,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1745
1838
|
annotations: { title: "Set chart values", ...WRITE_IDEMPOTENT },
|
|
1746
1839
|
handler: async ({ cells }) => {
|
|
1747
1840
|
const resolved = cells.map((c) => ({ seriesId: seriesById(c.series).id, index: categoryIndex(c.category), value: c.value }));
|
|
1748
|
-
const parsed = resolved.map((c) =>
|
|
1841
|
+
const parsed = resolved.map((c) => _chunkBPX4Z3N3cjs.parseChartValue.call(void 0, c.value));
|
|
1749
1842
|
const bad = resolved.find((_, i) => parsed[i] === void 0);
|
|
1750
1843
|
if (bad) fail2(`"${String(bad.value)}" is not a number; pass a number, numeric text or null for a gap. Nothing was changed.`);
|
|
1751
1844
|
if (options.director && parsed.every((v) => typeof v === "number")) {
|
|
@@ -1762,7 +1855,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1762
1855
|
description: "Adds a series (values padded to the categories) and selects it. Returns its id and stored values.",
|
|
1763
1856
|
inputSchema: {
|
|
1764
1857
|
type: "object",
|
|
1765
|
-
properties: { ...
|
|
1858
|
+
properties: { ..._chunkMZFZSVUJcjs.SERIES_PROPS, id: { type: "string", description: "Id to use (default: series-N)." }, at: { type: "integer", minimum: 0, description: "Position (default: last)." } },
|
|
1766
1859
|
required: ["name"],
|
|
1767
1860
|
additionalProperties: false
|
|
1768
1861
|
},
|
|
@@ -1780,7 +1873,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1780
1873
|
description: "Renames, recolours, hides, moves to the secondary axis or changes how a series is drawn (marker, curve, labels, format, x values, bubble sizes, point colours, error bars). null resets a field. Values change with set_chart_values. Returns the series.",
|
|
1781
1874
|
inputSchema: {
|
|
1782
1875
|
type: "object",
|
|
1783
|
-
properties: { series:
|
|
1876
|
+
properties: { series: _chunkMZFZSVUJcjs.SERIES_REF, ...Object.fromEntries(Object.entries(_chunkMZFZSVUJcjs.SERIES_PROPS).filter(([k]) => k !== "values")) },
|
|
1784
1877
|
required: ["series"],
|
|
1785
1878
|
additionalProperties: false
|
|
1786
1879
|
},
|
|
@@ -1796,7 +1889,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1796
1889
|
name: "remove_chart_series",
|
|
1797
1890
|
title: "Delete a series",
|
|
1798
1891
|
description: "Deletes a series and its values. Returns the remaining series ids.",
|
|
1799
|
-
inputSchema: { type: "object", properties: { series:
|
|
1892
|
+
inputSchema: { type: "object", properties: { series: _chunkMZFZSVUJcjs.SERIES_REF }, required: ["series"], additionalProperties: false },
|
|
1800
1893
|
annotations: { title: "Delete a series", ...DESTRUCTIVE },
|
|
1801
1894
|
handler: ({ series }) => {
|
|
1802
1895
|
resolve(controller.removeSeries(seriesById(series).id));
|
|
@@ -1822,7 +1915,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1822
1915
|
name: "remove_chart_category",
|
|
1823
1916
|
title: "Delete a category",
|
|
1824
1917
|
description: "Deletes a category and its value in every series. Returns the remaining categories.",
|
|
1825
|
-
inputSchema: { type: "object", properties: { category:
|
|
1918
|
+
inputSchema: { type: "object", properties: { category: _chunkMZFZSVUJcjs.CATEGORY_REF }, required: ["category"], additionalProperties: false },
|
|
1826
1919
|
annotations: { title: "Delete a category", ...DESTRUCTIVE },
|
|
1827
1920
|
handler: ({ category }) => {
|
|
1828
1921
|
resolve(controller.removeCategory(categoryIndex(category)));
|
|
@@ -1865,7 +1958,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1865
1958
|
annotations: { title: "Import a Mermaid chart", ...DESTRUCTIVE },
|
|
1866
1959
|
handler: ({ mermaid }) => {
|
|
1867
1960
|
const fenced = /```(?:mermaid)?\s*\n([\s\S]*?)```/.exec(mermaid);
|
|
1868
|
-
const read =
|
|
1961
|
+
const read = _chunkV5L2G22Rcjs.chartFromMermaid.call(void 0, fenced ? fenced[1] : mermaid);
|
|
1869
1962
|
if (!read.family) fail2(read.issues.map((i) => i.message).join(" ") || "Expected Mermaid starting with xychart-beta, pie, radar-beta, sankey-beta or treemap-beta.");
|
|
1870
1963
|
resolve(controller.update({ ...read.spec }, { label: "Import Mermaid chart" }));
|
|
1871
1964
|
return { spec: controller.toJSON(), issues: read.issues };
|
|
@@ -1878,7 +1971,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1878
1971
|
inputSchema: { type: "object", properties: { xml: { type: "string", description: "The chart part XML, e.g. word/charts/chart1.xml." } }, required: ["xml"], additionalProperties: false },
|
|
1879
1972
|
annotations: { title: "Import an Office chart", ...DESTRUCTIVE },
|
|
1880
1973
|
handler: ({ xml }) => {
|
|
1881
|
-
const read =
|
|
1974
|
+
const read = _chunkSZWVMB3Bcjs.chartFromOoxml.call(void 0, xml, { DOMParser: Parser() });
|
|
1882
1975
|
if (read.issues.some((i) => i.path === "" || i.path === "plotArea")) fail2(read.issues.map((i) => i.message).join(" "));
|
|
1883
1976
|
resolve(controller.update({ ...read.spec }, { label: "Import Office chart" }));
|
|
1884
1977
|
return { spec: controller.toJSON(), issues: read.issues.map((i) => i.message), unsupported: read.unsupported, lossless: read.lossless };
|
|
@@ -1888,7 +1981,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1888
1981
|
name: "add_chart_trendline",
|
|
1889
1982
|
title: "Add a trendline",
|
|
1890
1983
|
description: "Fits a trendline to a series and draws it (unstacked bar, line, area, scatter and bubble charts). Returns its index and the fit: coefficients, R\xB2 and equation.",
|
|
1891
|
-
inputSchema: { type: "object", properties: { series:
|
|
1984
|
+
inputSchema: { type: "object", properties: { series: _chunkMZFZSVUJcjs.SERIES_REF, ..._chunkMZFZSVUJcjs.TRENDLINE_PROPS }, required: ["series", "type"], additionalProperties: false },
|
|
1892
1985
|
annotations: { title: "Add a trendline", ...WRITE },
|
|
1893
1986
|
handler: ({ series, ...line }) => {
|
|
1894
1987
|
const s = seriesById(series);
|
|
@@ -1902,7 +1995,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1902
1995
|
description: "Deletes a trendline from a series. Returns the series' remaining trendlines.",
|
|
1903
1996
|
inputSchema: {
|
|
1904
1997
|
type: "object",
|
|
1905
|
-
properties: { series:
|
|
1998
|
+
properties: { series: _chunkMZFZSVUJcjs.SERIES_REF, index: { type: "integer", minimum: 0, description: "Trendline index on the series (0 = first)." } },
|
|
1906
1999
|
required: ["series", "index"],
|
|
1907
2000
|
additionalProperties: false
|
|
1908
2001
|
},
|
|
@@ -1910,7 +2003,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1910
2003
|
handler: ({ series, index }) => {
|
|
1911
2004
|
const s = seriesById(series);
|
|
1912
2005
|
resolve(controller.removeTrendline(s.id, index));
|
|
1913
|
-
return { series: s.id, trendlines: _nullishCoalesce(_optionalChain([controller, 'access',
|
|
2006
|
+
return { series: s.id, trendlines: _nullishCoalesce(_optionalChain([controller, 'access', _100 => _100.getSeries, 'call', _101 => _101(s.id), 'optionalAccess', _102 => _102.trendlines]), () => ( [])) };
|
|
1914
2007
|
}
|
|
1915
2008
|
};
|
|
1916
2009
|
const referenceTools = (what) => {
|
|
@@ -1921,7 +2014,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1921
2014
|
name: `add_chart_reference_${what}`,
|
|
1922
2015
|
title: `Add a reference ${what}`,
|
|
1923
2016
|
description: what === "line" ? "Draws a dashed line across the plot at one value: a target, a floor, an average (bar, line, area, scatter and bubble charts). The axis grows to keep it in view. Returns its index and the reference lines." : "Shades a band across the plot between two values: a target or normal range (bar, line, area, scatter and bubble charts), drawn under the data. The axis grows to keep it in view. Returns its index and the reference bands.",
|
|
1924
|
-
inputSchema: { type: "object", properties: what === "line" ?
|
|
2017
|
+
inputSchema: { type: "object", properties: what === "line" ? _chunkMZFZSVUJcjs.REFERENCE_LINE_PROPS : _chunkMZFZSVUJcjs.REFERENCE_BAND_PROPS, required: what === "line" ? ["value"] : ["from", "to"], additionalProperties: false },
|
|
1925
2018
|
annotations: { title: `Add a reference ${what}`, ...WRITE },
|
|
1926
2019
|
handler: (args) => {
|
|
1927
2020
|
const result = resolve(what === "line" ? controller.addReferenceLine(args) : controller.addReferenceBand(args));
|
|
@@ -1932,7 +2025,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1932
2025
|
name: `update_chart_reference_${what}`,
|
|
1933
2026
|
title: `Change a reference ${what}`,
|
|
1934
2027
|
description: `Changes a reference ${what} by index (all-or-nothing); label, axis and color take null to remove them. Returns the ${what} as stored.`,
|
|
1935
|
-
inputSchema: { type: "object", properties: { index:
|
|
2028
|
+
inputSchema: { type: "object", properties: { index: _chunkMZFZSVUJcjs.REFERENCE_INDEX.call(void 0, Kind), ...what === "line" ? _chunkMZFZSVUJcjs.REFERENCE_LINE_PATCH : _chunkMZFZSVUJcjs.REFERENCE_BAND_PATCH }, required: ["index"], additionalProperties: false },
|
|
1936
2029
|
annotations: { title: `Change a reference ${what}`, ...WRITE_IDEMPOTENT },
|
|
1937
2030
|
handler: ({ index, ...patch }) => {
|
|
1938
2031
|
if (!Object.keys(patch).length) fail2(`Nothing to change: pass at least one field besides index, e.g. {"index": ${index}, "label": "Target"}.`);
|
|
@@ -1944,7 +2037,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1944
2037
|
name: `remove_chart_reference_${what}`,
|
|
1945
2038
|
title: `Delete a reference ${what}`,
|
|
1946
2039
|
description: `Deletes a reference ${what} by index; the ones after it move up one. Returns the reference ${what}s left.`,
|
|
1947
|
-
inputSchema: { type: "object", properties: { index:
|
|
2040
|
+
inputSchema: { type: "object", properties: { index: _chunkMZFZSVUJcjs.REFERENCE_INDEX.call(void 0, Kind) }, required: ["index"], additionalProperties: false },
|
|
1948
2041
|
annotations: { title: `Delete a reference ${what}`, ...DESTRUCTIVE },
|
|
1949
2042
|
handler: ({ index }) => {
|
|
1950
2043
|
resolve(what === "line" ? controller.removeReferenceLine(index) : controller.removeReferenceBand(index));
|
|
@@ -1961,7 +2054,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1961
2054
|
description: 'Pins a short label to one bar or point, with a leader line, to say why it matters ("Record quarter", "Launch"); label null or "" removes it. Bar, line, area, scatter and bubble charts; the point must have a value. Selects the point and returns the series id, category index and label.',
|
|
1962
2055
|
inputSchema: {
|
|
1963
2056
|
type: "object",
|
|
1964
|
-
properties: { series:
|
|
2057
|
+
properties: { series: _chunkMZFZSVUJcjs.SERIES_REF, category: _chunkMZFZSVUJcjs.CATEGORY_REF, label: { type: ["string", "null"], description: "The label (keep it to a few words), or null to remove it." } },
|
|
1965
2058
|
required: ["series", "category", "label"],
|
|
1966
2059
|
additionalProperties: false
|
|
1967
2060
|
},
|
|
@@ -1970,7 +2063,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1970
2063
|
const s = seriesById(series);
|
|
1971
2064
|
const index = categoryIndex(category);
|
|
1972
2065
|
resolve(controller.setCallout(s.id, index, label));
|
|
1973
|
-
return { series: s.id, index, category: spec().categories[index], label: _nullishCoalesce(_optionalChain([controller, 'access',
|
|
2066
|
+
return { series: s.id, index, category: spec().categories[index], label: _nullishCoalesce(_optionalChain([controller, 'access', _103 => _103.getSeries, 'call', _104 => _104(s.id), 'optionalAccess', _105 => _105.callouts, 'optionalAccess', _106 => _106[index]]), () => ( null)) };
|
|
1974
2067
|
}
|
|
1975
2068
|
};
|
|
1976
2069
|
const highlight = {
|
|
@@ -1994,7 +2087,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
1994
2087
|
name: "set_chart_tree",
|
|
1995
2088
|
title: "Replace grouped data",
|
|
1996
2089
|
description: `Replaces the chart's data with groups of items (a tree) for treemaps and sunbursts, as one undo step: items {"name", "value"} and groups {"name", "children"}, up to 6 levels, names unique among siblings. The top-level groups become the categories and their totals the first series, so other chart types draw the totals. [] goes back to plain data (the totals stay as values). Returns the tree, each group's total and the depth.`,
|
|
1997
|
-
inputSchema: { type: "object", properties: { tree: { type: "array", items: { $ref: "#/$defs/chartTreeNode" }, description: "The top-level nodes; [] removes the grouping." } }, required: ["tree"], additionalProperties: false, $defs:
|
|
2090
|
+
inputSchema: { type: "object", properties: { tree: { type: "array", items: { $ref: "#/$defs/chartTreeNode" }, description: "The top-level nodes; [] removes the grouping." } }, required: ["tree"], additionalProperties: false, $defs: _chunkMZFZSVUJcjs.TREE_DEFS },
|
|
1998
2091
|
annotations: { title: "Replace grouped data", ...WRITE_IDEMPOTENT },
|
|
1999
2092
|
handler: ({ tree }) => {
|
|
2000
2093
|
resolve(controller.setTree(tree));
|
|
@@ -2033,13 +2126,13 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
2033
2126
|
},
|
|
2034
2127
|
required: ["node"],
|
|
2035
2128
|
additionalProperties: false,
|
|
2036
|
-
$defs:
|
|
2129
|
+
$defs: _chunkMZFZSVUJcjs.TREE_DEFS
|
|
2037
2130
|
},
|
|
2038
2131
|
annotations: { title: "Add an item or group", ...WRITE },
|
|
2039
2132
|
handler: ({ parent = [], node, at }) => {
|
|
2040
2133
|
const result = resolve(controller.addTreeNode(parent, node, { at }));
|
|
2041
|
-
const group = parent.length ?
|
|
2042
|
-
return { path: result.path, parentTotal: group ?
|
|
2134
|
+
const group = parent.length ? _chunkBPX4Z3N3cjs.findChartTreeNode.call(void 0, spec().tree, parent) : null;
|
|
2135
|
+
return { path: result.path, parentTotal: group ? _chunkBPX4Z3N3cjs.chartTreeTotal.call(void 0, group) : spec().tree.reduce((t, n) => t + _chunkBPX4Z3N3cjs.chartTreeTotal.call(void 0, n), 0) };
|
|
2043
2136
|
}
|
|
2044
2137
|
};
|
|
2045
2138
|
const updateTreeNode = {
|
|
@@ -2049,7 +2142,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
2049
2142
|
inputSchema: {
|
|
2050
2143
|
type: "object",
|
|
2051
2144
|
properties: {
|
|
2052
|
-
path:
|
|
2145
|
+
path: _chunkMZFZSVUJcjs.TREE_PATH,
|
|
2053
2146
|
name: { type: "string", description: "New name (unique among its siblings)." },
|
|
2054
2147
|
value: { type: "number", minimum: 0, description: "Items only: the new amount." },
|
|
2055
2148
|
color: { type: ["string", "null"], description: "CSS colour, or null for the palette colour." }
|
|
@@ -2061,14 +2154,14 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
2061
2154
|
handler: ({ path, ...patch }) => {
|
|
2062
2155
|
if (!Object.keys(patch).length) fail2("Nothing to change: pass name, value or color with the path.");
|
|
2063
2156
|
const result = resolve(controller.updateTreeNode(path, patch));
|
|
2064
|
-
return { path: result.path, node:
|
|
2157
|
+
return { path: result.path, node: _chunkBPX4Z3N3cjs.findChartTreeNode.call(void 0, spec().tree, result.path) };
|
|
2065
2158
|
}
|
|
2066
2159
|
};
|
|
2067
2160
|
const removeTreeNode = {
|
|
2068
2161
|
name: "remove_chart_tree_node",
|
|
2069
2162
|
title: "Delete an item or group",
|
|
2070
2163
|
description: "Deletes a node of the grouped data with everything under it (a group left empty becomes an item with value 0). Returns the group totals left.",
|
|
2071
|
-
inputSchema: { type: "object", properties: { path:
|
|
2164
|
+
inputSchema: { type: "object", properties: { path: _chunkMZFZSVUJcjs.TREE_PATH }, required: ["path"], additionalProperties: false },
|
|
2072
2165
|
annotations: { title: "Delete an item or group", ...DESTRUCTIVE },
|
|
2073
2166
|
handler: ({ path }) => {
|
|
2074
2167
|
resolve(controller.removeTreeNode(path));
|
|
@@ -2082,7 +2175,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
2082
2175
|
inputSchema: {
|
|
2083
2176
|
type: "object",
|
|
2084
2177
|
properties: {
|
|
2085
|
-
links: { type: "array", items: { type: "object", properties:
|
|
2178
|
+
links: { type: "array", items: { type: "object", properties: _chunkMZFZSVUJcjs.LINK_PROPS, required: ["source", "target", "value"], additionalProperties: false }, description: "All the flows; [] removes them." },
|
|
2086
2179
|
nodes: { type: "array", items: { type: "string" }, description: "Node names in stacking order (default: as the flows first name them)." }
|
|
2087
2180
|
},
|
|
2088
2181
|
required: ["links"],
|
|
@@ -2117,12 +2210,12 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
2117
2210
|
name: "add_chart_link",
|
|
2118
2211
|
title: "Add a flow",
|
|
2119
2212
|
description: "Adds a flow from one node to another (new names add nodes). Refused when the pair exists already or it would close a loop. Returns its index and the throughput of its two nodes.",
|
|
2120
|
-
inputSchema: { type: "object", properties:
|
|
2213
|
+
inputSchema: { type: "object", properties: _chunkMZFZSVUJcjs.LINK_PROPS, required: ["source", "target", "value"], additionalProperties: false },
|
|
2121
2214
|
annotations: { title: "Add a flow", ...WRITE },
|
|
2122
2215
|
handler: (args) => {
|
|
2123
2216
|
const result = resolve(controller.addLink(args));
|
|
2124
2217
|
const s = spec();
|
|
2125
|
-
const through = (n) => _nullishCoalesce(_optionalChain([s, 'access',
|
|
2218
|
+
const through = (n) => _nullishCoalesce(_optionalChain([s, 'access', _107 => _107.series, 'access', _108 => _108[0], 'optionalAccess', _109 => _109.values, 'access', _110 => _110[s.sankeyNodes.indexOf(n)]]), () => ( 0));
|
|
2126
2219
|
const link = s.links[result.index];
|
|
2127
2220
|
return { index: result.index, link, nodes: [link.source, link.target].map((name) => ({ name, value: through(name) })) };
|
|
2128
2221
|
}
|
|
@@ -2131,7 +2224,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
2131
2224
|
name: "update_chart_link",
|
|
2132
2225
|
title: "Change a flow",
|
|
2133
2226
|
description: "Changes a flow by index: its source, target, value or colour (null goes back to the default). Checked like a new flow. Returns the flow as stored.",
|
|
2134
|
-
inputSchema: { type: "object", properties: { index:
|
|
2227
|
+
inputSchema: { type: "object", properties: { index: _chunkMZFZSVUJcjs.LINK_INDEX, ..._chunkMZFZSVUJcjs.LINK_PROPS, color: { type: ["string", "null"], description: "CSS colour, or null for the default." } }, required: ["index"], additionalProperties: false },
|
|
2135
2228
|
annotations: { title: "Change a flow", ...WRITE_IDEMPOTENT },
|
|
2136
2229
|
handler: ({ index, ...patch }) => {
|
|
2137
2230
|
if (!Object.keys(patch).length) fail2(`Nothing to change: pass source, target, value or color with the index, e.g. {"index": ${index}, "value": 40}.`);
|
|
@@ -2143,13 +2236,37 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
2143
2236
|
name: "remove_chart_link",
|
|
2144
2237
|
title: "Delete a flow",
|
|
2145
2238
|
description: "Deletes a flow by index; the ones after it move up one, and nodes no flow uses any more go. Returns the flows left.",
|
|
2146
|
-
inputSchema: { type: "object", properties: { index:
|
|
2239
|
+
inputSchema: { type: "object", properties: { index: _chunkMZFZSVUJcjs.LINK_INDEX }, required: ["index"], additionalProperties: false },
|
|
2147
2240
|
annotations: { title: "Delete a flow", ...DESTRUCTIVE },
|
|
2148
2241
|
handler: ({ index }) => {
|
|
2149
2242
|
resolve(controller.removeLink(index));
|
|
2150
2243
|
return { links: spec().links };
|
|
2151
2244
|
}
|
|
2152
2245
|
};
|
|
2246
|
+
const setRaceFrame = {
|
|
2247
|
+
name: "set_chart_race_frame",
|
|
2248
|
+
title: "Show a bar race moment",
|
|
2249
|
+
description: "Shows the bar race at a time point (or between two), and stops playback. This is view state like the selection: it is not an undo step and is not saved in the chart. Returns the moment and the ranking shown.",
|
|
2250
|
+
inputSchema: { type: "object", properties: { time: { ..._chunkMZFZSVUJcjs.RACE_TIME, type: ["string", "number", "null"], description: `${_chunkMZFZSVUJcjs.RACE_TIME.description} null shows the last time point.` } }, required: ["time"], additionalProperties: false },
|
|
2251
|
+
annotations: { title: "Show a bar race moment", ...WRITE_IDEMPOTENT },
|
|
2252
|
+
handler: ({ time }) => {
|
|
2253
|
+
const frame = time === null ? null : raceFrameOf(time);
|
|
2254
|
+
resolve(controller.setRaceFrame(frame));
|
|
2255
|
+
return raceAt(frame);
|
|
2256
|
+
}
|
|
2257
|
+
};
|
|
2258
|
+
const playRace = {
|
|
2259
|
+
name: "play_chart_race",
|
|
2260
|
+
title: "Play the bar race",
|
|
2261
|
+
description: "Starts playing the bar race for the user from the moment shown (from the start when it is at the end), one time point every msPerStep ms, and returns at once. set_chart_race_frame stops it. Nothing in the chart changes.",
|
|
2262
|
+
inputSchema: { type: "object", properties: { msPerStep: { type: "number", minimum: 50, maximum: 1e4, description: "Milliseconds per time point (default 1000)." } }, additionalProperties: false },
|
|
2263
|
+
annotations: { title: "Play the bar race", ...WRITE },
|
|
2264
|
+
handler: ({ msPerStep }) => {
|
|
2265
|
+
resolve(controller.playRace({ msPerStep }));
|
|
2266
|
+
const n = spec().categories.length;
|
|
2267
|
+
return { playing: true, from: _nullishCoalesce(controller.getState().raceFrame, () => ( 0)), durationMs: Math.round((n - 1 - (_nullishCoalesce(controller.getState().raceFrame, () => ( 0)))) * (_nullishCoalesce(msPerStep, () => ( 1e3)))) };
|
|
2268
|
+
}
|
|
2269
|
+
};
|
|
2153
2270
|
const applyPreset = {
|
|
2154
2271
|
name: "apply_chart_preset",
|
|
2155
2272
|
title: "Apply a chart style",
|
|
@@ -2157,8 +2274,8 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
2157
2274
|
inputSchema: {
|
|
2158
2275
|
type: "object",
|
|
2159
2276
|
properties: {
|
|
2160
|
-
layout: { type: "string", enum:
|
|
2161
|
-
colors: { type: "string", enum:
|
|
2277
|
+
layout: { type: "string", enum: _chunkV5L2G22Rcjs.CHART_LAYOUT_PRESETS.map((p) => p.id), description: "Quick layout id." },
|
|
2278
|
+
colors: { type: "string", enum: _chunkV5L2G22Rcjs.CHART_COLOR_SCHEMES.map((p) => p.id), description: "Colour scheme id." }
|
|
2162
2279
|
},
|
|
2163
2280
|
additionalProperties: false
|
|
2164
2281
|
},
|
|
@@ -2187,8 +2304,8 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
2187
2304
|
type: "object",
|
|
2188
2305
|
properties: {
|
|
2189
2306
|
kind: { type: "string", enum: ["none", "chart", "title", "subtitle", "legend", "axis", "series", "point", "category", "trendline"], description: "What to select." },
|
|
2190
|
-
series: { ...
|
|
2191
|
-
category: { ...
|
|
2307
|
+
series: { ..._chunkMZFZSVUJcjs.SERIES_REF, description: "Series id or name (series, point, trendline)." },
|
|
2308
|
+
category: { ..._chunkMZFZSVUJcjs.CATEGORY_REF, description: "Category index or label (point, category)." },
|
|
2192
2309
|
axis: { type: "string", enum: ["x", "y", "y2"], description: "Axis (axis)." },
|
|
2193
2310
|
index: { type: "integer", minimum: 0, description: "Trendline index (trendline)." }
|
|
2194
2311
|
},
|
|
@@ -2246,20 +2363,20 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
2246
2363
|
to: { type: "object", description: "End, as fractions of the chart.", properties: { x: { type: "number", minimum: 0, maximum: 1, description: "Fraction of the width." }, y: { type: "number", minimum: 0, maximum: 1, description: "Fraction of the height." } }, required: ["x", "y"], additionalProperties: false },
|
|
2247
2364
|
fine: { type: "boolean", description: "Move a tenth as far (Alt)." },
|
|
2248
2365
|
lockAxis: { type: "boolean", description: "Scatter charts: change only the axis moved along most (Shift)." },
|
|
2249
|
-
width:
|
|
2250
|
-
height:
|
|
2366
|
+
width: _chunkMZFZSVUJcjs.WIDTH,
|
|
2367
|
+
height: _chunkMZFZSVUJcjs.HEIGHT
|
|
2251
2368
|
},
|
|
2252
2369
|
required: ["from", "to"],
|
|
2253
2370
|
additionalProperties: false
|
|
2254
2371
|
},
|
|
2255
2372
|
annotations: { title: "Drag a chart point", ...WRITE },
|
|
2256
2373
|
handler: ({ from, to, fine, lockAxis, width = size.width, height = size.height }) => {
|
|
2257
|
-
const scene =
|
|
2374
|
+
const scene = _chunkUUUTEVX6cjs.layoutChart.call(void 0, controller.toJSON(), { width, height });
|
|
2258
2375
|
const start = { x: from.x * width, y: from.y * height };
|
|
2259
2376
|
const target = chartHitTest(scene, start);
|
|
2260
|
-
if (_optionalChain([target, 'optionalAccess',
|
|
2377
|
+
if (_optionalChain([target, 'optionalAccess', _111 => _111.kind]) !== "point") fail2(`There is no bar or point at (${from.x}, ${from.y}); ${target ? `that is the ${target.kind}` : "that is outside the chart"}. Use render_chart to find marks.`);
|
|
2261
2378
|
const t = target;
|
|
2262
|
-
const before = _nullishCoalesce(_optionalChain([controller, 'access',
|
|
2379
|
+
const before = _nullishCoalesce(_optionalChain([controller, 'access', _112 => _112.getSeries, 'call', _113 => _113(t.seriesId), 'optionalAccess', _114 => _114.values, 'access', _115 => _115[t.index]]), () => ( null));
|
|
2263
2380
|
const session = startChartPointDrag(controller, scene, t, start);
|
|
2264
2381
|
if (!session) fail2("That point cannot be dragged here (percent-stacked charts, pies and gaps cannot be dragged).");
|
|
2265
2382
|
session.move({ x: to.x * width, y: to.y * height }, { fine, lockAxis });
|
|
@@ -2284,10 +2401,10 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
2284
2401
|
},
|
|
2285
2402
|
annotations: { title: "Press a key on the chart", ...DESTRUCTIVE },
|
|
2286
2403
|
handler: ({ key: k, shift, alt }) => {
|
|
2287
|
-
const scene =
|
|
2404
|
+
const scene = _chunkUUUTEVX6cjs.layoutChart.call(void 0, controller.toJSON(), size);
|
|
2288
2405
|
const used = handleChartKey(controller, scene, { key: k, shiftKey: shift, altKey: alt });
|
|
2289
2406
|
const sel = controller.getState().selection;
|
|
2290
|
-
const value = _optionalChain([sel, 'optionalAccess',
|
|
2407
|
+
const value = _optionalChain([sel, 'optionalAccess', _116 => _116.kind]) === "point" ? _nullishCoalesce(_optionalChain([controller, 'access', _117 => _117.getSeries, 'call', _118 => _118(sel.seriesId), 'optionalAccess', _119 => _119.values, 'access', _120 => _120[sel.index]]), () => ( null)) : void 0;
|
|
2291
2408
|
return { used, selection: sel, ...value !== void 0 ? { value } : {} };
|
|
2292
2409
|
}
|
|
2293
2410
|
};
|
|
@@ -2315,7 +2432,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
2315
2432
|
return { redone, ...redone ? { label } : {} };
|
|
2316
2433
|
}
|
|
2317
2434
|
};
|
|
2318
|
-
const reads = [getChart, renderChart, checkColors, recommend, getTrendline, listPresets, exportMermaid, exportOoxml];
|
|
2435
|
+
const reads = [getChart, renderChart, checkColors, recommend, getTrendline, raceRanking, listPresets, exportMermaid, exportOoxml];
|
|
2319
2436
|
const writes = [
|
|
2320
2437
|
updateChart,
|
|
2321
2438
|
setData,
|
|
@@ -2347,6 +2464,8 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
2347
2464
|
addLink,
|
|
2348
2465
|
updateLink,
|
|
2349
2466
|
removeLink,
|
|
2467
|
+
setRaceFrame,
|
|
2468
|
+
playRace,
|
|
2350
2469
|
applyPreset,
|
|
2351
2470
|
transpose,
|
|
2352
2471
|
select,
|
|
@@ -2359,7 +2478,7 @@ function createChartToolProvider(controller, options = {}) {
|
|
|
2359
2478
|
id: _nullishCoalesce(options.id, () => ( "chart")),
|
|
2360
2479
|
namespace: options.namespace,
|
|
2361
2480
|
title: "Chart editor",
|
|
2362
|
-
description: "One chart: its spec, data and values, series and categories, trendlines, reference lines and bands, callouts, highlight, grouped data, flows and presets, CSV, Mermaid and OOXML import, rendering and colour checks.",
|
|
2481
|
+
description: "One chart: its spec, data and values, series and categories, trendlines, reference lines and bands, callouts, highlight, grouped data, flows, bar race playback and presets, CSV, Mermaid and OOXML import, rendering and colour checks.",
|
|
2363
2482
|
skill: "pixerate-chart",
|
|
2364
2483
|
tools: () => {
|
|
2365
2484
|
if (readOnlyReason()) return reads;
|
|
@@ -2433,12 +2552,12 @@ var ChartStream = (_class = class {
|
|
|
2433
2552
|
if (format === "json") {
|
|
2434
2553
|
const value = complete ? safeParse(text) : parsePartialChartJson(text);
|
|
2435
2554
|
if (value !== void 0) {
|
|
2436
|
-
const read =
|
|
2555
|
+
const read = _chunkBPX4Z3N3cjs.normalizeChartSpec.call(void 0, value);
|
|
2437
2556
|
spec = read.spec;
|
|
2438
2557
|
issues = complete ? read.issues : [];
|
|
2439
2558
|
}
|
|
2440
2559
|
} else {
|
|
2441
|
-
const read =
|
|
2560
|
+
const read = _chunkV5L2G22Rcjs.chartFromMermaid.call(void 0, text, { partial: !complete });
|
|
2442
2561
|
if (read.family) {
|
|
2443
2562
|
spec = read.spec;
|
|
2444
2563
|
issues = complete ? read.issues : [];
|
|
@@ -2535,7 +2654,7 @@ function elements(root, localName) {
|
|
|
2535
2654
|
}
|
|
2536
2655
|
function relId(el, localName = "id") {
|
|
2537
2656
|
for (const a of Array.from(el.attributes)) {
|
|
2538
|
-
if (a.localName === localName && (_optionalChain([a, 'access',
|
|
2657
|
+
if (a.localName === localName && (_optionalChain([a, 'access', _121 => _121.namespaceURI, 'optionalAccess', _122 => _122.includes, 'call', _123 => _123("relationships")]) || a.prefix === "r")) return a.value;
|
|
2539
2658
|
}
|
|
2540
2659
|
return void 0;
|
|
2541
2660
|
}
|
|
@@ -2554,17 +2673,17 @@ async function readRels(r, partPath) {
|
|
|
2554
2673
|
const id = rel.getAttribute("Id");
|
|
2555
2674
|
if (!id) continue;
|
|
2556
2675
|
const target = _nullishCoalesce(rel.getAttribute("Target"), () => ( ""));
|
|
2557
|
-
const external = _optionalChain([rel, 'access',
|
|
2676
|
+
const external = _optionalChain([rel, 'access', _124 => _124.getAttribute, 'call', _125 => _125("TargetMode"), 'optionalAccess', _126 => _126.toLowerCase, 'call', _127 => _127()]) === "external";
|
|
2558
2677
|
rels.set(id, { type: _nullishCoalesce(rel.getAttribute("Type"), () => ( "")), target: external ? target : resolvePartPath(dirname(partPath), target), external });
|
|
2559
2678
|
}
|
|
2560
2679
|
return rels;
|
|
2561
2680
|
}
|
|
2562
|
-
var isChartRef = (el) => el.localName === "chart" && (el.namespaceURI ===
|
|
2681
|
+
var isChartRef = (el) => el.localName === "chart" && (el.namespaceURI === _chunkSZWVMB3Bcjs.CHART_OOXML_NS || el.namespaceURI === STRICT_CHART_NS || el.namespaceURI === CHARTEX_NS);
|
|
2563
2682
|
function frameName(ref) {
|
|
2564
2683
|
for (let el = ref.parentElement; el; el = el.parentElement) {
|
|
2565
2684
|
if (el.localName === "graphicFrame") {
|
|
2566
2685
|
const nv = elements(el, "cNvPr")[0];
|
|
2567
|
-
return _optionalChain([nv, 'optionalAccess',
|
|
2686
|
+
return _optionalChain([nv, 'optionalAccess', _128 => _128.getAttribute, 'call', _129 => _129("name")]) || void 0;
|
|
2568
2687
|
}
|
|
2569
2688
|
}
|
|
2570
2689
|
return void 0;
|
|
@@ -2578,7 +2697,7 @@ async function chartsInPart(r, root, rels, place) {
|
|
|
2578
2697
|
const entry = r.zip.get(rel.target);
|
|
2579
2698
|
if (!entry) continue;
|
|
2580
2699
|
r.seen.add(rel.target);
|
|
2581
|
-
const read =
|
|
2700
|
+
const read = _chunkSZWVMB3Bcjs.chartFromOoxml.call(void 0, await r.zip.readText(entry), { DOMParser: r.Parser });
|
|
2582
2701
|
const name = frameName(ref);
|
|
2583
2702
|
r.charts.push({
|
|
2584
2703
|
id: `chart-${r.charts.length + 1}`,
|
|
@@ -2600,8 +2719,8 @@ function columnName(index) {
|
|
|
2600
2719
|
return name;
|
|
2601
2720
|
}
|
|
2602
2721
|
function anchorCell(marker) {
|
|
2603
|
-
const col = Number(_optionalChain([firstChild, 'call',
|
|
2604
|
-
const row = Number(_optionalChain([firstChild, 'call',
|
|
2722
|
+
const col = Number(_optionalChain([firstChild, 'call', _130 => _130(marker, "col"), 'optionalAccess', _131 => _131.textContent]));
|
|
2723
|
+
const row = Number(_optionalChain([firstChild, 'call', _132 => _132(marker, "row"), 'optionalAccess', _133 => _133.textContent]));
|
|
2605
2724
|
return Number.isInteger(col) && Number.isInteger(row) && col >= 0 && row >= 0 ? `${columnName(col)}${row + 1}` : void 0;
|
|
2606
2725
|
}
|
|
2607
2726
|
function drawingPlace(ref) {
|
|
@@ -2764,7 +2883,7 @@ function createOfficeChartToolProvider(options = {}) {
|
|
|
2764
2883
|
description: "Lists the Office files the user opened that charts can be read from. Returns their names and sizes in bytes.",
|
|
2765
2884
|
inputSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
2766
2885
|
annotations: { title: "List open files", ...READ2 },
|
|
2767
|
-
handler: () => ({ files: (_nullishCoalesce(_optionalChain([options, 'access',
|
|
2886
|
+
handler: () => ({ files: (_nullishCoalesce(_optionalChain([options, 'access', _134 => _134.files, 'optionalCall', _135 => _135()]), () => ( []))).map((f) => ({ name: f.name, bytes: f.data.byteLength })) })
|
|
2768
2887
|
};
|
|
2769
2888
|
const listCharts = {
|
|
2770
2889
|
name: "list_file_charts",
|
|
@@ -2849,17 +2968,17 @@ var COLOR = { type: "string", minLength: 1, description: 'A CSS colour (hex or r
|
|
|
2849
2968
|
function chartColors(spec) {
|
|
2850
2969
|
const out = [];
|
|
2851
2970
|
const visible = spec.series.map((s, i) => ({ s, i })).filter(({ s }) => !s.hidden);
|
|
2852
|
-
if (
|
|
2971
|
+
if (_chunkBPX4Z3N3cjs.chartColorsByCategory.call(void 0, spec.type)) {
|
|
2853
2972
|
const first = visible[0];
|
|
2854
2973
|
spec.categories.forEach((name, index) => {
|
|
2855
|
-
const color = _optionalChain([first, 'optionalAccess',
|
|
2974
|
+
const color = _optionalChain([first, 'optionalAccess', _136 => _136.s, 'access', _137 => _137.pointColors, 'optionalAccess', _138 => _138[index]]) || _chunkBPX4Z3N3cjs.chartSliceColor.call(void 0, spec, index);
|
|
2856
2975
|
out.push({ color, label: `Slice "${name}"`, target: first ? { kind: "point", seriesId: first.s.id, index } : { kind: "category", index } });
|
|
2857
2976
|
});
|
|
2858
2977
|
return out;
|
|
2859
2978
|
}
|
|
2860
2979
|
for (const { s, i } of visible) {
|
|
2861
|
-
out.push({ color:
|
|
2862
|
-
_optionalChain([s, 'access',
|
|
2980
|
+
out.push({ color: _chunkBPX4Z3N3cjs.chartSeriesColor.call(void 0, spec, i), label: `Series "${s.name}"`, target: { kind: "series", seriesId: s.id } });
|
|
2981
|
+
_optionalChain([s, 'access', _139 => _139.pointColors, 'optionalAccess', _140 => _140.forEach, 'call', _141 => _141((c, index) => {
|
|
2863
2982
|
if (c) out.push({ color: c, label: `Point ${index + 1} of "${s.name}"`, target: { kind: "point", seriesId: s.id, index } });
|
|
2864
2983
|
})]);
|
|
2865
2984
|
}
|
|
@@ -2867,7 +2986,7 @@ function chartColors(spec) {
|
|
|
2867
2986
|
}
|
|
2868
2987
|
var paletteOf = (profile) => {
|
|
2869
2988
|
const palette = profile.palette;
|
|
2870
|
-
if (!_optionalChain([palette, 'optionalAccess',
|
|
2989
|
+
if (!_optionalChain([palette, 'optionalAccess', _142 => _142.length])) throw new Error("the profile has no palette.");
|
|
2871
2990
|
return palette;
|
|
2872
2991
|
};
|
|
2873
2992
|
var paletteOnly = {
|
|
@@ -2880,18 +2999,18 @@ var paletteOnly = {
|
|
|
2880
2999
|
},
|
|
2881
3000
|
run(spec, profile, { tolerance = 0.02 }) {
|
|
2882
3001
|
const palette = paletteOf(profile);
|
|
2883
|
-
const allowed = palette.flatMap((c) =>
|
|
3002
|
+
const allowed = palette.flatMap((c) => _chunkBPX4Z3N3cjs.CHART_PALETTE_SHADES.map((t) => _chunkBPX4Z3N3cjs.shadeChartColor.call(void 0, c, t))).map((c) => ({ c, rgb: _chunkBPX4Z3N3cjs.parseChartColor.call(void 0, c) }));
|
|
2884
3003
|
return chartColors(spec).flatMap(({ color, label, target }) => {
|
|
2885
|
-
const rgb =
|
|
3004
|
+
const rgb = _chunkBPX4Z3N3cjs.parseChartColor.call(void 0, color);
|
|
2886
3005
|
if (!rgb) return [];
|
|
2887
3006
|
let best = { c: palette[0], d: Infinity };
|
|
2888
3007
|
for (const a of allowed) {
|
|
2889
3008
|
if (!a.rgb) continue;
|
|
2890
|
-
const d =
|
|
3009
|
+
const d = _chunkBPX4Z3N3cjs.chartColorDistance.call(void 0, rgb, a.rgb);
|
|
2891
3010
|
if (d < best.d) best = { c: a.c, d };
|
|
2892
3011
|
}
|
|
2893
3012
|
if (best.d <= tolerance) return [];
|
|
2894
|
-
const nearest = palette.map((c) => ({ c, d:
|
|
3013
|
+
const nearest = palette.map((c) => ({ c, d: _chunkBPX4Z3N3cjs.parseChartColor.call(void 0, c) ? _chunkBPX4Z3N3cjs.chartColorDistance.call(void 0, rgb, _chunkBPX4Z3N3cjs.parseChartColor.call(void 0, c)) : Infinity })).sort((a, b) => a.d - b.d)[0].c;
|
|
2895
3014
|
return [{ severity: "error", message: `${label} uses ${color}, which is not in the house palette; use ${nearest} or another palette colour (${palette.join(", ")}).`, target }];
|
|
2896
3015
|
});
|
|
2897
3016
|
}
|
|
@@ -2905,8 +3024,8 @@ var distinguishable = {
|
|
|
2905
3024
|
additionalProperties: false
|
|
2906
3025
|
},
|
|
2907
3026
|
run(spec, _profile, { minDistance = 0.08 }) {
|
|
2908
|
-
const colors = chartColors(spec).filter((c) => c.target.kind !== "point" ||
|
|
2909
|
-
const result =
|
|
3027
|
+
const colors = chartColors(spec).filter((c) => c.target.kind !== "point" || _chunkBPX4Z3N3cjs.chartColorsByCategory.call(void 0, spec.type));
|
|
3028
|
+
const result = _chunkBPX4Z3N3cjs.checkChartColors.call(void 0, colors.map((c) => c.color), { minDistance, minContrast: 0 });
|
|
2910
3029
|
const findings = [];
|
|
2911
3030
|
for (const [vision, pair] of Object.entries(result.closest)) {
|
|
2912
3031
|
if (!pair || pair.distance >= minDistance) continue;
|
|
@@ -2932,7 +3051,7 @@ var minContrast = {
|
|
|
2932
3051
|
const theme = _nullishCoalesce(profile.theme, () => ( {}));
|
|
2933
3052
|
const background = theme.background && theme.background !== "transparent" ? theme.background : _nullishCoalesce(theme.surface, () => ( "#ffffff"));
|
|
2934
3053
|
return chartColors(spec).flatMap(({ color, label, target }) => {
|
|
2935
|
-
const r =
|
|
3054
|
+
const r = _chunkBPX4Z3N3cjs.chartContrastRatio.call(void 0, color, background);
|
|
2936
3055
|
if (r === null || r >= ratio) return [];
|
|
2937
3056
|
return [{ severity: "warning", message: `${label} (${color}) has contrast ${Math.round(r * 100) / 100}:1 against the background ${background}; want at least ${ratio}:1, so use a darker or lighter palette colour.`, target }];
|
|
2938
3057
|
});
|
|
@@ -2961,8 +3080,8 @@ var chartStyleDomain = {
|
|
|
2961
3080
|
type: "object",
|
|
2962
3081
|
properties: {
|
|
2963
3082
|
palette: { type: "array", items: COLOR, minItems: 1, description: "Series colours in order." },
|
|
2964
|
-
colorSchemes: { type: "array", items: { type: "string", enum:
|
|
2965
|
-
layouts: { type: "array", items: { type: "string", enum:
|
|
3083
|
+
colorSchemes: { type: "array", items: { type: "string", enum: _chunkV5L2G22Rcjs.CHART_COLOR_SCHEMES.map((s) => s.id) }, description: "Colour scheme ids allowed besides the palette (empty: none)." },
|
|
3084
|
+
layouts: { type: "array", items: { type: "string", enum: _chunkV5L2G22Rcjs.CHART_LAYOUT_PRESETS.map((p) => p.id) }, description: "Layout preset ids allowed." },
|
|
2966
3085
|
theme: {
|
|
2967
3086
|
type: "object",
|
|
2968
3087
|
properties: {
|
|
@@ -3001,7 +3120,7 @@ var chartStyleDomain = {
|
|
|
3001
3120
|
};
|
|
3002
3121
|
function chartStylePatch(profile) {
|
|
3003
3122
|
const p = profile;
|
|
3004
|
-
return { ..._nullishCoalesce(p.defaults, () => ( {})), ..._optionalChain([p, 'access',
|
|
3123
|
+
return { ..._nullishCoalesce(p.defaults, () => ( {})), ..._optionalChain([p, 'access', _143 => _143.palette, 'optionalAccess', _144 => _144.length]) ? { palette: [...p.palette] } : {} };
|
|
3005
3124
|
}
|
|
3006
3125
|
function createChartStyleToolProvider(controller, styles, options = {}) {
|
|
3007
3126
|
if (!styles.domains.some((d) => d.id === "chart")) throw new Error('The style resolver has no "chart" domain; add chartStyleDomain to its domains.');
|
|
@@ -3234,4 +3353,7 @@ function createChartStyleToolProvider(controller, styles, options = {}) {
|
|
|
3234
3353
|
|
|
3235
3354
|
|
|
3236
3355
|
|
|
3237
|
-
exports.CHART_AXIS_KINDS = _chunkUVXTOZ2Bcjs.CHART_AXIS_KINDS; exports.CHART_AXIS_SCALES = _chunkUVXTOZ2Bcjs.CHART_AXIS_SCALES; exports.CHART_COLOR_SCHEMES = _chunkIMRXC7OAcjs.CHART_COLOR_SCHEMES; exports.CHART_CURVES = _chunkUVXTOZ2Bcjs.CHART_CURVES; exports.CHART_DATE_STEPS = _chunkQO2T6KA5cjs.CHART_DATE_STEPS; exports.CHART_ERROR_BAR_DIRECTIONS = _chunkUVXTOZ2Bcjs.CHART_ERROR_BAR_DIRECTIONS; exports.CHART_ERROR_BAR_LABELS = _chunkUVXTOZ2Bcjs.CHART_ERROR_BAR_LABELS; exports.CHART_ERROR_BAR_TYPES = _chunkUVXTOZ2Bcjs.CHART_ERROR_BAR_TYPES; exports.CHART_LABEL_POSITIONS = _chunkUVXTOZ2Bcjs.CHART_LABEL_POSITIONS; exports.CHART_LAYOUT_PRESETS = _chunkIMRXC7OAcjs.CHART_LAYOUT_PRESETS; exports.CHART_LEGEND_POSITIONS = _chunkUVXTOZ2Bcjs.CHART_LEGEND_POSITIONS; exports.CHART_LIKERT_NEUTRALS = _chunkUVXTOZ2Bcjs.CHART_LIKERT_NEUTRALS; exports.CHART_LIKERT_SORTS = _chunkUVXTOZ2Bcjs.CHART_LIKERT_SORTS; exports.CHART_MARKERS = _chunkUVXTOZ2Bcjs.CHART_MARKERS; exports.CHART_MERMAID_META_PREFIX = _chunkIMRXC7OAcjs.CHART_MERMAID_META_PREFIX; exports.CHART_NUMBER_STYLES = _chunkUVXTOZ2Bcjs.CHART_NUMBER_STYLES; exports.CHART_OOXML_CONTENT_TYPE = _chunkQ25WAFTDcjs.CHART_OOXML_CONTENT_TYPE; exports.CHART_OOXML_NS = _chunkQ25WAFTDcjs.CHART_OOXML_NS; exports.CHART_OOXML_RELATIONSHIP = _chunkQ25WAFTDcjs.CHART_OOXML_RELATIONSHIP; exports.CHART_ORIENTATIONS = _chunkUVXTOZ2Bcjs.CHART_ORIENTATIONS; exports.CHART_PALETTE_SHADES = _chunkUVXTOZ2Bcjs.CHART_PALETTE_SHADES; exports.CHART_PRESENCE_COLORS = CHART_PRESENCE_COLORS; exports.CHART_RADAR_GRATICULES = _chunkUVXTOZ2Bcjs.CHART_RADAR_GRATICULES; exports.CHART_RASTER_MAX_SIZE = CHART_RASTER_MAX_SIZE; exports.CHART_REFERENCE_AXES = _chunkUVXTOZ2Bcjs.CHART_REFERENCE_AXES; exports.CHART_SANKEY_LINK_COLORS = _chunkUVXTOZ2Bcjs.CHART_SANKEY_LINK_COLORS; exports.CHART_SERIES_TYPES = _chunkUVXTOZ2Bcjs.CHART_SERIES_TYPES; exports.CHART_STACKINGS = _chunkUVXTOZ2Bcjs.CHART_STACKINGS; exports.CHART_TRENDLINE_TYPES = _chunkUVXTOZ2Bcjs.CHART_TRENDLINE_TYPES; exports.CHART_TYPES = _chunkUVXTOZ2Bcjs.CHART_TYPES; exports.CHART_TYPE_LABELS = _chunkUVXTOZ2Bcjs.CHART_TYPE_LABELS; exports.CSS_VARIABLE_CHART_THEME = _chunkUVXTOZ2Bcjs.CSS_VARIABLE_CHART_THEME; exports.ChartController = _chunkIMRXC7OAcjs.ChartController; exports.ChartDirector = ChartDirector; exports.ChartPresence = ChartPresence; exports.ChartStream = ChartStream; exports.DEFAULT_CHART_PALETTE = _chunkUVXTOZ2Bcjs.DEFAULT_CHART_PALETTE; exports.DEFAULT_CHART_THEME = _chunkUVXTOZ2Bcjs.DEFAULT_CHART_THEME; exports.MAX_CHART_DATA_LABELS = _chunkQO2T6KA5cjs.MAX_CHART_DATA_LABELS; exports.MAX_CHART_LINE_POINTS = _chunkQO2T6KA5cjs.MAX_CHART_LINE_POINTS; exports.MAX_CHART_LINKS = _chunkUVXTOZ2Bcjs.MAX_CHART_LINKS; exports.MAX_CHART_MARKERS = _chunkQO2T6KA5cjs.MAX_CHART_MARKERS; exports.MAX_CHART_TREE_DEPTH = _chunkUVXTOZ2Bcjs.MAX_CHART_TREE_DEPTH; exports.MAX_CHART_TREE_NODES = _chunkUVXTOZ2Bcjs.MAX_CHART_TREE_NODES; exports.OfficeChartsError = OfficeChartsError; exports.RENDER_CHART_INSTRUCTIONS = RENDER_CHART_INSTRUCTIONS; exports.addChartLink = _chunkUVXTOZ2Bcjs.addChartLink; exports.addChartTreeRow = _chunkUVXTOZ2Bcjs.addChartTreeRow; exports.analyzeChartTable = analyzeChartTable; exports.blendChartScenes = blendChartScenes; exports.canDragChartPoint = canDragChartPoint; exports.chartBoxStats = _chunkQO2T6KA5cjs.chartBoxStats; exports.chartClientToScene = chartClientToScene; exports.chartColorDistance = _chunkUVXTOZ2Bcjs.chartColorDistance; exports.chartColorInputValue = _chunkUVXTOZ2Bcjs.chartColorInputValue; exports.chartColorsByCategory = _chunkUVXTOZ2Bcjs.chartColorsByCategory; exports.chartContrastRatio = _chunkUVXTOZ2Bcjs.chartContrastRatio; exports.chartDataFromTable = _chunkUVXTOZ2Bcjs.chartDataFromTable; exports.chartDataToTable = _chunkUVXTOZ2Bcjs.chartDataToTable; exports.chartDateLabels = _chunkQO2T6KA5cjs.chartDateLabels; exports.chartDateToSerial = _chunkQO2T6KA5cjs.chartDateToSerial; exports.chartErrorAmounts = _chunkUVXTOZ2Bcjs.chartErrorAmounts; exports.chartErrorBarsOfType = _chunkUVXTOZ2Bcjs.chartErrorBarsOfType; exports.chartFamily = _chunkUVXTOZ2Bcjs.chartFamily; exports.chartFileName = chartFileName; exports.chartFormatToCode = _chunkQ25WAFTDcjs.chartFormatToCode; exports.chartFromMermaid = _chunkIMRXC7OAcjs.chartFromMermaid; exports.chartFromOoxml = _chunkQ25WAFTDcjs.chartFromOoxml; exports.chartFromTable = chartFromTable; exports.chartHistogram = _chunkQO2T6KA5cjs.chartHistogram; exports.chartHitTest = chartHitTest; exports.chartLikertColor = _chunkUVXTOZ2Bcjs.chartLikertColor; exports.chartLinksFromTable = _chunkUVXTOZ2Bcjs.chartLinksFromTable; exports.chartLuminance = _chunkUVXTOZ2Bcjs.chartLuminance; exports.chartMermaidFamily = _chunkIMRXC7OAcjs.chartMermaidFamily; exports.chartMovingAverage = _chunkQO2T6KA5cjs.chartMovingAverage; exports.chartPointAnchor = chartPointAnchor; exports.chartPointColor = _chunkUVXTOZ2Bcjs.chartPointColor; exports.chartPointRef = chartPointRef; exports.chartPresetPatch = _chunkIMRXC7OAcjs.chartPresetPatch; exports.chartQuantile = _chunkQO2T6KA5cjs.chartQuantile; exports.chartRasterSize = chartRasterSize; exports.chartRgbToHex = _chunkUVXTOZ2Bcjs.chartRgbToHex; exports.chartRgbToOklab = _chunkUVXTOZ2Bcjs.chartRgbToOklab; exports.chartSankeyNodeValues = _chunkUVXTOZ2Bcjs.chartSankeyNodeValues; exports.chartSankeyNodes = _chunkUVXTOZ2Bcjs.chartSankeyNodes; exports.chartScaleFromPixel = _chunkQO2T6KA5cjs.chartScaleFromPixel; exports.chartScaleToPixel = _chunkQO2T6KA5cjs.chartScaleToPixel; exports.chartSceneToDomSpec = _chunkIMRXC7OAcjs.chartSceneToDomSpec; exports.chartSceneToSvg = _chunkIMRXC7OAcjs.chartSceneToSvg; exports.chartSerialToDate = _chunkQO2T6KA5cjs.chartSerialToDate; exports.chartSeriesColor = _chunkUVXTOZ2Bcjs.chartSeriesColor; exports.chartSeriesType = _chunkUVXTOZ2Bcjs.chartSeriesType; exports.chartSliceColor = _chunkUVXTOZ2Bcjs.chartSliceColor; exports.chartSpecColorsByCategory = _chunkUVXTOZ2Bcjs.chartSpecColorsByCategory; exports.chartSquarify = _chunkQO2T6KA5cjs.chartSquarify; exports.chartStyleDomain = chartStyleDomain; exports.chartStylePatch = chartStylePatch; exports.chartSupportsTrendlines = _chunkQO2T6KA5cjs.chartSupportsTrendlines; exports.chartTextBaseline = _chunkIMRXC7OAcjs.chartTextBaseline; exports.chartTextOn = _chunkUVXTOZ2Bcjs.chartTextOn; exports.chartTextTransform = _chunkIMRXC7OAcjs.chartTextTransform; exports.chartToMermaid = _chunkIMRXC7OAcjs.chartToMermaid; exports.chartToOoxml = _chunkQ25WAFTDcjs.chartToOoxml; exports.chartToSvg = _chunkIMRXC7OAcjs.chartToSvg; exports.chartTreeColumnLabels = _chunkUVXTOZ2Bcjs.chartTreeColumnLabels; exports.chartTreeDepth = _chunkUVXTOZ2Bcjs.chartTreeDepth; exports.chartTreeFromRows = _chunkUVXTOZ2Bcjs.chartTreeFromRows; exports.chartTreeFromSeries = _chunkUVXTOZ2Bcjs.chartTreeFromSeries; exports.chartTreeFromTable = _chunkUVXTOZ2Bcjs.chartTreeFromTable; exports.chartTreeToRows = _chunkUVXTOZ2Bcjs.chartTreeToRows; exports.chartTreeTotal = _chunkUVXTOZ2Bcjs.chartTreeTotal; exports.chartTrendlineName = _chunkQO2T6KA5cjs.chartTrendlineName; exports.chartValueAtPoint = _chunkQO2T6KA5cjs.chartValueAtPoint; exports.chartVariesColors = _chunkUVXTOZ2Bcjs.chartVariesColors; exports.chartXAtPoint = _chunkQO2T6KA5cjs.chartXAtPoint; exports.checkChartColors = _chunkUVXTOZ2Bcjs.checkChartColors; exports.cloneChartSeries = _chunkUVXTOZ2Bcjs.cloneChartSeries; exports.cloneChartSpec = _chunkUVXTOZ2Bcjs.cloneChartSpec; exports.cloneChartTree = _chunkUVXTOZ2Bcjs.cloneChartTree; exports.compileChartFormatCode = _chunkQO2T6KA5cjs.compileChartFormatCode; exports.contrastingTextColor = _chunkQO2T6KA5cjs.contrastingTextColor; exports.createChartCommands = createChartCommands; exports.createChartController = _chunkIMRXC7OAcjs.createChartController; exports.createChartEditorDocument = createChartEditorDocument; exports.createChartRasterizer = createChartRasterizer; exports.createChartSpec = _chunkUVXTOZ2Bcjs.createChartSpec; exports.createChartStyleToolProvider = createChartStyleToolProvider; exports.createChartToolProvider = createChartToolProvider; exports.createInstantChartClock = createInstantChartClock; exports.createOfficeChartToolProvider = createOfficeChartToolProvider; exports.cyclePaletteColor = _chunkUVXTOZ2Bcjs.cyclePaletteColor; exports.decimateChartPoints = _chunkQO2T6KA5cjs.decimateChartPoints; exports.defaultChartAxis = _chunkUVXTOZ2Bcjs.defaultChartAxis; exports.defaultChartErrorBarValue = _chunkUVXTOZ2Bcjs.defaultChartErrorBarValue; exports.describeChart = _chunkIMRXC7OAcjs.describeChart; exports.describeChartErrorBars = _chunkUVXTOZ2Bcjs.describeChartErrorBars; exports.describeChartSelection = describeChartSelection; exports.describeOfficeChartPlace = describeOfficeChartPlace; exports.downloadChartPng = downloadChartPng; exports.easeChartTween = easeChartTween; exports.estimateChartTextWidth = _chunkQO2T6KA5cjs.estimateChartTextWidth; exports.extractDocxCharts = extractDocxCharts; exports.extractOfficeCharts = extractOfficeCharts; exports.extractPptxCharts = extractPptxCharts; exports.extractXlsxCharts = extractXlsxCharts; exports.findChartTreeNode = _chunkUVXTOZ2Bcjs.findChartTreeNode; exports.findMermaidCharts = _chunkIMRXC7OAcjs.findMermaidCharts; exports.fitChartTrendline = _chunkQO2T6KA5cjs.fitChartTrendline; exports.formatChartAmountList = _chunkUVXTOZ2Bcjs.formatChartAmountList; exports.formatChartDate = _chunkQO2T6KA5cjs.formatChartDate; exports.formatChartNumber = _chunkQO2T6KA5cjs.formatChartNumber; exports.formatChartValueWithCode = _chunkQO2T6KA5cjs.formatChartValueWithCode; exports.handleChartKey = handleChartKey; exports.isCartesianChart = _chunkUVXTOZ2Bcjs.isCartesianChart; exports.isXyChart = _chunkUVXTOZ2Bcjs.isXyChart; exports.layoutChart = _chunkQO2T6KA5cjs.layoutChart; exports.layoutSparkline = _chunkIMRXC7OAcjs.layoutSparkline; exports.linearMap = _chunkQO2T6KA5cjs.linearMap; exports.locateChartPoint = locateChartPoint; exports.monochromeChartPalette = _chunkIMRXC7OAcjs.monochromeChartPalette; exports.niceLogScale = _chunkQO2T6KA5cjs.niceLogScale; exports.niceScale = _chunkQO2T6KA5cjs.niceScale; exports.niceStep = _chunkQO2T6KA5cjs.niceStep; exports.normalizeChartAxis = _chunkUVXTOZ2Bcjs.normalizeChartAxis; exports.normalizeChartErrorBars = _chunkUVXTOZ2Bcjs.normalizeChartErrorBars; exports.normalizeChartLinks = _chunkUVXTOZ2Bcjs.normalizeChartLinks; exports.normalizeChartReferenceBand = _chunkUVXTOZ2Bcjs.normalizeChartReferenceBand; exports.normalizeChartReferenceLine = _chunkUVXTOZ2Bcjs.normalizeChartReferenceLine; exports.normalizeChartSpec = _chunkUVXTOZ2Bcjs.normalizeChartSpec; exports.normalizeChartTree = _chunkUVXTOZ2Bcjs.normalizeChartTree; exports.normalizeChartTrendline = _chunkUVXTOZ2Bcjs.normalizeChartTrendline; exports.normalizeChartValues = _chunkUVXTOZ2Bcjs.normalizeChartValues; exports.parseChartAmountList = _chunkUVXTOZ2Bcjs.parseChartAmountList; exports.parseChartColor = _chunkUVXTOZ2Bcjs.parseChartColor; exports.parseChartDate = _chunkQO2T6KA5cjs.parseChartDate; exports.parseChartValue = _chunkUVXTOZ2Bcjs.parseChartValue; exports.parsePartialChartJson = parsePartialChartJson; exports.planChartCommand = planChartCommand; exports.planChartToolPlayback = planChartToolPlayback; exports.rasterizeChartSvg = rasterizeChartSvg; exports.realChartClock = realChartClock; exports.recommendChartTypes = recommendChartTypes; exports.recommendForShape = recommendForShape; exports.removeChartTreeRow = _chunkUVXTOZ2Bcjs.removeChartTreeRow; exports.resolveChartSvgPaints = resolveChartSvgPaints; exports.sameChartSelection = _chunkQO2T6KA5cjs.sameChartSelection; exports.setChartLinkField = _chunkUVXTOZ2Bcjs.setChartLinkField; exports.setChartTreeRowName = _chunkUVXTOZ2Bcjs.setChartTreeRowName; exports.setChartTreeRowValue = _chunkUVXTOZ2Bcjs.setChartTreeRowValue; exports.shadeChartColor = _chunkUVXTOZ2Bcjs.shadeChartColor; exports.simulateChartVision = _chunkUVXTOZ2Bcjs.simulateChartVision; exports.snapChartDragValue = snapChartDragValue; exports.snapChartValue = _chunkQO2T6KA5cjs.snapChartValue; exports.sparklineToSvg = _chunkIMRXC7OAcjs.sparklineToSvg; exports.startChartPointDrag = startChartPointDrag; exports.stepDecimals = _chunkQO2T6KA5cjs.stepDecimals; exports.suggestChartReferences = _chunkQO2T6KA5cjs.suggestChartReferences; exports.summarizeChart = _chunkIMRXC7OAcjs.summarizeChart; exports.summarizeChartSeries = _chunkQO2T6KA5cjs.summarizeChartSeries; exports.trendNumberText = _chunkQO2T6KA5cjs.trendNumberText; exports.uniqueChartSeriesId = _chunkUVXTOZ2Bcjs.uniqueChartSeriesId; exports.withChartPlayback = withChartPlayback;
|
|
3356
|
+
|
|
3357
|
+
|
|
3358
|
+
|
|
3359
|
+
exports.CHART_AXIS_KINDS = _chunkBPX4Z3N3cjs.CHART_AXIS_KINDS; exports.CHART_AXIS_SCALES = _chunkBPX4Z3N3cjs.CHART_AXIS_SCALES; exports.CHART_COLOR_SCHEMES = _chunkV5L2G22Rcjs.CHART_COLOR_SCHEMES; exports.CHART_CURVES = _chunkBPX4Z3N3cjs.CHART_CURVES; exports.CHART_DATE_STEPS = _chunkUUUTEVX6cjs.CHART_DATE_STEPS; exports.CHART_ERROR_BAR_DIRECTIONS = _chunkBPX4Z3N3cjs.CHART_ERROR_BAR_DIRECTIONS; exports.CHART_ERROR_BAR_LABELS = _chunkBPX4Z3N3cjs.CHART_ERROR_BAR_LABELS; exports.CHART_ERROR_BAR_TYPES = _chunkBPX4Z3N3cjs.CHART_ERROR_BAR_TYPES; exports.CHART_LABEL_POSITIONS = _chunkBPX4Z3N3cjs.CHART_LABEL_POSITIONS; exports.CHART_LAYOUT_PRESETS = _chunkV5L2G22Rcjs.CHART_LAYOUT_PRESETS; exports.CHART_LEGEND_POSITIONS = _chunkBPX4Z3N3cjs.CHART_LEGEND_POSITIONS; exports.CHART_LIKERT_NEUTRALS = _chunkBPX4Z3N3cjs.CHART_LIKERT_NEUTRALS; exports.CHART_LIKERT_SORTS = _chunkBPX4Z3N3cjs.CHART_LIKERT_SORTS; exports.CHART_MARKERS = _chunkBPX4Z3N3cjs.CHART_MARKERS; exports.CHART_MERMAID_META_PREFIX = _chunkV5L2G22Rcjs.CHART_MERMAID_META_PREFIX; exports.CHART_NUMBER_STYLES = _chunkBPX4Z3N3cjs.CHART_NUMBER_STYLES; exports.CHART_OOXML_CONTENT_TYPE = _chunkSZWVMB3Bcjs.CHART_OOXML_CONTENT_TYPE; exports.CHART_OOXML_NS = _chunkSZWVMB3Bcjs.CHART_OOXML_NS; exports.CHART_OOXML_RELATIONSHIP = _chunkSZWVMB3Bcjs.CHART_OOXML_RELATIONSHIP; exports.CHART_ORIENTATIONS = _chunkBPX4Z3N3cjs.CHART_ORIENTATIONS; exports.CHART_PALETTE_SHADES = _chunkBPX4Z3N3cjs.CHART_PALETTE_SHADES; exports.CHART_PRESENCE_COLORS = CHART_PRESENCE_COLORS; exports.CHART_RADAR_GRATICULES = _chunkBPX4Z3N3cjs.CHART_RADAR_GRATICULES; exports.CHART_RASTER_MAX_SIZE = CHART_RASTER_MAX_SIZE; exports.CHART_REFERENCE_AXES = _chunkBPX4Z3N3cjs.CHART_REFERENCE_AXES; exports.CHART_SANKEY_LINK_COLORS = _chunkBPX4Z3N3cjs.CHART_SANKEY_LINK_COLORS; exports.CHART_SERIES_TYPES = _chunkBPX4Z3N3cjs.CHART_SERIES_TYPES; exports.CHART_STACKINGS = _chunkBPX4Z3N3cjs.CHART_STACKINGS; exports.CHART_TRENDLINE_TYPES = _chunkBPX4Z3N3cjs.CHART_TRENDLINE_TYPES; exports.CHART_TYPES = _chunkBPX4Z3N3cjs.CHART_TYPES; exports.CHART_TYPE_LABELS = _chunkBPX4Z3N3cjs.CHART_TYPE_LABELS; exports.CSS_VARIABLE_CHART_THEME = _chunkBPX4Z3N3cjs.CSS_VARIABLE_CHART_THEME; exports.ChartController = _chunkV5L2G22Rcjs.ChartController; exports.ChartDirector = ChartDirector; exports.ChartPresence = ChartPresence; exports.ChartStream = ChartStream; exports.DEFAULT_CHART_PALETTE = _chunkBPX4Z3N3cjs.DEFAULT_CHART_PALETTE; exports.DEFAULT_CHART_THEME = _chunkBPX4Z3N3cjs.DEFAULT_CHART_THEME; exports.MAX_CHART_DATA_LABELS = _chunkUUUTEVX6cjs.MAX_CHART_DATA_LABELS; exports.MAX_CHART_LINE_POINTS = _chunkUUUTEVX6cjs.MAX_CHART_LINE_POINTS; exports.MAX_CHART_LINKS = _chunkBPX4Z3N3cjs.MAX_CHART_LINKS; exports.MAX_CHART_MARKERS = _chunkUUUTEVX6cjs.MAX_CHART_MARKERS; exports.MAX_CHART_TREE_DEPTH = _chunkBPX4Z3N3cjs.MAX_CHART_TREE_DEPTH; exports.MAX_CHART_TREE_NODES = _chunkBPX4Z3N3cjs.MAX_CHART_TREE_NODES; exports.OfficeChartsError = OfficeChartsError; exports.RENDER_CHART_INSTRUCTIONS = RENDER_CHART_INSTRUCTIONS; exports.addChartLink = _chunkBPX4Z3N3cjs.addChartLink; exports.addChartTreeRow = _chunkBPX4Z3N3cjs.addChartTreeRow; exports.analyzeChartTable = analyzeChartTable; exports.blendChartScenes = blendChartScenes; exports.canDragChartPoint = canDragChartPoint; exports.chartBoxStats = _chunkUUUTEVX6cjs.chartBoxStats; exports.chartClientToScene = chartClientToScene; exports.chartColorDistance = _chunkBPX4Z3N3cjs.chartColorDistance; exports.chartColorInputValue = _chunkBPX4Z3N3cjs.chartColorInputValue; exports.chartColorsByCategory = _chunkBPX4Z3N3cjs.chartColorsByCategory; exports.chartContrastRatio = _chunkBPX4Z3N3cjs.chartContrastRatio; exports.chartDataFromTable = _chunkBPX4Z3N3cjs.chartDataFromTable; exports.chartDataToTable = _chunkBPX4Z3N3cjs.chartDataToTable; exports.chartDateLabels = _chunkUUUTEVX6cjs.chartDateLabels; exports.chartDateToSerial = _chunkUUUTEVX6cjs.chartDateToSerial; exports.chartErrorAmounts = _chunkBPX4Z3N3cjs.chartErrorAmounts; exports.chartErrorBarsOfType = _chunkBPX4Z3N3cjs.chartErrorBarsOfType; exports.chartFamily = _chunkBPX4Z3N3cjs.chartFamily; exports.chartFileName = chartFileName; exports.chartFormatToCode = _chunkSZWVMB3Bcjs.chartFormatToCode; exports.chartFromMermaid = _chunkV5L2G22Rcjs.chartFromMermaid; exports.chartFromOoxml = _chunkSZWVMB3Bcjs.chartFromOoxml; exports.chartFromTable = chartFromTable; exports.chartHistogram = _chunkUUUTEVX6cjs.chartHistogram; exports.chartHitTest = chartHitTest; exports.chartLikertColor = _chunkBPX4Z3N3cjs.chartLikertColor; exports.chartLinksFromTable = _chunkBPX4Z3N3cjs.chartLinksFromTable; exports.chartLuminance = _chunkBPX4Z3N3cjs.chartLuminance; exports.chartMermaidFamily = _chunkV5L2G22Rcjs.chartMermaidFamily; exports.chartMovingAverage = _chunkUUUTEVX6cjs.chartMovingAverage; exports.chartPointAnchor = chartPointAnchor; exports.chartPointColor = _chunkBPX4Z3N3cjs.chartPointColor; exports.chartPointRef = chartPointRef; exports.chartPresetPatch = _chunkV5L2G22Rcjs.chartPresetPatch; exports.chartQuantile = _chunkUUUTEVX6cjs.chartQuantile; exports.chartRaceMoment = _chunkUUUTEVX6cjs.chartRaceMoment; exports.chartRaceRanking = _chunkUUUTEVX6cjs.chartRaceRanking; exports.chartRaceValueAt = _chunkUUUTEVX6cjs.chartRaceValueAt; exports.chartRasterSize = chartRasterSize; exports.chartRgbToHex = _chunkBPX4Z3N3cjs.chartRgbToHex; exports.chartRgbToOklab = _chunkBPX4Z3N3cjs.chartRgbToOklab; exports.chartSankeyNodeValues = _chunkBPX4Z3N3cjs.chartSankeyNodeValues; exports.chartSankeyNodes = _chunkBPX4Z3N3cjs.chartSankeyNodes; exports.chartScaleFromPixel = _chunkUUUTEVX6cjs.chartScaleFromPixel; exports.chartScaleToPixel = _chunkUUUTEVX6cjs.chartScaleToPixel; exports.chartSceneToDomSpec = _chunkV5L2G22Rcjs.chartSceneToDomSpec; exports.chartSceneToSvg = _chunkV5L2G22Rcjs.chartSceneToSvg; exports.chartSerialToDate = _chunkUUUTEVX6cjs.chartSerialToDate; exports.chartSeriesColor = _chunkBPX4Z3N3cjs.chartSeriesColor; exports.chartSeriesType = _chunkBPX4Z3N3cjs.chartSeriesType; exports.chartSliceColor = _chunkBPX4Z3N3cjs.chartSliceColor; exports.chartSpecColorsByCategory = _chunkBPX4Z3N3cjs.chartSpecColorsByCategory; exports.chartSquarify = _chunkUUUTEVX6cjs.chartSquarify; exports.chartStyleDomain = chartStyleDomain; exports.chartStylePatch = chartStylePatch; exports.chartSupportsTrendlines = _chunkUUUTEVX6cjs.chartSupportsTrendlines; exports.chartTextBaseline = _chunkV5L2G22Rcjs.chartTextBaseline; exports.chartTextOn = _chunkBPX4Z3N3cjs.chartTextOn; exports.chartTextTransform = _chunkV5L2G22Rcjs.chartTextTransform; exports.chartToMermaid = _chunkV5L2G22Rcjs.chartToMermaid; exports.chartToOoxml = _chunkSZWVMB3Bcjs.chartToOoxml; exports.chartToSvg = _chunkV5L2G22Rcjs.chartToSvg; exports.chartTreeColumnLabels = _chunkBPX4Z3N3cjs.chartTreeColumnLabels; exports.chartTreeDepth = _chunkBPX4Z3N3cjs.chartTreeDepth; exports.chartTreeFromRows = _chunkBPX4Z3N3cjs.chartTreeFromRows; exports.chartTreeFromSeries = _chunkBPX4Z3N3cjs.chartTreeFromSeries; exports.chartTreeFromTable = _chunkBPX4Z3N3cjs.chartTreeFromTable; exports.chartTreeToRows = _chunkBPX4Z3N3cjs.chartTreeToRows; exports.chartTreeTotal = _chunkBPX4Z3N3cjs.chartTreeTotal; exports.chartTrendlineName = _chunkUUUTEVX6cjs.chartTrendlineName; exports.chartValueAtPoint = _chunkUUUTEVX6cjs.chartValueAtPoint; exports.chartVariesColors = _chunkBPX4Z3N3cjs.chartVariesColors; exports.chartXAtPoint = _chunkUUUTEVX6cjs.chartXAtPoint; exports.checkChartColors = _chunkBPX4Z3N3cjs.checkChartColors; exports.cloneChartSeries = _chunkBPX4Z3N3cjs.cloneChartSeries; exports.cloneChartSpec = _chunkBPX4Z3N3cjs.cloneChartSpec; exports.cloneChartTree = _chunkBPX4Z3N3cjs.cloneChartTree; exports.compileChartFormatCode = _chunkUUUTEVX6cjs.compileChartFormatCode; exports.contrastingTextColor = _chunkUUUTEVX6cjs.contrastingTextColor; exports.createChartCommands = createChartCommands; exports.createChartController = _chunkV5L2G22Rcjs.createChartController; exports.createChartEditorDocument = createChartEditorDocument; exports.createChartRasterizer = createChartRasterizer; exports.createChartSpec = _chunkBPX4Z3N3cjs.createChartSpec; exports.createChartStyleToolProvider = createChartStyleToolProvider; exports.createChartToolProvider = createChartToolProvider; exports.createInstantChartClock = createInstantChartClock; exports.createOfficeChartToolProvider = createOfficeChartToolProvider; exports.cyclePaletteColor = _chunkBPX4Z3N3cjs.cyclePaletteColor; exports.decimateChartPoints = _chunkUUUTEVX6cjs.decimateChartPoints; exports.defaultChartAxis = _chunkBPX4Z3N3cjs.defaultChartAxis; exports.defaultChartErrorBarValue = _chunkBPX4Z3N3cjs.defaultChartErrorBarValue; exports.describeChart = _chunkV5L2G22Rcjs.describeChart; exports.describeChartErrorBars = _chunkBPX4Z3N3cjs.describeChartErrorBars; exports.describeChartSelection = describeChartSelection; exports.describeOfficeChartPlace = describeOfficeChartPlace; exports.downloadChartPng = downloadChartPng; exports.easeChartTween = easeChartTween; exports.estimateChartTextWidth = _chunkUUUTEVX6cjs.estimateChartTextWidth; exports.extractDocxCharts = extractDocxCharts; exports.extractOfficeCharts = extractOfficeCharts; exports.extractPptxCharts = extractPptxCharts; exports.extractXlsxCharts = extractXlsxCharts; exports.findChartTreeNode = _chunkBPX4Z3N3cjs.findChartTreeNode; exports.findMermaidCharts = _chunkV5L2G22Rcjs.findMermaidCharts; exports.fitChartTrendline = _chunkUUUTEVX6cjs.fitChartTrendline; exports.formatChartAmountList = _chunkBPX4Z3N3cjs.formatChartAmountList; exports.formatChartDate = _chunkUUUTEVX6cjs.formatChartDate; exports.formatChartNumber = _chunkUUUTEVX6cjs.formatChartNumber; exports.formatChartValueWithCode = _chunkUUUTEVX6cjs.formatChartValueWithCode; exports.handleChartKey = handleChartKey; exports.isCartesianChart = _chunkBPX4Z3N3cjs.isCartesianChart; exports.isXyChart = _chunkBPX4Z3N3cjs.isXyChart; exports.layoutChart = _chunkUUUTEVX6cjs.layoutChart; exports.layoutSparkline = _chunkV5L2G22Rcjs.layoutSparkline; exports.linearMap = _chunkUUUTEVX6cjs.linearMap; exports.locateChartPoint = locateChartPoint; exports.monochromeChartPalette = _chunkV5L2G22Rcjs.monochromeChartPalette; exports.niceLogScale = _chunkUUUTEVX6cjs.niceLogScale; exports.niceScale = _chunkUUUTEVX6cjs.niceScale; exports.niceStep = _chunkUUUTEVX6cjs.niceStep; exports.normalizeChartAxis = _chunkBPX4Z3N3cjs.normalizeChartAxis; exports.normalizeChartErrorBars = _chunkBPX4Z3N3cjs.normalizeChartErrorBars; exports.normalizeChartLinks = _chunkBPX4Z3N3cjs.normalizeChartLinks; exports.normalizeChartReferenceBand = _chunkBPX4Z3N3cjs.normalizeChartReferenceBand; exports.normalizeChartReferenceLine = _chunkBPX4Z3N3cjs.normalizeChartReferenceLine; exports.normalizeChartSpec = _chunkBPX4Z3N3cjs.normalizeChartSpec; exports.normalizeChartTree = _chunkBPX4Z3N3cjs.normalizeChartTree; exports.normalizeChartTrendline = _chunkBPX4Z3N3cjs.normalizeChartTrendline; exports.normalizeChartValues = _chunkBPX4Z3N3cjs.normalizeChartValues; exports.parseChartAmountList = _chunkBPX4Z3N3cjs.parseChartAmountList; exports.parseChartColor = _chunkBPX4Z3N3cjs.parseChartColor; exports.parseChartDate = _chunkUUUTEVX6cjs.parseChartDate; exports.parseChartValue = _chunkBPX4Z3N3cjs.parseChartValue; exports.parsePartialChartJson = parsePartialChartJson; exports.planChartCommand = planChartCommand; exports.planChartToolPlayback = planChartToolPlayback; exports.rasterizeChartSvg = rasterizeChartSvg; exports.realChartClock = realChartClock; exports.recommendChartTypes = recommendChartTypes; exports.recommendForShape = recommendForShape; exports.removeChartTreeRow = _chunkBPX4Z3N3cjs.removeChartTreeRow; exports.resolveChartSvgPaints = resolveChartSvgPaints; exports.sameChartSelection = _chunkUUUTEVX6cjs.sameChartSelection; exports.setChartLinkField = _chunkBPX4Z3N3cjs.setChartLinkField; exports.setChartTreeRowName = _chunkBPX4Z3N3cjs.setChartTreeRowName; exports.setChartTreeRowValue = _chunkBPX4Z3N3cjs.setChartTreeRowValue; exports.shadeChartColor = _chunkBPX4Z3N3cjs.shadeChartColor; exports.simulateChartVision = _chunkBPX4Z3N3cjs.simulateChartVision; exports.snapChartDragValue = snapChartDragValue; exports.snapChartValue = _chunkUUUTEVX6cjs.snapChartValue; exports.sparklineToSvg = _chunkV5L2G22Rcjs.sparklineToSvg; exports.startChartPointDrag = startChartPointDrag; exports.stepDecimals = _chunkUUUTEVX6cjs.stepDecimals; exports.suggestChartReferences = _chunkUUUTEVX6cjs.suggestChartReferences; exports.summarizeChart = _chunkV5L2G22Rcjs.summarizeChart; exports.summarizeChartSeries = _chunkUUUTEVX6cjs.summarizeChartSeries; exports.trendNumberText = _chunkUUUTEVX6cjs.trendNumberText; exports.uniqueChartSeriesId = _chunkBPX4Z3N3cjs.uniqueChartSeriesId; exports.withChartPlayback = withChartPlayback;
|