@pixerate/editor 0.236.0 → 0.238.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/agent/index.cjs +40 -39
- package/dist/agent/index.js +9 -8
- package/dist/animation/index.cjs +7 -6
- package/dist/animation/index.js +6 -5
- package/dist/animation-editor/index.cjs +66 -65
- package/dist/animation-editor/index.js +9 -8
- package/dist/{brushstrokeRender-WDTKD54B.cjs → brushstrokeRender-MPOM7BFW.cjs} +7 -5
- package/dist/{brushstrokeRender-MAHOXL7K.js → brushstrokeRender-WB67GMUP.js} +4 -2
- package/dist/canvas/index.cjs +55 -54
- package/dist/canvas/index.js +10 -9
- package/dist/chart/index.cjs +159 -158
- package/dist/chart/index.js +9 -8
- package/dist/{chunk-L6Y7TSQ4.js → chunk-36ZTV7WO.js} +1 -1
- package/dist/{chunk-JVNGCS26.js → chunk-3E36VDMJ.js} +1 -1
- package/dist/{chunk-WRZ6C4TU.cjs → chunk-3R5P3DVY.cjs} +6 -6
- package/dist/{chunk-RUONPPMC.cjs → chunk-44BMJJVA.cjs} +8 -8
- package/dist/{chunk-YBAPT7NL.js → chunk-6ADHGQ73.js} +4 -2
- package/dist/chunk-7AHBW2CQ.cjs +200 -0
- package/dist/{chunk-EUIDTZNQ.cjs → chunk-7PT4RJL5.cjs} +113 -111
- package/dist/{chunk-CU6ANS5L.js → chunk-7YGBSFC6.js} +2 -2
- package/dist/{chunk-ATKKG76G.cjs → chunk-AD7GA3TL.cjs} +23 -23
- package/dist/{chunk-FSLKBQU7.js → chunk-AIS56JOO.js} +3 -3
- package/dist/{chunk-5VQXSS2S.cjs → chunk-BBUE3UJL.cjs} +86 -86
- package/dist/{chunk-7272D3K2.js → chunk-BP6KSGVD.js} +6 -4
- package/dist/{chunk-F6R67I3A.js → chunk-CXXXAZ7H.js} +1 -1
- package/dist/{chunk-5DQPDXOM.cjs → chunk-D2SGV525.cjs} +76 -76
- package/dist/chunk-F67XMVDI.js +200 -0
- package/dist/{chunk-PHYOZK3B.js → chunk-FQVVO5YA.js} +85 -8
- package/dist/{chunk-UXETV2NC.cjs → chunk-GA4EU4P3.cjs} +4 -4
- package/dist/{chunk-UFEDHACQ.js → chunk-GXAK6Q5J.js} +2 -2
- package/dist/{chunk-MHLU6GRJ.js → chunk-JEGJP4OW.js} +7 -196
- package/dist/{chunk-GOBOCZZI.js → chunk-LEQKZGQI.js} +1 -1
- package/dist/{chunk-M5GLQQWG.cjs → chunk-LJZRHVZV.cjs} +2 -2
- package/dist/{chunk-N76AMOKE.cjs → chunk-MOW3JMNG.cjs} +42 -42
- package/dist/{chunk-WKMUBATU.js → chunk-N4DFDI73.js} +1 -1
- package/dist/{chunk-GNZI3KYK.cjs → chunk-NKTNLJUJ.cjs} +49 -9
- package/dist/{chunk-TQOL6CF7.js → chunk-PJYG6FCF.js} +49 -9
- package/dist/{chunk-V3L7U63N.cjs → chunk-PP6BXVRL.cjs} +1 -1
- package/dist/{chunk-TFF2GTGN.cjs → chunk-PPFJHTW5.cjs} +24 -22
- package/dist/{chunk-6ZZKRH7R.js → chunk-QARCM66V.js} +3 -3
- package/dist/{chunk-5UEFBM2M.cjs → chunk-RD7RX52G.cjs} +18 -207
- package/dist/{chunk-CDP2AKMA.js → chunk-RV5DKZHU.js} +1 -1
- package/dist/{chunk-HUAISCUX.cjs → chunk-T7KQEMAE.cjs} +18 -18
- package/dist/{chunk-BQE3Y6ZO.cjs → chunk-THXFU3JB.cjs} +5 -5
- package/dist/{chunk-4ZC5QJE2.cjs → chunk-UTI5IITZ.cjs} +3 -3
- package/dist/{chunk-XSVUNSDJ.js → chunk-UUBO6RB5.js} +1 -1
- package/dist/{chunk-WPWHT4Z6.cjs → chunk-UZU6DIZA.cjs} +221 -144
- package/dist/{chunk-M2TPMYJE.js → chunk-V6DT2CDH.js} +1 -1
- package/dist/{chunk-WV5WTOC6.cjs → chunk-W7GRGGBH.cjs} +16 -16
- package/dist/{chunk-23E5GI2U.js → chunk-WGN7AUKB.js} +2 -2
- package/dist/{chunk-YMREOA67.js → chunk-XK4SST43.js} +2 -2
- package/dist/{chunk-SOSBOS5T.cjs → chunk-XWOLPNBW.cjs} +22 -22
- package/dist/{chunk-ILP77UD6.js → chunk-YGQVCQTG.js} +1 -1
- package/dist/{chunk-GXLZZVR5.cjs → chunk-ZXNO3ZOX.cjs} +37 -37
- package/dist/color/index.cjs +6 -4
- package/dist/color/index.js +9 -7
- package/dist/export/index.cjs +8 -7
- package/dist/export/index.js +7 -6
- package/dist/extensions/index.cjs +13 -10
- package/dist/extensions/index.js +12 -9
- package/dist/extensions/loading-node.d.cts +45 -1
- package/dist/extensions/loading-node.d.ts +45 -1
- package/dist/gradient/index.cjs +29 -28
- package/dist/gradient/index.js +4 -3
- package/dist/image-editor/index.cjs +778 -777
- package/dist/image-editor/index.js +9 -8
- package/dist/index.cjs +19 -16
- package/dist/index.js +13 -10
- package/dist/paint-editor/controller.d.cts +31 -1
- package/dist/paint-editor/controller.d.ts +31 -1
- package/dist/paint-editor/index.cjs +403 -195
- package/dist/paint-editor/index.js +231 -23
- package/dist/paint-editor/sticker-tools.d.cts +1 -1
- package/dist/paint-editor/sticker-tools.d.ts +1 -1
- package/dist/paint-editor/stickers.d.cts +10 -3
- package/dist/paint-editor/stickers.d.ts +10 -3
- package/dist/paint-editor/ui.d.cts +10 -3
- package/dist/paint-editor/ui.d.ts +10 -3
- package/dist/tokens/index.cjs +4 -3
- package/dist/tokens/index.js +3 -2
- package/dist/typography/index.cjs +8 -7
- package/dist/typography/index.js +3 -2
- package/dist/vector/index.cjs +967 -966
- package/dist/vector/index.js +9 -8
- package/dist/video-editor/index.cjs +7 -6
- package/dist/video-editor/index.js +6 -5
- package/package.json +1 -1
- package/skills/pixerate-color/SKILL.md +3 -0
- package/skills/pixerate-image-editor/SKILL.md +1 -0
- package/skills/pixerate-paint-editor/SKILL.md +6 -2
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkD2SGV525cjs = require('./chunk-D2SGV525.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkMOW3JMNGcjs = require('./chunk-MOW3JMNG.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunk3R5P3DVYcjs = require('./chunk-3R5P3DVY.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
var _chunkG43MNQ4Ccjs = require('./chunk-G43MNQ4C.cjs');
|
|
@@ -1457,7 +1457,7 @@ var ChartNodeView = (_class = class {
|
|
|
1457
1457
|
this.dom.contentEditable = "false";
|
|
1458
1458
|
this.syncAttributes();
|
|
1459
1459
|
this.key = specKey(this.node.attrs.spec);
|
|
1460
|
-
this.controller = new (0,
|
|
1460
|
+
this.controller = new (0, _chunkD2SGV525cjs.ChartController)({ spec: this.node.attrs.spec });
|
|
1461
1461
|
this.unsubscribe = this.controller.subscribe((state) => {
|
|
1462
1462
|
if (!state.gesture) this.writeBack();
|
|
1463
1463
|
});
|
|
@@ -1690,7 +1690,7 @@ function readSpec(value) {
|
|
|
1690
1690
|
}
|
|
1691
1691
|
}
|
|
1692
1692
|
if (!input || typeof input !== "object" || Array.isArray(input)) return null;
|
|
1693
|
-
return
|
|
1693
|
+
return _chunk3R5P3DVYcjs.normalizeChartSpec.call(void 0, input).spec;
|
|
1694
1694
|
}
|
|
1695
1695
|
var readSize = (value) => {
|
|
1696
1696
|
const n = value === null ? NaN : Number(value);
|
|
@@ -1716,10 +1716,10 @@ function staticChartSvg(node, options) {
|
|
|
1716
1716
|
const spec = node.attrs.spec;
|
|
1717
1717
|
const width = _nullishCoalesce(node.attrs.width, () => ( options.defaultWidth));
|
|
1718
1718
|
const height = _nullishCoalesce(node.attrs.height, () => ( options.defaultHeight));
|
|
1719
|
-
const scene =
|
|
1720
|
-
return
|
|
1719
|
+
const scene = _chunkMOW3JMNGcjs.layoutChart.call(void 0, spec, { width, height, theme: options.theme, selection: null });
|
|
1720
|
+
return _chunkD2SGV525cjs.chartSceneToDomSpec.call(void 0, scene, {
|
|
1721
1721
|
ariaLabel: spec.title || "Chart",
|
|
1722
|
-
description:
|
|
1722
|
+
description: _chunkD2SGV525cjs.describeChart.call(void 0, spec),
|
|
1723
1723
|
attrs: { style: "max-width: 100%; height: auto; display: block" }
|
|
1724
1724
|
});
|
|
1725
1725
|
}
|
|
@@ -1735,7 +1735,7 @@ var Chart = _core.Node.create({
|
|
|
1735
1735
|
return {
|
|
1736
1736
|
HTMLAttributes: {},
|
|
1737
1737
|
nodeView: null,
|
|
1738
|
-
theme:
|
|
1738
|
+
theme: _chunk3R5P3DVYcjs.DEFAULT_CHART_THEME,
|
|
1739
1739
|
defaultWidth: 640,
|
|
1740
1740
|
defaultHeight: 320,
|
|
1741
1741
|
generateId: () => generateStructureId("chart")
|
|
@@ -1749,7 +1749,7 @@ var Chart = _core.Node.create({
|
|
|
1749
1749
|
renderHTML: (attributes) => attributes.id ? { "data-chart-id": attributes.id } : {}
|
|
1750
1750
|
},
|
|
1751
1751
|
spec: {
|
|
1752
|
-
default:
|
|
1752
|
+
default: _chunk3R5P3DVYcjs.normalizeChartSpec.call(void 0, {}).spec,
|
|
1753
1753
|
// null (no `data-chart`) keeps what the parse rule found, e.g. a mermaid block's spec.
|
|
1754
1754
|
parseHTML: (element) => readSpec(element.getAttribute("data-chart")),
|
|
1755
1755
|
renderHTML: (attributes) => ({
|
|
@@ -1787,7 +1787,7 @@ var Chart = _core.Node.create({
|
|
|
1787
1787
|
const code = element.querySelector("code");
|
|
1788
1788
|
const language = _nullishCoalesce(_nullishCoalesce(_optionalChain([code, 'optionalAccess', _47 => _47.getAttribute, 'call', _48 => _48("class")]), () => ( element.getAttribute("data-language"))), () => ( ""));
|
|
1789
1789
|
if (!/(?:^|\s)language-mermaid(?:\s|$)/.test(language) && language !== "mermaid") return false;
|
|
1790
|
-
const result =
|
|
1790
|
+
const result = _chunkD2SGV525cjs.chartFromMermaid.call(void 0, _nullishCoalesce((_nullishCoalesce(code, () => ( element))).textContent, () => ( "")));
|
|
1791
1791
|
return result.family ? { spec: result.spec } : false;
|
|
1792
1792
|
}
|
|
1793
1793
|
}
|
|
@@ -1811,7 +1811,7 @@ var Chart = _core.Node.create({
|
|
|
1811
1811
|
return {
|
|
1812
1812
|
markdown: {
|
|
1813
1813
|
serialize(state, node) {
|
|
1814
|
-
const text =
|
|
1814
|
+
const text = _chunkD2SGV525cjs.chartToMermaid.call(void 0, node.attrs.spec);
|
|
1815
1815
|
const fence = "`".repeat(Math.max(3, longestBacktickRun(text) + 1));
|
|
1816
1816
|
state.write(`${fence}mermaid
|
|
1817
1817
|
`);
|
|
@@ -1833,7 +1833,7 @@ var Chart = _core.Node.create({
|
|
|
1833
1833
|
type: this.name,
|
|
1834
1834
|
attrs: {
|
|
1835
1835
|
id: _nullishCoalesce(options.id, () => ( this.options.generateId())),
|
|
1836
|
-
spec:
|
|
1836
|
+
spec: _chunk3R5P3DVYcjs.normalizeChartSpec.call(void 0, _nullishCoalesce(options.spec, () => ( {}))).spec,
|
|
1837
1837
|
width: _nullishCoalesce(options.width, () => ( null)),
|
|
1838
1838
|
height: _nullishCoalesce(options.height, () => ( this.options.defaultHeight))
|
|
1839
1839
|
}
|
|
@@ -1844,7 +1844,7 @@ var Chart = _core.Node.create({
|
|
|
1844
1844
|
if (dispatch) {
|
|
1845
1845
|
tr.setNodeMarkup(chart.pos, void 0, {
|
|
1846
1846
|
...chart.node.attrs,
|
|
1847
|
-
...changes.spec !== void 0 ? { spec:
|
|
1847
|
+
...changes.spec !== void 0 ? { spec: _chunk3R5P3DVYcjs.normalizeChartSpec.call(void 0, changes.spec).spec } : {},
|
|
1848
1848
|
...changes.width !== void 0 ? { width: changes.width } : {},
|
|
1849
1849
|
...changes.height !== void 0 ? { height: changes.height } : {}
|
|
1850
1850
|
});
|
|
@@ -1951,14 +1951,14 @@ var Sparkline = _core.Node.create({
|
|
|
1951
1951
|
return [{ tag: 'span[data-type="sparkline"]', priority: 60 }];
|
|
1952
1952
|
},
|
|
1953
1953
|
renderHTML({ node, HTMLAttributes }) {
|
|
1954
|
-
const scene =
|
|
1954
|
+
const scene = _chunkD2SGV525cjs.layoutSparkline.call(void 0, node.attrs.values, {
|
|
1955
1955
|
kind: node.attrs.kind,
|
|
1956
1956
|
width: node.attrs.width,
|
|
1957
1957
|
height: node.attrs.height,
|
|
1958
1958
|
color: _nullishCoalesce(node.attrs.color, () => ( this.options.color)),
|
|
1959
1959
|
negativeColor: this.options.negativeColor
|
|
1960
1960
|
});
|
|
1961
|
-
const svg =
|
|
1961
|
+
const svg = _chunkD2SGV525cjs.chartSceneToDomSpec.call(void 0, scene, {
|
|
1962
1962
|
ariaLabel: sparklineLabel(node),
|
|
1963
1963
|
attrs: { style: "display: inline-block; vertical-align: middle" }
|
|
1964
1964
|
});
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
r2,
|
|
15
15
|
sameChartSelection,
|
|
16
16
|
summarizeChartSeries
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-N4DFDI73.js";
|
|
18
18
|
import {
|
|
19
19
|
CHART_TYPE_LABELS,
|
|
20
20
|
DEFAULT_CHART_PALETTE,
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
parseChartValue,
|
|
48
48
|
shadeChartColor,
|
|
49
49
|
uniqueChartSeriesId
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-QARCM66V.js";
|
|
51
51
|
import {
|
|
52
52
|
parseCsv,
|
|
53
53
|
parseTsv
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
unionBounds,
|
|
19
19
|
vectorGradientPoints,
|
|
20
20
|
widthProfileAt
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-7YGBSFC6.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-V6DT2CDH.js";
|
|
33
33
|
|
|
34
34
|
// src/vector/blend.ts
|
|
35
35
|
var lerpN = (a, b, t) => a + (b - a) * t;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunk3R5P3DVYcjs = require('./chunk-3R5P3DVY.cjs');
|
|
22
22
|
|
|
23
23
|
// src/chart/schemas.ts
|
|
24
24
|
var VALUE = { type: ["number", "string", "null"], description: 'A number, numeric text ("1,200", "12%", "$40", "(3)") or null for a gap.' };
|
|
@@ -30,7 +30,7 @@ var FORMAT = {
|
|
|
30
30
|
type: "object",
|
|
31
31
|
description: "How numbers are written on this axis or series.",
|
|
32
32
|
properties: {
|
|
33
|
-
style: { type: "string", enum: [...
|
|
33
|
+
style: { type: "string", enum: [..._chunk3R5P3DVYcjs.CHART_NUMBER_STYLES], description: "number (default), percent (0.25 \u2192 25%), currency or compact (1.2K)." },
|
|
34
34
|
decimals: { type: "integer", minimum: 0, maximum: 10, description: "Fixed decimals (default: what the ticks need)." },
|
|
35
35
|
currency: { type: "string", description: 'ISO currency code for style "currency", e.g. "EUR" (default USD).' },
|
|
36
36
|
prefix: { type: "string", description: "Text before every number." },
|
|
@@ -50,10 +50,10 @@ var AXIS = (what) => ({
|
|
|
50
50
|
step: { type: ["number", "null"], exclusiveMinimum: 0, description: "Fixed distance between ticks, or null for automatic." },
|
|
51
51
|
gridlines: { type: "boolean", description: "Grid lines at each tick." },
|
|
52
52
|
format: FORMAT,
|
|
53
|
-
kind: { type: ["string", "null"], enum: [...
|
|
53
|
+
kind: { type: ["string", "null"], enum: [..._chunk3R5P3DVYcjs.CHART_AXIS_KINDS, null], description: 'Category axis only: "date" reads categories as dates and labels them by calendar steps.' },
|
|
54
54
|
scale: {
|
|
55
55
|
type: ["string", "null"],
|
|
56
|
-
enum: [...
|
|
56
|
+
enum: [..._chunk3R5P3DVYcjs.CHART_AXIS_SCALES, null],
|
|
57
57
|
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.'
|
|
58
58
|
},
|
|
59
59
|
logBase: { type: ["number", "null"], minimum: 2, maximum: 1e3, description: "Base of a log axis, 2 to 1000 (default 10; null resets)." },
|
|
@@ -62,7 +62,7 @@ var AXIS = (what) => ({
|
|
|
62
62
|
additionalProperties: false
|
|
63
63
|
});
|
|
64
64
|
var TRENDLINE_PROPS = {
|
|
65
|
-
type: { type: "string", enum: [...
|
|
65
|
+
type: { type: "string", enum: [..._chunk3R5P3DVYcjs.CHART_TRENDLINE_TYPES], description: "Fit: linear, exponential, logarithmic, power, polynomial or moving-average." },
|
|
66
66
|
order: { type: "integer", minimum: 2, maximum: 6, description: "Polynomial order (default 2)." },
|
|
67
67
|
period: { type: "integer", minimum: 2, description: "Moving-average period in points (default 2)." },
|
|
68
68
|
forward: { type: "number", minimum: 0, description: "Extend the line this many x units past the last point (default 0)." },
|
|
@@ -77,7 +77,7 @@ var REFERENCE_COMMON = {
|
|
|
77
77
|
label: { type: "string", description: 'Text written on it, e.g. "Target" (default none).' },
|
|
78
78
|
axis: {
|
|
79
79
|
type: "string",
|
|
80
|
-
enum: [...
|
|
80
|
+
enum: [..._chunk3R5P3DVYcjs.CHART_REFERENCE_AXES],
|
|
81
81
|
description: "Axis it is measured on: y (default) is the value axis, y2 the secondary value axis (needs a series there), x the numeric x axis of a scatter or bubble chart."
|
|
82
82
|
},
|
|
83
83
|
color: { type: "string", description: "CSS colour (default: the text colour)." }
|
|
@@ -93,7 +93,7 @@ var REFERENCE_BAND_PROPS = {
|
|
|
93
93
|
};
|
|
94
94
|
var REFERENCE_COMMON_PATCH = {
|
|
95
95
|
label: { type: ["string", "null"], description: "Text written on it; null removes it." },
|
|
96
|
-
axis: { type: ["string", "null"], enum: [...
|
|
96
|
+
axis: { type: ["string", "null"], enum: [..._chunk3R5P3DVYcjs.CHART_REFERENCE_AXES, null], description: "Axis it is measured on (y, y2 or x); null goes back to y." },
|
|
97
97
|
color: { type: ["string", "null"], description: "CSS colour; null goes back to the text colour." }
|
|
98
98
|
};
|
|
99
99
|
var REFERENCE_LINE_PATCH = { value: REFERENCE_LINE_PROPS.value, ...REFERENCE_COMMON_PATCH };
|
|
@@ -127,13 +127,13 @@ var ERROR_BARS = (what) => ({
|
|
|
127
127
|
properties: {
|
|
128
128
|
type: {
|
|
129
129
|
type: "string",
|
|
130
|
-
enum: [...
|
|
130
|
+
enum: [..._chunk3R5P3DVYcjs.CHART_ERROR_BAR_TYPES],
|
|
131
131
|
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."
|
|
132
132
|
},
|
|
133
133
|
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." },
|
|
134
134
|
plus: { type: "array", items: VALUE, description: "custom only: amount above each point, one per category, in data units (0 or more; null for none)." },
|
|
135
135
|
minus: { type: "array", items: VALUE, description: "custom only: amount below each point, one per category (default: the plus amounts)." },
|
|
136
|
-
direction: { type: "string", enum: [...
|
|
136
|
+
direction: { type: "string", enum: [..._chunk3R5P3DVYcjs.CHART_ERROR_BAR_DIRECTIONS], description: "both (default), plus (only above) or minus (only below)." },
|
|
137
137
|
cap: { type: "boolean", description: "Draw end caps (default true)." }
|
|
138
138
|
},
|
|
139
139
|
required: ["type"],
|
|
@@ -143,22 +143,22 @@ var SERIES_PROPS = {
|
|
|
143
143
|
name: { type: "string", description: "Series name (legend and data grid header)." },
|
|
144
144
|
values: { type: "array", items: VALUE, description: "One value per category, in category order (padded with gaps)." },
|
|
145
145
|
color: { type: ["string", "null"], description: "CSS colour, or null for the palette colour." },
|
|
146
|
-
type: { type: ["string", "null"], enum: [...
|
|
146
|
+
type: { type: ["string", "null"], enum: [..._chunk3R5P3DVYcjs.CHART_SERIES_TYPES, null], description: "Draw this series as bar, line, area or scatter (a combo chart); null follows the chart type." },
|
|
147
147
|
hidden: { type: "boolean", description: "Hide the series (its data is kept)." },
|
|
148
148
|
axis: { type: ["string", "null"], enum: ["primary", "secondary", null], description: "Value axis: secondary is drawn on the right with its own scale." },
|
|
149
149
|
x: { type: ["array", "null"], items: VALUE, description: "Numeric x per category, for scatter and bubble charts." },
|
|
150
150
|
sizes: { type: ["array", "null"], items: VALUE, description: "Bubble sizes per category (area is proportional to size)." },
|
|
151
151
|
pointColors: { type: ["array", "null"], items: { type: ["string", "null"] }, description: "Colour per category (null keeps the series colour)." },
|
|
152
152
|
callouts: { type: ["array", "null"], items: { type: ["string", "null"] }, description: "A label pinned to each point that matters, one per category (null: none); null removes them all. Bar, line, area and scatter charts. set_chart_callout sets one." },
|
|
153
|
-
marker: { type: ["string", "null"], enum: [...
|
|
154
|
-
curve: { type: ["string", "null"], enum: [...
|
|
153
|
+
marker: { type: ["string", "null"], enum: [..._chunk3R5P3DVYcjs.CHART_MARKERS, null], description: "Point marker shape for line, area and scatter series." },
|
|
154
|
+
curve: { type: ["string", "null"], enum: [..._chunk3R5P3DVYcjs.CHART_CURVES, null], description: "Line shape for this series: linear, smooth or step." },
|
|
155
155
|
dataLabels: { type: ["boolean", "null"], description: "Value labels for this series (null follows the chart)." },
|
|
156
156
|
format: { ...FORMAT, type: ["object", "null"], description: "How this series' labels are written (null follows the value axis)." },
|
|
157
157
|
errorBars: ERROR_BARS("Error bars along the value axis (bar, line, area and scatter series; on stacked charts they sit on the stack top)."),
|
|
158
158
|
xErrorBars: ERROR_BARS("Error bars along the x axis (scatter and bubble charts with numeric x values; amounts in x units).")
|
|
159
159
|
};
|
|
160
160
|
var CHART_UPDATE_PROPERTIES = {
|
|
161
|
-
type: { type: "string", enum: [...
|
|
161
|
+
type: { type: "string", enum: [..._chunk3R5P3DVYcjs.CHART_TYPES], description: "Chart type. streamgraph stacks areas symmetrically around a center baseline; slope joins each category from the first series (before) to the second (after); likert reads each category as a question and the series as answers from most negative to most positive; parliament draws the first series as seats; sunburst draws the grouped data (set_chart_tree) as rings, and a treemap with grouped data nests its groups; sankey draws the flows (set_chart_links); barrace reads categories as time points and series as names, and animates their ranking; choropleth shades the regions of a map, each category naming a region by code (FRA) or name (France)." },
|
|
162
162
|
title: { type: "string", description: 'Title ("" for none).' },
|
|
163
163
|
subtitle: { type: "string", description: 'Subtitle ("" for none).' },
|
|
164
164
|
xAxis: AXIS("Category axis (or numeric x axis of scatter / bubble charts)."),
|
|
@@ -167,15 +167,15 @@ var CHART_UPDATE_PROPERTIES = {
|
|
|
167
167
|
legend: {
|
|
168
168
|
type: "object",
|
|
169
169
|
description: "Legend.",
|
|
170
|
-
properties: { show: { type: "boolean", description: "Show the legend." }, position: { type: "string", enum: [...
|
|
170
|
+
properties: { show: { type: "boolean", description: "Show the legend." }, position: { type: "string", enum: [..._chunk3R5P3DVYcjs.CHART_LEGEND_POSITIONS], description: "Where the legend goes." } },
|
|
171
171
|
additionalProperties: false
|
|
172
172
|
},
|
|
173
|
-
stacking: { type: "string", enum: [...
|
|
174
|
-
orientation: { type: "string", enum: [...
|
|
175
|
-
curve: { type: "string", enum: [...
|
|
173
|
+
stacking: { type: "string", enum: [..._chunk3R5P3DVYcjs.CHART_STACKINGS], description: "none, stacked, or percent (each category scaled to 100%)." },
|
|
174
|
+
orientation: { type: "string", enum: [..._chunk3R5P3DVYcjs.CHART_ORIENTATIONS], description: "horizontal draws bars sideways." },
|
|
175
|
+
curve: { type: "string", enum: [..._chunk3R5P3DVYcjs.CHART_CURVES], description: "Line shape: linear, smooth or step." },
|
|
176
176
|
points: { type: "boolean", description: "Dots on line and area series." },
|
|
177
177
|
dataLabels: { type: "boolean", description: "Value labels on bars, points and slices." },
|
|
178
|
-
labelPosition: { type: "string", enum: [...
|
|
178
|
+
labelPosition: { type: "string", enum: [..._chunk3R5P3DVYcjs.CHART_LABEL_POSITIONS], description: "Bar label position; auto drops labels that do not fit." },
|
|
179
179
|
palette: { type: "array", items: { type: "string" }, minItems: 1, description: "Series colours in order (CSS colours)." },
|
|
180
180
|
innerRadius: { type: "number", minimum: 0, maximum: 0.9, description: "Donut hole as a fraction of the radius." },
|
|
181
181
|
gapWidth: { type: "number", minimum: 0, maximum: 0.9, description: "Space between bar groups as a fraction of the category (default 0.28)." },
|
|
@@ -183,19 +183,19 @@ var CHART_UPDATE_PROPERTIES = {
|
|
|
183
183
|
bins: { type: ["integer", "null"], minimum: 1, maximum: 500, description: "Histogram bin count, or null for \u221An." },
|
|
184
184
|
showTotal: { type: "boolean", description: "Waterfall: append a total bar." },
|
|
185
185
|
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)." },
|
|
186
|
-
radarGraticule: { type: "string", enum: [...
|
|
186
|
+
radarGraticule: { type: "string", enum: [..._chunk3R5P3DVYcjs.CHART_RADAR_GRATICULES], description: "Radar: draw rings as polygons through the spokes or as circles (default polygon)." },
|
|
187
187
|
note: { type: "string", description: 'A source or footnote written under the chart ("" for none).' },
|
|
188
188
|
highlight: { type: "array", items: { type: "string" }, description: "Category labels and series names (or ids) to draw normally while the rest are muted; [] shows everything. highlight_chart checks the names." },
|
|
189
189
|
referenceLines: { type: "array", items: { type: "object", properties: REFERENCE_LINE_PROPS, required: ["value"], additionalProperties: false }, description: "Replaces every reference line (targets, floors, averages across the plot). add_chart_reference_line adds one." },
|
|
190
190
|
referenceBands: { type: "array", items: { type: "object", properties: REFERENCE_BAND_PROPS, required: ["from", "to"], additionalProperties: false }, description: "Replaces every reference band (target ranges across the plot). add_chart_reference_band adds one." },
|
|
191
191
|
varyColors: { type: "boolean", description: "A one-series bar, line, area or scatter chart colours each category from the palette, and its legend lists the categories (default false)." },
|
|
192
|
-
likertNeutral: { type: "string", enum: [...
|
|
193
|
-
likertSort: { type: "string", enum: [...
|
|
192
|
+
likertNeutral: { type: "string", enum: [..._chunk3R5P3DVYcjs.CHART_LIKERT_NEUTRALS], description: "Likert with an odd number of answers: split (default) puts the middle answer across the centre line; separate draws it in its own column on the right." },
|
|
193
|
+
likertSort: { type: "string", enum: [..._chunk3R5P3DVYcjs.CHART_LIKERT_SORTS], description: "Likert: order the questions by agreement (positive), by disagreement (negative) or as given (none, default)." },
|
|
194
194
|
parliamentArc: { type: "number", minimum: 90, maximum: 360, description: "Parliament: sweep of the hemicycle in degrees (default 180)." },
|
|
195
195
|
parliamentMajority: { type: ["integer", "null"], minimum: 1, description: "Parliament: seats needed for a majority, drawn as a dashed line (null: half of the seats plus one)." },
|
|
196
196
|
parliamentLabel: { type: "string", description: 'Parliament: caption under the seat total ("" writes "seats").' },
|
|
197
197
|
sunburstLabel: { type: "string", description: 'Sunburst: caption under the total in the centre ("" for none).' },
|
|
198
|
-
sankeyLinkColor: { type: "string", enum: [...
|
|
198
|
+
sankeyLinkColor: { type: "string", enum: [..._chunk3R5P3DVYcjs.CHART_SANKEY_LINK_COLORS], description: "Sankey: colour each flow by its source node (default), its target node, or grey." },
|
|
199
199
|
map: { type: "string", description: 'Choropleth: the registered map to draw (list_chart_map_regions lists them; "europe" by default).' },
|
|
200
200
|
mapSteps: { type: "integer", minimum: 2, maximum: 9, description: "Choropleth: number of equal colour classes between the smallest and largest value (default 5)." },
|
|
201
201
|
mapThresholds: { type: "array", items: { type: "number" }, maxItems: 8, description: "Choropleth: class breaks in ascending order, e.g. [100, 250, 500], used instead of mapSteps; [] goes back to equal classes." },
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkTHXFU3JBcjs = require('./chunk-THXFU3JB.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -29,7 +29,7 @@ var _chunkGF2RBSDMcjs = require('./chunk-GF2RBSDM.cjs');
|
|
|
29
29
|
var _chunkDWJJI6RTcjs = require('./chunk-DWJJI6RT.cjs');
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkUTI5IITZcjs = require('./chunk-UTI5IITZ.cjs');
|
|
33
33
|
|
|
34
34
|
// src/vector/blend.ts
|
|
35
35
|
var lerpN = (a, b, t) => a + (b - a) * t;
|
|
@@ -37,7 +37,7 @@ var lerpP = (a, b, t) => [a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t];
|
|
|
37
37
|
var toP = (v) => [v.x, v.y];
|
|
38
38
|
var mapP = (m, p) => [m[0] * p[0] + m[2] * p[1] + m[4], m[1] * p[0] + m[3] * p[1] + m[5]];
|
|
39
39
|
var curvesOf = (c) => Math.max(0, (c.pts.length - 1) / 3) | 0;
|
|
40
|
-
function subpathToMorphContour(sp, m =
|
|
40
|
+
function subpathToMorphContour(sp, m = _chunkTHXFU3JBcjs.IDENTITY_MATRIX) {
|
|
41
41
|
const n = sp.anchors.length;
|
|
42
42
|
if (!n) return null;
|
|
43
43
|
const first = mapP(m, toP(sp.anchors[0]));
|
|
@@ -67,8 +67,8 @@ function isStraight(p0, p1, p2, p3) {
|
|
|
67
67
|
const u2 = along(p2);
|
|
68
68
|
return off(p1) < tol && off(p2) < tol && u1 >= -1e-9 && u1 <= 1 + 1e-9 && u2 >= -1e-9 && u2 <= 1 + 1e-9;
|
|
69
69
|
}
|
|
70
|
-
function morphContourToSubpath(c, m =
|
|
71
|
-
const pts =
|
|
70
|
+
function morphContourToSubpath(c, m = _chunkTHXFU3JBcjs.IDENTITY_MATRIX, closed = c.closed) {
|
|
71
|
+
const pts = _chunkTHXFU3JBcjs.isIdentityMatrix.call(void 0, m) ? c.pts : c.pts.map((p) => mapP(m, p));
|
|
72
72
|
const curves = curvesOf(c);
|
|
73
73
|
const dropLast = closed && c.closed && curves > 0;
|
|
74
74
|
const count = dropLast ? curves : curves + 1;
|
|
@@ -84,7 +84,7 @@ function morphContourToSubpath(c, m = _chunkBQE3Y6ZOcjs.IDENTITY_MATRIX, closed
|
|
|
84
84
|
anchors[(k + 1) % count].in = { x: p2[0], y: p2[1] };
|
|
85
85
|
}
|
|
86
86
|
for (const a of anchors) {
|
|
87
|
-
const type =
|
|
87
|
+
const type = _chunkTHXFU3JBcjs.inferAnchorType.call(void 0, a);
|
|
88
88
|
if (type !== "corner") a.type = type;
|
|
89
89
|
}
|
|
90
90
|
const isClosed = closed && curves > 0;
|
|
@@ -267,7 +267,7 @@ function bestStart(fixed, free, useShapeContext) {
|
|
|
267
267
|
return best;
|
|
268
268
|
}
|
|
269
269
|
function placeIn(c, from, to) {
|
|
270
|
-
const b =
|
|
270
|
+
const b = _chunkTHXFU3JBcjs.unionBounds.call(void 0, [boundsOfPoints(c.pts)]);
|
|
271
271
|
const p = b ? [b.x + b.width / 2, b.y + b.height / 2] : c.pts[0];
|
|
272
272
|
if (!from || !to) return p;
|
|
273
273
|
const fx = from.width > 0 ? (p[0] - from.x) / from.width : 0.5;
|
|
@@ -452,11 +452,11 @@ function interpolateRigidMatrix(a, b, t) {
|
|
|
452
452
|
function interpolateVectorColor(a, b, t) {
|
|
453
453
|
if (t <= 0) return a;
|
|
454
454
|
if (t >= 1) return b;
|
|
455
|
-
return _nullishCoalesce(
|
|
455
|
+
return _nullishCoalesce(_chunkUTI5IITZcjs.mixColorsOklab.call(void 0, a, b, t), () => ( (t < 0.5 ? a : b)));
|
|
456
456
|
}
|
|
457
457
|
function resampleGradientStops(g, offsets) {
|
|
458
458
|
return offsets.map((offset) => {
|
|
459
|
-
const s =
|
|
459
|
+
const s = _chunkTHXFU3JBcjs.sampleVectorGradient.call(void 0, g, offset);
|
|
460
460
|
return s.opacity < 1 ? { offset, color: s.color, opacity: Math.round(s.opacity * 1e4) / 1e4 } : { offset, color: s.color };
|
|
461
461
|
});
|
|
462
462
|
}
|
|
@@ -467,11 +467,11 @@ function lerpAngle(a, b, t) {
|
|
|
467
467
|
var lerpPoint = (a, b, t) => ({ x: lerpN(a.x, b.x, t), y: lerpN(a.y, b.y, t) });
|
|
468
468
|
var sameColourModel = (a, b) => (_nullishCoalesce(a.interpolation, () => ( "srgb"))) === (_nullishCoalesce(b.interpolation, () => ( "srgb"))) && (_nullishCoalesce(a.smoothness, () => ( 0))) === (_nullishCoalesce(b.smoothness, () => ( 0)));
|
|
469
469
|
function lerpStops(a, b, t) {
|
|
470
|
-
let stopsA =
|
|
471
|
-
let stopsB =
|
|
470
|
+
let stopsA = _chunkTHXFU3JBcjs.sortedVectorGradientStops.call(void 0, a);
|
|
471
|
+
let stopsB = _chunkTHXFU3JBcjs.sortedVectorGradientStops.call(void 0, b);
|
|
472
472
|
const resampled = stopsA.length !== stopsB.length || !sameColourModel(a, b);
|
|
473
473
|
if (resampled) {
|
|
474
|
-
const offs = [...
|
|
474
|
+
const offs = [..._chunkTHXFU3JBcjs.expandVectorGradientStops.call(void 0, a), ..._chunkTHXFU3JBcjs.expandVectorGradientStops.call(void 0, b), ...stopsA, ...stopsB].map((s) => s.offset).filter(Number.isFinite).sort((x, y) => x - y);
|
|
475
475
|
const common = offs.filter((o, i) => i === 0 || o - offs[i - 1] > 1e-4);
|
|
476
476
|
stopsA = resampleGradientStops(a, common);
|
|
477
477
|
stopsB = resampleGradientStops(b, common);
|
|
@@ -498,8 +498,8 @@ function lerpGradient(a, b, t) {
|
|
|
498
498
|
}
|
|
499
499
|
if (near.spread && near.spread !== "pad") out.spread = near.spread;
|
|
500
500
|
if (near.strokeMode && near.strokeMode !== "within") out.strokeMode = near.strokeMode;
|
|
501
|
-
const ea =
|
|
502
|
-
const eb =
|
|
501
|
+
const ea = _chunkTHXFU3JBcjs.hasExplicitGradientGeometry.call(void 0, a);
|
|
502
|
+
const eb = _chunkTHXFU3JBcjs.hasExplicitGradientGeometry.call(void 0, b);
|
|
503
503
|
if (!ea && !eb) {
|
|
504
504
|
if (a.angle !== void 0 || b.angle !== void 0 || a.type === "linear" || a.type === "reflected") {
|
|
505
505
|
const fallback = a.type === "linear" || a.type === "reflected" ? 180 : 90;
|
|
@@ -512,10 +512,10 @@ function lerpGradient(a, b, t) {
|
|
|
512
512
|
}
|
|
513
513
|
return out;
|
|
514
514
|
}
|
|
515
|
-
const pa =
|
|
516
|
-
const pb =
|
|
515
|
+
const pa = _chunkTHXFU3JBcjs.vectorGradientPoints.call(void 0, a);
|
|
516
|
+
const pb = _chunkTHXFU3JBcjs.vectorGradientPoints.call(void 0, b);
|
|
517
517
|
if (pa.units !== pb.units) {
|
|
518
|
-
const src =
|
|
518
|
+
const src = _chunkTHXFU3JBcjs.explicitVectorGradient.call(void 0, near);
|
|
519
519
|
return { ...src, stops: out.stops, ...out.interpolation ? { interpolation: out.interpolation } : {}, ...out.smoothness ? { smoothness: out.smoothness } : {} };
|
|
520
520
|
}
|
|
521
521
|
out.start = lerpPoint(pa.start, pb.start, t);
|
|
@@ -535,14 +535,14 @@ function solidLike(color, like) {
|
|
|
535
535
|
function interpolateVectorPaint(a, b, t) {
|
|
536
536
|
if (t <= 0) return a;
|
|
537
537
|
if (t >= 1) return b;
|
|
538
|
-
const pa =
|
|
539
|
-
const pb =
|
|
538
|
+
const pa = _chunkTHXFU3JBcjs.hasPaint.call(void 0, a);
|
|
539
|
+
const pb = _chunkTHXFU3JBcjs.hasPaint.call(void 0, b);
|
|
540
540
|
if (!pa && !pb) return t < 0.5 ? a : b;
|
|
541
541
|
if (typeof a === "string" && pa && typeof b === "string" && pb) return interpolateVectorColor(a, b, t);
|
|
542
542
|
if (!pa && typeof b === "string") return interpolateVectorColor("transparent", b, t);
|
|
543
543
|
if (!pb && typeof a === "string") return interpolateVectorColor(a, "transparent", t);
|
|
544
|
-
const ga = pa &&
|
|
545
|
-
const gb = pb &&
|
|
544
|
+
const ga = pa && _chunkTHXFU3JBcjs.isVectorGradient.call(void 0, a) ? a : null;
|
|
545
|
+
const gb = pb && _chunkTHXFU3JBcjs.isVectorGradient.call(void 0, b) ? b : null;
|
|
546
546
|
if (ga && gb) return _nullishCoalesce(lerpGradient(ga, gb, t), () => ( (t < 0.5 ? a : b)));
|
|
547
547
|
if (gb) return _nullishCoalesce(lerpGradient(solidLike(pa ? a : null, gb), gb, t), () => ( b));
|
|
548
548
|
if (ga) return _nullishCoalesce(lerpGradient(ga, solidLike(pb ? b : null, ga), t), () => ( a));
|
|
@@ -553,8 +553,8 @@ function interpolateWidthProfiles(a, b, t) {
|
|
|
553
553
|
const at = [..._nullishCoalesce(a, () => ( [])), ..._nullishCoalesce(b, () => ( [])), { t: 0 }, { t: 1 }].map((p) => p.t).sort((x, y) => x - y);
|
|
554
554
|
const ts = at.filter((v, i) => i === 0 || v - at[i - 1] > 1e-6);
|
|
555
555
|
return ts.map((pos) => {
|
|
556
|
-
const x =
|
|
557
|
-
const y =
|
|
556
|
+
const x = _chunkTHXFU3JBcjs.widthProfileAt.call(void 0, a, pos);
|
|
557
|
+
const y = _chunkTHXFU3JBcjs.widthProfileAt.call(void 0, b, pos);
|
|
558
558
|
return { t: pos, left: lerpN(x.left, y.left, t), right: lerpN(x.right, y.right, t) };
|
|
559
559
|
});
|
|
560
560
|
}
|
|
@@ -597,7 +597,7 @@ function reversedStyle(s) {
|
|
|
597
597
|
out.endArrow = s.startArrow;
|
|
598
598
|
out.startArrowScale = s.endArrowScale;
|
|
599
599
|
out.endArrowScale = s.startArrowScale;
|
|
600
|
-
if (_optionalChain([s, 'access', _6 => _6.strokeWidthProfile, 'optionalAccess', _7 => _7.length])) out.strokeWidthProfile =
|
|
600
|
+
if (_optionalChain([s, 'access', _6 => _6.strokeWidthProfile, 'optionalAccess', _7 => _7.length])) out.strokeWidthProfile = _chunkTHXFU3JBcjs.reverseWidthProfile.call(void 0, s.strokeWidthProfile);
|
|
601
601
|
for (const k of ["startArrow", "endArrow", "startArrowScale", "endArrowScale"]) if (out[k] === void 0) delete out[k];
|
|
602
602
|
return out;
|
|
603
603
|
}
|
|
@@ -623,19 +623,19 @@ function styleOf(n) {
|
|
|
623
623
|
return out;
|
|
624
624
|
}
|
|
625
625
|
function contoursOf(node, m) {
|
|
626
|
-
return
|
|
626
|
+
return _chunkTHXFU3JBcjs.expandVectorCorners.call(void 0, node.subpaths).map((sp) => subpathToMorphContour(sp, m)).filter((c) => !!c);
|
|
627
627
|
}
|
|
628
|
-
function preparePathMorph(a, b, options, ma =
|
|
628
|
+
function preparePathMorph(a, b, options, ma = _chunkTHXFU3JBcjs.nodeMatrix.call(void 0, a), mb = _chunkTHXFU3JBcjs.nodeMatrix.call(void 0, b)) {
|
|
629
629
|
const corr = correspondMorphContours(contoursOf(a, ma), contoursOf(b, mb), options);
|
|
630
630
|
const sim = procrustes(corr.a, corr.b);
|
|
631
631
|
const styleA = styleOf(a);
|
|
632
632
|
const styleB = corr.reversed ? reversedStyle(styleOf(b)) : styleOf(b);
|
|
633
|
-
const rigid = !
|
|
633
|
+
const rigid = !_chunkTHXFU3JBcjs.isIdentityMatrix.call(void 0, ma) || !_chunkTHXFU3JBcjs.isIdentityMatrix.call(void 0, mb);
|
|
634
634
|
const id = _nullishCoalesce(options.id, () => ( a.id));
|
|
635
635
|
return (t) => {
|
|
636
636
|
const contours = interpolateMorphContours(corr.a, corr.b, t, { linear: options.linear, rigidity: options.rigidity, similarity: sim });
|
|
637
|
-
const m = rigid ? interpolateRigidMatrix(ma, mb, t) :
|
|
638
|
-
const back = rigid ?
|
|
637
|
+
const m = rigid ? interpolateRigidMatrix(ma, mb, t) : _chunkTHXFU3JBcjs.IDENTITY_MATRIX;
|
|
638
|
+
const back = rigid ? _chunkTHXFU3JBcjs.invertMatrix.call(void 0, m) : _chunkTHXFU3JBcjs.IDENTITY_MATRIX;
|
|
639
639
|
const subpaths = contours.map((c, k) => {
|
|
640
640
|
const closed = t <= 0 ? corr.a[k].closed : t >= 1 ? corr.b[k].closed : corr.a[k].closed && corr.b[k].closed;
|
|
641
641
|
return morphContourToSubpath({ closed: corr.a[k].closed && corr.b[k].closed, pts: c.pts }, back, closed);
|
|
@@ -643,14 +643,14 @@ function preparePathMorph(a, b, options, ma = _chunkBQE3Y6ZOcjs.nodeMatrix.call(
|
|
|
643
643
|
const node = { id, type: "path", subpaths, ...interpolateVectorStyle(styleA, styleB, t) };
|
|
644
644
|
const opacity = lerpN(_nullishCoalesce(a.opacity, () => ( 1)), _nullishCoalesce(b.opacity, () => ( 1)), t);
|
|
645
645
|
if (opacity < 1) node.opacity = opacity;
|
|
646
|
-
if (rigid && !
|
|
646
|
+
if (rigid && !_chunkTHXFU3JBcjs.isIdentityMatrix.call(void 0, m)) node.transform = m;
|
|
647
647
|
return node;
|
|
648
648
|
};
|
|
649
649
|
}
|
|
650
|
-
function flattenPaths(node, parent =
|
|
651
|
-
const m =
|
|
650
|
+
function flattenPaths(node, parent = _chunkTHXFU3JBcjs.IDENTITY_MATRIX) {
|
|
651
|
+
const m = _chunkTHXFU3JBcjs.multiplyMatrices.call(void 0, _chunkTHXFU3JBcjs.nodeMatrix.call(void 0, node), parent);
|
|
652
652
|
if (node.type === "path") return [{ path: node, m, opacity: 1 }];
|
|
653
|
-
if (node.type === "text" || node.type === "instance") return flattenPaths(
|
|
653
|
+
if (node.type === "text" || node.type === "instance") return flattenPaths(_chunkTHXFU3JBcjs.expandVectorAppearance.call(void 0, node), parent);
|
|
654
654
|
const o = _nullishCoalesce(node.opacity, () => ( 1));
|
|
655
655
|
return node.children.filter((c) => c.visible !== false).flatMap((c) => flattenPaths(c, m)).map((e) => ({ ...e, opacity: e.opacity * o }));
|
|
656
656
|
}
|
|
@@ -672,8 +672,8 @@ function createVectorMorph(a, b, options = {}) {
|
|
|
672
672
|
}
|
|
673
673
|
const pa = flattenPaths(a);
|
|
674
674
|
const pb = flattenPaths(b);
|
|
675
|
-
const ba =
|
|
676
|
-
const bb =
|
|
675
|
+
const ba = _chunkTHXFU3JBcjs.unionBounds.call(void 0, pa.map((e) => placedBounds(e.path, e.m)));
|
|
676
|
+
const bb = _chunkTHXFU3JBcjs.unionBounds.call(void 0, pb.map((e) => placedBounds(e.path, e.m)));
|
|
677
677
|
const id = _nullishCoalesce(options.id, () => ( a.id));
|
|
678
678
|
const parts = [];
|
|
679
679
|
const opacities = [];
|
|
@@ -685,10 +685,10 @@ function createVectorMorph(a, b, options = {}) {
|
|
|
685
685
|
parts.push(preparePathMorph(x.path, y.path, sub, x.m, y.m));
|
|
686
686
|
opacities.push([x.opacity, y.opacity]);
|
|
687
687
|
} else if (x) {
|
|
688
|
-
parts.push(preparePathMorph(x.path, collapsedPath(x.path, x.m, ba, bb), sub, x.m,
|
|
688
|
+
parts.push(preparePathMorph(x.path, collapsedPath(x.path, x.m, ba, bb), sub, x.m, _chunkTHXFU3JBcjs.IDENTITY_MATRIX));
|
|
689
689
|
opacities.push([x.opacity, x.opacity]);
|
|
690
690
|
} else if (y) {
|
|
691
|
-
parts.push(preparePathMorph(collapsedPath(y.path, y.m, bb, ba), y.path, sub,
|
|
691
|
+
parts.push(preparePathMorph(collapsedPath(y.path, y.m, bb, ba), y.path, sub, _chunkTHXFU3JBcjs.IDENTITY_MATRIX, y.m));
|
|
692
692
|
opacities.push([y.opacity, y.opacity]);
|
|
693
693
|
}
|
|
694
694
|
}
|
package/dist/color/index.cjs
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunk7PT4RJL5cjs = require('../chunk-7PT4RJL5.cjs');
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
@@ -38,7 +38,7 @@ var _chunkEUIDTZNQcjs = require('../chunk-EUIDTZNQ.cjs');
|
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
var
|
|
41
|
+
var _chunkPPFJHTW5cjs = require('../chunk-PPFJHTW5.cjs');
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
|
|
@@ -47,6 +47,7 @@ var _chunkTFF2GTGNcjs = require('../chunk-TFF2GTGN.cjs');
|
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
|
|
50
|
+
var _chunkRD7RX52Gcjs = require('../chunk-RD7RX52G.cjs');
|
|
50
51
|
|
|
51
52
|
|
|
52
53
|
|
|
@@ -59,7 +60,8 @@ var _chunkTFF2GTGNcjs = require('../chunk-TFF2GTGN.cjs');
|
|
|
59
60
|
|
|
60
61
|
|
|
61
62
|
|
|
62
|
-
|
|
63
|
+
|
|
64
|
+
var _chunk7AHBW2CQcjs = require('../chunk-7AHBW2CQ.cjs');
|
|
63
65
|
require('../chunk-IPJ3TEYR.cjs');
|
|
64
66
|
|
|
65
67
|
|
|
@@ -118,4 +120,4 @@ require('../chunk-IPJ3TEYR.cjs');
|
|
|
118
120
|
|
|
119
121
|
|
|
120
122
|
|
|
121
|
-
exports.DEFAULT_SCHEME_SURFACES =
|
|
123
|
+
exports.DEFAULT_SCHEME_SURFACES = _chunk7PT4RJL5cjs.DEFAULT_SCHEME_SURFACES; exports.HARMONY_KINDS = _chunk7PT4RJL5cjs.HARMONY_KINDS; exports.NAMED_COLORS = _chunkRD7RX52Gcjs.NAMED_COLORS; exports.PICKER_HUE_BACKGROUND = _chunk7PT4RJL5cjs.PICKER_HUE_BACKGROUND; exports.checkDualColorContrast = _chunk7PT4RJL5cjs.checkDualColorContrast; exports.checkPaletteColors = _chunk7PT4RJL5cjs.checkPaletteColors; exports.colorHarmony = _chunk7PT4RJL5cjs.colorHarmony; exports.contrastLevel = _chunkRD7RX52Gcjs.contrastLevel; exports.contrastRatio = _chunkRD7RX52Gcjs.contrastRatio; exports.createColorToolProvider = _chunk7PT4RJL5cjs.createColorToolProvider; exports.deltaEOK = _chunkPPFJHTW5cjs.deltaEOK; exports.deriveDualColor = _chunk7PT4RJL5cjs.deriveDualColor; exports.displayP3ToLinearSrgb = _chunk7AHBW2CQcjs.displayP3ToLinearSrgb; exports.dualColorsToCss = _chunk7PT4RJL5cjs.dualColorsToCss; exports.dualPickerView = _chunk7PT4RJL5cjs.dualPickerView; exports.formatColor = _chunkPPFJHTW5cjs.formatColor; exports.formatDualColor = _chunk7PT4RJL5cjs.formatDualColor; exports.formatHex = _chunkPPFJHTW5cjs.formatHex; exports.hslToRgb = _chunk7AHBW2CQcjs.hslToRgb; exports.hsvToRgb = _chunk7AHBW2CQcjs.hsvToRgb; exports.hueToWheel = _chunk7PT4RJL5cjs.hueToWheel; exports.inSrgbGamut = _chunkPPFJHTW5cjs.inSrgbGamut; exports.isColor = _chunkRD7RX52Gcjs.isColor; exports.isDualColor = _chunk7PT4RJL5cjs.isDualColor; exports.isSameInBothSchemes = _chunk7PT4RJL5cjs.isSameInBothSchemes; exports.linearSrgbToDisplayP3 = _chunk7AHBW2CQcjs.linearSrgbToDisplayP3; exports.linearToSrgb = _chunk7AHBW2CQcjs.linearToSrgb; exports.mixColors = _chunk7PT4RJL5cjs.mixColors; exports.normalizeColor = _chunkPPFJHTW5cjs.normalizeColor; exports.normalizeDualColor = _chunk7PT4RJL5cjs.normalizeDualColor; exports.oklabToOklch = _chunk7AHBW2CQcjs.oklabToOklch; exports.oklabToRgb = _chunk7AHBW2CQcjs.oklabToRgb; exports.oklchToOklab = _chunk7AHBW2CQcjs.oklchToOklab; exports.parseColor = _chunkRD7RX52Gcjs.parseColor; exports.parseDualColor = _chunk7PT4RJL5cjs.parseDualColor; exports.pickerAlphaBackground = _chunk7PT4RJL5cjs.pickerAlphaBackground; exports.pickerAreaBackground = _chunk7PT4RJL5cjs.pickerAreaBackground; exports.pickerKeyStep = _chunk7PT4RJL5cjs.pickerKeyStep; exports.pickerStateFromAlpha = _chunk7PT4RJL5cjs.pickerStateFromAlpha; exports.pickerStateFromArea = _chunk7PT4RJL5cjs.pickerStateFromArea; exports.pickerStateFromColor = _chunk7PT4RJL5cjs.pickerStateFromColor; exports.pickerStateFromHue = _chunk7PT4RJL5cjs.pickerStateFromHue; exports.pickerStateToHex = _chunk7PT4RJL5cjs.pickerStateToHex; exports.pushRecentColor = _chunk7PT4RJL5cjs.pushRecentColor; exports.readableTextColor = _chunkRD7RX52Gcjs.readableTextColor; exports.relativeLuminance = _chunkRD7RX52Gcjs.relativeLuminance; exports.resolveColor = _chunk7PT4RJL5cjs.resolveColor; exports.rgbToHsl = _chunk7AHBW2CQcjs.rgbToHsl; exports.rgbToHsv = _chunk7AHBW2CQcjs.rgbToHsv; exports.rgbToOklab = _chunk7AHBW2CQcjs.rgbToOklab; exports.setDualColorSide = _chunk7PT4RJL5cjs.setDualColorSide; exports.simulateColorVision = _chunk7PT4RJL5cjs.simulateColorVision; exports.srgbToLinear = _chunk7AHBW2CQcjs.srgbToLinear; exports.suggestAccessibleForeground = _chunkPPFJHTW5cjs.suggestAccessibleForeground; exports.toSrgbGamut = _chunkPPFJHTW5cjs.toSrgbGamut; exports.wheelToHue = _chunk7PT4RJL5cjs.wheelToHue;
|