@pixerate/editor 0.161.0 → 0.162.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.cjs +36 -35
- package/dist/agent/index.js +7 -6
- package/dist/animation/index.cjs +5 -4
- package/dist/animation/index.js +4 -3
- package/dist/animation-editor/index.cjs +63 -62
- package/dist/animation-editor/index.js +7 -6
- package/dist/{brushstrokeRender-Q4LI22QV.js → brushstrokeRender-7LXCU7PD.js} +2 -2
- package/dist/{brushstrokeRender-5WANQIG4.cjs → brushstrokeRender-VO4ZTWVA.cjs} +5 -5
- package/dist/canvas/index.cjs +40 -39
- package/dist/canvas/index.js +7 -6
- package/dist/chart/index.cjs +88 -87
- package/dist/chart/index.js +7 -6
- package/dist/{chunk-LQLZHP6F.js → chunk-36OKQDCF.js} +7 -4
- package/dist/{chunk-AKDWAWSY.cjs → chunk-3IHNXRUV.cjs} +45 -45
- package/dist/{chunk-72BGL3I2.js → chunk-3VLOOO3G.js} +1 -1
- package/dist/{chunk-TVO6W2Q6.cjs → chunk-4NGVHHJB.cjs} +17 -17
- package/dist/chunk-4VU4CP7R.js +769 -0
- package/dist/{chunk-MHEXLG3M.cjs → chunk-5AARIS3R.cjs} +37 -37
- package/dist/{chunk-DBIVICAO.js → chunk-7CKPUUN4.js} +1 -1
- package/dist/{chunk-57JLBGJ5.cjs → chunk-7YBDRJXT.cjs} +8 -8
- package/dist/{chunk-KY3FYKP3.js → chunk-BQWGN5WH.js} +1 -1
- package/dist/{chunk-LEUZ4FRC.cjs → chunk-CIPIESX4.cjs} +3 -3
- package/dist/chunk-CJE5MOIS.js +347 -0
- package/dist/{chunk-5QBRAIVK.js → chunk-CX6JLDFC.js} +3 -3
- package/dist/{chunk-R3QY7PPL.js → chunk-DTSTNRPH.js} +1 -1
- package/dist/{chunk-6LUYFHHN.cjs → chunk-EQ46F75O.cjs} +51 -51
- package/dist/{chunk-UKCJ43YL.cjs → chunk-ES3UEVUT.cjs} +130 -898
- package/dist/{chunk-UM3RPYC5.js → chunk-EVPZ5IKN.js} +1 -1
- package/dist/{chunk-XNQ5EFB4.cjs → chunk-EY22AY6R.cjs} +16 -16
- package/dist/chunk-FKUKJ3XA.cjs +347 -0
- package/dist/{chunk-YABNLNY7.js → chunk-GLMP22FT.js} +3 -3
- package/dist/{chunk-SUF6WRXR.cjs → chunk-GTELFJRE.cjs} +2 -2
- package/dist/{chunk-AY65VQSU.js → chunk-H3OEM3Q2.js} +1 -1
- package/dist/{chunk-4YWAEV4W.cjs → chunk-HDGBM7EA.cjs} +26 -26
- package/dist/{chunk-H5XX4KHB.js → chunk-HLOKB7WW.js} +5 -3
- package/dist/{chunk-QMI5HZWA.cjs → chunk-JCXMJUQO.cjs} +5 -5
- package/dist/{chunk-WPPJH6X4.cjs → chunk-LL3H5XUH.cjs} +6 -4
- package/dist/{chunk-4T44CJ5K.cjs → chunk-NA4UVVJ4.cjs} +15 -15
- package/dist/{chunk-Q6PA362P.js → chunk-NO5QQDHZ.js} +2 -2
- package/dist/{chunk-3YDQLQH2.cjs → chunk-PA3IMPPS.cjs} +81 -81
- package/dist/{chunk-WNAAWLZ5.js → chunk-QY4KUDMY.js} +2 -2
- package/dist/{chunk-AA34BA7G.js → chunk-QYZGBVNC.js} +30 -798
- package/dist/chunk-S6X2QRVU.cjs +769 -0
- package/dist/{chunk-6UPGM3JB.js → chunk-SET6KJOP.js} +2 -2
- package/dist/{chunk-GNK7SESQ.cjs → chunk-V7GWZIZK.cjs} +7 -4
- package/dist/{chunk-EYVVIZJ3.cjs → chunk-WTW7QRTS.cjs} +1 -1
- package/dist/{chunk-SSCL7QQ4.js → chunk-XDCFJEU7.js} +2 -2
- package/dist/{chunk-JGKCC5OF.cjs → chunk-YQ5C5BVK.cjs} +10 -9
- package/dist/{chunk-A5UCR2TO.js → chunk-YXKLVD56.js} +10 -9
- package/dist/{chunk-45XXVHVG.js → chunk-ZZGPYNS2.js} +1 -1
- package/dist/color/index.cjs +6 -2
- package/dist/color/index.d.cts +1 -0
- package/dist/color/index.d.ts +1 -0
- package/dist/color/index.js +28 -24
- package/dist/color/suggest.d.cts +12 -0
- package/dist/color/suggest.d.ts +12 -0
- package/dist/effects/index.cjs +37 -13
- package/dist/effects/index.js +29 -5
- package/dist/effects/ui.d.cts +20 -3
- package/dist/effects/ui.d.ts +20 -3
- package/dist/export/index.cjs +6 -5
- package/dist/export/index.js +5 -4
- package/dist/extensions/index.cjs +9 -8
- package/dist/extensions/index.js +8 -7
- package/dist/gradient/index.cjs +28 -26
- package/dist/gradient/index.js +7 -5
- package/dist/image-editor/index.cjs +641 -640
- package/dist/image-editor/index.js +7 -6
- package/dist/index.cjs +15 -14
- package/dist/index.js +9 -8
- package/dist/paint/index.cjs +2 -2
- package/dist/paint/index.js +1 -1
- package/dist/paint-editor/index.cjs +136 -135
- package/dist/paint-editor/index.js +8 -7
- package/dist/typography/accessibility.d.cts +44 -0
- package/dist/typography/accessibility.d.ts +44 -0
- package/dist/typography/catalog.d.cts +98 -0
- package/dist/typography/catalog.d.ts +98 -0
- package/dist/typography/index.cjs +1099 -0
- package/dist/typography/index.d.cts +16 -0
- package/dist/typography/index.d.ts +16 -0
- package/dist/typography/index.js +1099 -0
- package/dist/typography/metrics.d.cts +31 -0
- package/dist/typography/metrics.d.ts +31 -0
- package/dist/typography/picker.d.cts +132 -0
- package/dist/typography/picker.d.ts +132 -0
- package/dist/typography/registry.d.cts +66 -0
- package/dist/typography/registry.d.ts +66 -0
- package/dist/typography/scale.d.cts +62 -0
- package/dist/typography/scale.d.ts +62 -0
- package/dist/typography/segment.d.cts +26 -0
- package/dist/typography/segment.d.ts +26 -0
- package/dist/typography/stack.d.cts +26 -0
- package/dist/typography/stack.d.ts +26 -0
- package/dist/typography/tools.d.cts +34 -0
- package/dist/typography/tools.d.ts +34 -0
- package/dist/typography/types.d.cts +96 -0
- package/dist/typography/types.d.ts +96 -0
- package/dist/typography/weight.d.cts +13 -0
- package/dist/typography/weight.d.ts +13 -0
- package/dist/vector/index.cjs +951 -950
- package/dist/vector/index.js +6 -5
- package/dist/video-editor/index.cjs +5 -4
- package/dist/video-editor/index.js +4 -3
- package/package.json +13 -3
- package/skills/README.md +1 -0
- package/skills/pixerate-chart/SKILL.md +92 -9
- package/skills/pixerate-paint-editor/SKILL.md +0 -2
- package/skills/pixerate-typography/SKILL.md +91 -0
package/dist/chart/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
TRENDLINE_PROPS,
|
|
8
8
|
VALUE,
|
|
9
9
|
WIDTH
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-EVPZ5IKN.js";
|
|
11
11
|
import {
|
|
12
12
|
CHART_OOXML_CONTENT_TYPE,
|
|
13
13
|
CHART_OOXML_NS,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
chartFormatToCode,
|
|
16
16
|
chartFromOoxml,
|
|
17
17
|
chartToOoxml
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-7CKPUUN4.js";
|
|
19
19
|
import {
|
|
20
20
|
CHART_COLOR_SCHEMES,
|
|
21
21
|
CHART_LAYOUT_PRESETS,
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
monochromeChartPalette,
|
|
38
38
|
sparklineToSvg,
|
|
39
39
|
summarizeChart
|
|
40
|
-
} from "../chunk-
|
|
40
|
+
} from "../chunk-XDCFJEU7.js";
|
|
41
41
|
import {
|
|
42
42
|
CHART_DATE_STEPS,
|
|
43
43
|
MAX_CHART_DATA_LABELS,
|
|
@@ -76,7 +76,7 @@ import {
|
|
|
76
76
|
stepDecimals,
|
|
77
77
|
summarizeChartSeries,
|
|
78
78
|
trendNumberText
|
|
79
|
-
} from "../chunk-
|
|
79
|
+
} from "../chunk-DTSTNRPH.js";
|
|
80
80
|
import {
|
|
81
81
|
CHART_AXIS_KINDS,
|
|
82
82
|
CHART_AXIS_SCALES,
|
|
@@ -138,7 +138,7 @@ import {
|
|
|
138
138
|
shadeChartColor,
|
|
139
139
|
simulateChartVision,
|
|
140
140
|
uniqueChartSeriesId
|
|
141
|
-
} from "../chunk-
|
|
141
|
+
} from "../chunk-HLOKB7WW.js";
|
|
142
142
|
import "../chunk-II2WIF5Z.js";
|
|
143
143
|
import {
|
|
144
144
|
parseCsv
|
|
@@ -159,7 +159,8 @@ import {
|
|
|
159
159
|
} from "../chunk-NHLYK3AX.js";
|
|
160
160
|
import "../chunk-HF5QZS7Z.js";
|
|
161
161
|
import "../chunk-RNSANXPT.js";
|
|
162
|
-
import "../chunk-
|
|
162
|
+
import "../chunk-QYZGBVNC.js";
|
|
163
|
+
import "../chunk-4VU4CP7R.js";
|
|
163
164
|
import "../chunk-6ONMQ6WF.js";
|
|
164
165
|
|
|
165
166
|
// src/chart/raster.ts
|
|
@@ -2358,12 +2358,15 @@ var WetMedium = class {
|
|
|
2358
2358
|
sample(rect, cov) {
|
|
2359
2359
|
const s = this.world.sample(this.laneId, rect, cov);
|
|
2360
2360
|
if (!(s.wet > 0) || !(s.weight > 0)) return null;
|
|
2361
|
-
const
|
|
2362
|
-
const
|
|
2361
|
+
const k0 = s.pigment[0] + s.settled[0];
|
|
2362
|
+
const k1 = s.pigment[1] + s.settled[1];
|
|
2363
|
+
const k2 = s.pigment[2] + s.settled[2];
|
|
2364
|
+
const k3 = s.pigment[3] + s.settled[3];
|
|
2365
|
+
const kmax = Math.max(k0, k1, k2);
|
|
2363
2366
|
if (!(kmax > 1e-9)) return null;
|
|
2364
2367
|
const f = SAMPLE_K / kmax;
|
|
2365
|
-
const rgb = pigmentColor(
|
|
2366
|
-
const density = Math.min(1, (
|
|
2368
|
+
const rgb = pigmentColor(k0 * f, k1 * f, k2 * f, k3 * f);
|
|
2369
|
+
const density = Math.min(1, (k0 + k1 + k2) / s.wet / 0.06);
|
|
2367
2370
|
return { rgb, contact: s.wet / s.weight * density };
|
|
2368
2371
|
}
|
|
2369
2372
|
deposit(rect, cov, dep, paint, _pigment, field = null) {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkHDGBM7EAcjs = require('./chunk-HDGBM7EA.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -27,7 +27,7 @@ var _chunk4YWAEV4Wcjs = require('./chunk-4YWAEV4W.cjs');
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _chunkLL3H5XUHcjs = require('./chunk-LL3H5XUH.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 = _chunkLL3H5XUHcjs.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";
|
|
@@ -227,8 +227,8 @@ function chartFromMermaid(text, options = {}) {
|
|
|
227
227
|
let title = _nullishCoalesce(frontTitle, () => ( ""));
|
|
228
228
|
const categories = [];
|
|
229
229
|
const series = [];
|
|
230
|
-
const xAxis =
|
|
231
|
-
const yAxis =
|
|
230
|
+
const xAxis = _chunkLL3H5XUHcjs.defaultChartAxis.call(void 0, false);
|
|
231
|
+
const yAxis = _chunkLL3H5XUHcjs.defaultChartAxis.call(void 0, true);
|
|
232
232
|
const radarAxes = [];
|
|
233
233
|
const pieSlices = [];
|
|
234
234
|
let legendShow = true;
|
|
@@ -388,7 +388,7 @@ function chartFromMermaid(text, options = {}) {
|
|
|
388
388
|
input.series = metaSeries.map((extra, i) => ({ ..._nullishCoalesce(base[i], () => ( {})), ..._nullishCoalesce(extra, () => ( {})) }));
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
|
-
const { spec, issues: specIssues } =
|
|
391
|
+
const { spec, issues: specIssues } = _chunkLL3H5XUHcjs.normalizeChartSpec.call(void 0, input);
|
|
392
392
|
if (!family && !partial && !issues.length) issues.push({ path: "header", message: "The text is empty: expected a chart header (xychart-beta, pie or radar-beta)." });
|
|
393
393
|
return { spec, issues: [...issues, ...specIssues], family, hasMeta: !!meta };
|
|
394
394
|
}
|
|
@@ -427,11 +427,11 @@ function findMermaidCharts(text) {
|
|
|
427
427
|
}
|
|
428
428
|
|
|
429
429
|
// src/chart/summary.ts
|
|
430
|
-
function summarizeChart(spec, size = { width: 640, height: 400 }, scene =
|
|
430
|
+
function summarizeChart(spec, size = { width: 640, height: 400 }, scene = _chunkHDGBM7EAcjs.layoutChart.call(void 0, spec, { ...size, selection: null })) {
|
|
431
431
|
const visible = spec.series.filter((s) => !s.hidden);
|
|
432
|
-
const series = visible.map((s) =>
|
|
433
|
-
const colors =
|
|
434
|
-
const check =
|
|
432
|
+
const series = visible.map((s) => _chunkHDGBM7EAcjs.summarizeChartSeries.call(void 0, s, spec.categories));
|
|
433
|
+
const colors = _chunkLL3H5XUHcjs.chartColorsByCategory.call(void 0, spec.type) ? spec.categories.map((_, i) => _optionalChain([visible, 'access', _10 => _10[0], 'optionalAccess', _11 => _11.pointColors, 'optionalAccess', _12 => _12[i]]) || _chunkLL3H5XUHcjs.chartSliceColor.call(void 0, spec, i)) : visible.map((s) => _chunkLL3H5XUHcjs.chartSeriesColor.call(void 0, spec, spec.series.indexOf(s)));
|
|
434
|
+
const check = _chunkLL3H5XUHcjs.checkChartColors.call(void 0, colors, { surface: scene.theme.surface.startsWith("var(") ? "#ffffff" : scene.theme.surface });
|
|
435
435
|
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;
|
|
436
436
|
return {
|
|
437
437
|
type: spec.type,
|
|
@@ -446,12 +446,12 @@ function summarizeChart(spec, size = { width: 640, height: 400 }, scene = _chunk
|
|
|
446
446
|
description: describeChart(spec, series)
|
|
447
447
|
};
|
|
448
448
|
}
|
|
449
|
-
function describeChart(spec, series = spec.series.filter((s) => !s.hidden).map((s) =>
|
|
450
|
-
const kind =
|
|
449
|
+
function describeChart(spec, series = spec.series.filter((s) => !s.hidden).map((s) => _chunkHDGBM7EAcjs.summarizeChartSeries.call(void 0, s, spec.categories))) {
|
|
450
|
+
const kind = _chunkLL3H5XUHcjs.CHART_TYPE_LABELS[spec.type].toLowerCase();
|
|
451
451
|
const parts = [];
|
|
452
|
-
const family =
|
|
452
|
+
const family = _chunkLL3H5XUHcjs.chartFamily.call(void 0, spec);
|
|
453
453
|
const format = spec.yAxis.format;
|
|
454
|
-
const fmt = (v) => v === null ? "blank" :
|
|
454
|
+
const fmt = (v) => v === null ? "blank" : _chunkHDGBM7EAcjs.formatChartNumber.call(void 0, v, format);
|
|
455
455
|
const head = spec.title ? `${spec.title}: a ${kind} chart` : `A ${kind} chart`;
|
|
456
456
|
if (!series.length || series.every((s) => s.count === 0)) return `${head} with no data.`;
|
|
457
457
|
if (family === "pie" || family === "funnel" || family === "treemap") {
|
|
@@ -499,7 +499,7 @@ function describeChart(spec, series = spec.series.filter((s) => !s.hidden).map((
|
|
|
499
499
|
}
|
|
500
500
|
parts.push(...axes);
|
|
501
501
|
for (const s of spec.series.filter((x) => !x.hidden && (x.errorBars || x.xErrorBars)).slice(0, 8)) {
|
|
502
|
-
const bars = [s.errorBars ?
|
|
502
|
+
const bars = [s.errorBars ? _chunkLL3H5XUHcjs.describeChartErrorBars.call(void 0, s.errorBars) : "", s.xErrorBars ? `x ${_chunkLL3H5XUHcjs.describeChartErrorBars.call(void 0, s.xErrorBars)}` : ""].filter(Boolean).join(" and ");
|
|
503
503
|
parts.push(`${s.name} has ${bars}.`);
|
|
504
504
|
}
|
|
505
505
|
return parts.join(" ");
|
|
@@ -564,7 +564,7 @@ function chartSceneToSvg(scene, options = {}) {
|
|
|
564
564
|
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>`;
|
|
565
565
|
}
|
|
566
566
|
function chartToSvg(spec, options) {
|
|
567
|
-
const scene =
|
|
567
|
+
const scene = _chunkHDGBM7EAcjs.layoutChart.call(void 0, spec, { ...options, selection: null });
|
|
568
568
|
return chartSceneToSvg(scene, { ...options, ariaLabel: _nullishCoalesce(options.ariaLabel, () => ( (spec.title || void 0))), description: _nullishCoalesce(options.description, () => ( describeChart(spec))) });
|
|
569
569
|
}
|
|
570
570
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
@@ -602,10 +602,10 @@ var CHART_LAYOUT_PRESETS = [
|
|
|
602
602
|
];
|
|
603
603
|
function monochromeChartPalette(base, count = 6) {
|
|
604
604
|
const steps = count <= 1 ? [0] : Array.from({ length: count }, (_, i) => -0.45 + 1.05 * i / (count - 1));
|
|
605
|
-
return steps.map((t) =>
|
|
605
|
+
return steps.map((t) => _chunkLL3H5XUHcjs.shadeChartColor.call(void 0, base, t));
|
|
606
606
|
}
|
|
607
607
|
var CHART_COLOR_SCHEMES = [
|
|
608
|
-
{ id: "default", label: "Default", description: "Ten distinct colours, readable on light and dark backgrounds.", palette:
|
|
608
|
+
{ id: "default", label: "Default", description: "Ten distinct colours, readable on light and dark backgrounds.", palette: _chunkLL3H5XUHcjs.DEFAULT_CHART_PALETTE },
|
|
609
609
|
{ 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"] },
|
|
610
610
|
{ id: "office", label: "Office", description: "The six accent colours of the default Office theme.", palette: ["#4472c4", "#ed7d31", "#a5a5a5", "#ffc000", "#5b9bd5", "#70ad47"] },
|
|
611
611
|
{ id: "warm", label: "Warm", description: "Reds, oranges and yellows.", palette: ["#b2182b", "#d6604d", "#f4a582", "#e08214", "#fdb863", "#8c510a"] },
|
|
@@ -664,7 +664,7 @@ var ChartController = (_class = class {
|
|
|
664
664
|
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);
|
|
665
665
|
this.history = _nullishCoalesce(options.history, () => ( new (0, _chunkFJ2MSI43cjs.HistoryManager)()));
|
|
666
666
|
this.onChange = options.onChange;
|
|
667
|
-
const { spec, issues } =
|
|
667
|
+
const { spec, issues } = _chunkLL3H5XUHcjs.normalizeChartSpec.call(void 0, _nullishCoalesce(options.spec, () => ( {})));
|
|
668
668
|
this.spec = spec;
|
|
669
669
|
this.issues = issues;
|
|
670
670
|
this.state = this.computeState();
|
|
@@ -767,7 +767,7 @@ var ChartController = (_class = class {
|
|
|
767
767
|
const hadIssues = this.issues.length > 0;
|
|
768
768
|
this.issues = [];
|
|
769
769
|
if (sameChartJson(before, next)) {
|
|
770
|
-
const reselect = select !== void 0 && !
|
|
770
|
+
const reselect = select !== void 0 && !_chunkHDGBM7EAcjs.sameChartSelection.call(void 0, this.selection, select) && !(select === null && this.selection === null);
|
|
771
771
|
if (reselect) this.selection = select;
|
|
772
772
|
if (reselect || hadIssues) this.notify(false);
|
|
773
773
|
return;
|
|
@@ -790,7 +790,7 @@ var ChartController = (_class = class {
|
|
|
790
790
|
}
|
|
791
791
|
/** A copy of the spec with `edit` applied (series and categories copied as needed). */
|
|
792
792
|
edited(edit) {
|
|
793
|
-
const draft =
|
|
793
|
+
const draft = _chunkLL3H5XUHcjs.cloneChartSpec.call(void 0, this.spec);
|
|
794
794
|
edit(draft);
|
|
795
795
|
return draft;
|
|
796
796
|
}
|
|
@@ -820,7 +820,7 @@ var ChartController = (_class = class {
|
|
|
820
820
|
legend: patch.legend ? { ...s.legend, ...patch.legend } : s.legend,
|
|
821
821
|
version: 1
|
|
822
822
|
};
|
|
823
|
-
const { spec, issues } =
|
|
823
|
+
const { spec, issues } = _chunkLL3H5XUHcjs.normalizeChartSpec.call(void 0, merged);
|
|
824
824
|
if (issues.length) return this.reject(issues.map((i) => i.message).join(" "), issues);
|
|
825
825
|
if (JSON.stringify(spec) === JSON.stringify(s)) return { ok: true };
|
|
826
826
|
this.commit(_nullishCoalesce(options.label, () => ( updateLabel(patch))), spec);
|
|
@@ -871,7 +871,7 @@ var ChartController = (_class = class {
|
|
|
871
871
|
const series = this.getSeries(seriesId);
|
|
872
872
|
if (!series) return this.unknownSeries(seriesId);
|
|
873
873
|
if (!Number.isInteger(index) || index < 0 || index >= this.spec.categories.length) return this.badIndex(index);
|
|
874
|
-
const parsed =
|
|
874
|
+
const parsed = _chunkLL3H5XUHcjs.parseChartValue.call(void 0, value);
|
|
875
875
|
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.` }]);
|
|
876
876
|
if (series.values[index] === parsed) {
|
|
877
877
|
if (this.issues.length) {
|
|
@@ -894,7 +894,7 @@ var ChartController = (_class = class {
|
|
|
894
894
|
if (!this.getSeries(cell.seriesId)) issues.push({ path: cell.seriesId, message: this.unknownSeries(cell.seriesId).message });
|
|
895
895
|
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 });
|
|
896
896
|
else {
|
|
897
|
-
const value =
|
|
897
|
+
const value = _chunkLL3H5XUHcjs.parseChartValue.call(void 0, cell.value);
|
|
898
898
|
if (value === void 0) issues.push({ path: `${cell.seriesId}[${cell.index}]`, message: `"${String(cell.value)}" is not a number.` });
|
|
899
899
|
else parsed.push({ seriesId: cell.seriesId, index: cell.index, value });
|
|
900
900
|
}
|
|
@@ -908,12 +908,12 @@ var ChartController = (_class = class {
|
|
|
908
908
|
}
|
|
909
909
|
/** Adds a series (values padded to the categories) and selects it. Returns its id. */
|
|
910
910
|
addSeries(input = {}, options = {}) {
|
|
911
|
-
const id = input.id && !this.getSeries(input.id) ? input.id :
|
|
911
|
+
const id = input.id && !this.getSeries(input.id) ? input.id : _chunkLL3H5XUHcjs.uniqueChartSeriesId.call(void 0, this.spec.series);
|
|
912
912
|
const name = _nullishCoalesce(input.name, () => ( `Series ${this.spec.series.length + 1}`));
|
|
913
913
|
const at = Math.max(0, Math.min(this.spec.series.length, _nullishCoalesce(options.at, () => ( this.spec.series.length))));
|
|
914
914
|
const series = [...this.spec.series];
|
|
915
915
|
series.splice(at, 0, { ...input, id, name, values: _nullishCoalesce(input.values, () => ( [])) });
|
|
916
|
-
const { spec, issues } =
|
|
916
|
+
const { spec, issues } = _chunkLL3H5XUHcjs.normalizeChartSpec.call(void 0, { ...this.spec, series });
|
|
917
917
|
if (issues.length) return this.reject(issues.map((i) => i.message).join(" "), issues);
|
|
918
918
|
this.commit(`Add series "${name}"`, spec, { kind: "series", seriesId: id });
|
|
919
919
|
return { ok: true, id };
|
|
@@ -932,7 +932,7 @@ var ChartController = (_class = class {
|
|
|
932
932
|
updateSeries(id, patch) {
|
|
933
933
|
const series = this.getSeries(id);
|
|
934
934
|
if (!series) return this.unknownSeries(id);
|
|
935
|
-
const next =
|
|
935
|
+
const next = _chunkLL3H5XUHcjs.cloneChartSeries.call(void 0, series);
|
|
936
936
|
if (patch.name !== void 0) next.name = String(patch.name);
|
|
937
937
|
if (patch.color === null || patch.color === "") delete next.color;
|
|
938
938
|
else if (patch.color !== void 0) next.color = patch.color;
|
|
@@ -950,7 +950,7 @@ var ChartController = (_class = class {
|
|
|
950
950
|
}
|
|
951
951
|
if (next.axis === "primary") delete next.axis;
|
|
952
952
|
const series2 = this.spec.series.map((s) => s.id === id ? next : s);
|
|
953
|
-
const { spec, issues } =
|
|
953
|
+
const { spec, issues } = _chunkLL3H5XUHcjs.normalizeChartSpec.call(void 0, { ...this.spec, series: series2 });
|
|
954
954
|
if (issues.length) return this.reject(issues.map((i) => i.message).join(" "), issues);
|
|
955
955
|
if (JSON.stringify(spec.series) === JSON.stringify(this.spec.series)) return { ok: true };
|
|
956
956
|
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}"`;
|
|
@@ -1043,7 +1043,7 @@ var ChartController = (_class = class {
|
|
|
1043
1043
|
const width = Math.max(...rows.map((r) => r.length));
|
|
1044
1044
|
const lastSeries = column + width - 1;
|
|
1045
1045
|
while (d.series.length <= lastSeries) {
|
|
1046
|
-
const id =
|
|
1046
|
+
const id = _chunkLL3H5XUHcjs.uniqueChartSeriesId.call(void 0, d.series);
|
|
1047
1047
|
d.series.push({ id, name: `Series ${d.series.length + 1}`, values: d.categories.map(() => null) });
|
|
1048
1048
|
}
|
|
1049
1049
|
const lastRow = row + rows.length - 1;
|
|
@@ -1057,7 +1057,7 @@ var ChartController = (_class = class {
|
|
|
1057
1057
|
const index = row + r;
|
|
1058
1058
|
if (col < 0) d.categories[index] = cell === null || cell === void 0 ? "" : String(cell).trim();
|
|
1059
1059
|
else {
|
|
1060
|
-
const parsed =
|
|
1060
|
+
const parsed = _chunkLL3H5XUHcjs.parseChartValue.call(void 0, cell);
|
|
1061
1061
|
if (parsed === void 0) issues.push({ path: `${d.series[col].id}[${index}]`, message: `"${String(cell)}" is not a number; it was left blank.` });
|
|
1062
1062
|
d.series[col].values[index] = _nullishCoalesce(parsed, () => ( null));
|
|
1063
1063
|
}
|
|
@@ -1076,14 +1076,14 @@ var ChartController = (_class = class {
|
|
|
1076
1076
|
* colours and types are kept by name.
|
|
1077
1077
|
*/
|
|
1078
1078
|
importTable(rows, options = {}) {
|
|
1079
|
-
const data =
|
|
1079
|
+
const data = _chunkLL3H5XUHcjs.chartDataFromTable.call(void 0, rows, options);
|
|
1080
1080
|
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.");
|
|
1081
1081
|
const byName = new Map(this.spec.series.map((s) => [s.name, s]));
|
|
1082
1082
|
const series = data.series.map((s) => {
|
|
1083
1083
|
const old = byName.get(s.name);
|
|
1084
1084
|
return { ...s, ..._optionalChain([old, 'optionalAccess', _27 => _27.color]) ? { color: old.color } : {}, ..._optionalChain([old, 'optionalAccess', _28 => _28.type]) ? { type: old.type } : {}, ...old ? { id: old.id } : {} };
|
|
1085
1085
|
});
|
|
1086
|
-
const { spec } =
|
|
1086
|
+
const { spec } = _chunkLL3H5XUHcjs.normalizeChartSpec.call(void 0, { ...this.spec, categories: data.categories, series });
|
|
1087
1087
|
this.commit("Import data", spec);
|
|
1088
1088
|
if (data.issues.length) {
|
|
1089
1089
|
this.issues = data.issues;
|
|
@@ -1104,10 +1104,10 @@ var ChartController = (_class = class {
|
|
|
1104
1104
|
addTrendline(seriesId, input) {
|
|
1105
1105
|
const series = this.getSeries(seriesId);
|
|
1106
1106
|
if (!series) return this.unknownSeries(seriesId);
|
|
1107
|
-
if (!
|
|
1107
|
+
if (!_chunkHDGBM7EAcjs.chartSupportsTrendlines.call(void 0, this.spec.type, this.spec.stacking))
|
|
1108
1108
|
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.`);
|
|
1109
1109
|
const issues = [];
|
|
1110
|
-
const line =
|
|
1110
|
+
const line = _chunkLL3H5XUHcjs.normalizeChartTrendline.call(void 0, input, "trendline", issues);
|
|
1111
1111
|
if (!line || issues.length) return this.reject(issues.map((i) => i.message).join(" ") || "The trendline is not valid.", issues);
|
|
1112
1112
|
const index = _nullishCoalesce(_optionalChain([series, 'access', _29 => _29.trendlines, 'optionalAccess', _30 => _30.length]), () => ( 0));
|
|
1113
1113
|
const next = this.edited((d) => {
|
|
@@ -1126,7 +1126,7 @@ var ChartController = (_class = class {
|
|
|
1126
1126
|
const issues = [];
|
|
1127
1127
|
const merged = { ...current, ...patch };
|
|
1128
1128
|
for (const [k, v] of Object.entries(patch)) if (v === null) delete merged[k];
|
|
1129
|
-
const line =
|
|
1129
|
+
const line = _chunkLL3H5XUHcjs.normalizeChartTrendline.call(void 0, merged, "trendline", issues);
|
|
1130
1130
|
if (!line || issues.length) return this.reject(issues.map((i) => i.message).join(" "), issues);
|
|
1131
1131
|
this.commit(
|
|
1132
1132
|
"Change trendline",
|
|
@@ -1154,7 +1154,7 @@ var ChartController = (_class = class {
|
|
|
1154
1154
|
trendlinePoints(seriesId) {
|
|
1155
1155
|
const series = this.getSeries(seriesId);
|
|
1156
1156
|
if (!series) return [];
|
|
1157
|
-
const xy =
|
|
1157
|
+
const xy = _chunkLL3H5XUHcjs.chartFamily.call(void 0, this.spec) === "xy";
|
|
1158
1158
|
const out = [];
|
|
1159
1159
|
series.values.forEach((v, i) => {
|
|
1160
1160
|
const x = xy ? _nullishCoalesce(_optionalChain([series, 'access', _37 => _37.x, 'optionalAccess', _38 => _38[i]]), () => ( (this.spec.type === "bubble" ? i + 1 : null))) : i + 1;
|
|
@@ -1166,13 +1166,13 @@ var ChartController = (_class = class {
|
|
|
1166
1166
|
trendlineFit(seriesId, index) {
|
|
1167
1167
|
const line = _optionalChain([this, 'access', _39 => _39.getSeries, 'call', _40 => _40(seriesId), 'optionalAccess', _41 => _41.trendlines, 'optionalAccess', _42 => _42[index]]);
|
|
1168
1168
|
if (!line) return null;
|
|
1169
|
-
return
|
|
1169
|
+
return _chunkHDGBM7EAcjs.fitChartTrendline.call(void 0, line, this.trendlinePoints(seriesId));
|
|
1170
1170
|
}
|
|
1171
1171
|
/** The moving-average points of a trendline (empty for other kinds). */
|
|
1172
1172
|
trendlineMovingAverage(seriesId, index) {
|
|
1173
1173
|
const line = _optionalChain([this, 'access', _43 => _43.getSeries, 'call', _44 => _44(seriesId), 'optionalAccess', _45 => _45.trendlines, 'optionalAccess', _46 => _46[index]]);
|
|
1174
1174
|
if (!line || line.type !== "moving-average") return [];
|
|
1175
|
-
return
|
|
1175
|
+
return _chunkHDGBM7EAcjs.chartMovingAverage.call(void 0, this.trendlinePoints(seriesId), _nullishCoalesce(line.period, () => ( 2)));
|
|
1176
1176
|
}
|
|
1177
1177
|
// -------------------------------------------------------------------------
|
|
1178
1178
|
// Reshaping
|
|
@@ -1191,7 +1191,7 @@ var ChartController = (_class = class {
|
|
|
1191
1191
|
used.add(id);
|
|
1192
1192
|
return { id, name, values: s.series.map((x) => _nullishCoalesce(x.values[i], () => ( null))) };
|
|
1193
1193
|
});
|
|
1194
|
-
const { spec } =
|
|
1194
|
+
const { spec } = _chunkLL3H5XUHcjs.normalizeChartSpec.call(void 0, { ...s, categories: s.series.map((x) => x.name), series });
|
|
1195
1195
|
this.commit("Switch rows and columns", spec, null);
|
|
1196
1196
|
return { ok: true };
|
|
1197
1197
|
}
|
|
@@ -1201,7 +1201,7 @@ var ChartController = (_class = class {
|
|
|
1201
1201
|
/** Selects a chart element (view state; not an undo step). */
|
|
1202
1202
|
select(selection) {
|
|
1203
1203
|
const next = this.validSelection(selection, this.spec);
|
|
1204
|
-
if (
|
|
1204
|
+
if (_chunkHDGBM7EAcjs.sameChartSelection.call(void 0, next, this.selection) || next === null && this.selection === null) return;
|
|
1205
1205
|
this.selection = next;
|
|
1206
1206
|
this.notify(false);
|
|
1207
1207
|
}
|
|
@@ -1276,14 +1276,14 @@ var ChartController = (_class = class {
|
|
|
1276
1276
|
// -------------------------------------------------------------------------
|
|
1277
1277
|
/** The spec, for saving (a copy). */
|
|
1278
1278
|
toJSON() {
|
|
1279
|
-
return
|
|
1279
|
+
return _chunkLL3H5XUHcjs.cloneChartSpec.call(void 0, this.spec);
|
|
1280
1280
|
}
|
|
1281
1281
|
/**
|
|
1282
1282
|
* Replaces the chart without an undo step (e.g. when opening a document). Problems are
|
|
1283
1283
|
* fixed with defaults and reported in `state.issues` (and returned).
|
|
1284
1284
|
*/
|
|
1285
1285
|
load(input, options = {}) {
|
|
1286
|
-
const { spec, issues } =
|
|
1286
|
+
const { spec, issues } = _chunkLL3H5XUHcjs.normalizeChartSpec.call(void 0, input);
|
|
1287
1287
|
this.spec = spec;
|
|
1288
1288
|
this.issues = issues;
|
|
1289
1289
|
this.selection = this.validSelection(this.selection, spec);
|
|
@@ -1303,7 +1303,7 @@ var ChartController = (_class = class {
|
|
|
1303
1303
|
* nothing changes and every problem is returned (and shown in `state.issues`).
|
|
1304
1304
|
*/
|
|
1305
1305
|
replace(input, options = {}) {
|
|
1306
|
-
const { spec, issues } =
|
|
1306
|
+
const { spec, issues } = _chunkLL3H5XUHcjs.normalizeChartSpec.call(void 0, input);
|
|
1307
1307
|
if (issues.length) return this.reject(issues.map((i) => i.message).join(" "), issues);
|
|
1308
1308
|
this.commit(_nullishCoalesce(options.label, () => ( "Replace chart")), spec, this.validSelection(this.selection, spec));
|
|
1309
1309
|
return { ok: true };
|
|
@@ -1365,7 +1365,7 @@ function layoutSparkline(values, options) {
|
|
|
1365
1365
|
const h = Number.isFinite(options.height) ? Math.max(1, options.height) : 1;
|
|
1366
1366
|
const color = _nullishCoalesce(options.color, () => ( "#4269d0"));
|
|
1367
1367
|
const negative = _nullishCoalesce(options.negativeColor, () => ( "#e5484d"));
|
|
1368
|
-
const theme = { ...
|
|
1368
|
+
const theme = { ..._chunkLL3H5XUHcjs.DEFAULT_CHART_THEME, background: "transparent" };
|
|
1369
1369
|
const marks = [];
|
|
1370
1370
|
const scene = { width: w, height: h, plot: { x: 0, y: 0, width: w, height: h }, marks, percent: false, theme, warnings: [] };
|
|
1371
1371
|
const vals = values.slice(0, MAX_POINTS).map((v) => v !== null && Number.isFinite(v) ? Math.max(-1e300, Math.min(1e300, v)) : null);
|
|
@@ -1398,7 +1398,7 @@ function layoutSparkline(values, options) {
|
|
|
1398
1398
|
const flush = () => {
|
|
1399
1399
|
if (run.length >= 2) {
|
|
1400
1400
|
const pts = run.length > 4e3 ? run.filter((_, i) => i % (Math.floor(run.length / 2e3) + 1) === 0) : run;
|
|
1401
|
-
d += pts.map(([x, y], i) => `${i ? "L" : "M"}${
|
|
1401
|
+
d += pts.map(([x, y], i) => `${i ? "L" : "M"}${_chunkHDGBM7EAcjs.r2.call(void 0, x)},${_chunkHDGBM7EAcjs.r2.call(void 0, y)}`).join("");
|
|
1402
1402
|
}
|
|
1403
1403
|
run = [];
|
|
1404
1404
|
};
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkLL3H5XUHcjs = require('./chunk-LL3H5XUH.cjs');
|
|
18
18
|
|
|
19
19
|
// src/chart/schemas.ts
|
|
20
20
|
var VALUE = { type: ["number", "string", "null"], description: 'A number, numeric text ("1,200", "12%", "$40", "(3)") or null for a gap.' };
|
|
@@ -26,7 +26,7 @@ var FORMAT = {
|
|
|
26
26
|
type: "object",
|
|
27
27
|
description: "How numbers are written on this axis or series.",
|
|
28
28
|
properties: {
|
|
29
|
-
style: { type: "string", enum: [...
|
|
29
|
+
style: { type: "string", enum: [..._chunkLL3H5XUHcjs.CHART_NUMBER_STYLES], description: "number (default), percent (0.25 \u2192 25%), currency or compact (1.2K)." },
|
|
30
30
|
decimals: { type: "integer", minimum: 0, maximum: 10, description: "Fixed decimals (default: what the ticks need)." },
|
|
31
31
|
currency: { type: "string", description: 'ISO currency code for style "currency", e.g. "EUR" (default USD).' },
|
|
32
32
|
prefix: { type: "string", description: "Text before every number." },
|
|
@@ -46,10 +46,10 @@ var AXIS = (what) => ({
|
|
|
46
46
|
step: { type: ["number", "null"], exclusiveMinimum: 0, description: "Fixed distance between ticks, or null for automatic." },
|
|
47
47
|
gridlines: { type: "boolean", description: "Grid lines at each tick." },
|
|
48
48
|
format: FORMAT,
|
|
49
|
-
kind: { type: ["string", "null"], enum: [...
|
|
49
|
+
kind: { type: ["string", "null"], enum: [..._chunkLL3H5XUHcjs.CHART_AXIS_KINDS, null], description: 'Category axis only: "date" reads categories as dates and labels them by calendar steps.' },
|
|
50
50
|
scale: {
|
|
51
51
|
type: ["string", "null"],
|
|
52
|
-
enum: [...
|
|
52
|
+
enum: [..._chunkLL3H5XUHcjs.CHART_AXIS_SCALES, null],
|
|
53
53
|
description: 'Value axes and the numeric x axis of scatter / bubble charts: "log" spaces ticks by powers of logBase (values of 0 or less are skipped; min and max must be above 0; not with percent stacking). "linear" or null is the default. Ignored on a category axis.'
|
|
54
54
|
},
|
|
55
55
|
logBase: { type: ["number", "null"], minimum: 2, maximum: 1e3, description: "Base of a log axis, 2 to 1000 (default 10; null resets)." },
|
|
@@ -58,7 +58,7 @@ var AXIS = (what) => ({
|
|
|
58
58
|
additionalProperties: false
|
|
59
59
|
});
|
|
60
60
|
var TRENDLINE_PROPS = {
|
|
61
|
-
type: { type: "string", enum: [...
|
|
61
|
+
type: { type: "string", enum: [..._chunkLL3H5XUHcjs.CHART_TRENDLINE_TYPES], description: "Fit: linear, exponential, logarithmic, power, polynomial or moving-average." },
|
|
62
62
|
order: { type: "integer", minimum: 2, maximum: 6, description: "Polynomial order (default 2)." },
|
|
63
63
|
period: { type: "integer", minimum: 2, description: "Moving-average period in points (default 2)." },
|
|
64
64
|
forward: { type: "number", minimum: 0, description: "Extend the line this many x units past the last point (default 0)." },
|
|
@@ -75,13 +75,13 @@ var ERROR_BARS = (what) => ({
|
|
|
75
75
|
properties: {
|
|
76
76
|
type: {
|
|
77
77
|
type: "string",
|
|
78
|
-
enum: [...
|
|
78
|
+
enum: [..._chunkLL3H5XUHcjs.CHART_ERROR_BAR_TYPES],
|
|
79
79
|
description: "fixed: the same amount at every point; percent: a percentage of each value; stddev: value standard deviations of the series, drawn around the series mean (as Excel does); stderr: the standard error of the series at every point; custom: per-point plus / minus amounts."
|
|
80
80
|
},
|
|
81
81
|
value: { type: "number", minimum: 0, description: "Amount in data units for fixed (default 1), percent of each value for percent (default 5), number of standard deviations for stddev (default 1). Not for stderr or custom." },
|
|
82
82
|
plus: { type: "array", items: VALUE, description: "custom only: amount above each point, one per category, in data units (0 or more; null for none)." },
|
|
83
83
|
minus: { type: "array", items: VALUE, description: "custom only: amount below each point, one per category (default: the plus amounts)." },
|
|
84
|
-
direction: { type: "string", enum: [...
|
|
84
|
+
direction: { type: "string", enum: [..._chunkLL3H5XUHcjs.CHART_ERROR_BAR_DIRECTIONS], description: "both (default), plus (only above) or minus (only below)." },
|
|
85
85
|
cap: { type: "boolean", description: "Draw end caps (default true)." }
|
|
86
86
|
},
|
|
87
87
|
required: ["type"],
|
|
@@ -91,21 +91,21 @@ var SERIES_PROPS = {
|
|
|
91
91
|
name: { type: "string", description: "Series name (legend and data grid header)." },
|
|
92
92
|
values: { type: "array", items: VALUE, description: "One value per category, in category order (padded with gaps)." },
|
|
93
93
|
color: { type: ["string", "null"], description: "CSS colour, or null for the palette colour." },
|
|
94
|
-
type: { type: ["string", "null"], enum: [...
|
|
94
|
+
type: { type: ["string", "null"], enum: [..._chunkLL3H5XUHcjs.CHART_SERIES_TYPES, null], description: "Draw this series as bar, line, area or scatter (a combo chart); null follows the chart type." },
|
|
95
95
|
hidden: { type: "boolean", description: "Hide the series (its data is kept)." },
|
|
96
96
|
axis: { type: ["string", "null"], enum: ["primary", "secondary", null], description: "Value axis: secondary is drawn on the right with its own scale." },
|
|
97
97
|
x: { type: ["array", "null"], items: VALUE, description: "Numeric x per category, for scatter and bubble charts." },
|
|
98
98
|
sizes: { type: ["array", "null"], items: VALUE, description: "Bubble sizes per category (area is proportional to size)." },
|
|
99
99
|
pointColors: { type: ["array", "null"], items: { type: ["string", "null"] }, description: "Colour per category (null keeps the series colour)." },
|
|
100
|
-
marker: { type: ["string", "null"], enum: [...
|
|
101
|
-
curve: { type: ["string", "null"], enum: [...
|
|
100
|
+
marker: { type: ["string", "null"], enum: [..._chunkLL3H5XUHcjs.CHART_MARKERS, null], description: "Point marker shape for line, area and scatter series." },
|
|
101
|
+
curve: { type: ["string", "null"], enum: [..._chunkLL3H5XUHcjs.CHART_CURVES, null], description: "Line shape for this series: linear, smooth or step." },
|
|
102
102
|
dataLabels: { type: ["boolean", "null"], description: "Value labels for this series (null follows the chart)." },
|
|
103
103
|
format: { ...FORMAT, type: ["object", "null"], description: "How this series' labels are written (null follows the value axis)." },
|
|
104
104
|
errorBars: ERROR_BARS("Error bars along the value axis (bar, line, area and scatter series; on stacked charts they sit on the stack top)."),
|
|
105
105
|
xErrorBars: ERROR_BARS("Error bars along the x axis (scatter and bubble charts with numeric x values; amounts in x units).")
|
|
106
106
|
};
|
|
107
107
|
var CHART_UPDATE_PROPERTIES = {
|
|
108
|
-
type: { type: "string", enum: [...
|
|
108
|
+
type: { type: "string", enum: [..._chunkLL3H5XUHcjs.CHART_TYPES], description: "Chart type." },
|
|
109
109
|
title: { type: "string", description: 'Title ("" for none).' },
|
|
110
110
|
subtitle: { type: "string", description: 'Subtitle ("" for none).' },
|
|
111
111
|
xAxis: AXIS("Category axis (or numeric x axis of scatter / bubble charts)."),
|
|
@@ -114,15 +114,15 @@ var CHART_UPDATE_PROPERTIES = {
|
|
|
114
114
|
legend: {
|
|
115
115
|
type: "object",
|
|
116
116
|
description: "Legend.",
|
|
117
|
-
properties: { show: { type: "boolean", description: "Show the legend." }, position: { type: "string", enum: [...
|
|
117
|
+
properties: { show: { type: "boolean", description: "Show the legend." }, position: { type: "string", enum: [..._chunkLL3H5XUHcjs.CHART_LEGEND_POSITIONS], description: "Where the legend goes." } },
|
|
118
118
|
additionalProperties: false
|
|
119
119
|
},
|
|
120
|
-
stacking: { type: "string", enum: [...
|
|
121
|
-
orientation: { type: "string", enum: [...
|
|
122
|
-
curve: { type: "string", enum: [...
|
|
120
|
+
stacking: { type: "string", enum: [..._chunkLL3H5XUHcjs.CHART_STACKINGS], description: "none, stacked, or percent (each category scaled to 100%)." },
|
|
121
|
+
orientation: { type: "string", enum: [..._chunkLL3H5XUHcjs.CHART_ORIENTATIONS], description: "horizontal draws bars sideways." },
|
|
122
|
+
curve: { type: "string", enum: [..._chunkLL3H5XUHcjs.CHART_CURVES], description: "Line shape: linear, smooth or step." },
|
|
123
123
|
points: { type: "boolean", description: "Dots on line and area series." },
|
|
124
124
|
dataLabels: { type: "boolean", description: "Value labels on bars, points and slices." },
|
|
125
|
-
labelPosition: { type: "string", enum: [...
|
|
125
|
+
labelPosition: { type: "string", enum: [..._chunkLL3H5XUHcjs.CHART_LABEL_POSITIONS], description: "Bar label position; auto drops labels that do not fit." },
|
|
126
126
|
palette: { type: "array", items: { type: "string" }, minItems: 1, description: "Series colours in order (CSS colours)." },
|
|
127
127
|
innerRadius: { type: "number", minimum: 0, maximum: 0.9, description: "Donut hole as a fraction of the radius." },
|
|
128
128
|
gapWidth: { type: "number", minimum: 0, maximum: 0.9, description: "Space between bar groups as a fraction of the category (default 0.28)." },
|
|
@@ -130,7 +130,7 @@ var CHART_UPDATE_PROPERTIES = {
|
|
|
130
130
|
bins: { type: ["integer", "null"], minimum: 1, maximum: 500, description: "Histogram bin count, or null for \u221An." },
|
|
131
131
|
showTotal: { type: "boolean", description: "Waterfall: append a total bar." },
|
|
132
132
|
radarTicks: { type: ["integer", "null"], minimum: 1, maximum: 50, description: "Radar: number of evenly spaced rings from the value axis min to max, or null for round-number rings (default null)." },
|
|
133
|
-
radarGraticule: { type: "string", enum: [...
|
|
133
|
+
radarGraticule: { type: "string", enum: [..._chunkLL3H5XUHcjs.CHART_RADAR_GRATICULES], description: "Radar: draw rings as polygons through the spokes or as circles (default polygon)." }
|
|
134
134
|
};
|
|
135
135
|
|
|
136
136
|
|