@pixerate/editor 0.146.0 → 0.147.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/README.md +3 -1
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/agent/index.cjs +36 -34
- package/dist/agent/index.js +7 -5
- package/dist/animation/index.cjs +5 -3
- package/dist/animation/index.js +4 -2
- package/dist/animation-editor/index.cjs +62 -60
- package/dist/animation-editor/index.js +6 -4
- package/dist/canvas/index.cjs +36 -34
- package/dist/canvas/index.js +19 -17
- package/dist/chart/index.cjs +88 -86
- package/dist/chart/index.js +7 -5
- package/dist/{chunk-WBJ6BG4R.js → chunk-2AQL4JHM.js} +6 -6
- package/dist/{chunk-HLMF3E53.cjs → chunk-2WDZI6QD.cjs} +15 -15
- package/dist/{chunk-ZNHB5RG6.js → chunk-37RLSNQ3.js} +2 -2
- package/dist/{chunk-5WOY52O6.cjs → chunk-4YQKRHMI.cjs} +8 -8
- package/dist/chunk-6ONMQ6WF.js +113 -0
- package/dist/{chunk-L434J57V.cjs → chunk-6QTON3VW.cjs} +16 -16
- package/dist/chunk-AA34BA7G.js +1913 -0
- package/dist/{chunk-QX25HWFL.js → chunk-AY65VQSU.js} +1 -1
- package/dist/{chunk-ONZJD2OD.cjs → chunk-BROJYMWU.cjs} +57 -153
- package/dist/{chunk-YM75DN54.js → chunk-DSZCDNTM.js} +1 -1
- package/dist/{chunk-PUR6BZFA.cjs → chunk-DVLMW3GB.cjs} +53 -53
- package/dist/{chunk-ALUWD3FG.js → chunk-EIUTJPEL.js} +1 -1
- package/dist/{chunk-X65C4DWV.js → chunk-EQ4SF4X4.js} +1 -1
- package/dist/{chunk-77SG47WT.js → chunk-FLOGD3QB.js} +1 -1
- package/dist/{chunk-AJSW5GMP.js → chunk-HVQVHUTV.js} +19 -115
- package/dist/{chunk-UR37VCIR.cjs → chunk-I4AHLP7F.cjs} +16 -35
- package/dist/chunk-IPJ3TEYR.cjs +113 -0
- package/dist/chunk-KY3FYKP3.js +52 -0
- package/dist/chunk-LEUZ4FRC.cjs +52 -0
- package/dist/{chunk-H6FX45CP.cjs → chunk-LIXLD433.cjs} +37 -37
- package/dist/{chunk-6GAYGQDC.js → chunk-O5ML2I6O.js} +3 -3
- package/dist/{chunk-KI2VBONS.js → chunk-OET45HIR.js} +2 -2
- package/dist/{chunk-XNZWATSB.cjs → chunk-QCEQIRJQ.cjs} +85 -85
- package/dist/{chunk-HRI3ZMDM.cjs → chunk-RHXW4TA5.cjs} +3 -3
- package/dist/{chunk-UUTTJK77.cjs → chunk-SUF6WRXR.cjs} +2 -2
- package/dist/{chunk-RN767PO6.js → chunk-SUVZJ2CP.js} +15 -34
- package/dist/{chunk-FLUTRPLY.cjs → chunk-TLMRGLQQ.cjs} +16 -16
- package/dist/{chunk-DAS7M4RY.js → chunk-UILRJQFD.js} +2 -2
- package/dist/chunk-UKCJ43YL.cjs +1913 -0
- package/dist/{chunk-XQ33O5BC.cjs → chunk-X35BV5YT.cjs} +44 -44
- package/dist/{chunk-6HMEHNWW.cjs → chunk-XTU6QO2W.cjs} +26 -26
- package/dist/{chunk-VM6JYWXQ.js → chunk-ZQUANEK4.js} +2 -2
- package/dist/cms/index.cjs +5 -3
- package/dist/cms/index.js +18 -16
- package/dist/color/contrast.d.cts +14 -0
- package/dist/color/contrast.d.ts +14 -0
- package/dist/color/convert.d.cts +30 -0
- package/dist/color/convert.d.ts +30 -0
- package/dist/color/dual.d.cts +98 -0
- package/dist/color/dual.d.ts +98 -0
- package/dist/color/format.d.cts +12 -0
- package/dist/color/format.d.ts +12 -0
- package/dist/color/gamut.d.cts +12 -0
- package/dist/color/gamut.d.ts +12 -0
- package/dist/color/harmony.d.cts +22 -0
- package/dist/color/harmony.d.ts +22 -0
- package/dist/color/index.cjs +115 -0
- package/dist/color/index.d.cts +18 -0
- package/dist/color/index.d.ts +18 -0
- package/dist/color/index.js +115 -0
- package/dist/color/mix.d.cts +11 -0
- package/dist/color/mix.d.ts +11 -0
- package/dist/color/named.d.cts +5 -0
- package/dist/color/named.d.ts +5 -0
- package/dist/color/parse.d.cts +11 -0
- package/dist/color/parse.d.ts +11 -0
- package/dist/color/picker.d.cts +52 -0
- package/dist/color/picker.d.ts +52 -0
- package/dist/color/recent.d.cts +8 -0
- package/dist/color/recent.d.ts +8 -0
- package/dist/color/tools.d.cts +15 -0
- package/dist/color/tools.d.ts +15 -0
- package/dist/color/types.d.cts +41 -0
- package/dist/color/types.d.ts +41 -0
- package/dist/color/vision.d.cts +36 -0
- package/dist/color/vision.d.ts +36 -0
- package/dist/export/index.cjs +6 -4
- package/dist/export/index.js +5 -3
- package/dist/extensions/index.cjs +10 -8
- package/dist/extensions/index.js +9 -7
- package/dist/gradient/controller.d.cts +109 -0
- package/dist/gradient/controller.d.ts +109 -0
- package/dist/gradient/editor.d.cts +38 -0
- package/dist/gradient/editor.d.ts +38 -0
- package/dist/gradient/index.cjs +1549 -0
- package/dist/gradient/index.d.cts +5 -0
- package/dist/gradient/index.d.ts +5 -0
- package/dist/gradient/index.js +1549 -0
- package/dist/gradient/model.d.cts +94 -0
- package/dist/gradient/model.d.ts +94 -0
- package/dist/gradient/tools.d.cts +11 -0
- package/dist/gradient/tools.d.ts +11 -0
- package/dist/gradient/types.d.cts +44 -0
- package/dist/gradient/types.d.ts +44 -0
- package/dist/image-editor/index.cjs +649 -647
- package/dist/image-editor/index.js +6 -4
- package/dist/index.cjs +19 -17
- package/dist/index.js +16 -14
- package/dist/paint-editor/color.d.cts +3 -13
- package/dist/paint-editor/color.d.ts +3 -13
- package/dist/paint-editor/index.cjs +23 -68
- package/dist/paint-editor/index.js +15 -60
- package/dist/vector/index.cjs +950 -948
- package/dist/vector/index.js +5 -3
- package/dist/video-editor/index.cjs +5 -3
- package/dist/video-editor/index.js +4 -2
- package/package.json +21 -1
- package/skills/README.md +1 -0
- package/skills/pixerate-color/SKILL.md +69 -0
- package/dist/chunk-45VRG4RB.js +0 -65
- package/dist/chunk-5FXOR7F2.cjs +0 -65
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkXTU6QO2Wcjs = require('./chunk-XTU6QO2W.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -27,7 +27,7 @@ var _chunk6HMEHNWWcjs = require('./chunk-6HMEHNWW.cjs');
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _chunkI4AHLP7Fcjs = require('./chunk-I4AHLP7F.cjs');
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
@@ -63,7 +63,7 @@ function splitOutside(text, sep) {
|
|
|
63
63
|
return out;
|
|
64
64
|
}
|
|
65
65
|
function chartMermaidFamily(spec) {
|
|
66
|
-
const family =
|
|
66
|
+
const family = _chunkI4AHLP7Fcjs.chartFamily.call(void 0, spec);
|
|
67
67
|
if (family === "pie" || family === "funnel" || family === "treemap") return "pie";
|
|
68
68
|
if (family === "radar") return "radar";
|
|
69
69
|
return "xychart";
|
|
@@ -225,8 +225,8 @@ function chartFromMermaid(text, options = {}) {
|
|
|
225
225
|
let title = _nullishCoalesce(frontTitle, () => ( ""));
|
|
226
226
|
const categories = [];
|
|
227
227
|
const series = [];
|
|
228
|
-
const xAxis =
|
|
229
|
-
const yAxis =
|
|
228
|
+
const xAxis = _chunkI4AHLP7Fcjs.defaultChartAxis.call(void 0, false);
|
|
229
|
+
const yAxis = _chunkI4AHLP7Fcjs.defaultChartAxis.call(void 0, true);
|
|
230
230
|
const radarAxes = [];
|
|
231
231
|
const pieSlices = [];
|
|
232
232
|
let legendShow = true;
|
|
@@ -378,7 +378,7 @@ function chartFromMermaid(text, options = {}) {
|
|
|
378
378
|
input.series = metaSeries.map((extra, i) => ({ ..._nullishCoalesce(base[i], () => ( {})), ..._nullishCoalesce(extra, () => ( {})) }));
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
|
-
const { spec, issues: specIssues } =
|
|
381
|
+
const { spec, issues: specIssues } = _chunkI4AHLP7Fcjs.normalizeChartSpec.call(void 0, input);
|
|
382
382
|
if (!family && !partial && !issues.length) issues.push({ path: "header", message: "The text is empty: expected a chart header (xychart-beta, pie or radar-beta)." });
|
|
383
383
|
return { spec, issues: [...issues, ...specIssues], family, hasMeta: !!meta };
|
|
384
384
|
}
|
|
@@ -417,11 +417,11 @@ function findMermaidCharts(text) {
|
|
|
417
417
|
}
|
|
418
418
|
|
|
419
419
|
// src/chart/summary.ts
|
|
420
|
-
function summarizeChart(spec, size = { width: 640, height: 400 }, scene =
|
|
420
|
+
function summarizeChart(spec, size = { width: 640, height: 400 }, scene = _chunkXTU6QO2Wcjs.layoutChart.call(void 0, spec, { ...size, selection: null })) {
|
|
421
421
|
const visible = spec.series.filter((s) => !s.hidden);
|
|
422
|
-
const series = visible.map((s) =>
|
|
423
|
-
const colors =
|
|
424
|
-
const check =
|
|
422
|
+
const series = visible.map((s) => _chunkXTU6QO2Wcjs.summarizeChartSeries.call(void 0, s, spec.categories));
|
|
423
|
+
const colors = _chunkI4AHLP7Fcjs.chartColorsByCategory.call(void 0, spec.type) ? spec.categories.map((_, i) => _optionalChain([visible, 'access', _10 => _10[0], 'optionalAccess', _11 => _11.pointColors, 'optionalAccess', _12 => _12[i]]) || _chunkI4AHLP7Fcjs.chartSliceColor.call(void 0, spec, i)) : visible.map((s) => _chunkI4AHLP7Fcjs.chartSeriesColor.call(void 0, spec, spec.series.indexOf(s)));
|
|
424
|
+
const check = _chunkI4AHLP7Fcjs.checkChartColors.call(void 0, colors, { surface: scene.theme.surface.startsWith("var(") ? "#ffffff" : scene.theme.surface });
|
|
425
425
|
const axis = (s, a) => s ? { min: s.domain[0], max: s.domain[1], ticks: [...s.ticks], ...s.logBase ? { logBase: s.logBase } : {}, ...a.reverse ? { reversed: true } : {} } : void 0;
|
|
426
426
|
return {
|
|
427
427
|
type: spec.type,
|
|
@@ -436,12 +436,12 @@ function summarizeChart(spec, size = { width: 640, height: 400 }, scene = _chunk
|
|
|
436
436
|
description: describeChart(spec, series)
|
|
437
437
|
};
|
|
438
438
|
}
|
|
439
|
-
function describeChart(spec, series = spec.series.filter((s) => !s.hidden).map((s) =>
|
|
440
|
-
const kind =
|
|
439
|
+
function describeChart(spec, series = spec.series.filter((s) => !s.hidden).map((s) => _chunkXTU6QO2Wcjs.summarizeChartSeries.call(void 0, s, spec.categories))) {
|
|
440
|
+
const kind = _chunkI4AHLP7Fcjs.CHART_TYPE_LABELS[spec.type].toLowerCase();
|
|
441
441
|
const parts = [];
|
|
442
|
-
const family =
|
|
442
|
+
const family = _chunkI4AHLP7Fcjs.chartFamily.call(void 0, spec);
|
|
443
443
|
const format = spec.yAxis.format;
|
|
444
|
-
const fmt = (v) => v === null ? "blank" :
|
|
444
|
+
const fmt = (v) => v === null ? "blank" : _chunkXTU6QO2Wcjs.formatChartNumber.call(void 0, v, format);
|
|
445
445
|
const head = spec.title ? `${spec.title}: a ${kind} chart` : `A ${kind} chart`;
|
|
446
446
|
if (!series.length || series.every((s) => s.count === 0)) return `${head} with no data.`;
|
|
447
447
|
if (family === "pie" || family === "funnel" || family === "treemap") {
|
|
@@ -489,7 +489,7 @@ function describeChart(spec, series = spec.series.filter((s) => !s.hidden).map((
|
|
|
489
489
|
}
|
|
490
490
|
parts.push(...axes);
|
|
491
491
|
for (const s of spec.series.filter((x) => !x.hidden && (x.errorBars || x.xErrorBars)).slice(0, 8)) {
|
|
492
|
-
const bars = [s.errorBars ?
|
|
492
|
+
const bars = [s.errorBars ? _chunkI4AHLP7Fcjs.describeChartErrorBars.call(void 0, s.errorBars) : "", s.xErrorBars ? `x ${_chunkI4AHLP7Fcjs.describeChartErrorBars.call(void 0, s.xErrorBars)}` : ""].filter(Boolean).join(" and ");
|
|
493
493
|
parts.push(`${s.name} has ${bars}.`);
|
|
494
494
|
}
|
|
495
495
|
return parts.join(" ");
|
|
@@ -554,7 +554,7 @@ function chartSceneToSvg(scene, options = {}) {
|
|
|
554
554
|
return `<svg xmlns="http://www.w3.org/2000/svg" width="${scene.width}" height="${scene.height}" viewBox="0 0 ${scene.width} ${scene.height}" role="img"${label ? ` aria-label="${escape(label)}"` : ""}${labelled ? ` aria-labelledby="${labelled}"` : ""}>${head}${body}</svg>`;
|
|
555
555
|
}
|
|
556
556
|
function chartToSvg(spec, options) {
|
|
557
|
-
const scene =
|
|
557
|
+
const scene = _chunkXTU6QO2Wcjs.layoutChart.call(void 0, spec, { ...options, selection: null });
|
|
558
558
|
return chartSceneToSvg(scene, { ...options, ariaLabel: _nullishCoalesce(options.ariaLabel, () => ( (spec.title || void 0))), description: _nullishCoalesce(options.description, () => ( describeChart(spec))) });
|
|
559
559
|
}
|
|
560
560
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
@@ -592,10 +592,10 @@ var CHART_LAYOUT_PRESETS = [
|
|
|
592
592
|
];
|
|
593
593
|
function monochromeChartPalette(base, count = 6) {
|
|
594
594
|
const steps = count <= 1 ? [0] : Array.from({ length: count }, (_, i) => -0.45 + 1.05 * i / (count - 1));
|
|
595
|
-
return steps.map((t) =>
|
|
595
|
+
return steps.map((t) => _chunkI4AHLP7Fcjs.shadeChartColor.call(void 0, base, t));
|
|
596
596
|
}
|
|
597
597
|
var CHART_COLOR_SCHEMES = [
|
|
598
|
-
{ id: "default", label: "Default", description: "Ten distinct colours, readable on light and dark backgrounds.", palette:
|
|
598
|
+
{ id: "default", label: "Default", description: "Ten distinct colours, readable on light and dark backgrounds.", palette: _chunkI4AHLP7Fcjs.DEFAULT_CHART_PALETTE },
|
|
599
599
|
{ id: "okabe-ito", label: "Okabe\u2013Ito", description: "Eight colours chosen to stay distinct with colour-blindness.", palette: ["#e69f00", "#56b4e9", "#009e73", "#f0e442", "#0072b2", "#d55e00", "#cc79a7", "#000000"] },
|
|
600
600
|
{ id: "office", label: "Office", description: "The six accent colours of the default Office theme.", palette: ["#4472c4", "#ed7d31", "#a5a5a5", "#ffc000", "#5b9bd5", "#70ad47"] },
|
|
601
601
|
{ id: "warm", label: "Warm", description: "Reds, oranges and yellows.", palette: ["#b2182b", "#d6604d", "#f4a582", "#e08214", "#fdb863", "#8c510a"] },
|
|
@@ -654,7 +654,7 @@ var ChartController = (_class = class {
|
|
|
654
654
|
constructor(options = {}) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);_class.prototype.__init7.call(this);_class.prototype.__init8.call(this);_class.prototype.__init9.call(this);_class.prototype.__init10.call(this);
|
|
655
655
|
this.history = _nullishCoalesce(options.history, () => ( new (0, _chunkFJ2MSI43cjs.HistoryManager)()));
|
|
656
656
|
this.onChange = options.onChange;
|
|
657
|
-
const { spec, issues } =
|
|
657
|
+
const { spec, issues } = _chunkI4AHLP7Fcjs.normalizeChartSpec.call(void 0, _nullishCoalesce(options.spec, () => ( {})));
|
|
658
658
|
this.spec = spec;
|
|
659
659
|
this.issues = issues;
|
|
660
660
|
this.state = this.computeState();
|
|
@@ -757,7 +757,7 @@ var ChartController = (_class = class {
|
|
|
757
757
|
const hadIssues = this.issues.length > 0;
|
|
758
758
|
this.issues = [];
|
|
759
759
|
if (sameChartJson(before, next)) {
|
|
760
|
-
const reselect = select !== void 0 && !
|
|
760
|
+
const reselect = select !== void 0 && !_chunkXTU6QO2Wcjs.sameChartSelection.call(void 0, this.selection, select) && !(select === null && this.selection === null);
|
|
761
761
|
if (reselect) this.selection = select;
|
|
762
762
|
if (reselect || hadIssues) this.notify(false);
|
|
763
763
|
return;
|
|
@@ -780,7 +780,7 @@ var ChartController = (_class = class {
|
|
|
780
780
|
}
|
|
781
781
|
/** A copy of the spec with `edit` applied (series and categories copied as needed). */
|
|
782
782
|
edited(edit) {
|
|
783
|
-
const draft =
|
|
783
|
+
const draft = _chunkI4AHLP7Fcjs.cloneChartSpec.call(void 0, this.spec);
|
|
784
784
|
edit(draft);
|
|
785
785
|
return draft;
|
|
786
786
|
}
|
|
@@ -810,7 +810,7 @@ var ChartController = (_class = class {
|
|
|
810
810
|
legend: patch.legend ? { ...s.legend, ...patch.legend } : s.legend,
|
|
811
811
|
version: 1
|
|
812
812
|
};
|
|
813
|
-
const { spec, issues } =
|
|
813
|
+
const { spec, issues } = _chunkI4AHLP7Fcjs.normalizeChartSpec.call(void 0, merged);
|
|
814
814
|
if (issues.length) return this.reject(issues.map((i) => i.message).join(" "), issues);
|
|
815
815
|
if (JSON.stringify(spec) === JSON.stringify(s)) return { ok: true };
|
|
816
816
|
this.commit(_nullishCoalesce(options.label, () => ( updateLabel(patch))), spec);
|
|
@@ -861,7 +861,7 @@ var ChartController = (_class = class {
|
|
|
861
861
|
const series = this.getSeries(seriesId);
|
|
862
862
|
if (!series) return this.unknownSeries(seriesId);
|
|
863
863
|
if (!Number.isInteger(index) || index < 0 || index >= this.spec.categories.length) return this.badIndex(index);
|
|
864
|
-
const parsed =
|
|
864
|
+
const parsed = _chunkI4AHLP7Fcjs.parseChartValue.call(void 0, value);
|
|
865
865
|
if (parsed === void 0) return this.reject(`"${String(value)}" is not a number; enter a number or leave the cell blank.`, [{ path: `${seriesId}[${index}]`, message: `"${String(value)}" is not a number.` }]);
|
|
866
866
|
if (series.values[index] === parsed) {
|
|
867
867
|
if (this.issues.length) {
|
|
@@ -884,7 +884,7 @@ var ChartController = (_class = class {
|
|
|
884
884
|
if (!this.getSeries(cell.seriesId)) issues.push({ path: cell.seriesId, message: this.unknownSeries(cell.seriesId).message });
|
|
885
885
|
else if (!Number.isInteger(cell.index) || cell.index < 0 || cell.index >= this.spec.categories.length) issues.push({ path: `${cell.seriesId}[${cell.index}]`, message: this.badIndex(cell.index).message });
|
|
886
886
|
else {
|
|
887
|
-
const value =
|
|
887
|
+
const value = _chunkI4AHLP7Fcjs.parseChartValue.call(void 0, cell.value);
|
|
888
888
|
if (value === void 0) issues.push({ path: `${cell.seriesId}[${cell.index}]`, message: `"${String(cell.value)}" is not a number.` });
|
|
889
889
|
else parsed.push({ seriesId: cell.seriesId, index: cell.index, value });
|
|
890
890
|
}
|
|
@@ -898,12 +898,12 @@ var ChartController = (_class = class {
|
|
|
898
898
|
}
|
|
899
899
|
/** Adds a series (values padded to the categories) and selects it. Returns its id. */
|
|
900
900
|
addSeries(input = {}, options = {}) {
|
|
901
|
-
const id = input.id && !this.getSeries(input.id) ? input.id :
|
|
901
|
+
const id = input.id && !this.getSeries(input.id) ? input.id : _chunkI4AHLP7Fcjs.uniqueChartSeriesId.call(void 0, this.spec.series);
|
|
902
902
|
const name = _nullishCoalesce(input.name, () => ( `Series ${this.spec.series.length + 1}`));
|
|
903
903
|
const at = Math.max(0, Math.min(this.spec.series.length, _nullishCoalesce(options.at, () => ( this.spec.series.length))));
|
|
904
904
|
const series = [...this.spec.series];
|
|
905
905
|
series.splice(at, 0, { ...input, id, name, values: _nullishCoalesce(input.values, () => ( [])) });
|
|
906
|
-
const { spec, issues } =
|
|
906
|
+
const { spec, issues } = _chunkI4AHLP7Fcjs.normalizeChartSpec.call(void 0, { ...this.spec, series });
|
|
907
907
|
if (issues.length) return this.reject(issues.map((i) => i.message).join(" "), issues);
|
|
908
908
|
this.commit(`Add series "${name}"`, spec, { kind: "series", seriesId: id });
|
|
909
909
|
return { ok: true, id };
|
|
@@ -922,7 +922,7 @@ var ChartController = (_class = class {
|
|
|
922
922
|
updateSeries(id, patch) {
|
|
923
923
|
const series = this.getSeries(id);
|
|
924
924
|
if (!series) return this.unknownSeries(id);
|
|
925
|
-
const next =
|
|
925
|
+
const next = _chunkI4AHLP7Fcjs.cloneChartSeries.call(void 0, series);
|
|
926
926
|
if (patch.name !== void 0) next.name = String(patch.name);
|
|
927
927
|
if (patch.color === null || patch.color === "") delete next.color;
|
|
928
928
|
else if (patch.color !== void 0) next.color = patch.color;
|
|
@@ -940,7 +940,7 @@ var ChartController = (_class = class {
|
|
|
940
940
|
}
|
|
941
941
|
if (next.axis === "primary") delete next.axis;
|
|
942
942
|
const series2 = this.spec.series.map((s) => s.id === id ? next : s);
|
|
943
|
-
const { spec, issues } =
|
|
943
|
+
const { spec, issues } = _chunkI4AHLP7Fcjs.normalizeChartSpec.call(void 0, { ...this.spec, series: series2 });
|
|
944
944
|
if (issues.length) return this.reject(issues.map((i) => i.message).join(" "), issues);
|
|
945
945
|
if (JSON.stringify(spec.series) === JSON.stringify(this.spec.series)) return { ok: true };
|
|
946
946
|
const label = patch.hidden !== void 0 && Object.keys(patch).length === 1 ? `${patch.hidden ? "Hide" : "Show"} "${series.name}"` : patch.name !== void 0 && Object.keys(patch).length === 1 ? "Rename series" : `Change series "${series.name}"`;
|
|
@@ -1033,7 +1033,7 @@ var ChartController = (_class = class {
|
|
|
1033
1033
|
const width = Math.max(...rows.map((r) => r.length));
|
|
1034
1034
|
const lastSeries = column + width - 1;
|
|
1035
1035
|
while (d.series.length <= lastSeries) {
|
|
1036
|
-
const id =
|
|
1036
|
+
const id = _chunkI4AHLP7Fcjs.uniqueChartSeriesId.call(void 0, d.series);
|
|
1037
1037
|
d.series.push({ id, name: `Series ${d.series.length + 1}`, values: d.categories.map(() => null) });
|
|
1038
1038
|
}
|
|
1039
1039
|
const lastRow = row + rows.length - 1;
|
|
@@ -1047,7 +1047,7 @@ var ChartController = (_class = class {
|
|
|
1047
1047
|
const index = row + r;
|
|
1048
1048
|
if (col < 0) d.categories[index] = cell === null || cell === void 0 ? "" : String(cell).trim();
|
|
1049
1049
|
else {
|
|
1050
|
-
const parsed =
|
|
1050
|
+
const parsed = _chunkI4AHLP7Fcjs.parseChartValue.call(void 0, cell);
|
|
1051
1051
|
if (parsed === void 0) issues.push({ path: `${d.series[col].id}[${index}]`, message: `"${String(cell)}" is not a number; it was left blank.` });
|
|
1052
1052
|
d.series[col].values[index] = _nullishCoalesce(parsed, () => ( null));
|
|
1053
1053
|
}
|
|
@@ -1066,14 +1066,14 @@ var ChartController = (_class = class {
|
|
|
1066
1066
|
* colours and types are kept by name.
|
|
1067
1067
|
*/
|
|
1068
1068
|
importTable(rows, options = {}) {
|
|
1069
|
-
const data =
|
|
1069
|
+
const data = _chunkI4AHLP7Fcjs.chartDataFromTable.call(void 0, rows, options);
|
|
1070
1070
|
if (!data.categories.length || !data.series.length) return this.reject("There is no data to import: expected a header row and at least one row of values.");
|
|
1071
1071
|
const byName = new Map(this.spec.series.map((s) => [s.name, s]));
|
|
1072
1072
|
const series = data.series.map((s) => {
|
|
1073
1073
|
const old = byName.get(s.name);
|
|
1074
1074
|
return { ...s, ..._optionalChain([old, 'optionalAccess', _27 => _27.color]) ? { color: old.color } : {}, ..._optionalChain([old, 'optionalAccess', _28 => _28.type]) ? { type: old.type } : {}, ...old ? { id: old.id } : {} };
|
|
1075
1075
|
});
|
|
1076
|
-
const { spec } =
|
|
1076
|
+
const { spec } = _chunkI4AHLP7Fcjs.normalizeChartSpec.call(void 0, { ...this.spec, categories: data.categories, series });
|
|
1077
1077
|
this.commit("Import data", spec);
|
|
1078
1078
|
if (data.issues.length) {
|
|
1079
1079
|
this.issues = data.issues;
|
|
@@ -1094,10 +1094,10 @@ var ChartController = (_class = class {
|
|
|
1094
1094
|
addTrendline(seriesId, input) {
|
|
1095
1095
|
const series = this.getSeries(seriesId);
|
|
1096
1096
|
if (!series) return this.unknownSeries(seriesId);
|
|
1097
|
-
if (!
|
|
1097
|
+
if (!_chunkXTU6QO2Wcjs.chartSupportsTrendlines.call(void 0, this.spec.type, this.spec.stacking))
|
|
1098
1098
|
return this.reject(`Trendlines need an unstacked bar, line, area, scatter or bubble chart; this is a ${this.spec.stacking !== "none" ? `${this.spec.stacking} ` : ""}${this.spec.type} chart.`);
|
|
1099
1099
|
const issues = [];
|
|
1100
|
-
const line =
|
|
1100
|
+
const line = _chunkI4AHLP7Fcjs.normalizeChartTrendline.call(void 0, input, "trendline", issues);
|
|
1101
1101
|
if (!line || issues.length) return this.reject(issues.map((i) => i.message).join(" ") || "The trendline is not valid.", issues);
|
|
1102
1102
|
const index = _nullishCoalesce(_optionalChain([series, 'access', _29 => _29.trendlines, 'optionalAccess', _30 => _30.length]), () => ( 0));
|
|
1103
1103
|
const next = this.edited((d) => {
|
|
@@ -1116,7 +1116,7 @@ var ChartController = (_class = class {
|
|
|
1116
1116
|
const issues = [];
|
|
1117
1117
|
const merged = { ...current, ...patch };
|
|
1118
1118
|
for (const [k, v] of Object.entries(patch)) if (v === null) delete merged[k];
|
|
1119
|
-
const line =
|
|
1119
|
+
const line = _chunkI4AHLP7Fcjs.normalizeChartTrendline.call(void 0, merged, "trendline", issues);
|
|
1120
1120
|
if (!line || issues.length) return this.reject(issues.map((i) => i.message).join(" "), issues);
|
|
1121
1121
|
this.commit(
|
|
1122
1122
|
"Change trendline",
|
|
@@ -1144,7 +1144,7 @@ var ChartController = (_class = class {
|
|
|
1144
1144
|
trendlinePoints(seriesId) {
|
|
1145
1145
|
const series = this.getSeries(seriesId);
|
|
1146
1146
|
if (!series) return [];
|
|
1147
|
-
const xy =
|
|
1147
|
+
const xy = _chunkI4AHLP7Fcjs.chartFamily.call(void 0, this.spec) === "xy";
|
|
1148
1148
|
const out = [];
|
|
1149
1149
|
series.values.forEach((v, i) => {
|
|
1150
1150
|
const x = xy ? _nullishCoalesce(_optionalChain([series, 'access', _37 => _37.x, 'optionalAccess', _38 => _38[i]]), () => ( (this.spec.type === "bubble" ? i + 1 : null))) : i + 1;
|
|
@@ -1156,13 +1156,13 @@ var ChartController = (_class = class {
|
|
|
1156
1156
|
trendlineFit(seriesId, index) {
|
|
1157
1157
|
const line = _optionalChain([this, 'access', _39 => _39.getSeries, 'call', _40 => _40(seriesId), 'optionalAccess', _41 => _41.trendlines, 'optionalAccess', _42 => _42[index]]);
|
|
1158
1158
|
if (!line) return null;
|
|
1159
|
-
return
|
|
1159
|
+
return _chunkXTU6QO2Wcjs.fitChartTrendline.call(void 0, line, this.trendlinePoints(seriesId));
|
|
1160
1160
|
}
|
|
1161
1161
|
/** The moving-average points of a trendline (empty for other kinds). */
|
|
1162
1162
|
trendlineMovingAverage(seriesId, index) {
|
|
1163
1163
|
const line = _optionalChain([this, 'access', _43 => _43.getSeries, 'call', _44 => _44(seriesId), 'optionalAccess', _45 => _45.trendlines, 'optionalAccess', _46 => _46[index]]);
|
|
1164
1164
|
if (!line || line.type !== "moving-average") return [];
|
|
1165
|
-
return
|
|
1165
|
+
return _chunkXTU6QO2Wcjs.chartMovingAverage.call(void 0, this.trendlinePoints(seriesId), _nullishCoalesce(line.period, () => ( 2)));
|
|
1166
1166
|
}
|
|
1167
1167
|
// -------------------------------------------------------------------------
|
|
1168
1168
|
// Reshaping
|
|
@@ -1181,7 +1181,7 @@ var ChartController = (_class = class {
|
|
|
1181
1181
|
used.add(id);
|
|
1182
1182
|
return { id, name, values: s.series.map((x) => _nullishCoalesce(x.values[i], () => ( null))) };
|
|
1183
1183
|
});
|
|
1184
|
-
const { spec } =
|
|
1184
|
+
const { spec } = _chunkI4AHLP7Fcjs.normalizeChartSpec.call(void 0, { ...s, categories: s.series.map((x) => x.name), series });
|
|
1185
1185
|
this.commit("Switch rows and columns", spec, null);
|
|
1186
1186
|
return { ok: true };
|
|
1187
1187
|
}
|
|
@@ -1191,7 +1191,7 @@ var ChartController = (_class = class {
|
|
|
1191
1191
|
/** Selects a chart element (view state; not an undo step). */
|
|
1192
1192
|
select(selection) {
|
|
1193
1193
|
const next = this.validSelection(selection, this.spec);
|
|
1194
|
-
if (
|
|
1194
|
+
if (_chunkXTU6QO2Wcjs.sameChartSelection.call(void 0, next, this.selection) || next === null && this.selection === null) return;
|
|
1195
1195
|
this.selection = next;
|
|
1196
1196
|
this.notify(false);
|
|
1197
1197
|
}
|
|
@@ -1266,14 +1266,14 @@ var ChartController = (_class = class {
|
|
|
1266
1266
|
// -------------------------------------------------------------------------
|
|
1267
1267
|
/** The spec, for saving (a copy). */
|
|
1268
1268
|
toJSON() {
|
|
1269
|
-
return
|
|
1269
|
+
return _chunkI4AHLP7Fcjs.cloneChartSpec.call(void 0, this.spec);
|
|
1270
1270
|
}
|
|
1271
1271
|
/**
|
|
1272
1272
|
* Replaces the chart without an undo step (e.g. when opening a document). Problems are
|
|
1273
1273
|
* fixed with defaults and reported in `state.issues` (and returned).
|
|
1274
1274
|
*/
|
|
1275
1275
|
load(input, options = {}) {
|
|
1276
|
-
const { spec, issues } =
|
|
1276
|
+
const { spec, issues } = _chunkI4AHLP7Fcjs.normalizeChartSpec.call(void 0, input);
|
|
1277
1277
|
this.spec = spec;
|
|
1278
1278
|
this.issues = issues;
|
|
1279
1279
|
this.selection = this.validSelection(this.selection, spec);
|
|
@@ -1343,7 +1343,7 @@ function layoutSparkline(values, options) {
|
|
|
1343
1343
|
const h = Number.isFinite(options.height) ? Math.max(1, options.height) : 1;
|
|
1344
1344
|
const color = _nullishCoalesce(options.color, () => ( "#4269d0"));
|
|
1345
1345
|
const negative = _nullishCoalesce(options.negativeColor, () => ( "#e5484d"));
|
|
1346
|
-
const theme = { ...
|
|
1346
|
+
const theme = { ..._chunkI4AHLP7Fcjs.DEFAULT_CHART_THEME, background: "transparent" };
|
|
1347
1347
|
const marks = [];
|
|
1348
1348
|
const scene = { width: w, height: h, plot: { x: 0, y: 0, width: w, height: h }, marks, percent: false, theme, warnings: [] };
|
|
1349
1349
|
const vals = values.slice(0, MAX_POINTS).map((v) => v !== null && Number.isFinite(v) ? Math.max(-1e300, Math.min(1e300, v)) : null);
|
|
@@ -1376,7 +1376,7 @@ function layoutSparkline(values, options) {
|
|
|
1376
1376
|
const flush = () => {
|
|
1377
1377
|
if (run.length >= 2) {
|
|
1378
1378
|
const pts = run.length > 4e3 ? run.filter((_, i) => i % (Math.floor(run.length / 2e3) + 1) === 0) : run;
|
|
1379
|
-
d += pts.map(([x, y], i) => `${i ? "L" : "M"}${
|
|
1379
|
+
d += pts.map(([x, y], i) => `${i ? "L" : "M"}${_chunkXTU6QO2Wcjs.r2.call(void 0, x)},${_chunkXTU6QO2Wcjs.r2.call(void 0, y)}`).join("");
|
|
1380
1380
|
}
|
|
1381
1381
|
run = [];
|
|
1382
1382
|
};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkI4AHLP7Fcjs = require('./chunk-I4AHLP7F.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunk55AKPTLMcjs = require('./chunk-55AKPTLM.cjs');
|
|
@@ -1074,7 +1074,7 @@ function layoutCartesian(ctx, area, visible) {
|
|
|
1074
1074
|
const { spec, theme, marks, measure, fs } = ctx;
|
|
1075
1075
|
const horizontal = spec.orientation === "horizontal";
|
|
1076
1076
|
const n = spec.categories.length;
|
|
1077
|
-
const types = new Map(visible.map((s) => [s.id,
|
|
1077
|
+
const types = new Map(visible.map((s) => [s.id, _chunkI4AHLP7Fcjs.chartSeriesType.call(void 0, spec, s)]));
|
|
1078
1078
|
const stacked = spec.stacking !== "none";
|
|
1079
1079
|
const percent = spec.stacking === "percent";
|
|
1080
1080
|
const onSecondary = (s) => s.axis === "secondary";
|
|
@@ -1111,7 +1111,7 @@ function layoutCartesian(ctx, area, visible) {
|
|
|
1111
1111
|
const stack = stacks.get(s.id);
|
|
1112
1112
|
errors.set(
|
|
1113
1113
|
s.id,
|
|
1114
|
-
|
|
1114
|
+
_chunkI4AHLP7Fcjs.chartErrorAmounts.call(void 0, s.errorBars, s.values).map((e, i) => {
|
|
1115
1115
|
const raw = s.values[i];
|
|
1116
1116
|
const seg = _optionalChain([stack, 'optionalAccess', _8 => _8.segments, 'access', _9 => _9[i]]);
|
|
1117
1117
|
if (!e || raw === null || stack && !seg) return null;
|
|
@@ -1178,7 +1178,7 @@ function layoutCartesian(ctx, area, visible) {
|
|
|
1178
1178
|
const drawOrder = [...visible].sort((a, b) => order(types.get(a.id)) - order(types.get(b.id)));
|
|
1179
1179
|
for (const s of drawOrder) {
|
|
1180
1180
|
const si = spec.series.indexOf(s);
|
|
1181
|
-
const color =
|
|
1181
|
+
const color = _chunkI4AHLP7Fcjs.chartSeriesColor.call(void 0, spec, si);
|
|
1182
1182
|
const type = types.get(s.id);
|
|
1183
1183
|
const stack = stacks.get(s.id);
|
|
1184
1184
|
const selSeries = ctx.seriesSelected(s.id);
|
|
@@ -1204,7 +1204,7 @@ function layoutCartesian(ctx, area, visible) {
|
|
|
1204
1204
|
const selected = ctx.isSelected(target);
|
|
1205
1205
|
const [x, y] = map({ c: c0, v: Math.min(a, b) });
|
|
1206
1206
|
const rect = horizontal ? { x: Math.min(a, b), y: c0, width: Math.abs(b - a), height: cw } : { x, y, width: cw, height: Math.abs(b - a) };
|
|
1207
|
-
const fill =
|
|
1207
|
+
const fill = _chunkI4AHLP7Fcjs.chartPointColor.call(void 0, spec, si, i);
|
|
1208
1208
|
marks.push({
|
|
1209
1209
|
kind: "rect",
|
|
1210
1210
|
key: `bar-${s.id}-${i}`,
|
|
@@ -1283,7 +1283,7 @@ function layoutCartesian(ctx, area, visible) {
|
|
|
1283
1283
|
const target = { kind: "point", seriesId: s.id, index: i };
|
|
1284
1284
|
const selected = ctx.isSelected(target);
|
|
1285
1285
|
const r = type === "scatter" ? 4.5 : 3.5;
|
|
1286
|
-
const pointColor =
|
|
1286
|
+
const pointColor = _chunkI4AHLP7Fcjs.chartPointColor.call(void 0, spec, si, i);
|
|
1287
1287
|
const fill = showDots ? type === "scatter" ? pointColor : theme.surface : "transparent";
|
|
1288
1288
|
marks.push(
|
|
1289
1289
|
pointMark({ key: `point-${s.id}-${i}`, target, selected: selected || selSeries, opacity: type === "scatter" ? 0.85 : void 0 }, showDots ? marker : "hit", cx, cy, showDots ? r : 6, fill, showDots ? pointColor : void 0, 2)
|
|
@@ -1355,8 +1355,8 @@ function layoutXy(ctx, area, visible) {
|
|
|
1355
1355
|
const yErrors = /* @__PURE__ */ new Map();
|
|
1356
1356
|
const xErrors = /* @__PURE__ */ new Map();
|
|
1357
1357
|
for (const { s } of all) {
|
|
1358
|
-
if (s.errorBars) yErrors.set(s.id,
|
|
1359
|
-
if (s.xErrorBars) xErrors.set(s.id,
|
|
1358
|
+
if (s.errorBars) yErrors.set(s.id, _chunkI4AHLP7Fcjs.chartErrorAmounts.call(void 0, s.errorBars, s.values));
|
|
1359
|
+
if (s.xErrorBars) xErrors.set(s.id, _chunkI4AHLP7Fcjs.chartErrorAmounts.call(void 0, s.xErrorBars, s.values.map((_, i) => _nullishCoalesce(_optionalChain([s, 'access', _26 => _26.x, 'optionalAccess', _27 => _27[i]]), () => ( (bubble || !s.x ? i + 1 : null))))));
|
|
1360
1360
|
}
|
|
1361
1361
|
let xlo = Infinity;
|
|
1362
1362
|
let xhi = -Infinity;
|
|
@@ -1435,8 +1435,8 @@ function layoutXy(ctx, area, visible) {
|
|
|
1435
1435
|
const trendLabels = [];
|
|
1436
1436
|
for (const { s, pts } of all) {
|
|
1437
1437
|
const si = spec.series.indexOf(s);
|
|
1438
|
-
const color =
|
|
1439
|
-
const type =
|
|
1438
|
+
const color = _chunkI4AHLP7Fcjs.chartSeriesColor.call(void 0, spec, si);
|
|
1439
|
+
const type = _chunkI4AHLP7Fcjs.chartSeriesType.call(void 0, spec, s);
|
|
1440
1440
|
const selSeries = ctx.seriesSelected(s.id);
|
|
1441
1441
|
const seriesTarget = { kind: "series", seriesId: s.id };
|
|
1442
1442
|
if (type === "line" || type === "area") {
|
|
@@ -1461,7 +1461,7 @@ function layoutXy(ctx, area, visible) {
|
|
|
1461
1461
|
}
|
|
1462
1462
|
const target = { kind: "point", seriesId: s.id, index: p.i };
|
|
1463
1463
|
const selected = ctx.isSelected(target);
|
|
1464
|
-
const pointColor =
|
|
1464
|
+
const pointColor = _chunkI4AHLP7Fcjs.chartPointColor.call(void 0, spec, si, p.i);
|
|
1465
1465
|
const r = bubble ? maxSize > 0 && p.size !== null && p.size > 0 ? Math.max(2, Math.sqrt(p.size / maxSize) * maxR) : 2 : 4.5;
|
|
1466
1466
|
if (bubble) marks.push({ kind: "circle", key: `point-${s.id}-${p.i}`, role: "point", cx, cy, r, fill: pointColor, stroke: pointColor, strokeWidth: 1, opacity: 0.6, target, selected: selected || selSeries });
|
|
1467
1467
|
else marks.push(pointMark({ key: `point-${s.id}-${p.i}`, target, selected: selected || selSeries, opacity: 0.85 }, marker === "none" ? "hit" : marker, cx, cy, marker === "none" ? 6 : r, marker === "none" ? "transparent" : pointColor, marker === "none" ? void 0 : pointColor, 2));
|
|
@@ -1504,7 +1504,7 @@ function trendlineLegendItems(spec, color) {
|
|
|
1504
1504
|
}
|
|
1505
1505
|
|
|
1506
1506
|
// src/chart/layout-families.ts
|
|
1507
|
-
var sliceColor = (ctx, series, i) => _optionalChain([series, 'access', _42 => _42.pointColors, 'optionalAccess', _43 => _43[i]]) ||
|
|
1507
|
+
var sliceColor = (ctx, series, i) => _optionalChain([series, 'access', _42 => _42.pointColors, 'optionalAccess', _43 => _43[i]]) || _chunkI4AHLP7Fcjs.chartSliceColor.call(void 0, ctx.spec, i);
|
|
1508
1508
|
function layoutPie(ctx, area, series) {
|
|
1509
1509
|
const { spec, theme, marks, fs, selection } = ctx;
|
|
1510
1510
|
const values = spec.categories.map((_, i) => {
|
|
@@ -1611,7 +1611,7 @@ function layoutRadar(ctx, area, visible) {
|
|
|
1611
1611
|
});
|
|
1612
1612
|
for (const s of visible) {
|
|
1613
1613
|
const si = spec.series.indexOf(s);
|
|
1614
|
-
const color =
|
|
1614
|
+
const color = _chunkI4AHLP7Fcjs.chartSeriesColor.call(void 0, spec, si);
|
|
1615
1615
|
const selSeries = ctx.seriesSelected(s.id);
|
|
1616
1616
|
const pts = s.values.map((v, i) => v !== null && Number.isFinite(v) ? at(i, rOf(v)) : null);
|
|
1617
1617
|
const present = pts.filter((p) => p !== null);
|
|
@@ -1661,7 +1661,7 @@ function layoutWaterfall(ctx, area, series) {
|
|
|
1661
1661
|
});
|
|
1662
1662
|
const { band, catCenter, map, value } = frame;
|
|
1663
1663
|
const w = band * (1 - spec.gapWidth);
|
|
1664
|
-
const color =
|
|
1664
|
+
const color = _chunkI4AHLP7Fcjs.chartSeriesColor.call(void 0, spec, spec.series.indexOf(series));
|
|
1665
1665
|
const format = _nullishCoalesce(series.format, () => ( spec.yAxis.format));
|
|
1666
1666
|
const labelsOn = _nullishCoalesce(series.dataLabels, () => ( spec.dataLabels));
|
|
1667
1667
|
let prevEnd = null;
|
|
@@ -1720,7 +1720,7 @@ function layoutHistogram(ctx, area, visible) {
|
|
|
1720
1720
|
const gap = k > 1 ? band * spec.gapWidth * 0.5 : 0;
|
|
1721
1721
|
const w = (band - gap) / k;
|
|
1722
1722
|
visible.forEach((s, si) => {
|
|
1723
|
-
const color =
|
|
1723
|
+
const color = _chunkI4AHLP7Fcjs.chartSeriesColor.call(void 0, spec, spec.series.indexOf(s));
|
|
1724
1724
|
const target = { kind: "series", seriesId: s.id };
|
|
1725
1725
|
const selected = ctx.seriesSelected(s.id);
|
|
1726
1726
|
counts[si].forEach((c, b) => {
|
|
@@ -1751,7 +1751,7 @@ function layoutBox(ctx, area, visible) {
|
|
|
1751
1751
|
visible.forEach((s, i) => {
|
|
1752
1752
|
const st = stats[i];
|
|
1753
1753
|
if (!st) return;
|
|
1754
|
-
const color =
|
|
1754
|
+
const color = _chunkI4AHLP7Fcjs.chartSeriesColor.call(void 0, spec, spec.series.indexOf(s));
|
|
1755
1755
|
const target = { kind: "series", seriesId: s.id };
|
|
1756
1756
|
const selected = ctx.seriesSelected(s.id);
|
|
1757
1757
|
const c = catCenter(i);
|
|
@@ -1837,13 +1837,13 @@ function layoutTreemap(ctx, area, series) {
|
|
|
1837
1837
|
|
|
1838
1838
|
// src/chart/layout.ts
|
|
1839
1839
|
function legendItems(spec, ctx) {
|
|
1840
|
-
const family =
|
|
1840
|
+
const family = _chunkI4AHLP7Fcjs.chartFamily.call(void 0, spec);
|
|
1841
1841
|
if (spec.type === "funnel") return [];
|
|
1842
|
-
if (
|
|
1842
|
+
if (_chunkI4AHLP7Fcjs.chartColorsByCategory.call(void 0, spec.type)) {
|
|
1843
1843
|
const first = spec.series.find((s) => !s.hidden);
|
|
1844
1844
|
return spec.categories.map((c, i) => ({
|
|
1845
1845
|
label: c,
|
|
1846
|
-
color: _optionalChain([first, 'optionalAccess', _45 => _45.pointColors, 'optionalAccess', _46 => _46[i]]) ||
|
|
1846
|
+
color: _optionalChain([first, 'optionalAccess', _45 => _45.pointColors, 'optionalAccess', _46 => _46[i]]) || _chunkI4AHLP7Fcjs.chartSliceColor.call(void 0, spec, i),
|
|
1847
1847
|
target: { kind: "category", index: i },
|
|
1848
1848
|
faded: false,
|
|
1849
1849
|
selected: ctx.isSelected({ kind: "category", index: i }),
|
|
@@ -1857,17 +1857,17 @@ function legendItems(spec, ctx) {
|
|
|
1857
1857
|
return [
|
|
1858
1858
|
{ label: "Increase", color: ctx.theme.positive, target, faded: false, selected: false, shape: "square" },
|
|
1859
1859
|
{ label: "Decrease", color: ctx.theme.negative, target, faded: false, selected: false, shape: "square" },
|
|
1860
|
-
{ label: "Total", color:
|
|
1860
|
+
{ label: "Total", color: _chunkI4AHLP7Fcjs.chartSeriesColor.call(void 0, spec, spec.series.indexOf(first)), target, faded: false, selected: false, shape: "square" }
|
|
1861
1861
|
];
|
|
1862
1862
|
}
|
|
1863
1863
|
if (family === "box") return [];
|
|
1864
|
-
const trends = trendlineLegendItems(spec, (i) =>
|
|
1864
|
+
const trends = trendlineLegendItems(spec, (i) => _chunkI4AHLP7Fcjs.chartSeriesColor.call(void 0, spec, i));
|
|
1865
1865
|
const items = [];
|
|
1866
1866
|
spec.series.forEach((s, i) => {
|
|
1867
|
-
const type =
|
|
1867
|
+
const type = _chunkI4AHLP7Fcjs.chartSeriesType.call(void 0, spec, s);
|
|
1868
1868
|
items.push({
|
|
1869
1869
|
label: s.name,
|
|
1870
|
-
color:
|
|
1870
|
+
color: _chunkI4AHLP7Fcjs.chartSeriesColor.call(void 0, spec, i),
|
|
1871
1871
|
target: { kind: "series", seriesId: s.id },
|
|
1872
1872
|
faded: !!s.hidden,
|
|
1873
1873
|
selected: ctx.seriesSelected(s.id),
|
|
@@ -1880,7 +1880,7 @@ function legendItems(spec, ctx) {
|
|
|
1880
1880
|
function layoutChart(spec, options) {
|
|
1881
1881
|
const width = Math.max(1, Number.isFinite(options.width) ? options.width : 1);
|
|
1882
1882
|
const height = Math.max(1, Number.isFinite(options.height) ? options.height : 1);
|
|
1883
|
-
const theme = { ...
|
|
1883
|
+
const theme = { ..._chunkI4AHLP7Fcjs.DEFAULT_CHART_THEME, ...options.theme };
|
|
1884
1884
|
const selection = _nullishCoalesce(options.selection, () => ( null));
|
|
1885
1885
|
const marks = [];
|
|
1886
1886
|
const warnings = [];
|
|
@@ -1919,7 +1919,7 @@ function layoutChart(spec, options) {
|
|
|
1919
1919
|
if (spec.title) titleMark("title", spec.title, theme.titleSize, 600, theme.text);
|
|
1920
1920
|
if (spec.subtitle) titleMark("subtitle", spec.subtitle, fs + 1, 400, theme.mutedText);
|
|
1921
1921
|
if (spec.title || spec.subtitle) top += 6;
|
|
1922
|
-
const family =
|
|
1922
|
+
const family = _chunkI4AHLP7Fcjs.chartFamily.call(void 0, spec);
|
|
1923
1923
|
const visible = spec.series.filter((s) => !s.hidden);
|
|
1924
1924
|
const items = legendItems(spec, ctx);
|
|
1925
1925
|
let area = { x: pad, y: top, width: width - pad * 2, height: height - top - pad };
|
|
@@ -2068,7 +2068,7 @@ function addReadout(ctx, readout, plot) {
|
|
|
2068
2068
|
} else return;
|
|
2069
2069
|
const axis = series.axis === "secondary" ? spec.yAxis2 : spec.yAxis;
|
|
2070
2070
|
const x = _optionalChain([series, 'access', _52 => _52.x, 'optionalAccess', _53 => _53[readout.index]]);
|
|
2071
|
-
const text = x !== null && x !== void 0 &&
|
|
2071
|
+
const text = x !== null && x !== void 0 && _chunkI4AHLP7Fcjs.chartFamily.call(void 0, spec) === "xy" ? `${formatChartNumber(x, spec.xAxis.format)}, ${formatChartNumber(value, axis.format)}` : `${_nullishCoalesce(spec.categories[readout.index], () => ( ""))}: ${formatChartNumber(value, _nullishCoalesce(series.format, () => ( axis.format)))}`;
|
|
2072
2072
|
const w = measure(text, fs, 600) + 10;
|
|
2073
2073
|
const h = fs + 8;
|
|
2074
2074
|
const bx = Math.max(plot.x, Math.min(plot.x + plot.width - w, ax - w / 2));
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
builtinProfile,
|
|
54
54
|
parseProfile,
|
|
55
55
|
srgbProfile
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-HVQVHUTV.js";
|
|
57
57
|
import {
|
|
58
58
|
DEFAULT_AUTO_LEADING,
|
|
59
59
|
DEFAULT_TEXT_STYLE,
|
|
@@ -89,7 +89,7 @@ import {
|
|
|
89
89
|
textRectPath,
|
|
90
90
|
translateMatrix,
|
|
91
91
|
warpPresetMesh
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-FLOGD3QB.js";
|
|
93
93
|
import {
|
|
94
94
|
bezierPathBounds,
|
|
95
95
|
outlineStroke,
|
package/dist/cms/index.cjs
CHANGED
|
@@ -54,6 +54,8 @@
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
|
|
57
|
+
var _chunkBROJYMWUcjs = require('../chunk-BROJYMWU.cjs');
|
|
58
|
+
require('../chunk-XFM3OCHU.cjs');
|
|
57
59
|
|
|
58
60
|
|
|
59
61
|
|
|
@@ -69,8 +71,8 @@
|
|
|
69
71
|
|
|
70
72
|
|
|
71
73
|
|
|
72
|
-
|
|
73
|
-
require('../chunk-
|
|
74
|
+
|
|
75
|
+
var _chunkIPJ3TEYRcjs = require('../chunk-IPJ3TEYR.cjs');
|
|
74
76
|
|
|
75
77
|
|
|
76
78
|
|
|
@@ -142,4 +144,4 @@ require('../chunk-XFM3OCHU.cjs');
|
|
|
142
144
|
|
|
143
145
|
|
|
144
146
|
|
|
145
|
-
exports.BUILTIN_COPYRIGHT =
|
|
147
|
+
exports.BUILTIN_COPYRIGHT = _chunkBROJYMWUcjs.BUILTIN_COPYRIGHT; exports.BUILTIN_PROFILES = _chunkBROJYMWUcjs.BUILTIN_PROFILES; exports.COATED_CMYK_DESCRIPTION = _chunkBROJYMWUcjs.COATED_CMYK_DESCRIPTION; exports.Clut = _chunkBROJYMWUcjs.Clut; exports.CmsError = _chunkBROJYMWUcjs.CmsError; exports.CmykModel = _chunkBROJYMWUcjs.CmykModel; exports.D50 = _chunkIPJ3TEYRcjs.D50; exports.D65_XY = _chunkIPJ3TEYRcjs.D65_XY; exports.DEFAULT_CMYK_PARAMS = _chunkBROJYMWUcjs.DEFAULT_CMYK_PARAMS; exports.DEFAULT_TRANSFORM_OPTIONS = _chunkBROJYMWUcjs.DEFAULT_TRANSFORM_OPTIONS; exports.GamutCheck = _chunkBROJYMWUcjs.GamutCheck; exports.IDENTITY = _chunkIPJ3TEYRcjs.IDENTITY; exports.IDENTITY_CURVE = _chunkBROJYMWUcjs.IDENTITY_CURVE; exports.INTENTS = _chunkBROJYMWUcjs.INTENTS; exports.Lut3d = _chunkBROJYMWUcjs.Lut3d; exports.MAX_CHANNELS = _chunkBROJYMWUcjs.MAX_CHANNELS; exports.MAX_PIPE = _chunkBROJYMWUcjs.MAX_PIPE; exports.Pipeline = _chunkBROJYMWUcjs.Pipeline; exports.SAME_COLORS_MAX_DELTA_E = _chunkBROJYMWUcjs.SAME_COLORS_MAX_DELTA_E; exports.Transform = _chunkBROJYMWUcjs.Transform; exports.apply = _chunkIPJ3TEYRcjs.apply; exports.blackPoint = _chunkBROJYMWUcjs.blackPoint; exports.bradford = _chunkIPJ3TEYRcjs.bradford; exports.builtinProfile = _chunkBROJYMWUcjs.builtinProfile; exports.builtinProfileId = _chunkBROJYMWUcjs.builtinProfileId; exports.cachedTransform = _chunkBROJYMWUcjs.cachedTransform; exports.canBeDestination = _chunkBROJYMWUcjs.canBeDestination; exports.classSig = _chunkBROJYMWUcjs.classSig; exports.cmykProfile = _chunkBROJYMWUcjs.cmykProfile; exports.d50Quantized = _chunkIPJ3TEYRcjs.d50Quantized; exports.defaultProfileFor = _chunkBROJYMWUcjs.defaultProfileFor; exports.deltaE76 = _chunkIPJ3TEYRcjs.deltaE76; exports.det = _chunkIPJ3TEYRcjs.det; exports.deviceToPcs = _chunkBROJYMWUcjs.deviceToPcs; exports.encodeProfile = _chunkBROJYMWUcjs.encodeProfile; exports.evalCurve = _chunkBROJYMWUcjs.evalCurve; exports.evalCurveInverse = _chunkBROJYMWUcjs.evalCurveInverse; exports.gammaCurve = _chunkBROJYMWUcjs.gammaCurve; exports.grayAsRgb = _chunkBROJYMWUcjs.grayAsRgb; exports.intentCode = _chunkBROJYMWUcjs.intentCode; exports.intentFromCode = _chunkBROJYMWUcjs.intentFromCode; exports.invert = _chunkIPJ3TEYRcjs.invert; exports.isIdentityCurve = _chunkBROJYMWUcjs.isIdentityCurve; exports.isMatrixShaper = _chunkBROJYMWUcjs.isMatrixShaper; exports.labToXyz = _chunkIPJ3TEYRcjs.labToXyz; exports.linkStages = _chunkBROJYMWUcjs.linkStages; exports.matrix3 = _chunkBROJYMWUcjs.matrix3; exports.mediaWhite = _chunkBROJYMWUcjs.mediaWhite; exports.mul = _chunkIPJ3TEYRcjs.mul; exports.paramCount = _chunkBROJYMWUcjs.paramCount; exports.parseProfile = _chunkBROJYMWUcjs.parseProfile; exports.pcsToDevice = _chunkBROJYMWUcjs.pcsToDevice; exports.profileChannels = _chunkBROJYMWUcjs.profileChannels; exports.readJpegIcc = _chunkBROJYMWUcjs.readJpegIcc; exports.readPngIcc = _chunkBROJYMWUcjs.readPngIcc; exports.rgbToXyzMatrix = _chunkIPJ3TEYRcjs.rgbToXyzMatrix; exports.s15f16Round = _chunkIPJ3TEYRcjs.s15f16Round; exports.sameColors = _chunkBROJYMWUcjs.sameColors; exports.sampleCurve = _chunkBROJYMWUcjs.sampleCurve; exports.separate = _chunkBROJYMWUcjs.separate; exports.spaceChannels = _chunkBROJYMWUcjs.spaceChannels; exports.spaceSig = _chunkBROJYMWUcjs.spaceSig; exports.srgbProfile = _chunkBROJYMWUcjs.srgbProfile; exports.srgbTrc = _chunkBROJYMWUcjs.srgbTrc; exports.stageOutputs = _chunkBROJYMWUcjs.stageOutputs; exports.supportsIntent = _chunkBROJYMWUcjs.supportsIntent; exports.writeJpegIcc = _chunkBROJYMWUcjs.writeJpegIcc; exports.writePngIcc = _chunkBROJYMWUcjs.writePngIcc; exports.xyToXyz = _chunkIPJ3TEYRcjs.xyToXyz; exports.xyzToLab = _chunkIPJ3TEYRcjs.xyzToLab;
|