@pixerate/editor 0.161.0 → 0.162.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 +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 +62 -61
- package/dist/animation-editor/index.js +6 -5
- package/dist/canvas/index.cjs +33 -32
- package/dist/canvas/index.js +6 -5
- package/dist/chart/index.cjs +88 -87
- package/dist/chart/index.js +7 -6
- package/dist/{chunk-QMI5HZWA.cjs → chunk-236TKNUR.cjs} +3 -3
- package/dist/{chunk-6UPGM3JB.js → chunk-2TKHLX6H.js} +1 -1
- package/dist/{chunk-3YDQLQH2.cjs → chunk-32MMQYCQ.cjs} +81 -81
- package/dist/{chunk-MHEXLG3M.cjs → chunk-3GJH2MGH.cjs} +37 -37
- package/dist/{chunk-AKDWAWSY.cjs → chunk-3IHNXRUV.cjs} +45 -45
- package/dist/{chunk-TVO6W2Q6.cjs → chunk-4NGVHHJB.cjs} +17 -17
- package/dist/chunk-4VU4CP7R.js +769 -0
- 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-72BGL3I2.js → chunk-GWV4T5NZ.js} +1 -1
- 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-WNAAWLZ5.js → chunk-KGTF55R3.js} +2 -2
- 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-AA34BA7G.js → chunk-QYZGBVNC.js} +30 -798
- package/dist/chunk-S6X2QRVU.cjs +769 -0
- package/dist/{chunk-SSCL7QQ4.js → chunk-XDCFJEU7.js} +2 -2
- 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 +638 -637
- package/dist/image-editor/index.js +5 -4
- package/dist/index.cjs +15 -14
- package/dist/index.js +9 -8
- package/dist/paint-editor/index.cjs +15 -14
- package/dist/paint-editor/index.js +5 -4
- 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 +950 -949
- package/dist/vector/index.js +5 -4
- package/dist/video-editor/index.cjs +5 -4
- package/dist/video-editor/index.js +4 -3
- package/package.json +11 -1
- package/skills/README.md +1 -0
- package/skills/pixerate-typography/SKILL.md +91 -0
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkLL3H5XUHcjs = require('./chunk-LL3H5XUH.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunk55AKPTLMcjs = require('./chunk-55AKPTLM.cjs');
|
|
@@ -1074,7 +1074,7 @@ function layoutCartesian(ctx, area, visible) {
|
|
|
1074
1074
|
const { spec, theme, marks, measure, fs } = ctx;
|
|
1075
1075
|
const horizontal = spec.orientation === "horizontal";
|
|
1076
1076
|
const n = spec.categories.length;
|
|
1077
|
-
const types = new Map(visible.map((s) => [s.id,
|
|
1077
|
+
const types = new Map(visible.map((s) => [s.id, _chunkLL3H5XUHcjs.chartSeriesType.call(void 0, spec, s)]));
|
|
1078
1078
|
const stacked = spec.stacking !== "none";
|
|
1079
1079
|
const percent = spec.stacking === "percent";
|
|
1080
1080
|
const onSecondary = (s) => s.axis === "secondary";
|
|
@@ -1111,7 +1111,7 @@ function layoutCartesian(ctx, area, visible) {
|
|
|
1111
1111
|
const stack = stacks.get(s.id);
|
|
1112
1112
|
errors.set(
|
|
1113
1113
|
s.id,
|
|
1114
|
-
|
|
1114
|
+
_chunkLL3H5XUHcjs.chartErrorAmounts.call(void 0, s.errorBars, s.values).map((e, i) => {
|
|
1115
1115
|
const raw = s.values[i];
|
|
1116
1116
|
const seg = _optionalChain([stack, 'optionalAccess', _8 => _8.segments, 'access', _9 => _9[i]]);
|
|
1117
1117
|
if (!e || raw === null || stack && !seg) return null;
|
|
@@ -1178,7 +1178,7 @@ function layoutCartesian(ctx, area, visible) {
|
|
|
1178
1178
|
const drawOrder = [...visible].sort((a, b) => order(types.get(a.id)) - order(types.get(b.id)));
|
|
1179
1179
|
for (const s of drawOrder) {
|
|
1180
1180
|
const si = spec.series.indexOf(s);
|
|
1181
|
-
const color =
|
|
1181
|
+
const color = _chunkLL3H5XUHcjs.chartSeriesColor.call(void 0, spec, si);
|
|
1182
1182
|
const type = types.get(s.id);
|
|
1183
1183
|
const stack = stacks.get(s.id);
|
|
1184
1184
|
const selSeries = ctx.seriesSelected(s.id);
|
|
@@ -1204,7 +1204,7 @@ function layoutCartesian(ctx, area, visible) {
|
|
|
1204
1204
|
const selected = ctx.isSelected(target);
|
|
1205
1205
|
const [x, y] = map({ c: c0, v: Math.min(a, b) });
|
|
1206
1206
|
const rect = horizontal ? { x: Math.min(a, b), y: c0, width: Math.abs(b - a), height: cw } : { x, y, width: cw, height: Math.abs(b - a) };
|
|
1207
|
-
const fill =
|
|
1207
|
+
const fill = _chunkLL3H5XUHcjs.chartPointColor.call(void 0, spec, si, i);
|
|
1208
1208
|
marks.push({
|
|
1209
1209
|
kind: "rect",
|
|
1210
1210
|
key: `bar-${s.id}-${i}`,
|
|
@@ -1283,7 +1283,7 @@ function layoutCartesian(ctx, area, visible) {
|
|
|
1283
1283
|
const target = { kind: "point", seriesId: s.id, index: i };
|
|
1284
1284
|
const selected = ctx.isSelected(target);
|
|
1285
1285
|
const r = type === "scatter" ? 4.5 : 3.5;
|
|
1286
|
-
const pointColor =
|
|
1286
|
+
const pointColor = _chunkLL3H5XUHcjs.chartPointColor.call(void 0, spec, si, i);
|
|
1287
1287
|
const fill = showDots ? type === "scatter" ? pointColor : theme.surface : "transparent";
|
|
1288
1288
|
marks.push(
|
|
1289
1289
|
pointMark({ key: `point-${s.id}-${i}`, target, selected: selected || selSeries, opacity: type === "scatter" ? 0.85 : void 0 }, showDots ? marker : "hit", cx, cy, showDots ? r : 6, fill, showDots ? pointColor : void 0, 2)
|
|
@@ -1355,8 +1355,8 @@ function layoutXy(ctx, area, visible) {
|
|
|
1355
1355
|
const yErrors = /* @__PURE__ */ new Map();
|
|
1356
1356
|
const xErrors = /* @__PURE__ */ new Map();
|
|
1357
1357
|
for (const { s } of all) {
|
|
1358
|
-
if (s.errorBars) yErrors.set(s.id,
|
|
1359
|
-
if (s.xErrorBars) xErrors.set(s.id,
|
|
1358
|
+
if (s.errorBars) yErrors.set(s.id, _chunkLL3H5XUHcjs.chartErrorAmounts.call(void 0, s.errorBars, s.values));
|
|
1359
|
+
if (s.xErrorBars) xErrors.set(s.id, _chunkLL3H5XUHcjs.chartErrorAmounts.call(void 0, s.xErrorBars, s.values.map((_, i) => _nullishCoalesce(_optionalChain([s, 'access', _26 => _26.x, 'optionalAccess', _27 => _27[i]]), () => ( (bubble || !s.x ? i + 1 : null))))));
|
|
1360
1360
|
}
|
|
1361
1361
|
let xlo = Infinity;
|
|
1362
1362
|
let xhi = -Infinity;
|
|
@@ -1435,8 +1435,8 @@ function layoutXy(ctx, area, visible) {
|
|
|
1435
1435
|
const trendLabels = [];
|
|
1436
1436
|
for (const { s, pts } of all) {
|
|
1437
1437
|
const si = spec.series.indexOf(s);
|
|
1438
|
-
const color =
|
|
1439
|
-
const type =
|
|
1438
|
+
const color = _chunkLL3H5XUHcjs.chartSeriesColor.call(void 0, spec, si);
|
|
1439
|
+
const type = _chunkLL3H5XUHcjs.chartSeriesType.call(void 0, spec, s);
|
|
1440
1440
|
const selSeries = ctx.seriesSelected(s.id);
|
|
1441
1441
|
const seriesTarget = { kind: "series", seriesId: s.id };
|
|
1442
1442
|
if (type === "line" || type === "area") {
|
|
@@ -1461,7 +1461,7 @@ function layoutXy(ctx, area, visible) {
|
|
|
1461
1461
|
}
|
|
1462
1462
|
const target = { kind: "point", seriesId: s.id, index: p.i };
|
|
1463
1463
|
const selected = ctx.isSelected(target);
|
|
1464
|
-
const pointColor =
|
|
1464
|
+
const pointColor = _chunkLL3H5XUHcjs.chartPointColor.call(void 0, spec, si, p.i);
|
|
1465
1465
|
const r = bubble ? maxSize > 0 && p.size !== null && p.size > 0 ? Math.max(2, Math.sqrt(p.size / maxSize) * maxR) : 2 : 4.5;
|
|
1466
1466
|
if (bubble) marks.push({ kind: "circle", key: `point-${s.id}-${p.i}`, role: "point", cx, cy, r, fill: pointColor, stroke: pointColor, strokeWidth: 1, opacity: 0.6, target, selected: selected || selSeries });
|
|
1467
1467
|
else marks.push(pointMark({ key: `point-${s.id}-${p.i}`, target, selected: selected || selSeries, opacity: 0.85 }, marker === "none" ? "hit" : marker, cx, cy, marker === "none" ? 6 : r, marker === "none" ? "transparent" : pointColor, marker === "none" ? void 0 : pointColor, 2));
|
|
@@ -1504,7 +1504,7 @@ function trendlineLegendItems(spec, color) {
|
|
|
1504
1504
|
}
|
|
1505
1505
|
|
|
1506
1506
|
// src/chart/layout-families.ts
|
|
1507
|
-
var sliceColor = (ctx, series, i) => _optionalChain([series, 'access', _42 => _42.pointColors, 'optionalAccess', _43 => _43[i]]) ||
|
|
1507
|
+
var sliceColor = (ctx, series, i) => _optionalChain([series, 'access', _42 => _42.pointColors, 'optionalAccess', _43 => _43[i]]) || _chunkLL3H5XUHcjs.chartSliceColor.call(void 0, ctx.spec, i);
|
|
1508
1508
|
function layoutPie(ctx, area, series) {
|
|
1509
1509
|
const { spec, theme, marks, fs, selection } = ctx;
|
|
1510
1510
|
const values = spec.categories.map((_, i) => {
|
|
@@ -1620,7 +1620,7 @@ function layoutRadar(ctx, area, visible) {
|
|
|
1620
1620
|
});
|
|
1621
1621
|
for (const s of visible) {
|
|
1622
1622
|
const si = spec.series.indexOf(s);
|
|
1623
|
-
const color =
|
|
1623
|
+
const color = _chunkLL3H5XUHcjs.chartSeriesColor.call(void 0, spec, si);
|
|
1624
1624
|
const selSeries = ctx.seriesSelected(s.id);
|
|
1625
1625
|
const pts = s.values.map((v, i) => v !== null && Number.isFinite(v) ? at(i, rOf(v)) : null);
|
|
1626
1626
|
const present = pts.filter((p) => p !== null);
|
|
@@ -1670,7 +1670,7 @@ function layoutWaterfall(ctx, area, series) {
|
|
|
1670
1670
|
});
|
|
1671
1671
|
const { band, catCenter, map, value } = frame;
|
|
1672
1672
|
const w = band * (1 - spec.gapWidth);
|
|
1673
|
-
const color =
|
|
1673
|
+
const color = _chunkLL3H5XUHcjs.chartSeriesColor.call(void 0, spec, spec.series.indexOf(series));
|
|
1674
1674
|
const format = _nullishCoalesce(series.format, () => ( spec.yAxis.format));
|
|
1675
1675
|
const labelsOn = _nullishCoalesce(series.dataLabels, () => ( spec.dataLabels));
|
|
1676
1676
|
let prevEnd = null;
|
|
@@ -1729,7 +1729,7 @@ function layoutHistogram(ctx, area, visible) {
|
|
|
1729
1729
|
const gap = k > 1 ? band * spec.gapWidth * 0.5 : 0;
|
|
1730
1730
|
const w = (band - gap) / k;
|
|
1731
1731
|
visible.forEach((s, si) => {
|
|
1732
|
-
const color =
|
|
1732
|
+
const color = _chunkLL3H5XUHcjs.chartSeriesColor.call(void 0, spec, spec.series.indexOf(s));
|
|
1733
1733
|
const target = { kind: "series", seriesId: s.id };
|
|
1734
1734
|
const selected = ctx.seriesSelected(s.id);
|
|
1735
1735
|
counts[si].forEach((c, b) => {
|
|
@@ -1760,7 +1760,7 @@ function layoutBox(ctx, area, visible) {
|
|
|
1760
1760
|
visible.forEach((s, i) => {
|
|
1761
1761
|
const st = stats[i];
|
|
1762
1762
|
if (!st) return;
|
|
1763
|
-
const color =
|
|
1763
|
+
const color = _chunkLL3H5XUHcjs.chartSeriesColor.call(void 0, spec, spec.series.indexOf(s));
|
|
1764
1764
|
const target = { kind: "series", seriesId: s.id };
|
|
1765
1765
|
const selected = ctx.seriesSelected(s.id);
|
|
1766
1766
|
const c = catCenter(i);
|
|
@@ -1846,13 +1846,13 @@ function layoutTreemap(ctx, area, series) {
|
|
|
1846
1846
|
|
|
1847
1847
|
// src/chart/layout.ts
|
|
1848
1848
|
function legendItems(spec, ctx) {
|
|
1849
|
-
const family =
|
|
1849
|
+
const family = _chunkLL3H5XUHcjs.chartFamily.call(void 0, spec);
|
|
1850
1850
|
if (spec.type === "funnel") return [];
|
|
1851
|
-
if (
|
|
1851
|
+
if (_chunkLL3H5XUHcjs.chartColorsByCategory.call(void 0, spec.type)) {
|
|
1852
1852
|
const first = spec.series.find((s) => !s.hidden);
|
|
1853
1853
|
return spec.categories.map((c, i) => ({
|
|
1854
1854
|
label: c,
|
|
1855
|
-
color: _optionalChain([first, 'optionalAccess', _45 => _45.pointColors, 'optionalAccess', _46 => _46[i]]) ||
|
|
1855
|
+
color: _optionalChain([first, 'optionalAccess', _45 => _45.pointColors, 'optionalAccess', _46 => _46[i]]) || _chunkLL3H5XUHcjs.chartSliceColor.call(void 0, spec, i),
|
|
1856
1856
|
target: { kind: "category", index: i },
|
|
1857
1857
|
faded: false,
|
|
1858
1858
|
selected: ctx.isSelected({ kind: "category", index: i }),
|
|
@@ -1866,17 +1866,17 @@ function legendItems(spec, ctx) {
|
|
|
1866
1866
|
return [
|
|
1867
1867
|
{ label: "Increase", color: ctx.theme.positive, target, faded: false, selected: false, shape: "square" },
|
|
1868
1868
|
{ label: "Decrease", color: ctx.theme.negative, target, faded: false, selected: false, shape: "square" },
|
|
1869
|
-
{ label: "Total", color:
|
|
1869
|
+
{ label: "Total", color: _chunkLL3H5XUHcjs.chartSeriesColor.call(void 0, spec, spec.series.indexOf(first)), target, faded: false, selected: false, shape: "square" }
|
|
1870
1870
|
];
|
|
1871
1871
|
}
|
|
1872
1872
|
if (family === "box") return [];
|
|
1873
|
-
const trends = trendlineLegendItems(spec, (i) =>
|
|
1873
|
+
const trends = trendlineLegendItems(spec, (i) => _chunkLL3H5XUHcjs.chartSeriesColor.call(void 0, spec, i));
|
|
1874
1874
|
const items = [];
|
|
1875
1875
|
spec.series.forEach((s, i) => {
|
|
1876
|
-
const type =
|
|
1876
|
+
const type = _chunkLL3H5XUHcjs.chartSeriesType.call(void 0, spec, s);
|
|
1877
1877
|
items.push({
|
|
1878
1878
|
label: s.name,
|
|
1879
|
-
color:
|
|
1879
|
+
color: _chunkLL3H5XUHcjs.chartSeriesColor.call(void 0, spec, i),
|
|
1880
1880
|
target: { kind: "series", seriesId: s.id },
|
|
1881
1881
|
faded: !!s.hidden,
|
|
1882
1882
|
selected: ctx.seriesSelected(s.id),
|
|
@@ -1889,7 +1889,7 @@ function legendItems(spec, ctx) {
|
|
|
1889
1889
|
function layoutChart(spec, options) {
|
|
1890
1890
|
const width = Math.max(1, Number.isFinite(options.width) ? options.width : 1);
|
|
1891
1891
|
const height = Math.max(1, Number.isFinite(options.height) ? options.height : 1);
|
|
1892
|
-
const theme = { ...
|
|
1892
|
+
const theme = { ..._chunkLL3H5XUHcjs.DEFAULT_CHART_THEME, ...options.theme };
|
|
1893
1893
|
const selection = _nullishCoalesce(options.selection, () => ( null));
|
|
1894
1894
|
const marks = [];
|
|
1895
1895
|
const warnings = [];
|
|
@@ -1928,7 +1928,7 @@ function layoutChart(spec, options) {
|
|
|
1928
1928
|
if (spec.title) titleMark("title", spec.title, theme.titleSize, 600, theme.text);
|
|
1929
1929
|
if (spec.subtitle) titleMark("subtitle", spec.subtitle, fs + 1, 400, theme.mutedText);
|
|
1930
1930
|
if (spec.title || spec.subtitle) top += 6;
|
|
1931
|
-
const family =
|
|
1931
|
+
const family = _chunkLL3H5XUHcjs.chartFamily.call(void 0, spec);
|
|
1932
1932
|
const visible = spec.series.filter((s) => !s.hidden);
|
|
1933
1933
|
const items = legendItems(spec, ctx);
|
|
1934
1934
|
let area = { x: pad, y: top, width: width - pad * 2, height: height - top - pad };
|
|
@@ -2077,7 +2077,7 @@ function addReadout(ctx, readout, plot) {
|
|
|
2077
2077
|
} else return;
|
|
2078
2078
|
const axis = series.axis === "secondary" ? spec.yAxis2 : spec.yAxis;
|
|
2079
2079
|
const x = _optionalChain([series, 'access', _52 => _52.x, 'optionalAccess', _53 => _53[readout.index]]);
|
|
2080
|
-
const text = x !== null && x !== void 0 &&
|
|
2080
|
+
const text = x !== null && x !== void 0 && _chunkLL3H5XUHcjs.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)))}`;
|
|
2081
2081
|
const w = measure(text, fs, 600) + 10;
|
|
2082
2082
|
const h = fs + 8;
|
|
2083
2083
|
const bx = Math.max(plot.x, Math.min(plot.x + plot.width - w, ax - w / 2));
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
unionBounds,
|
|
19
19
|
vectorGradientPoints,
|
|
20
20
|
widthProfileAt
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-2TKHLX6H.js";
|
|
22
22
|
import {
|
|
23
23
|
segmentLength,
|
|
24
24
|
segmentParamAtLength,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
} from "./chunk-5UJHB3BW.js";
|
|
30
30
|
import {
|
|
31
31
|
mixColorsOklab
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-BQWGN5WH.js";
|
|
33
33
|
|
|
34
34
|
// src/vector/blend.ts
|
|
35
35
|
var lerpN = (a, b, t) => a + (b - a) * t;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
+
var _chunkES3UEVUTcjs = require('./chunk-ES3UEVUT.cjs');
|
|
3
4
|
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
|
|
7
|
+
var _chunkS6X2QRVUcjs = require('./chunk-S6X2QRVU.cjs');
|
|
6
8
|
|
|
7
9
|
// src/chart/color.ts
|
|
8
10
|
var NAMED = {
|
|
@@ -79,18 +81,18 @@ function chartTextOn(fill, fallback, dark = "#0f172a", light = "#ffffff") {
|
|
|
79
81
|
return darkRatio >= lightRatio ? dark : light;
|
|
80
82
|
}
|
|
81
83
|
function chartRgbToOklab(rgb) {
|
|
82
|
-
const lab =
|
|
84
|
+
const lab = _chunkS6X2QRVUcjs.rgbToOklab.call(void 0, { r: rgb[0], g: rgb[1], b: rgb[2], a: 1 });
|
|
83
85
|
return [lab.l, lab.a, lab.b];
|
|
84
86
|
}
|
|
85
87
|
function chartColorDistance(a, b) {
|
|
86
|
-
return
|
|
88
|
+
return _chunkS6X2QRVUcjs.deltaEOK.call(void 0,
|
|
87
89
|
{ r: a[0], g: a[1], b: a[2], a: 1 },
|
|
88
90
|
{ r: b[0], g: b[1], b: b[2], a: 1 }
|
|
89
91
|
);
|
|
90
92
|
}
|
|
91
93
|
function simulateChartVision(rgb, vision) {
|
|
92
94
|
if (vision === "normal") return rgb;
|
|
93
|
-
const c =
|
|
95
|
+
const c = _chunkES3UEVUTcjs.simulateColorVision.call(void 0, { r: rgb[0], g: rgb[1], b: rgb[2], a: 1 }, vision);
|
|
94
96
|
return [c.r, c.g, c.b];
|
|
95
97
|
}
|
|
96
98
|
function checkChartColors(colors, options = {}) {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkLL3H5XUHcjs = require('./chunk-LL3H5XUH.cjs');
|
|
10
10
|
|
|
11
11
|
// src/chart/ooxml.ts
|
|
12
12
|
var CHART_OOXML_NS = "http://schemas.openxmlformats.org/drawingml/2006/chart";
|
|
@@ -109,11 +109,11 @@ function chartFromOoxml(xml, options = {}) {
|
|
|
109
109
|
try {
|
|
110
110
|
doc = new (parser(options))().parseFromString(xml, "application/xml");
|
|
111
111
|
} catch (error) {
|
|
112
|
-
return { spec:
|
|
112
|
+
return { spec: _chunkLL3H5XUHcjs.normalizeChartSpec.call(void 0, {}).spec, issues: [{ path: "", message: `The chart XML could not be read: ${error.message}` }], unsupported, lossless: false };
|
|
113
113
|
}
|
|
114
114
|
const root = doc.documentElement;
|
|
115
115
|
if (!root || root.localName !== "chartSpace" || doc.getElementsByTagName("parsererror").length) {
|
|
116
|
-
return { spec:
|
|
116
|
+
return { spec: _chunkLL3H5XUHcjs.normalizeChartSpec.call(void 0, {}).spec, issues: [{ path: "", message: "This is not a chart part: expected a c:chartSpace (or cx:chartSpace) root element." }], unsupported, lossless: false };
|
|
117
117
|
}
|
|
118
118
|
if (_optionalChain([root, 'access', _14 => _14.namespaceURI, 'optionalAccess', _15 => _15.includes, 'call', _16 => _16("chartex")]) || kid(root, "chartData")) return readChartex(root, issues, unsupported);
|
|
119
119
|
const chart = kid(root, "chart");
|
|
@@ -278,7 +278,7 @@ function chartFromOoxml(xml, options = {}) {
|
|
|
278
278
|
}
|
|
279
279
|
if (!types.length) {
|
|
280
280
|
issues.push({ path: "plotArea", message: unsupported.length ? `The chart type is not supported: ${unsupported.join(", ")}.` : "The chart has no plot groups." });
|
|
281
|
-
return { spec:
|
|
281
|
+
return { spec: _chunkLL3H5XUHcjs.normalizeChartSpec.call(void 0, input).spec, issues, unsupported, lossless: false };
|
|
282
282
|
}
|
|
283
283
|
const first = types[0];
|
|
284
284
|
const combo = types.some((t) => t !== first);
|
|
@@ -288,7 +288,7 @@ function chartFromOoxml(xml, options = {}) {
|
|
|
288
288
|
if (!combo) {
|
|
289
289
|
for (const s of series) if (s.axis) issues.push({ path: "series", message: `"${s.name}" is on a second value axis.` });
|
|
290
290
|
}
|
|
291
|
-
if (types.some((t) => !
|
|
291
|
+
if (types.some((t) => !_chunkLL3H5XUHcjs.isCartesianChart.call(void 0, t)) && combo) unsupported.push("a pie or radar mixed with other chart types");
|
|
292
292
|
input.series = series;
|
|
293
293
|
input.categories = categories.length ? categories : Array.from({ length: Math.max(0, ...series.map((s) => s.values.length)) }, (_, i) => `${i + 1}`);
|
|
294
294
|
input.stacking = stacking;
|
|
@@ -322,12 +322,12 @@ function chartFromOoxml(xml, options = {}) {
|
|
|
322
322
|
};
|
|
323
323
|
const xy = first === "scatter" || first === "bubble";
|
|
324
324
|
const catAxis = _nullishCoalesce(_nullishCoalesce(kid(plot, "catAx"), () => ( kid(plot, "dateAx"))), () => ( (xy ? valAxes.find((a) => !vertical(a)) : void 0)));
|
|
325
|
-
input.xAxis = readAxis(catAxis,
|
|
325
|
+
input.xAxis = readAxis(catAxis, _chunkLL3H5XUHcjs.defaultChartAxis.call(void 0, false));
|
|
326
326
|
if (kid(plot, "dateAx")) input.xAxis.kind = "date";
|
|
327
|
-
input.yAxis = readAxis(_nullishCoalesce(_nullishCoalesce(primaryAxis, () => ( valAxes.find(vertical))), () => ( valAxes[0])),
|
|
327
|
+
input.yAxis = readAxis(_nullishCoalesce(_nullishCoalesce(primaryAxis, () => ( valAxes.find(vertical))), () => ( valAxes[0])), _chunkLL3H5XUHcjs.defaultChartAxis.call(void 0, true));
|
|
328
328
|
const secondaryAxis = valAxes.find((a) => a !== primaryAxis && (xy ? vertical(a) && a !== primaryAxis : true) && a !== catAxis);
|
|
329
|
-
if (series.some((s) => s.axis === "secondary") && secondaryAxis) input.yAxis2 = readAxis(secondaryAxis,
|
|
330
|
-
const { spec, issues: specIssues } =
|
|
329
|
+
if (series.some((s) => s.axis === "secondary") && secondaryAxis) input.yAxis2 = readAxis(secondaryAxis, _chunkLL3H5XUHcjs.defaultChartAxis.call(void 0, false));
|
|
330
|
+
const { spec, issues: specIssues } = _chunkLL3H5XUHcjs.normalizeChartSpec.call(void 0, input);
|
|
331
331
|
issues.push(...specIssues);
|
|
332
332
|
const uniq = [...new Set(unsupported)];
|
|
333
333
|
return { spec, issues, unsupported: uniq, lossless: uniq.length === 0 && specIssues.length === 0 };
|
|
@@ -357,7 +357,7 @@ function readChartex(root, issues, unsupported) {
|
|
|
357
357
|
const type = layouts[layout];
|
|
358
358
|
if (!type) {
|
|
359
359
|
issues.push({ path: "plotArea", message: `The chart layout "${layout || "unknown"}" is not supported.` });
|
|
360
|
-
return { spec:
|
|
360
|
+
return { spec: _chunkLL3H5XUHcjs.normalizeChartSpec.call(void 0, {}).spec, issues, unsupported: [layout || "unknown chartex layout"], lossless: false };
|
|
361
361
|
}
|
|
362
362
|
if (layout === "sunburst") unsupported.push("sunburst (drawn as a treemap of the innermost level)");
|
|
363
363
|
if (layout === "paretoLine") unsupported.push("pareto line");
|
|
@@ -382,15 +382,15 @@ function readChartex(root, issues, unsupported) {
|
|
|
382
382
|
categories: categories.length >= longest ? categories : Array.from({ length: longest }, (_, i) => _nullishCoalesce(categories[i], () => ( `${i + 1}`)))
|
|
383
383
|
};
|
|
384
384
|
if (type === "waterfall") input.showTotal = false;
|
|
385
|
-
const { spec, issues: specIssues } =
|
|
385
|
+
const { spec, issues: specIssues } = _chunkLL3H5XUHcjs.normalizeChartSpec.call(void 0, input);
|
|
386
386
|
issues.push(...specIssues);
|
|
387
387
|
return { spec, issues, unsupported, lossless: unsupported.length === 0 && specIssues.length === 0 };
|
|
388
388
|
}
|
|
389
389
|
var esc = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
390
390
|
var hex = (color) => {
|
|
391
391
|
if (!color) return null;
|
|
392
|
-
const rgb =
|
|
393
|
-
return rgb ?
|
|
392
|
+
const rgb = _chunkLL3H5XUHcjs.parseChartColor.call(void 0, color);
|
|
393
|
+
return rgb ? _chunkLL3H5XUHcjs.chartRgbToHex.call(void 0, rgb).slice(1).toUpperCase() : null;
|
|
394
394
|
};
|
|
395
395
|
var fillXml = (color, line = false) => {
|
|
396
396
|
const h = hex(color);
|
|
@@ -434,7 +434,7 @@ function errBarsXml(bars, dir) {
|
|
|
434
434
|
var MARKER_OUT = { circle: "circle", square: "square", diamond: "diamond", triangle: "triangle", cross: "x", none: "none" };
|
|
435
435
|
function chartToOoxml(spec) {
|
|
436
436
|
const issues = [];
|
|
437
|
-
const family =
|
|
437
|
+
const family = _chunkLL3H5XUHcjs.chartFamily.call(void 0, spec);
|
|
438
438
|
let type = spec.type;
|
|
439
439
|
if (family === "waterfall" || family === "histogram" || family === "box" || family === "funnel") {
|
|
440
440
|
issues.push(`${spec.type} charts are written as bar charts: DrawingML has no ${spec.type} type (Office 2016 stores it as chartex).`);
|
|
@@ -449,7 +449,7 @@ function chartToOoxml(spec) {
|
|
|
449
449
|
const ids = { cat: 500000001, val: 500000002, cat2: 500000003, val2: 500000004 };
|
|
450
450
|
const xy = family === "xy" || type === "scatter" || type === "bubble";
|
|
451
451
|
const pieLike = type === "pie" || type === "donut";
|
|
452
|
-
const typed = (s) => pieLike || type === "radar" ? type : type === "bubble" ? "bubble" : xy ? "scatter" :
|
|
452
|
+
const typed = (s) => pieLike || type === "radar" ? type : type === "bubble" ? "bubble" : xy ? "scatter" : _chunkLL3H5XUHcjs.chartSeriesType.call(void 0, { type }, s);
|
|
453
453
|
const groups = [];
|
|
454
454
|
visible.forEach((s) => {
|
|
455
455
|
const kind = typed(s);
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
CHART_OOXML_NS,
|
|
12
12
|
CHART_OOXML_RELATIONSHIP,
|
|
13
13
|
chartToOoxml
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-7CKPUUN4.js";
|
|
15
15
|
import {
|
|
16
16
|
normalizeChartSpec
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-HLOKB7WW.js";
|
|
18
18
|
|
|
19
19
|
// src/export/images.ts
|
|
20
20
|
var DOCX_IMAGE_TYPES = {
|