@pixerate/editor 0.164.0 → 0.166.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.cjs +54 -39
- package/dist/agent/index.js +24 -9
- package/dist/animation/index.cjs +6 -5
- package/dist/animation/index.js +5 -4
- package/dist/animation-editor/index.cjs +65 -64
- package/dist/animation-editor/index.js +8 -7
- package/dist/bridge/cli.cjs +3 -3
- package/dist/bridge/cli.js +2 -2
- package/dist/bridge/index.cjs +3 -3
- package/dist/bridge/index.js +2 -2
- package/dist/canvas/index.cjs +89 -87
- package/dist/canvas/index.js +11 -9
- package/dist/chart/controller.d.cts +60 -2
- package/dist/chart/controller.d.ts +60 -2
- package/dist/chart/index.cjs +657 -163
- package/dist/chart/index.d.cts +3 -0
- package/dist/chart/index.d.ts +3 -0
- package/dist/chart/index.js +512 -18
- package/dist/chart/layout-families.d.cts +14 -0
- package/dist/chart/layout-families.d.ts +14 -0
- package/dist/chart/layout-shared.d.cts +5 -0
- package/dist/chart/layout-shared.d.ts +5 -0
- package/dist/chart/links.d.cts +34 -0
- package/dist/chart/links.d.ts +34 -0
- package/dist/chart/mermaid.d.cts +9 -6
- package/dist/chart/mermaid.d.ts +9 -6
- package/dist/chart/race.d.cts +26 -0
- package/dist/chart/race.d.ts +26 -0
- package/dist/chart/schemas.d.cts +5 -0
- package/dist/chart/schemas.d.ts +5 -0
- package/dist/chart/spec.d.cts +3 -2
- package/dist/chart/spec.d.ts +3 -2
- package/dist/chart/style.d.cts +33 -0
- package/dist/chart/style.d.ts +33 -0
- package/dist/chart/types.d.cts +28 -2
- package/dist/chart/types.d.ts +28 -2
- package/dist/{chunk-ZVNAMTFO.cjs → chunk-3FSUJIXN.cjs} +18 -174
- package/dist/{chunk-RQCMSEM5.cjs → chunk-4QUUHTGJ.cjs} +2 -2
- package/dist/{chunk-CIPIESX4.cjs → chunk-4ZC5QJE2.cjs} +3 -3
- package/dist/{chunk-S6X2QRVU.cjs → chunk-5UEFBM2M.cjs} +1 -138
- package/dist/{chunk-5FNGLV2D.js → chunk-5UNQDC3Q.js} +18 -3
- package/dist/{chunk-YSAGBIRW.cjs → chunk-6FYIFGBW.cjs} +16 -16
- package/dist/{chunk-QYZGBVNC.js → chunk-7272D3K2.js} +10 -8
- package/dist/{chunk-462WGGXX.cjs → chunk-AMX23CSN.cjs} +27 -16
- package/dist/{chunk-3VLOOO3G.js → chunk-BDIM6NVW.js} +1 -1
- package/dist/{chunk-R3P2M7HU.cjs → chunk-BPX4Z3N3.cjs} +355 -207
- package/dist/{chunk-D54JHQK2.cjs → chunk-CHLV7UFP.cjs} +51 -51
- package/dist/{chunk-OXERWBKE.js → chunk-DFCAR7AW.js} +3 -3
- package/dist/{chunk-GZ2FM3ZB.js → chunk-DKNEQX7T.js} +6 -162
- package/dist/{chunk-JCXMJUQO.cjs → chunk-EGZM52EO.cjs} +3 -3
- package/dist/{chunk-ES3UEVUT.cjs → chunk-EUIDTZNQ.cjs} +112 -110
- package/dist/{chunk-H3OEM3Q2.js → chunk-F6R67I3A.js} +1 -1
- package/dist/{chunk-3NEZJCBY.js → chunk-FR432ROA.js} +349 -201
- package/dist/chunk-HIDFL5LQ.js +484 -0
- package/dist/{chunk-22KLZZGH.cjs → chunk-HXOBOHH2.cjs} +8 -8
- package/dist/{chunk-MKTDELCD.js → chunk-I5MRJW7B.js} +1 -1
- package/dist/{chunk-SDHZG5TF.js → chunk-ILP77UD6.js} +160 -2
- package/dist/{chunk-Z4P2RBMJ.js → chunk-ITANXMZD.js} +177 -3
- package/dist/chunk-KGRZMHZB.js +204 -0
- package/dist/{chunk-SET6KJOP.js → chunk-LPIKXPBM.js} +1 -1
- package/dist/{chunk-BQWGN5WH.js → chunk-M2TPMYJE.js} +1 -1
- package/dist/{chunk-GTELFJRE.cjs → chunk-M5GLQQWG.cjs} +2 -2
- package/dist/{chunk-4VU4CP7R.js → chunk-MHLU6GRJ.js} +1 -138
- package/dist/{chunk-NZD2MZJC.cjs → chunk-MZFZSVUJ.cjs} +38 -23
- package/dist/{chunk-DAPQGA55.js → chunk-NQQDGGXY.js} +2 -2
- package/dist/chunk-O6OGNDND.js +164 -0
- package/dist/{chunk-PA3IMPPS.cjs → chunk-OVYQAYGH.cjs} +81 -81
- package/dist/{chunk-YXOW456B.js → chunk-PPEDZ5WR.js} +1 -1
- package/dist/{chunk-24M7VD6M.cjs → chunk-S4EIAIEW.cjs} +7 -7
- package/dist/{chunk-M4MIZPQI.cjs → chunk-SJ2CPTQC.cjs} +189 -15
- package/dist/{chunk-YGG7WDWT.cjs → chunk-SZWVMB3B.cjs} +24 -18
- package/dist/chunk-TFF2GTGN.cjs +153 -0
- package/dist/chunk-TTCJPX4U.cjs +204 -0
- package/dist/{chunk-SBQVEBSU.cjs → chunk-UUUTEVX6.cjs} +242 -68
- package/dist/{chunk-WI7QJA7A.cjs → chunk-UXETV2NC.cjs} +161 -3
- package/dist/{chunk-GKNEJ6EN.cjs → chunk-V5L2G22R.cjs} +321 -107
- package/dist/{chunk-TALQONZ5.js → chunk-VB2CY6EG.js} +3 -3
- package/dist/{chunk-QY4KUDMY.js → chunk-VRXXAXUT.js} +2 -2
- package/dist/chunk-VU6WQSMB.cjs +164 -0
- package/dist/{chunk-NHLYK3AX.js → chunk-XBQX76CT.js} +182 -8
- package/dist/{chunk-5AARIS3R.cjs → chunk-XCDGM7TD.cjs} +37 -37
- package/dist/{chunk-POR54B55.js → chunk-XNU45TYA.js} +7 -1
- package/dist/{chunk-EVXQNQND.js → chunk-XZB3TJ6K.js} +16 -5
- package/dist/chunk-YBAPT7NL.js +153 -0
- package/dist/{chunk-SZA42R4N.js → chunk-YUFTVNLX.js} +230 -16
- package/dist/chunk-Z2UQYMPS.cjs +484 -0
- package/dist/color/index.cjs +5 -3
- package/dist/color/index.js +12 -10
- package/dist/diagram/index.cjs +55 -243
- package/dist/diagram/index.js +12 -200
- package/dist/export/index.cjs +7 -6
- package/dist/export/index.js +6 -5
- package/dist/extensions/index.cjs +12 -9
- package/dist/extensions/index.js +11 -8
- package/dist/gradient/index.cjs +29 -27
- package/dist/gradient/index.js +6 -4
- package/dist/image-editor/index.cjs +644 -643
- package/dist/image-editor/index.js +7 -6
- package/dist/index.cjs +21 -18
- package/dist/index.js +14 -11
- package/dist/paint-editor/index.cjs +19 -18
- package/dist/paint-editor/index.js +7 -6
- package/dist/parameters/index.cjs +2 -2
- package/dist/parameters/index.js +1 -1
- package/dist/persistence/assetWrites.d.cts +22 -0
- package/dist/persistence/assetWrites.d.ts +22 -0
- package/dist/persistence/assets.d.cts +71 -0
- package/dist/persistence/assets.d.ts +71 -0
- package/dist/persistence/documentStore.d.cts +17 -1
- package/dist/persistence/documentStore.d.ts +17 -1
- package/dist/persistence/documentTools.d.cts +5 -1
- package/dist/persistence/documentTools.d.ts +5 -1
- package/dist/persistence/editorAutosave.d.cts +7 -0
- package/dist/persistence/editorAutosave.d.ts +7 -0
- package/dist/persistence/index.cjs +141 -21
- package/dist/persistence/index.js +130 -10
- package/dist/persistence/storage.d.cts +13 -1
- package/dist/persistence/storage.d.ts +13 -1
- package/dist/spreadsheet/index.cjs +3 -3
- package/dist/spreadsheet/index.js +2 -2
- package/dist/tokens/index.cjs +11 -3
- package/dist/tokens/index.d.cts +1 -0
- package/dist/tokens/index.d.ts +1 -0
- package/dist/tokens/index.js +10 -2
- package/dist/tokens/style.d.cts +36 -0
- package/dist/tokens/style.d.ts +36 -0
- package/dist/tools/index.cjs +15 -3
- package/dist/tools/index.d.cts +2 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.js +14 -2
- package/dist/tools/style-tools.d.cts +19 -0
- package/dist/tools/style-tools.d.ts +19 -0
- package/dist/tools/style.d.cts +212 -0
- package/dist/tools/style.d.ts +212 -0
- package/dist/tools/view.d.cts +6 -0
- package/dist/tools/view.d.ts +6 -0
- package/dist/typography/index.cjs +8 -6
- package/dist/typography/index.js +5 -3
- package/dist/vector/index.cjs +953 -952
- package/dist/vector/index.js +7 -6
- package/dist/video-editor/index.cjs +8 -7
- package/dist/video-editor/index.js +6 -5
- package/package.json +1 -1
- package/skills/pixerate-chart/SKILL.md +20 -2
- package/dist/chunk-ERAGQL2N.cjs +0 -68
- package/dist/chunk-KMU6QJB7.js +0 -68
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkBPX4Z3N3cjs = require('./chunk-BPX4Z3N3.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
var _chunk55AKPTLMcjs = require('./chunk-55AKPTLM.cjs');
|
|
@@ -907,7 +907,7 @@ function drawCallouts(ctx, plot) {
|
|
|
907
907
|
if (s.hidden || !s.callouts) continue;
|
|
908
908
|
s.callouts.forEach((label, i) => {
|
|
909
909
|
if (!label) return;
|
|
910
|
-
const mark = marks.find((m) => (m.role === "bar" || m.role === "point") && _optionalChain([m, 'access',
|
|
910
|
+
const mark = marks.find((m) => (m.role === "bar" || m.role === "point") && _optionalChain([m, 'access', _3 => _3.target, 'optionalAccess', _4 => _4.kind]) === "point" && m.target.seriesId === s.id && m.target.index === i);
|
|
911
911
|
const anchor = mark ? anchorOf(mark, horizontal && mark.kind === "rect") : null;
|
|
912
912
|
if (!anchor) {
|
|
913
913
|
unplaced++;
|
|
@@ -948,7 +948,7 @@ function drawCallouts(ctx, plot) {
|
|
|
948
948
|
}
|
|
949
949
|
if (unplaced) ctx.warn("annotations-skipped", `${unplaced} callout${unplaced === 1 ? " points" : "s point"} at a gap or a hidden value and ${unplaced === 1 ? "is" : "are"} not drawn.`);
|
|
950
950
|
}
|
|
951
|
-
var MUTED = /* @__PURE__ */ new Set(["bar", "line", "area", "point", "slice", "cell", "box", "whisker", "outlier", "connector", "trendline", "trendline-label", "error-bar", "data-label", "legend-swatch", "legend-label"]);
|
|
951
|
+
var MUTED = /* @__PURE__ */ new Set(["node", "bar", "line", "area", "point", "slice", "cell", "box", "whisker", "outlier", "connector", "trendline", "trendline-label", "error-bar", "data-label", "legend-swatch", "legend-label"]);
|
|
952
952
|
function applyHighlight(ctx) {
|
|
953
953
|
const { spec, marks } = ctx;
|
|
954
954
|
if (!spec.highlight.length) return;
|
|
@@ -992,8 +992,8 @@ var MAX_CHART_DATA_LABELS = 200;
|
|
|
992
992
|
var MAX_CHART_LINE_POINTS = 2e3;
|
|
993
993
|
var MAX_CHART_MARKERS = 1e3;
|
|
994
994
|
function scaleInfo(scale, range, format, axis) {
|
|
995
|
-
const logBase = _optionalChain([axis, 'optionalAccess',
|
|
996
|
-
const r = _optionalChain([axis, 'optionalAccess',
|
|
995
|
+
const logBase = _optionalChain([axis, 'optionalAccess', _5 => _5.scale]) === "log" ? _nullishCoalesce(axis.logBase, () => ( 10)) : void 0;
|
|
996
|
+
const r = _optionalChain([axis, 'optionalAccess', _6 => _6.reverse]) ? [range[1], range[0]] : range;
|
|
997
997
|
const vs = { domain: [scale.min, scale.max], range: r, logBase };
|
|
998
998
|
const raw = (v) => chartScaleToPixel(v, vs);
|
|
999
999
|
const px = (v) => logBase && !(v > 0) ? r[0] : raw(Math.min(scale.max, Math.max(scale.min, v)));
|
|
@@ -1014,7 +1014,7 @@ function categoryFrame(ctx, area, input) {
|
|
|
1014
1014
|
};
|
|
1015
1015
|
const valueLen0 = horizontal ? area.width : area.height;
|
|
1016
1016
|
const valueLabelWidth = primary.axis.show ? estimate(primary, valueLen0) : 0;
|
|
1017
|
-
const valueLabelWidth2 = _optionalChain([secondary, 'optionalAccess',
|
|
1017
|
+
const valueLabelWidth2 = _optionalChain([secondary, 'optionalAccess', _7 => _7.axis, 'access', _8 => _8.show]) ? estimate(secondary, valueLen0) : 0;
|
|
1018
1018
|
const catLabelWidth = Math.max(0, ...labels.map((c) => measure(c, fs)));
|
|
1019
1019
|
let left;
|
|
1020
1020
|
let bottom;
|
|
@@ -1138,7 +1138,7 @@ function categoryFrame(ctx, area, input) {
|
|
|
1138
1138
|
marks.push({ kind: "text", key: `axis-title-${horizontal ? "y" : "x"}`, role: "axis-title", x: plot.x + plot.width / 2, y: area.y + area.height, text: bottomTitle, anchor: "middle", baseline: "bottom", size: fs + 1, weight: 500, fill: theme.text, target: horizontal ? yTarget : xTarget });
|
|
1139
1139
|
if (leftTitle)
|
|
1140
1140
|
marks.push({ kind: "text", key: `axis-title-${horizontal ? "x" : "y"}`, role: "axis-title", x: area.x, y: plot.y + plot.height / 2, text: leftTitle, anchor: "middle", baseline: "top", size: fs + 1, weight: 500, fill: theme.text, rotate: -90, target: horizontal ? xTarget : yTarget });
|
|
1141
|
-
if (_optionalChain([secondary, 'optionalAccess',
|
|
1141
|
+
if (_optionalChain([secondary, 'optionalAccess', _9 => _9.axis, 'access', _10 => _10.title])) {
|
|
1142
1142
|
const target = { kind: "axis", axis: "y2" };
|
|
1143
1143
|
if (horizontal) marks.push({ kind: "text", key: "axis-title-y2", role: "axis-title", x: plot.x + plot.width / 2, y: area.y, text: secondary.axis.title, anchor: "middle", baseline: "top", size: fs + 1, weight: 500, fill: theme.text, target });
|
|
1144
1144
|
else marks.push({ kind: "text", key: "axis-title-y2", role: "axis-title", x: area.x + area.width, y: plot.y + plot.height / 2, text: secondary.axis.title, anchor: "middle", baseline: "top", size: fs + 1, weight: 500, fill: theme.text, rotate: 90, target });
|
|
@@ -1239,7 +1239,7 @@ function layoutCartesian(ctx, area, visible) {
|
|
|
1239
1239
|
const { spec, theme, marks, measure, fs } = ctx;
|
|
1240
1240
|
const horizontal = spec.orientation === "horizontal";
|
|
1241
1241
|
const n = spec.categories.length;
|
|
1242
|
-
const types = new Map(visible.map((s) => [s.id,
|
|
1242
|
+
const types = new Map(visible.map((s) => [s.id, _chunkBPX4Z3N3cjs.chartSeriesType.call(void 0, spec, s)]));
|
|
1243
1243
|
const stacked = spec.stacking !== "none";
|
|
1244
1244
|
const percent = spec.stacking === "percent";
|
|
1245
1245
|
const onSecondary = (s) => s.axis === "secondary";
|
|
@@ -1276,9 +1276,9 @@ function layoutCartesian(ctx, area, visible) {
|
|
|
1276
1276
|
const stack = stacks.get(s.id);
|
|
1277
1277
|
errors.set(
|
|
1278
1278
|
s.id,
|
|
1279
|
-
|
|
1279
|
+
_chunkBPX4Z3N3cjs.chartErrorAmounts.call(void 0, s.errorBars, s.values).map((e, i) => {
|
|
1280
1280
|
const raw = s.values[i];
|
|
1281
|
-
const seg = _optionalChain([stack, 'optionalAccess',
|
|
1281
|
+
const seg = _optionalChain([stack, 'optionalAccess', _11 => _11.segments, 'access', _12 => _12[i]]);
|
|
1282
1282
|
if (!e || raw === null || stack && !seg) return null;
|
|
1283
1283
|
const k = seg && percent ? raw ? (seg[1] - seg[0]) / raw : 0 : 1;
|
|
1284
1284
|
const center = (seg ? seg[1] : raw) + (e.center - raw) * k;
|
|
@@ -1300,7 +1300,7 @@ function layoutCartesian(ctx, area, visible) {
|
|
|
1300
1300
|
const stack = stacks.get(s.id);
|
|
1301
1301
|
if (stack) stack.segments.forEach((seg) => seg && (see(seg[0]), see(seg[1])));
|
|
1302
1302
|
else s.values.forEach((v) => v !== null && see(v));
|
|
1303
|
-
_optionalChain([errors, 'access',
|
|
1303
|
+
_optionalChain([errors, 'access', _13 => _13.get, 'call', _14 => _14(s.id), 'optionalAccess', _15 => _15.forEach, 'call', _16 => _16((e) => e && (see(e.lo), see(e.hi)))]);
|
|
1304
1304
|
}
|
|
1305
1305
|
for (const v of referenceValues(spec, secondary ? "y2" : "y")) see(v);
|
|
1306
1306
|
if (log) {
|
|
@@ -1346,7 +1346,7 @@ function layoutCartesian(ctx, area, visible) {
|
|
|
1346
1346
|
const drawOrder = [...visible].sort((a, b) => order(types.get(a.id)) - order(types.get(b.id)));
|
|
1347
1347
|
for (const s of drawOrder) {
|
|
1348
1348
|
const si = spec.series.indexOf(s);
|
|
1349
|
-
const color =
|
|
1349
|
+
const color = _chunkBPX4Z3N3cjs.chartSeriesColor.call(void 0, spec, si);
|
|
1350
1350
|
const type = types.get(s.id);
|
|
1351
1351
|
const stack = stacks.get(s.id);
|
|
1352
1352
|
const selSeries = ctx.seriesSelected(s.id);
|
|
@@ -1372,7 +1372,7 @@ function layoutCartesian(ctx, area, visible) {
|
|
|
1372
1372
|
const selected = ctx.isSelected(target);
|
|
1373
1373
|
const [x, y] = map({ c: c0, v: Math.min(a, b) });
|
|
1374
1374
|
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) };
|
|
1375
|
-
const fill =
|
|
1375
|
+
const fill = _chunkBPX4Z3N3cjs.chartPointColor.call(void 0, spec, si, i);
|
|
1376
1376
|
marks.push({
|
|
1377
1377
|
kind: "rect",
|
|
1378
1378
|
key: `bar-${s.id}-${i}`,
|
|
@@ -1400,7 +1400,7 @@ function layoutCartesian(ctx, area, visible) {
|
|
|
1400
1400
|
} else {
|
|
1401
1401
|
const curve = _nullishCoalesce(s.curve, () => ( spec.curve));
|
|
1402
1402
|
const pointValue = (i) => {
|
|
1403
|
-
const v = stack ? _nullishCoalesce(_optionalChain([stack, 'access',
|
|
1403
|
+
const v = stack ? _nullishCoalesce(_optionalChain([stack, 'access', _17 => _17.segments, 'access', _18 => _18[i], 'optionalAccess', _19 => _19[1]]), () => ( null)) : s.values[i];
|
|
1404
1404
|
return v !== null && Number.isFinite(v) && !(log && (v <= 0 || (_nullishCoalesce(s.values[i], () => ( 0))) <= 0)) ? v : null;
|
|
1405
1405
|
};
|
|
1406
1406
|
const runs = [];
|
|
@@ -1424,7 +1424,7 @@ function layoutCartesian(ctx, area, visible) {
|
|
|
1424
1424
|
const drawn = runs.map(thin);
|
|
1425
1425
|
if (type === "area") {
|
|
1426
1426
|
const parts = drawn.map((r) => {
|
|
1427
|
-
const baseline = stack ? r.map((pt) => ({ c: pt.c, v: valuePx(_nullishCoalesce(_optionalChain([stack, 'access',
|
|
1427
|
+
const baseline = stack ? r.map((pt) => ({ c: pt.c, v: valuePx(_nullishCoalesce(_optionalChain([stack, 'access', _20 => _20.segments, 'access', _21 => _21[pt.i], 'optionalAccess', _22 => _22[0]]), () => ( 0))) })).reverse() : [
|
|
1428
1428
|
{ c: r[r.length - 1].c, v: info.zero },
|
|
1429
1429
|
{ c: r[0].c, v: info.zero }
|
|
1430
1430
|
];
|
|
@@ -1451,7 +1451,7 @@ function layoutCartesian(ctx, area, visible) {
|
|
|
1451
1451
|
const target = { kind: "point", seriesId: s.id, index: i };
|
|
1452
1452
|
const selected = ctx.isSelected(target);
|
|
1453
1453
|
const r = type === "scatter" ? 4.5 : 3.5;
|
|
1454
|
-
const pointColor =
|
|
1454
|
+
const pointColor = _chunkBPX4Z3N3cjs.chartPointColor.call(void 0, spec, si, i);
|
|
1455
1455
|
const fill = showDots ? type === "scatter" ? pointColor : theme.surface : "transparent";
|
|
1456
1456
|
marks.push(
|
|
1457
1457
|
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)
|
|
@@ -1488,7 +1488,7 @@ function layoutCartesian(ctx, area, visible) {
|
|
|
1488
1488
|
if (d) errorMarks.push({ kind: "path", key: `error-bar-${s.id}-${i}`, role: "error-bar", d, fill: "none", stroke: type === "bar" ? theme.text : color, strokeWidth: selSeries ? 2 : 1.25, target: seriesTarget, selected: selSeries });
|
|
1489
1489
|
});
|
|
1490
1490
|
}
|
|
1491
|
-
if (trendsAllowed && _optionalChain([s, 'access',
|
|
1491
|
+
if (trendsAllowed && _optionalChain([s, 'access', _23 => _23.trendlines, 'optionalAccess', _24 => _24.length])) {
|
|
1492
1492
|
const points = [];
|
|
1493
1493
|
s.values.forEach((v, i) => v !== null && Number.isFinite(v) && points.push([i + 1, v]));
|
|
1494
1494
|
const toPx = (x, y) => map({ c: catCenter(x - 1), v: info.raw(y) });
|
|
@@ -1514,7 +1514,7 @@ function layoutXy(ctx, area, visible) {
|
|
|
1514
1514
|
const xLog = xAxis.scale === "log";
|
|
1515
1515
|
const yLog = yAxis.scale === "log";
|
|
1516
1516
|
let skipped = 0;
|
|
1517
|
-
const pointsOf = (s) => s.values.map((y, i) => ({ i, x: _nullishCoalesce(_optionalChain([s, 'access',
|
|
1517
|
+
const pointsOf = (s) => s.values.map((y, i) => ({ i, x: _nullishCoalesce(_optionalChain([s, 'access', _25 => _25.x, 'optionalAccess', _26 => _26[i]]), () => ( (bubble || !s.x ? i + 1 : null))), y, size: _nullishCoalesce(_optionalChain([s, 'access', _27 => _27.sizes, 'optionalAccess', _28 => _28[i]]), () => ( null)) })).filter((p) => {
|
|
1518
1518
|
if (p.x === null || p.y === null || !Number.isFinite(p.x) || !Number.isFinite(p.y)) return false;
|
|
1519
1519
|
if (xLog && p.x <= 0 || yLog && p.y <= 0) return skipped++, false;
|
|
1520
1520
|
return true;
|
|
@@ -1524,8 +1524,8 @@ function layoutXy(ctx, area, visible) {
|
|
|
1524
1524
|
const yErrors = /* @__PURE__ */ new Map();
|
|
1525
1525
|
const xErrors = /* @__PURE__ */ new Map();
|
|
1526
1526
|
for (const { s } of all) {
|
|
1527
|
-
if (s.errorBars) yErrors.set(s.id,
|
|
1528
|
-
if (s.xErrorBars) xErrors.set(s.id,
|
|
1527
|
+
if (s.errorBars) yErrors.set(s.id, _chunkBPX4Z3N3cjs.chartErrorAmounts.call(void 0, s.errorBars, s.values));
|
|
1528
|
+
if (s.xErrorBars) xErrors.set(s.id, _chunkBPX4Z3N3cjs.chartErrorAmounts.call(void 0, s.xErrorBars, s.values.map((_, i) => _nullishCoalesce(_optionalChain([s, 'access', _29 => _29.x, 'optionalAccess', _30 => _30[i]]), () => ( (bubble || !s.x ? i + 1 : null))))));
|
|
1529
1529
|
}
|
|
1530
1530
|
let xlo = Infinity;
|
|
1531
1531
|
let xhi = -Infinity;
|
|
@@ -1547,9 +1547,9 @@ function layoutXy(ctx, area, visible) {
|
|
|
1547
1547
|
seeX(p.x);
|
|
1548
1548
|
seeY(p.y);
|
|
1549
1549
|
if (p.size !== null && p.size > maxSize) maxSize = p.size;
|
|
1550
|
-
const ey = _optionalChain([yErrors, 'access',
|
|
1550
|
+
const ey = _optionalChain([yErrors, 'access', _31 => _31.get, 'call', _32 => _32(s.id), 'optionalAccess', _33 => _33[p.i]]);
|
|
1551
1551
|
if (ey) seeY(ey.center - ey.minus), seeY(ey.center + ey.plus);
|
|
1552
|
-
const ex = _optionalChain([xErrors, 'access',
|
|
1552
|
+
const ex = _optionalChain([xErrors, 'access', _34 => _34.get, 'call', _35 => _35(s.id), 'optionalAccess', _36 => _36[p.i]]);
|
|
1553
1553
|
if (ex) seeX(ex.center - ex.minus), seeX(ex.center + ex.plus);
|
|
1554
1554
|
}
|
|
1555
1555
|
for (const t of _nullishCoalesce(s.trendlines, () => ( []))) {
|
|
@@ -1608,8 +1608,8 @@ function layoutXy(ctx, area, visible) {
|
|
|
1608
1608
|
const trendLabels = [];
|
|
1609
1609
|
for (const { s, pts } of all) {
|
|
1610
1610
|
const si = spec.series.indexOf(s);
|
|
1611
|
-
const color =
|
|
1612
|
-
const type =
|
|
1611
|
+
const color = _chunkBPX4Z3N3cjs.chartSeriesColor.call(void 0, spec, si);
|
|
1612
|
+
const type = _chunkBPX4Z3N3cjs.chartSeriesType.call(void 0, spec, s);
|
|
1613
1613
|
const selSeries = ctx.seriesSelected(s.id);
|
|
1614
1614
|
const seriesTarget = { kind: "series", seriesId: s.id };
|
|
1615
1615
|
if (type === "line" || type === "area") {
|
|
@@ -1634,7 +1634,7 @@ function layoutXy(ctx, area, visible) {
|
|
|
1634
1634
|
}
|
|
1635
1635
|
const target = { kind: "point", seriesId: s.id, index: p.i };
|
|
1636
1636
|
const selected = ctx.isSelected(target);
|
|
1637
|
-
const pointColor =
|
|
1637
|
+
const pointColor = _chunkBPX4Z3N3cjs.chartPointColor.call(void 0, spec, si, p.i);
|
|
1638
1638
|
const r = bubble ? maxSize > 0 && p.size !== null && p.size > 0 ? Math.max(2, Math.sqrt(p.size / maxSize) * maxR) : 2 : 4.5;
|
|
1639
1639
|
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 });
|
|
1640
1640
|
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));
|
|
@@ -1644,14 +1644,14 @@ function layoutXy(ctx, area, visible) {
|
|
|
1644
1644
|
const stroke = color;
|
|
1645
1645
|
const errorBar = (key, d) => d && errorMarks.push({ kind: "path", key, role: "error-bar", d, fill: "none", stroke, strokeWidth: selSeries ? 2 : 1.25, target: seriesTarget, selected: selSeries });
|
|
1646
1646
|
for (const p of pts) {
|
|
1647
|
-
const ey = _optionalChain([yErrors, 'access',
|
|
1647
|
+
const ey = _optionalChain([yErrors, 'access', _37 => _37.get, 'call', _38 => _38(s.id), 'optionalAccess', _39 => _39[p.i]]);
|
|
1648
1648
|
if (ey) {
|
|
1649
1649
|
const lo = ey.center - ey.minus;
|
|
1650
1650
|
const hi = ey.center + ey.plus;
|
|
1651
1651
|
const cap = s.errorBars.cap !== false;
|
|
1652
1652
|
errorBar(`error-bar-${s.id}-${p.i}`, errorBarPath((q) => [q.c, q.v], xPx(p.x), yPx(lo), yPx(hi), 8, cap && lo < ey.center, cap && hi > ey.center));
|
|
1653
1653
|
}
|
|
1654
|
-
const ex = _optionalChain([xErrors, 'access',
|
|
1654
|
+
const ex = _optionalChain([xErrors, 'access', _40 => _40.get, 'call', _41 => _41(s.id), 'optionalAccess', _42 => _42[p.i]]);
|
|
1655
1655
|
if (ex) {
|
|
1656
1656
|
const lo = ex.center - ex.minus;
|
|
1657
1657
|
const hi = ex.center + ex.plus;
|
|
@@ -1659,7 +1659,7 @@ function layoutXy(ctx, area, visible) {
|
|
|
1659
1659
|
errorBar(`error-bar-x-${s.id}-${p.i}`, errorBarPath((q) => [q.v, q.c], yPx(p.y), xPx(lo), xPx(hi), 8, cap && lo < ex.center, cap && hi > ex.center));
|
|
1660
1660
|
}
|
|
1661
1661
|
}
|
|
1662
|
-
if (_optionalChain([s, 'access',
|
|
1662
|
+
if (_optionalChain([s, 'access', _43 => _43.trendlines, 'optionalAccess', _44 => _44.length])) drawTrendlines(ctx, plot, s, color, pts.map((p) => [p.x, p.y]), (x, y) => [xRaw(x), yRaw(y)], trendLabels, xLog || yLog);
|
|
1663
1663
|
}
|
|
1664
1664
|
drawReferences(ctx, plot, refAxes, "lines");
|
|
1665
1665
|
marks.push(...errorMarks, ...labelMarks);
|
|
@@ -1677,8 +1677,40 @@ function trendlineLegendItems(spec, color) {
|
|
|
1677
1677
|
);
|
|
1678
1678
|
}
|
|
1679
1679
|
|
|
1680
|
+
// src/chart/race.ts
|
|
1681
|
+
function chartRaceValueAt(series, index) {
|
|
1682
|
+
for (let i = Math.min(index, series.values.length - 1); i >= 0; i--) {
|
|
1683
|
+
const v = series.values[i];
|
|
1684
|
+
if (v !== null && v !== void 0 && Number.isFinite(v)) return v;
|
|
1685
|
+
}
|
|
1686
|
+
return 0;
|
|
1687
|
+
}
|
|
1688
|
+
function chartRaceMoment(count, frame) {
|
|
1689
|
+
const last = Math.max(0, count - 1);
|
|
1690
|
+
const at = frame === null || frame === void 0 || !Number.isFinite(frame) ? last : Math.max(0, Math.min(last, frame));
|
|
1691
|
+
const from = Math.floor(at);
|
|
1692
|
+
const to = Math.min(last, from + 1);
|
|
1693
|
+
return { from, to, t: at - from, at };
|
|
1694
|
+
}
|
|
1695
|
+
function chartRaceRanking(spec, frame) {
|
|
1696
|
+
const visible = spec.series.filter((s) => !s.hidden);
|
|
1697
|
+
const { from, to, t } = chartRaceMoment(spec.categories.length, frame);
|
|
1698
|
+
const rankAt = (i) => {
|
|
1699
|
+
const order2 = visible.map((s, k) => ({ id: s.id, v: chartRaceValueAt(s, i), k })).sort((a, b) => b.v - a.v || a.k - b.k);
|
|
1700
|
+
return new Map(order2.map((o, r) => [o.id, r]));
|
|
1701
|
+
};
|
|
1702
|
+
const r0 = rankAt(from);
|
|
1703
|
+
const r1 = rankAt(to);
|
|
1704
|
+
const near = t < 0.5 ? r0 : r1;
|
|
1705
|
+
return visible.map((s) => {
|
|
1706
|
+
const a = chartRaceValueAt(s, from);
|
|
1707
|
+
const b = chartRaceValueAt(s, to);
|
|
1708
|
+
return { seriesId: s.id, name: s.name, value: a + (b - a) * t, position: r0.get(s.id) + (r1.get(s.id) - r0.get(s.id)) * t, rank: near.get(s.id) };
|
|
1709
|
+
}).sort((a, b) => a.position - b.position || b.value - a.value);
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1680
1712
|
// src/chart/layout-families.ts
|
|
1681
|
-
var sliceColor = (ctx, series, i) => _optionalChain([series, 'access',
|
|
1713
|
+
var sliceColor = (ctx, series, i) => _optionalChain([series, 'access', _45 => _45.pointColors, 'optionalAccess', _46 => _46[i]]) || _chunkBPX4Z3N3cjs.chartSliceColor.call(void 0, ctx.spec, i);
|
|
1682
1714
|
function layoutPie(ctx, area, series) {
|
|
1683
1715
|
const { spec, theme, marks, fs, selection } = ctx;
|
|
1684
1716
|
const values = spec.categories.map((_, i) => {
|
|
@@ -1708,7 +1740,7 @@ function layoutPie(ctx, area, series) {
|
|
|
1708
1740
|
angle = end;
|
|
1709
1741
|
const target = { kind: "point", seriesId: series.id, index: i };
|
|
1710
1742
|
const selected = ctx.isSelected(target) || ctx.isSelected({ kind: "category", index: i });
|
|
1711
|
-
const seriesSel = _optionalChain([selection, 'optionalAccess',
|
|
1743
|
+
const seriesSel = _optionalChain([selection, 'optionalAccess', _47 => _47.kind]) === "series" && selection.seriesId === series.id;
|
|
1712
1744
|
const mid = (start + end) / 2;
|
|
1713
1745
|
const off = selected ? 6 : 0;
|
|
1714
1746
|
const ox = cx + off * Math.sin(mid);
|
|
@@ -1794,7 +1826,7 @@ function layoutRadar(ctx, area, visible) {
|
|
|
1794
1826
|
});
|
|
1795
1827
|
for (const s of visible) {
|
|
1796
1828
|
const si = spec.series.indexOf(s);
|
|
1797
|
-
const color =
|
|
1829
|
+
const color = _chunkBPX4Z3N3cjs.chartSeriesColor.call(void 0, spec, si);
|
|
1798
1830
|
const selSeries = ctx.seriesSelected(s.id);
|
|
1799
1831
|
const pts = s.values.map((v, i) => v !== null && Number.isFinite(v) ? at(i, rOf(v)) : null);
|
|
1800
1832
|
const present = pts.filter((p) => p !== null);
|
|
@@ -1844,7 +1876,7 @@ function layoutWaterfall(ctx, area, series) {
|
|
|
1844
1876
|
});
|
|
1845
1877
|
const { band, catCenter, map, value } = frame;
|
|
1846
1878
|
const w = band * (1 - spec.gapWidth);
|
|
1847
|
-
const color =
|
|
1879
|
+
const color = _chunkBPX4Z3N3cjs.chartSeriesColor.call(void 0, spec, spec.series.indexOf(series));
|
|
1848
1880
|
const format = _nullishCoalesce(series.format, () => ( spec.yAxis.format));
|
|
1849
1881
|
const labelsOn = _nullishCoalesce(series.dataLabels, () => ( spec.dataLabels));
|
|
1850
1882
|
let prevEnd = null;
|
|
@@ -1903,7 +1935,7 @@ function layoutHistogram(ctx, area, visible) {
|
|
|
1903
1935
|
const gap = k > 1 ? band * spec.gapWidth * 0.5 : 0;
|
|
1904
1936
|
const w = (band - gap) / k;
|
|
1905
1937
|
visible.forEach((s, si) => {
|
|
1906
|
-
const color =
|
|
1938
|
+
const color = _chunkBPX4Z3N3cjs.chartSeriesColor.call(void 0, spec, spec.series.indexOf(s));
|
|
1907
1939
|
const target = { kind: "series", seriesId: s.id };
|
|
1908
1940
|
const selected = ctx.seriesSelected(s.id);
|
|
1909
1941
|
counts[si].forEach((c, b) => {
|
|
@@ -1934,7 +1966,7 @@ function layoutBox(ctx, area, visible) {
|
|
|
1934
1966
|
visible.forEach((s, i) => {
|
|
1935
1967
|
const st = stats[i];
|
|
1936
1968
|
if (!st) return;
|
|
1937
|
-
const color =
|
|
1969
|
+
const color = _chunkBPX4Z3N3cjs.chartSeriesColor.call(void 0, spec, spec.series.indexOf(s));
|
|
1938
1970
|
const target = { kind: "series", seriesId: s.id };
|
|
1939
1971
|
const selected = ctx.seriesSelected(s.id);
|
|
1940
1972
|
const c = catCenter(i);
|
|
@@ -2153,7 +2185,7 @@ function layoutLikert(ctx, area, visible) {
|
|
|
2153
2185
|
if (x1 - x0 <= 0) return;
|
|
2154
2186
|
const target = { kind: "point", seriesId: s.id, index: i };
|
|
2155
2187
|
const selected = ctx.isSelected(target);
|
|
2156
|
-
const fill = _optionalChain([s, 'access',
|
|
2188
|
+
const fill = _optionalChain([s, 'access', _48 => _48.pointColors, 'optionalAccess', _49 => _49[i]]) || _chunkBPX4Z3N3cjs.chartSeriesColor.call(void 0, spec, spec.series.indexOf(s));
|
|
2157
2189
|
const rect = { x: x0, y, width: x1 - x0, height: barH };
|
|
2158
2190
|
marks.push({ kind: "rect", key, role: "bar", ...rect, fill, target, selected: selected || ctx.seriesSelected(s.id) || catSelected });
|
|
2159
2191
|
if (selected) ctx.outline(`${key}-selection`, { x: rect.x - 2, y: rect.y - 2, width: rect.width + 4, height: rect.height + 4 });
|
|
@@ -2252,22 +2284,22 @@ function layoutParliament(ctx, area, series) {
|
|
|
2252
2284
|
}
|
|
2253
2285
|
function treeColor(ctx, series, node, group, base, shade) {
|
|
2254
2286
|
if (node.color) return node.color;
|
|
2255
|
-
if (base === null) return _optionalChain([series, 'optionalAccess',
|
|
2256
|
-
return
|
|
2287
|
+
if (base === null) return _optionalChain([series, 'optionalAccess', _50 => _50.pointColors, 'optionalAccess', _51 => _51[group]]) || _chunkBPX4Z3N3cjs.chartSliceColor.call(void 0, ctx.spec, group);
|
|
2288
|
+
return _chunkBPX4Z3N3cjs.shadeChartColor.call(void 0, base, shade);
|
|
2257
2289
|
}
|
|
2258
2290
|
function layoutTreemapTree(ctx, area, series) {
|
|
2259
2291
|
const { spec, marks, theme, fs, measure } = ctx;
|
|
2260
|
-
const format = _nullishCoalesce(_optionalChain([series, 'optionalAccess',
|
|
2261
|
-
const labelsOn = _nullishCoalesce(_optionalChain([series, 'optionalAccess',
|
|
2292
|
+
const format = _nullishCoalesce(_optionalChain([series, 'optionalAccess', _52 => _52.format]), () => ( spec.yAxis.format));
|
|
2293
|
+
const labelsOn = _nullishCoalesce(_optionalChain([series, 'optionalAccess', _53 => _53.dataLabels]), () => ( true));
|
|
2262
2294
|
let unlabelled = 0;
|
|
2263
2295
|
const draw = (nodes, rect, key, group, base) => {
|
|
2264
|
-
const rects = chartSquarify(nodes.map(
|
|
2296
|
+
const rects = chartSquarify(nodes.map(_chunkBPX4Z3N3cjs.chartTreeTotal), rect);
|
|
2265
2297
|
nodes.forEach((node, k) => {
|
|
2266
2298
|
const r = rects[k];
|
|
2267
2299
|
if (r.width <= 0.5 || r.height <= 0.5) return;
|
|
2268
2300
|
const g = _nullishCoalesce(group, () => ( k));
|
|
2269
2301
|
const target = { kind: "category", index: g };
|
|
2270
|
-
const selected = ctx.isSelected(target) || ctx.isSelected({ kind: "point", seriesId: _nullishCoalesce(_optionalChain([series, 'optionalAccess',
|
|
2302
|
+
const selected = ctx.isSelected(target) || ctx.isSelected({ kind: "point", seriesId: _nullishCoalesce(_optionalChain([series, 'optionalAccess', _54 => _54.id]), () => ( "")), index: g });
|
|
2271
2303
|
const id = `${key}-${k}`;
|
|
2272
2304
|
const fill = treeColor(ctx, series, node, g, base, base === null ? 0 : (k % 4 - 1.5) * 0.14);
|
|
2273
2305
|
if (node.children) {
|
|
@@ -2296,10 +2328,10 @@ function layoutTreemapTree(ctx, area, series) {
|
|
|
2296
2328
|
}
|
|
2297
2329
|
function layoutSunburst(ctx, area, series) {
|
|
2298
2330
|
const { spec, marks, theme, fs, measure } = ctx;
|
|
2299
|
-
const tree = spec.tree.length ? spec.tree :
|
|
2331
|
+
const tree = spec.tree.length ? spec.tree : _chunkBPX4Z3N3cjs.chartTreeFromSeries.call(void 0, spec.categories, _nullishCoalesce(_optionalChain([series, 'optionalAccess', _55 => _55.values]), () => ( [])));
|
|
2300
2332
|
const indexOf = new Map(spec.categories.map((c, i) => [c.trim() || `${i + 1}`, i]));
|
|
2301
|
-
const depth =
|
|
2302
|
-
const total = tree.reduce((t, n) => t +
|
|
2333
|
+
const depth = _chunkBPX4Z3N3cjs.chartTreeDepth.call(void 0, tree);
|
|
2334
|
+
const total = tree.reduce((t, n) => t + _chunkBPX4Z3N3cjs.chartTreeTotal.call(void 0, n), 0);
|
|
2303
2335
|
const cx = area.x + area.width / 2;
|
|
2304
2336
|
const cy = area.y + area.height / 2;
|
|
2305
2337
|
const outer = Math.max(8, Math.min(area.width, area.height) / 2 - 4);
|
|
@@ -2310,20 +2342,20 @@ function layoutSunburst(ctx, area, series) {
|
|
|
2310
2342
|
}
|
|
2311
2343
|
const hole = outer * 0.28;
|
|
2312
2344
|
const ring = (outer - hole) / Math.max(1, depth);
|
|
2313
|
-
const format = _nullishCoalesce(_optionalChain([series, 'optionalAccess',
|
|
2345
|
+
const format = _nullishCoalesce(_optionalChain([series, 'optionalAccess', _56 => _56.format]), () => ( spec.yAxis.format));
|
|
2314
2346
|
let unlabelled = 0;
|
|
2315
2347
|
const walk = (nodes, start, sweep, level, key, group, base) => {
|
|
2316
|
-
const sum = nodes.reduce((t, n) => t +
|
|
2348
|
+
const sum = nodes.reduce((t, n) => t + _chunkBPX4Z3N3cjs.chartTreeTotal.call(void 0, n), 0);
|
|
2317
2349
|
let at = start;
|
|
2318
2350
|
nodes.forEach((node, k) => {
|
|
2319
|
-
const value =
|
|
2351
|
+
const value = _chunkBPX4Z3N3cjs.chartTreeTotal.call(void 0, node);
|
|
2320
2352
|
if (!(value > 0) || !sum) return;
|
|
2321
2353
|
const a0 = at;
|
|
2322
2354
|
const a1 = at + sweep * value / sum;
|
|
2323
2355
|
at = a1;
|
|
2324
2356
|
const g = _nullishCoalesce(_nullishCoalesce(group, () => ( indexOf.get(node.name))), () => ( k));
|
|
2325
2357
|
const target = { kind: "category", index: g };
|
|
2326
|
-
const selected = ctx.isSelected(target) || ctx.isSelected({ kind: "point", seriesId: _nullishCoalesce(_optionalChain([series, 'optionalAccess',
|
|
2358
|
+
const selected = ctx.isSelected(target) || ctx.isSelected({ kind: "point", seriesId: _nullishCoalesce(_optionalChain([series, 'optionalAccess', _57 => _57.id]), () => ( "")), index: g });
|
|
2327
2359
|
const fill = treeColor(ctx, series, node, g, base, 0.22 * level);
|
|
2328
2360
|
const id = `${key}-${k}`;
|
|
2329
2361
|
const r0 = hole + ring * level;
|
|
@@ -2349,17 +2381,148 @@ function layoutSunburst(ctx, area, series) {
|
|
|
2349
2381
|
}
|
|
2350
2382
|
return { plot };
|
|
2351
2383
|
}
|
|
2384
|
+
function layoutSankey(ctx, area, series) {
|
|
2385
|
+
const { spec, theme, marks, fs, measure } = ctx;
|
|
2386
|
+
const nodes = spec.sankeyNodes;
|
|
2387
|
+
const links = spec.links;
|
|
2388
|
+
const at = new Map(nodes.map((n, i) => [n, i]));
|
|
2389
|
+
const incoming = nodes.map(() => []);
|
|
2390
|
+
const outgoing = nodes.map(() => []);
|
|
2391
|
+
links.forEach((l, k) => {
|
|
2392
|
+
outgoing[at.get(l.source)].push(k);
|
|
2393
|
+
incoming[at.get(l.target)].push(k);
|
|
2394
|
+
});
|
|
2395
|
+
const column = nodes.map(() => -1);
|
|
2396
|
+
const depth = (i) => {
|
|
2397
|
+
if (column[i] >= 0) return column[i];
|
|
2398
|
+
column[i] = 0;
|
|
2399
|
+
column[i] = incoming[i].reduce((d, k) => Math.max(d, depth(at.get(links[k].source)) + 1), 0);
|
|
2400
|
+
return column[i];
|
|
2401
|
+
};
|
|
2402
|
+
nodes.forEach((_, i) => depth(i));
|
|
2403
|
+
const last = Math.max(...column);
|
|
2404
|
+
nodes.forEach((_, i) => {
|
|
2405
|
+
if (!outgoing[i].length) column[i] = last;
|
|
2406
|
+
});
|
|
2407
|
+
const value = _nullishCoalesce(_optionalChain([series, 'optionalAccess', _58 => _58.values, 'access', _59 => _59.map, 'call', _60 => _60((v) => _nullishCoalesce(v, () => ( 0)))]), () => ( nodes.map(() => 0)));
|
|
2408
|
+
const nodeW = Math.max(6, Math.min(16, area.width * 0.02));
|
|
2409
|
+
const gap = last > 0 ? (area.width - nodeW) / last : 0;
|
|
2410
|
+
const xOf = (c) => last > 0 ? area.x + c * gap : area.x + area.width / 2 - nodeW / 2;
|
|
2411
|
+
const columns = Array.from({ length: last + 1 }, (_, c) => nodes.map((_2, i) => i).filter((i) => column[i] === c));
|
|
2412
|
+
const pad = Math.max(4, Math.min(fs * 1.2, area.height / Math.max(1, Math.max(...columns.map((c) => c.length))) / 3));
|
|
2413
|
+
const ky = Math.min(...columns.filter((c) => c.length).map((c) => (area.height - pad * (c.length - 1)) / Math.max(1e-9, c.reduce((t, i) => t + value[i], 0))));
|
|
2414
|
+
const top = nodes.map(() => 0);
|
|
2415
|
+
for (const col of columns) {
|
|
2416
|
+
const used = col.reduce((t, i) => t + value[i] * ky, 0) + pad * Math.max(0, col.length - 1);
|
|
2417
|
+
let y = area.y + (area.height - used) / 2;
|
|
2418
|
+
for (const i of col) {
|
|
2419
|
+
top[i] = y;
|
|
2420
|
+
y += value[i] * ky + pad;
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
const color = (i) => _optionalChain([series, 'optionalAccess', _61 => _61.pointColors, 'optionalAccess', _62 => _62[i]]) || _chunkBPX4Z3N3cjs.chartSliceColor.call(void 0, spec, i);
|
|
2424
|
+
const named = new Set(spec.highlight);
|
|
2425
|
+
const lit = nodes.map((n) => named.has(n));
|
|
2426
|
+
const dimLinks = lit.some(Boolean);
|
|
2427
|
+
const outOffset = nodes.map(() => 0);
|
|
2428
|
+
const inOffset = nodes.map(() => 0);
|
|
2429
|
+
const startY = /* @__PURE__ */ new Map();
|
|
2430
|
+
const endY = /* @__PURE__ */ new Map();
|
|
2431
|
+
nodes.forEach((_, i) => {
|
|
2432
|
+
for (const k of [...outgoing[i]].sort((a, b) => top[at.get(links[a].target)] - top[at.get(links[b].target)])) {
|
|
2433
|
+
startY.set(k, top[i] + outOffset[i]);
|
|
2434
|
+
outOffset[i] += links[k].value * ky;
|
|
2435
|
+
}
|
|
2436
|
+
for (const k of [...incoming[i]].sort((a, b) => top[at.get(links[a].source)] - top[at.get(links[b].source)])) {
|
|
2437
|
+
endY.set(k, top[i] + inOffset[i]);
|
|
2438
|
+
inOffset[i] += links[k].value * ky;
|
|
2439
|
+
}
|
|
2440
|
+
});
|
|
2441
|
+
const selectedNode = (i) => ctx.isSelected({ kind: "category", index: i }) || ctx.isSelected({ kind: "point", seriesId: _nullishCoalesce(_optionalChain([series, 'optionalAccess', _63 => _63.id]), () => ( "")), index: i });
|
|
2442
|
+
links.forEach((l, k) => {
|
|
2443
|
+
const s = at.get(l.source);
|
|
2444
|
+
const t = at.get(l.target);
|
|
2445
|
+
const w = l.value * ky;
|
|
2446
|
+
const x0 = xOf(column[s]) + nodeW;
|
|
2447
|
+
const x1 = xOf(column[t]);
|
|
2448
|
+
const y0 = startY.get(k);
|
|
2449
|
+
const y1 = endY.get(k);
|
|
2450
|
+
const xm = (x0 + x1) / 2;
|
|
2451
|
+
const d = `M${r2(x0)},${r2(y0)}C${r2(xm)},${r2(y0)} ${r2(xm)},${r2(y1)} ${r2(x1)},${r2(y1)}L${r2(x1)},${r2(y1 + w)}C${r2(xm)},${r2(y1 + w)} ${r2(xm)},${r2(y0 + w)} ${r2(x0)},${r2(y0 + w)}Z`;
|
|
2452
|
+
const fill = _nullishCoalesce(l.color, () => ( (spec.sankeyLinkColor === "gray" ? theme.mutedText : color(spec.sankeyLinkColor === "target" ? t : s))));
|
|
2453
|
+
const emphasis = selectedNode(s) || selectedNode(t) ? 0.6 : 0.35;
|
|
2454
|
+
const opacity = dimLinks && !lit[s] && !lit[t] ? emphasis * 0.25 : emphasis;
|
|
2455
|
+
marks.push({ kind: "path", key: `link-${k}`, role: "link", d, fill, opacity });
|
|
2456
|
+
});
|
|
2457
|
+
const labelsOn = _nullishCoalesce(_optionalChain([series, 'optionalAccess', _64 => _64.dataLabels]), () => ( spec.dataLabels));
|
|
2458
|
+
const format = _nullishCoalesce(_optionalChain([series, 'optionalAccess', _65 => _65.format]), () => ( spec.yAxis.format));
|
|
2459
|
+
let hidden = 0;
|
|
2460
|
+
nodes.forEach((name, i) => {
|
|
2461
|
+
const x = xOf(column[i]);
|
|
2462
|
+
const h = Math.max(1, value[i] * ky);
|
|
2463
|
+
const target = { kind: "category", index: i };
|
|
2464
|
+
const selected = selectedNode(i);
|
|
2465
|
+
marks.push({ kind: "rect", key: `node-${i}`, role: "node", x, y: top[i], width: nodeW, height: h, fill: color(i), radius: 1, ...selected ? { stroke: theme.selection, strokeWidth: 2 } : {}, target, selected });
|
|
2466
|
+
const text = labelsOn ? `${name} ${formatChartNumber(value[i], format)}` : name;
|
|
2467
|
+
const room = (last > 0 ? gap : area.width / 2) - nodeW - 10;
|
|
2468
|
+
const shown = truncate(text, Math.max(fs * 2, room), fs, measure);
|
|
2469
|
+
if (shown !== text) hidden++;
|
|
2470
|
+
const right = column[i] < last || last === 0;
|
|
2471
|
+
marks.push({ kind: "text", key: `label-node-${i}`, role: "data-label", x: right ? x + nodeW + 5 : x - 5, y: top[i] + h / 2, text: shown, anchor: right ? "start" : "end", baseline: "middle", size: fs, weight: selected ? 600 : void 0, fill: selected ? theme.selection : theme.text, target, selected });
|
|
2472
|
+
});
|
|
2473
|
+
if (hidden) ctx.warn("labels-truncated", `${hidden} node label${hidden === 1 ? " was" : "s were"} shortened to fit between the columns.`);
|
|
2474
|
+
return { plot: area };
|
|
2475
|
+
}
|
|
2476
|
+
function layoutBarRace(ctx, area, frame) {
|
|
2477
|
+
const { spec, theme, marks, fs, measure } = ctx;
|
|
2478
|
+
const top = spec.raceTopN;
|
|
2479
|
+
const moment = chartRaceMoment(spec.categories.length, frame);
|
|
2480
|
+
const ranking = chartRaceRanking(spec, frame);
|
|
2481
|
+
const shown = ranking.filter((e) => e.position < top);
|
|
2482
|
+
const labelW = Math.min(area.width * 0.3, Math.max(0, ...ranking.map((e) => measure(e.name, fs)))) + 8;
|
|
2483
|
+
const tickH = spec.yAxis.show ? fs * 1.6 : 4;
|
|
2484
|
+
const plot = { x: area.x + labelW, y: area.y + tickH, width: Math.max(1, area.width - labelW - fs * 4), height: Math.max(1, area.height - tickH) };
|
|
2485
|
+
const lead = Math.max(1e-9, ...shown.map((e) => e.value));
|
|
2486
|
+
const max = spec.yAxis.max !== null && spec.yAxis.max > 0 ? spec.yAxis.max : lead * 1.08;
|
|
2487
|
+
const xOf = (v) => plot.x + Math.max(0, Math.min(max, v)) / max * plot.width;
|
|
2488
|
+
const ticks = niceScale(0, max, 5).ticks.filter((t) => t <= max);
|
|
2489
|
+
const axisTarget = { kind: "axis", axis: "y" };
|
|
2490
|
+
const format = spec.yAxis.format;
|
|
2491
|
+
ticks.forEach((t, k) => {
|
|
2492
|
+
if (spec.yAxis.gridlines) marks.push({ kind: "line", key: `grid-y-${k}`, role: "grid", x1: xOf(t), y1: plot.y, x2: xOf(t), y2: plot.y + plot.height, stroke: theme.grid, strokeWidth: 1 });
|
|
2493
|
+
if (spec.yAxis.show) marks.push({ kind: "text", key: `tick-y-${k}`, role: "tick-label", x: xOf(t), y: area.y, text: formatChartNumber(t, format, _nullishCoalesce(format.decimals, () => ( stepDecimals(ticks[1] - ticks[0] || 1)))), anchor: "middle", baseline: "top", size: fs - 1, fill: theme.mutedText, target: axisTarget });
|
|
2494
|
+
});
|
|
2495
|
+
const label = _nullishCoalesce(spec.categories[moment.t < 0.5 ? moment.from : moment.to], () => ( ""));
|
|
2496
|
+
const timeSize = Math.min(theme.titleSize * 3, plot.height * 0.2, plot.width * 0.5 / Math.max(1, label.length * 0.6));
|
|
2497
|
+
marks.push({ kind: "text", key: "race-time", role: "race-time", x: plot.x + plot.width, y: plot.y + plot.height - 4, text: label, anchor: "end", baseline: "bottom", size: timeSize, weight: 700, fill: theme.mutedText, opacity: 0.55, target: { kind: "category", index: moment.t < 0.5 ? moment.from : moment.to } });
|
|
2498
|
+
const band = plot.height / top;
|
|
2499
|
+
const barH = Math.max(2, band * (1 - Math.min(0.8, spec.gapWidth)));
|
|
2500
|
+
const index = Math.round(moment.at);
|
|
2501
|
+
for (const e of shown) {
|
|
2502
|
+
const si = spec.series.findIndex((s2) => s2.id === e.seriesId);
|
|
2503
|
+
const s = spec.series[si];
|
|
2504
|
+
const y = plot.y + e.position * band + (band - barH) / 2;
|
|
2505
|
+
const target = { kind: "point", seriesId: e.seriesId, index };
|
|
2506
|
+
const selected = ctx.isSelected(target) || ctx.seriesSelected(e.seriesId);
|
|
2507
|
+
const width = Math.max(0, xOf(e.value) - plot.x);
|
|
2508
|
+
marks.push({ kind: "rect", key: `bar-${e.seriesId}`, role: "bar", x: plot.x, y, width, height: barH, fill: _chunkBPX4Z3N3cjs.chartSeriesColor.call(void 0, spec, si), radius: Math.min(3, barH / 4), target, selected, ...selected ? { stroke: theme.selection, strokeWidth: 1.5 } : {} });
|
|
2509
|
+
marks.push({ kind: "text", key: `label-name-${e.seriesId}`, role: "tick-label", x: plot.x - 6, y: y + barH / 2, text: truncate(e.name, labelW - 8, fs, measure), anchor: "end", baseline: "middle", size: fs, fill: selected ? theme.selection : theme.text, target: { kind: "series", seriesId: e.seriesId } });
|
|
2510
|
+
if (_nullishCoalesce(s.dataLabels, () => ( true))) marks.push({ kind: "text", key: `label-${e.seriesId}`, role: "data-label", x: plot.x + width + 5, y: y + barH / 2, text: formatChartNumber(e.value, _nullishCoalesce(s.format, () => ( format)), _nullishCoalesce((_nullishCoalesce(s.format, () => ( format))).decimals, () => ( (Math.abs(e.value) >= 100 ? 0 : void 0)))), anchor: "start", baseline: "middle", size: fs - 1, fill: theme.text, target });
|
|
2511
|
+
}
|
|
2512
|
+
if (ranking.length > top) ctx.warn("values-skipped", `The race shows the top ${top} of ${ranking.length} names at each moment (raceTopN).`);
|
|
2513
|
+
return { plot, valueScale: { axis: "x", domain: [0, max], range: [plot.x, plot.x + plot.width], ticks } };
|
|
2514
|
+
}
|
|
2352
2515
|
|
|
2353
2516
|
// src/chart/layout.ts
|
|
2354
2517
|
function legendItems(spec, ctx) {
|
|
2355
|
-
const family =
|
|
2356
|
-
if (spec.type === "funnel" || spec.type === "slope") return [];
|
|
2357
|
-
if (
|
|
2518
|
+
const family = _chunkBPX4Z3N3cjs.chartFamily.call(void 0, spec);
|
|
2519
|
+
if (spec.type === "funnel" || spec.type === "slope" || spec.type === "sankey" || spec.type === "barrace") return [];
|
|
2520
|
+
if (_chunkBPX4Z3N3cjs.chartSpecColorsByCategory.call(void 0, spec)) {
|
|
2358
2521
|
const first = spec.series.find((s) => !s.hidden);
|
|
2359
|
-
const seats = (i) => Math.max(0, Math.round(_nullishCoalesce(_optionalChain([first, 'optionalAccess',
|
|
2522
|
+
const seats = (i) => Math.max(0, Math.round(_nullishCoalesce(_optionalChain([first, 'optionalAccess', _66 => _66.values, 'access', _67 => _67[i]]), () => ( 0))));
|
|
2360
2523
|
return spec.categories.map((c, i) => ({
|
|
2361
2524
|
label: spec.type === "parliament" ? `${c} ${seats(i)}` : c,
|
|
2362
|
-
color: _optionalChain([first, 'optionalAccess',
|
|
2525
|
+
color: _optionalChain([first, 'optionalAccess', _68 => _68.pointColors, 'optionalAccess', _69 => _69[i]]) || _chunkBPX4Z3N3cjs.chartSliceColor.call(void 0, spec, i),
|
|
2363
2526
|
target: { kind: "category", index: i },
|
|
2364
2527
|
faded: false,
|
|
2365
2528
|
selected: ctx.isSelected({ kind: "category", index: i }),
|
|
@@ -2373,17 +2536,17 @@ function legendItems(spec, ctx) {
|
|
|
2373
2536
|
return [
|
|
2374
2537
|
{ label: "Increase", color: ctx.theme.positive, target, faded: false, selected: false, shape: "square" },
|
|
2375
2538
|
{ label: "Decrease", color: ctx.theme.negative, target, faded: false, selected: false, shape: "square" },
|
|
2376
|
-
{ label: "Total", color:
|
|
2539
|
+
{ label: "Total", color: _chunkBPX4Z3N3cjs.chartSeriesColor.call(void 0, spec, spec.series.indexOf(first)), target, faded: false, selected: false, shape: "square" }
|
|
2377
2540
|
];
|
|
2378
2541
|
}
|
|
2379
2542
|
if (family === "box") return [];
|
|
2380
|
-
const trends = trendlineLegendItems(spec, (i) =>
|
|
2543
|
+
const trends = trendlineLegendItems(spec, (i) => _chunkBPX4Z3N3cjs.chartSeriesColor.call(void 0, spec, i));
|
|
2381
2544
|
const items = [];
|
|
2382
2545
|
spec.series.forEach((s, i) => {
|
|
2383
|
-
const type =
|
|
2546
|
+
const type = _chunkBPX4Z3N3cjs.chartSeriesType.call(void 0, spec, s);
|
|
2384
2547
|
items.push({
|
|
2385
2548
|
label: s.name,
|
|
2386
|
-
color:
|
|
2549
|
+
color: _chunkBPX4Z3N3cjs.chartSeriesColor.call(void 0, spec, i),
|
|
2387
2550
|
target: { kind: "series", seriesId: s.id },
|
|
2388
2551
|
faded: !!s.hidden,
|
|
2389
2552
|
selected: ctx.seriesSelected(s.id),
|
|
@@ -2396,7 +2559,7 @@ function legendItems(spec, ctx) {
|
|
|
2396
2559
|
function layoutChart(spec, options) {
|
|
2397
2560
|
const width = Math.max(1, Number.isFinite(options.width) ? options.width : 1);
|
|
2398
2561
|
const height = Math.max(1, Number.isFinite(options.height) ? options.height : 1);
|
|
2399
|
-
const theme = { ...
|
|
2562
|
+
const theme = { ..._chunkBPX4Z3N3cjs.DEFAULT_CHART_THEME, ...options.theme };
|
|
2400
2563
|
const selection = _nullishCoalesce(options.selection, () => ( null));
|
|
2401
2564
|
const marks = [];
|
|
2402
2565
|
const warnings = [];
|
|
@@ -2412,7 +2575,7 @@ function layoutChart(spec, options) {
|
|
|
2412
2575
|
warnings,
|
|
2413
2576
|
selection,
|
|
2414
2577
|
isSelected: (target) => sameChartSelection(selection, target),
|
|
2415
|
-
seriesSelected: (id) => _optionalChain([selection, 'optionalAccess',
|
|
2578
|
+
seriesSelected: (id) => _optionalChain([selection, 'optionalAccess', _70 => _70.kind]) === "series" && selection.seriesId === id,
|
|
2416
2579
|
outline: (key, box) => marks.push({ kind: "rect", key, role: "selection", ...box, fill: "none", stroke: theme.selection, strokeWidth: 1, radius: 3 }),
|
|
2417
2580
|
warn: (code, message) => {
|
|
2418
2581
|
if (!warnings.some((w) => w.code === code && w.message === message)) warnings.push({ code, message });
|
|
@@ -2435,17 +2598,17 @@ function layoutChart(spec, options) {
|
|
|
2435
2598
|
if (spec.title) titleMark("title", spec.title, theme.titleSize, 600, theme.text);
|
|
2436
2599
|
if (spec.subtitle) titleMark("subtitle", spec.subtitle, fs + 1, 400, theme.mutedText);
|
|
2437
2600
|
if (spec.title || spec.subtitle) top += 6;
|
|
2438
|
-
const family =
|
|
2601
|
+
const family = _chunkBPX4Z3N3cjs.chartFamily.call(void 0, spec);
|
|
2439
2602
|
const visible = spec.series.filter((s) => !s.hidden);
|
|
2440
2603
|
const items = legendItems(spec, ctx);
|
|
2441
2604
|
let area = { x: pad, y: top, width: width - pad * 2, height: height - top - pad - noteHeight(spec, fs) };
|
|
2442
2605
|
const seriesLegend = family === "cartesian" || family === "xy" || family === "radar" || family === "histogram";
|
|
2443
2606
|
const hasTrend = items.some((i) => i.shape === "dash");
|
|
2444
|
-
const showLegend = spec.legend.show && items.length > 0 && (!seriesLegend ||
|
|
2607
|
+
const showLegend = spec.legend.show && items.length > 0 && (!seriesLegend || _chunkBPX4Z3N3cjs.chartVariesColors.call(void 0, spec) || spec.series.length > 1 || spec.series.some((s) => s.hidden) || hasTrend);
|
|
2445
2608
|
if (showLegend) area = layoutLegend(items, spec.legend.position, area, ctx, ctx.isSelected({ kind: "legend" }));
|
|
2446
2609
|
const finish = (result) => {
|
|
2447
2610
|
if (result.plot.width > 0) {
|
|
2448
|
-
if (chartAnnotationFamily(
|
|
2611
|
+
if (chartAnnotationFamily(_chunkBPX4Z3N3cjs.chartFamily.call(void 0, spec))) drawCallouts(ctx, result.plot);
|
|
2449
2612
|
else if (spec.referenceLines.length || spec.referenceBands.length || spec.series.some((s) => s.callouts))
|
|
2450
2613
|
ctx.warn("annotations-skipped", `Reference lines, bands and callouts are drawn on bar, line, area, scatter and bubble charts; this ${spec.type} chart leaves them out.`);
|
|
2451
2614
|
}
|
|
@@ -2493,6 +2656,14 @@ function layoutChart(spec, options) {
|
|
|
2493
2656
|
return finish(layoutFunnel(ctx, area, visible[0]));
|
|
2494
2657
|
case "treemap":
|
|
2495
2658
|
return finish(spec.tree.length ? layoutTreemapTree(ctx, area, spec.series[0]) : layoutTreemap(ctx, area, visible[0]));
|
|
2659
|
+
case "barrace":
|
|
2660
|
+
return finish(layoutBarRace(ctx, area, options.raceFrame));
|
|
2661
|
+
case "sankey":
|
|
2662
|
+
if (!spec.links.length) {
|
|
2663
|
+
ctx.warn("type-fallback", "A Sankey diagram needs flows (set_chart_links); it is drawn as a bar chart until then.");
|
|
2664
|
+
return finish(layoutCartesian(ctx, area, visible));
|
|
2665
|
+
}
|
|
2666
|
+
return finish(layoutSankey(ctx, area, spec.series[0]));
|
|
2496
2667
|
case "sunburst":
|
|
2497
2668
|
return finish(layoutSunburst(ctx, area, spec.tree.length ? spec.series[0] : visible[0]));
|
|
2498
2669
|
case "slope":
|
|
@@ -2588,9 +2759,9 @@ function layoutLegend(items, position, area, ctx, legendSelected) {
|
|
|
2588
2759
|
function addReadout(ctx, readout, plot) {
|
|
2589
2760
|
const { spec, marks, theme, fs, measure } = ctx;
|
|
2590
2761
|
const series = spec.series.find((s) => s.id === readout.seriesId);
|
|
2591
|
-
const value = _optionalChain([series, 'optionalAccess',
|
|
2762
|
+
const value = _optionalChain([series, 'optionalAccess', _71 => _71.values, 'access', _72 => _72[readout.index]]);
|
|
2592
2763
|
if (!series || value === null || value === void 0) return;
|
|
2593
|
-
const mark = marks.find((m) => (m.role === "point" || m.role === "bar") && _optionalChain([m, 'access',
|
|
2764
|
+
const mark = marks.find((m) => (m.role === "point" || m.role === "bar") && _optionalChain([m, 'access', _73 => _73.target, 'optionalAccess', _74 => _74.kind]) === "point" && m.target.seriesId === readout.seriesId && m.target.index === readout.index);
|
|
2594
2765
|
if (!mark) return;
|
|
2595
2766
|
let ax;
|
|
2596
2767
|
let ay;
|
|
@@ -2602,8 +2773,8 @@ function addReadout(ctx, readout, plot) {
|
|
|
2602
2773
|
ay = mark.cy - mark.r;
|
|
2603
2774
|
} else return;
|
|
2604
2775
|
const axis = series.axis === "secondary" ? spec.yAxis2 : spec.yAxis;
|
|
2605
|
-
const x = _optionalChain([series, 'access',
|
|
2606
|
-
const text = x !== null && x !== void 0 &&
|
|
2776
|
+
const x = _optionalChain([series, 'access', _75 => _75.x, 'optionalAccess', _76 => _76[readout.index]]);
|
|
2777
|
+
const text = x !== null && x !== void 0 && _chunkBPX4Z3N3cjs.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)))}`;
|
|
2607
2778
|
const w = measure(text, fs, 600) + 10;
|
|
2608
2779
|
const h = fs + 8;
|
|
2609
2780
|
const bx = Math.max(plot.x, Math.min(plot.x + plot.width - w, ax - w / 2));
|
|
@@ -2652,7 +2823,7 @@ function chartXAtPoint(scene, point) {
|
|
|
2652
2823
|
if (!scale) return void 0;
|
|
2653
2824
|
return chartScaleFromPixel(point.x, scale);
|
|
2654
2825
|
}
|
|
2655
|
-
function snapChartValue(scene, value, step, ticks = _nullishCoalesce(_optionalChain([scene, 'access',
|
|
2826
|
+
function snapChartValue(scene, value, step, ticks = _nullishCoalesce(_optionalChain([scene, 'access', _77 => _77.valueScale, 'optionalAccess', _78 => _78.ticks]), () => ( [])), logBase) {
|
|
2656
2827
|
if (logBase && step === void 0) return value > 0 && Number.isFinite(value) ? Number(value.toPrecision(2)) : value;
|
|
2657
2828
|
const unit = _nullishCoalesce(step, () => ( (ticks.length > 1 ? (ticks[1] - ticks[0]) / 10 : 1)));
|
|
2658
2829
|
if (!(unit > 0)) return value;
|
|
@@ -2700,4 +2871,7 @@ function snapChartValue(scene, value, step, ticks = _nullishCoalesce(_optionalCh
|
|
|
2700
2871
|
|
|
2701
2872
|
|
|
2702
2873
|
|
|
2703
|
-
|
|
2874
|
+
|
|
2875
|
+
|
|
2876
|
+
|
|
2877
|
+
exports.parseChartDate = parseChartDate; exports.CHART_DATE_STEPS = CHART_DATE_STEPS; exports.formatChartDate = formatChartDate; exports.chartDateLabels = chartDateLabels; exports.compileChartFormatCode = compileChartFormatCode; exports.formatChartValueWithCode = formatChartValueWithCode; exports.chartSerialToDate = chartSerialToDate; exports.chartDateToSerial = chartDateToSerial; exports.niceStep = niceStep; exports.niceScale = niceScale; exports.stepDecimals = stepDecimals; exports.formatChartNumber = formatChartNumber; exports.linearMap = linearMap; exports.niceLogScale = niceLogScale; exports.chartScaleToPixel = chartScaleToPixel; exports.chartScaleFromPixel = chartScaleFromPixel; exports.estimateChartTextWidth = estimateChartTextWidth; exports.sameChartSelection = sameChartSelection; exports.contrastingTextColor = contrastingTextColor; exports.r2 = r2; exports.chartHistogram = chartHistogram; exports.chartQuantile = chartQuantile; exports.suggestChartReferences = suggestChartReferences; exports.chartBoxStats = chartBoxStats; exports.chartSquarify = chartSquarify; exports.decimateChartPoints = decimateChartPoints; exports.summarizeChartSeries = summarizeChartSeries; exports.fitChartTrendline = fitChartTrendline; exports.trendNumberText = trendNumberText; exports.chartMovingAverage = chartMovingAverage; exports.chartTrendlineName = chartTrendlineName; exports.chartSupportsTrendlines = chartSupportsTrendlines; exports.MAX_CHART_DATA_LABELS = MAX_CHART_DATA_LABELS; exports.MAX_CHART_LINE_POINTS = MAX_CHART_LINE_POINTS; exports.MAX_CHART_MARKERS = MAX_CHART_MARKERS; exports.chartRaceValueAt = chartRaceValueAt; exports.chartRaceMoment = chartRaceMoment; exports.chartRaceRanking = chartRaceRanking; exports.layoutChart = layoutChart; exports.chartValueAtPoint = chartValueAtPoint; exports.chartXAtPoint = chartXAtPoint; exports.snapChartValue = snapChartValue;
|