@pixerate/editor 0.162.0 → 0.163.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 +34 -34
- package/dist/agent/index.js +5 -5
- package/dist/animation-editor/index.cjs +57 -57
- package/dist/animation-editor/index.js +3 -3
- package/dist/{brushstrokeRender-Q4LI22QV.js → brushstrokeRender-7LXCU7PD.js} +2 -2
- package/dist/{brushstrokeRender-5WANQIG4.cjs → brushstrokeRender-VO4ZTWVA.cjs} +5 -5
- package/dist/canvas/index.cjs +14 -14
- package/dist/canvas/index.js +3 -3
- package/dist/chart/commands.d.cts +2 -1
- package/dist/chart/commands.d.ts +2 -1
- package/dist/chart/controller.d.cts +109 -1
- package/dist/chart/controller.d.ts +109 -1
- package/dist/chart/index.cjs +605 -130
- package/dist/chart/index.d.cts +1 -0
- package/dist/chart/index.d.ts +1 -0
- package/dist/chart/index.js +490 -15
- package/dist/chart/layout-annotations.d.cts +29 -0
- package/dist/chart/layout-annotations.d.ts +29 -0
- package/dist/chart/layout-families.d.cts +23 -0
- package/dist/chart/layout-families.d.ts +23 -0
- package/dist/chart/mermaid.d.cts +2 -1
- package/dist/chart/mermaid.d.ts +2 -1
- package/dist/chart/schemas.d.cts +13 -0
- package/dist/chart/schemas.d.ts +13 -0
- package/dist/chart/spec.d.cts +30 -5
- package/dist/chart/spec.d.ts +30 -5
- package/dist/chart/stats.d.cts +9 -1
- package/dist/chart/stats.d.ts +9 -1
- package/dist/chart/tools.d.cts +1 -1
- package/dist/chart/tools.d.ts +1 -1
- package/dist/chart/tree.d.cts +62 -0
- package/dist/chart/tree.d.ts +62 -0
- package/dist/chart/types.d.cts +77 -3
- package/dist/chart/types.d.ts +77 -3
- package/dist/{chunk-7YBDRJXT.cjs → chunk-22KLZZGH.cjs} +8 -8
- package/dist/{chunk-LQLZHP6F.js → chunk-36OKQDCF.js} +7 -4
- package/dist/{chunk-HLOKB7WW.js → chunk-3NEZJCBY.js} +366 -6
- package/dist/{chunk-GWV4T5NZ.js → chunk-3VLOOO3G.js} +1 -1
- package/dist/{chunk-3GJH2MGH.cjs → chunk-5AARIS3R.cjs} +35 -35
- package/dist/{chunk-EVPZ5IKN.js → chunk-5FNGLV2D.js} +65 -3
- package/dist/{chunk-EQ46F75O.cjs → chunk-D54JHQK2.cjs} +51 -51
- package/dist/{chunk-NO5QQDHZ.js → chunk-DAPQGA55.js} +2 -2
- package/dist/{chunk-3IHNXRUV.cjs → chunk-GKNEJ6EN.cjs} +399 -67
- package/dist/{chunk-236TKNUR.cjs → chunk-JCXMJUQO.cjs} +2 -2
- package/dist/{chunk-4NGVHHJB.cjs → chunk-NZD2MZJC.cjs} +80 -18
- package/dist/{chunk-CX6JLDFC.js → chunk-OXERWBKE.js} +3 -3
- package/dist/{chunk-32MMQYCQ.cjs → chunk-PA3IMPPS.cjs} +81 -81
- package/dist/{chunk-7CKPUUN4.js → chunk-POR54B55.js} +61 -10
- package/dist/{chunk-KGTF55R3.js → chunk-QY4KUDMY.js} +1 -1
- package/dist/{chunk-LL3H5XUH.cjs → chunk-R3P2M7HU.cjs} +367 -7
- package/dist/{chunk-HDGBM7EA.cjs → chunk-SBQVEBSU.cjs} +580 -53
- package/dist/{chunk-2TKHLX6H.js → chunk-SET6KJOP.js} +1 -1
- package/dist/{chunk-XDCFJEU7.js → chunk-SZA42R4N.js} +346 -14
- package/dist/{chunk-GLMP22FT.js → chunk-TALQONZ5.js} +3 -3
- package/dist/{chunk-GNK7SESQ.cjs → chunk-V7GWZIZK.cjs} +7 -4
- package/dist/{chunk-EYVVIZJ3.cjs → chunk-WTW7QRTS.cjs} +1 -1
- package/dist/{chunk-NA4UVVJ4.cjs → chunk-YGG7WDWT.cjs} +76 -25
- package/dist/{chunk-JGKCC5OF.cjs → chunk-YQ5C5BVK.cjs} +10 -9
- package/dist/{chunk-EY22AY6R.cjs → chunk-YSAGBIRW.cjs} +16 -16
- package/dist/{chunk-A5UCR2TO.js → chunk-YXKLVD56.js} +10 -9
- package/dist/{chunk-DTSTNRPH.js → chunk-Z4P2RBMJ.js} +536 -9
- package/dist/{chunk-45XXVHVG.js → chunk-ZZGPYNS2.js} +1 -1
- package/dist/export/index.cjs +4 -4
- package/dist/export/index.js +3 -3
- package/dist/extensions/index.cjs +7 -7
- package/dist/extensions/index.js +6 -6
- package/dist/image-editor/index.cjs +638 -638
- package/dist/image-editor/index.js +4 -4
- package/dist/index.cjs +13 -13
- package/dist/index.js +7 -7
- package/dist/paint/index.cjs +2 -2
- package/dist/paint/index.js +1 -1
- package/dist/paint-editor/index.cjs +129 -149
- package/dist/paint-editor/index.js +5 -25
- package/dist/vector/index.cjs +948 -948
- package/dist/vector/index.js +3 -3
- package/package.json +3 -3
- package/skills/pixerate-canvas/SKILL.md +16 -0
- package/skills/pixerate-chart/SKILL.md +92 -9
- package/skills/pixerate-paint-editor/SKILL.md +0 -2
package/dist/chart/types.d.cts
CHANGED
|
@@ -10,8 +10,14 @@
|
|
|
10
10
|
* - `waterfall` draws the first series as running increases and decreases.
|
|
11
11
|
* - `histogram` bins every value of the visible series; `box` draws one box and whiskers per series.
|
|
12
12
|
* - `funnel` and `treemap` draw the first series, one bar or rectangle per category.
|
|
13
|
+
* - `slope` joins each category's value in the first series (before) to the second (after).
|
|
14
|
+
* - `likert` draws each category (a question) as one diverging bar of the series (answers,
|
|
15
|
+
* most negative first), as shares of the question's total.
|
|
16
|
+
* - `parliament` draws the first series as seats in a hemicycle, one colour per category.
|
|
17
|
+
* - `sunburst` draws `tree` as rings from the centre out (or, without a tree, the first series
|
|
18
|
+
* as one ring); a `treemap` with a `tree` nests each group's rectangles inside it.
|
|
13
19
|
*/
|
|
14
|
-
export type ChartType = 'bar' | 'line' | 'area' | 'scatter' | 'bubble' | 'pie' | 'donut' | 'radar' | 'waterfall' | 'histogram' | 'box' | 'funnel' | 'treemap';
|
|
20
|
+
export type ChartType = 'bar' | 'line' | 'area' | 'scatter' | 'bubble' | 'pie' | 'donut' | 'radar' | 'waterfall' | 'histogram' | 'box' | 'funnel' | 'treemap' | 'slope' | 'likert' | 'parliament' | 'sunburst';
|
|
15
21
|
/** How a series is drawn in a cartesian chart. */
|
|
16
22
|
export type ChartSeriesType = 'bar' | 'line' | 'area' | 'scatter';
|
|
17
23
|
/** One data value; `null` is a gap (missing value). */
|
|
@@ -101,6 +107,41 @@ export interface ChartSeries {
|
|
|
101
107
|
errorBars?: ChartErrorBars;
|
|
102
108
|
/** Error bars along the numeric x axis (scatter charts with x values). */
|
|
103
109
|
xErrorBars?: ChartErrorBars;
|
|
110
|
+
/** A label pinned to each point that matters, one per category (null: none). Bar, line, area and scatter charts. */
|
|
111
|
+
callouts?: (string | null)[];
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* One node of a chart's hierarchy: a leaf with a `value`, or a group with `children` (whose
|
|
115
|
+
* value is the sum of its leaves). Sibling names are unique, so a path of names finds a node.
|
|
116
|
+
*/
|
|
117
|
+
export interface ChartTreeNode {
|
|
118
|
+
name: string;
|
|
119
|
+
/** Leaves only: 0 or more. */
|
|
120
|
+
value?: number;
|
|
121
|
+
children?: ChartTreeNode[];
|
|
122
|
+
/** CSS colour (default: the palette colour of its top-level group, lighter further in). */
|
|
123
|
+
color?: string;
|
|
124
|
+
}
|
|
125
|
+
/** Which axis a reference line or band is measured on: the value axis, the secondary value axis, or the numeric x axis of a scatter or bubble chart. */
|
|
126
|
+
export type ChartReferenceAxis = 'y' | 'y2' | 'x';
|
|
127
|
+
/** A line across the plot at one value: a target, a floor, an average. */
|
|
128
|
+
export interface ChartReferenceLine {
|
|
129
|
+
value: number;
|
|
130
|
+
label?: string;
|
|
131
|
+
/** Default `y`. */
|
|
132
|
+
axis?: ChartReferenceAxis;
|
|
133
|
+
/** CSS colour (default: the theme's text colour). */
|
|
134
|
+
color?: string;
|
|
135
|
+
}
|
|
136
|
+
/** A band across the plot between two values: a target range. */
|
|
137
|
+
export interface ChartReferenceBand {
|
|
138
|
+
from: number;
|
|
139
|
+
to: number;
|
|
140
|
+
label?: string;
|
|
141
|
+
/** Default `y`. */
|
|
142
|
+
axis?: ChartReferenceAxis;
|
|
143
|
+
/** CSS colour (default: the theme's text colour, faint). */
|
|
144
|
+
color?: string;
|
|
104
145
|
}
|
|
105
146
|
export interface ChartNumberFormat {
|
|
106
147
|
/** `number` (default), `percent` (0.25 → 25%), `currency` or `compact` (1.2K). */
|
|
@@ -157,6 +198,8 @@ export type ChartStacking = 'none' | 'stacked' | 'percent';
|
|
|
157
198
|
export type ChartOrientation = 'vertical' | 'horizontal';
|
|
158
199
|
export type ChartCurve = 'linear' | 'smooth' | 'step';
|
|
159
200
|
export type ChartRadarGraticule = 'polygon' | 'circle';
|
|
201
|
+
export type ChartLikertNeutral = 'split' | 'separate';
|
|
202
|
+
export type ChartLikertSort = 'none' | 'positive' | 'negative';
|
|
160
203
|
/** Where bar labels go: `auto` puts them outside, or centred on stacked segments, and drops ones that do not fit. */
|
|
161
204
|
export type ChartLabelPosition = 'auto' | 'inside' | 'outside' | 'center';
|
|
162
205
|
/** A whole chart: data plus presentation. Plain JSON, safe to persist. */
|
|
@@ -203,6 +246,37 @@ export interface ChartSpec {
|
|
|
203
246
|
radarTicks: number | null;
|
|
204
247
|
/** Radar: rings drawn as polygons through the spokes or as circles. */
|
|
205
248
|
radarGraticule: ChartRadarGraticule;
|
|
249
|
+
/** A source or footnote, written under the chart. */
|
|
250
|
+
note: string;
|
|
251
|
+
/**
|
|
252
|
+
* The marks the chart is about; the rest are drawn muted. Each entry names a category
|
|
253
|
+
* (label) or a series (name or id). A point stays bright when its category or its series
|
|
254
|
+
* is named; whole lines and areas are muted only when another series is named.
|
|
255
|
+
*/
|
|
256
|
+
highlight: string[];
|
|
257
|
+
/** Targets, floors and averages across the plot (bar, line, area, scatter and bubble charts). */
|
|
258
|
+
referenceLines: ChartReferenceLine[];
|
|
259
|
+
/** Target ranges across the plot (bar, line, area, scatter and bubble charts). */
|
|
260
|
+
referenceBands: ChartReferenceBand[];
|
|
261
|
+
/** A one-series bar, line, area or scatter chart colours each category from the palette (and the legend lists categories). */
|
|
262
|
+
varyColors: boolean;
|
|
263
|
+
/** Likert, with an odd number of answers: the middle one straddles the centre line (`split`) or is drawn apart on the right (`separate`). */
|
|
264
|
+
likertNeutral: ChartLikertNeutral;
|
|
265
|
+
/** Likert: order the questions by agreement (`positive`), by disagreement (`negative`) or as given (`none`). */
|
|
266
|
+
likertSort: ChartLikertSort;
|
|
267
|
+
/** Parliament: the sweep of the hemicycle in degrees, 90–360. */
|
|
268
|
+
parliamentArc: number;
|
|
269
|
+
/** Parliament: seats needed for a majority, drawn as a line (`null`: half of the seats plus one). */
|
|
270
|
+
parliamentMajority: number | null;
|
|
271
|
+
/** Parliament: the caption under the seat total ("" writes "seats"). */
|
|
272
|
+
parliamentLabel: string;
|
|
273
|
+
/**
|
|
274
|
+
* Grouped data (treemaps and sunbursts). When set it is the chart's data: the categories are
|
|
275
|
+
* its top-level names and the first series holds their totals, so other types draw the totals.
|
|
276
|
+
*/
|
|
277
|
+
tree: ChartTreeNode[];
|
|
278
|
+
/** Sunburst: the caption under the total in the centre ("" for none). */
|
|
279
|
+
sunburstLabel: string;
|
|
206
280
|
}
|
|
207
281
|
/** What a click selects. */
|
|
208
282
|
export type ChartSelection = {
|
|
@@ -258,7 +332,7 @@ export interface ChartRect {
|
|
|
258
332
|
height: number;
|
|
259
333
|
}
|
|
260
334
|
/** What a mark is, for styling and tests. */
|
|
261
|
-
export type ChartMarkRole = 'background' | 'title' | 'subtitle' | 'grid' | 'axis' | 'tick' | 'tick-label' | 'axis-title' | 'bar' | 'line' | 'area' | 'point' | 'slice' | 'cell' | 'box' | 'whisker' | 'outlier' | 'connector' | 'trendline' | 'trendline-label' | 'error-bar' | 'data-label' | 'legend-swatch' | 'legend-label' | 'drag-readout' | 'selection' | 'empty';
|
|
335
|
+
export type ChartMarkRole = 'background' | 'title' | 'subtitle' | 'grid' | 'axis' | 'tick' | 'tick-label' | 'axis-title' | 'bar' | 'line' | 'area' | 'point' | 'slice' | 'cell' | 'box' | 'whisker' | 'outlier' | 'connector' | 'trendline' | 'trendline-label' | 'error-bar' | 'data-label' | 'legend-swatch' | 'legend-label' | 'drag-readout' | 'reference-line' | 'reference-band' | 'reference-label' | 'callout' | 'note' | 'selection' | 'empty';
|
|
262
336
|
interface ChartMarkBase {
|
|
263
337
|
/** Unique within the scene (a stable key for frameworks). */
|
|
264
338
|
key: string;
|
|
@@ -334,7 +408,7 @@ export interface ChartValueScale {
|
|
|
334
408
|
}
|
|
335
409
|
/** Something the layout had to leave out or shorten, as a sentence (for agents and screen readers). */
|
|
336
410
|
export interface ChartWarning {
|
|
337
|
-
code: 'labels-hidden' | 'labels-truncated' | 'legend-truncated' | 'points-decimated' | 'values-skipped' | 'data-labels-hidden' | 'type-fallback';
|
|
411
|
+
code: 'labels-hidden' | 'labels-truncated' | 'legend-truncated' | 'points-decimated' | 'values-skipped' | 'data-labels-hidden' | 'type-fallback' | 'annotations-skipped' | 'highlight-unmatched';
|
|
338
412
|
message: string;
|
|
339
413
|
}
|
|
340
414
|
/** A laid-out chart: drawing primitives in scene pixels, ready for SVG, canvas or anything else. */
|
package/dist/chart/types.d.ts
CHANGED
|
@@ -10,8 +10,14 @@
|
|
|
10
10
|
* - `waterfall` draws the first series as running increases and decreases.
|
|
11
11
|
* - `histogram` bins every value of the visible series; `box` draws one box and whiskers per series.
|
|
12
12
|
* - `funnel` and `treemap` draw the first series, one bar or rectangle per category.
|
|
13
|
+
* - `slope` joins each category's value in the first series (before) to the second (after).
|
|
14
|
+
* - `likert` draws each category (a question) as one diverging bar of the series (answers,
|
|
15
|
+
* most negative first), as shares of the question's total.
|
|
16
|
+
* - `parliament` draws the first series as seats in a hemicycle, one colour per category.
|
|
17
|
+
* - `sunburst` draws `tree` as rings from the centre out (or, without a tree, the first series
|
|
18
|
+
* as one ring); a `treemap` with a `tree` nests each group's rectangles inside it.
|
|
13
19
|
*/
|
|
14
|
-
export type ChartType = 'bar' | 'line' | 'area' | 'scatter' | 'bubble' | 'pie' | 'donut' | 'radar' | 'waterfall' | 'histogram' | 'box' | 'funnel' | 'treemap';
|
|
20
|
+
export type ChartType = 'bar' | 'line' | 'area' | 'scatter' | 'bubble' | 'pie' | 'donut' | 'radar' | 'waterfall' | 'histogram' | 'box' | 'funnel' | 'treemap' | 'slope' | 'likert' | 'parliament' | 'sunburst';
|
|
15
21
|
/** How a series is drawn in a cartesian chart. */
|
|
16
22
|
export type ChartSeriesType = 'bar' | 'line' | 'area' | 'scatter';
|
|
17
23
|
/** One data value; `null` is a gap (missing value). */
|
|
@@ -101,6 +107,41 @@ export interface ChartSeries {
|
|
|
101
107
|
errorBars?: ChartErrorBars;
|
|
102
108
|
/** Error bars along the numeric x axis (scatter charts with x values). */
|
|
103
109
|
xErrorBars?: ChartErrorBars;
|
|
110
|
+
/** A label pinned to each point that matters, one per category (null: none). Bar, line, area and scatter charts. */
|
|
111
|
+
callouts?: (string | null)[];
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* One node of a chart's hierarchy: a leaf with a `value`, or a group with `children` (whose
|
|
115
|
+
* value is the sum of its leaves). Sibling names are unique, so a path of names finds a node.
|
|
116
|
+
*/
|
|
117
|
+
export interface ChartTreeNode {
|
|
118
|
+
name: string;
|
|
119
|
+
/** Leaves only: 0 or more. */
|
|
120
|
+
value?: number;
|
|
121
|
+
children?: ChartTreeNode[];
|
|
122
|
+
/** CSS colour (default: the palette colour of its top-level group, lighter further in). */
|
|
123
|
+
color?: string;
|
|
124
|
+
}
|
|
125
|
+
/** Which axis a reference line or band is measured on: the value axis, the secondary value axis, or the numeric x axis of a scatter or bubble chart. */
|
|
126
|
+
export type ChartReferenceAxis = 'y' | 'y2' | 'x';
|
|
127
|
+
/** A line across the plot at one value: a target, a floor, an average. */
|
|
128
|
+
export interface ChartReferenceLine {
|
|
129
|
+
value: number;
|
|
130
|
+
label?: string;
|
|
131
|
+
/** Default `y`. */
|
|
132
|
+
axis?: ChartReferenceAxis;
|
|
133
|
+
/** CSS colour (default: the theme's text colour). */
|
|
134
|
+
color?: string;
|
|
135
|
+
}
|
|
136
|
+
/** A band across the plot between two values: a target range. */
|
|
137
|
+
export interface ChartReferenceBand {
|
|
138
|
+
from: number;
|
|
139
|
+
to: number;
|
|
140
|
+
label?: string;
|
|
141
|
+
/** Default `y`. */
|
|
142
|
+
axis?: ChartReferenceAxis;
|
|
143
|
+
/** CSS colour (default: the theme's text colour, faint). */
|
|
144
|
+
color?: string;
|
|
104
145
|
}
|
|
105
146
|
export interface ChartNumberFormat {
|
|
106
147
|
/** `number` (default), `percent` (0.25 → 25%), `currency` or `compact` (1.2K). */
|
|
@@ -157,6 +198,8 @@ export type ChartStacking = 'none' | 'stacked' | 'percent';
|
|
|
157
198
|
export type ChartOrientation = 'vertical' | 'horizontal';
|
|
158
199
|
export type ChartCurve = 'linear' | 'smooth' | 'step';
|
|
159
200
|
export type ChartRadarGraticule = 'polygon' | 'circle';
|
|
201
|
+
export type ChartLikertNeutral = 'split' | 'separate';
|
|
202
|
+
export type ChartLikertSort = 'none' | 'positive' | 'negative';
|
|
160
203
|
/** Where bar labels go: `auto` puts them outside, or centred on stacked segments, and drops ones that do not fit. */
|
|
161
204
|
export type ChartLabelPosition = 'auto' | 'inside' | 'outside' | 'center';
|
|
162
205
|
/** A whole chart: data plus presentation. Plain JSON, safe to persist. */
|
|
@@ -203,6 +246,37 @@ export interface ChartSpec {
|
|
|
203
246
|
radarTicks: number | null;
|
|
204
247
|
/** Radar: rings drawn as polygons through the spokes or as circles. */
|
|
205
248
|
radarGraticule: ChartRadarGraticule;
|
|
249
|
+
/** A source or footnote, written under the chart. */
|
|
250
|
+
note: string;
|
|
251
|
+
/**
|
|
252
|
+
* The marks the chart is about; the rest are drawn muted. Each entry names a category
|
|
253
|
+
* (label) or a series (name or id). A point stays bright when its category or its series
|
|
254
|
+
* is named; whole lines and areas are muted only when another series is named.
|
|
255
|
+
*/
|
|
256
|
+
highlight: string[];
|
|
257
|
+
/** Targets, floors and averages across the plot (bar, line, area, scatter and bubble charts). */
|
|
258
|
+
referenceLines: ChartReferenceLine[];
|
|
259
|
+
/** Target ranges across the plot (bar, line, area, scatter and bubble charts). */
|
|
260
|
+
referenceBands: ChartReferenceBand[];
|
|
261
|
+
/** A one-series bar, line, area or scatter chart colours each category from the palette (and the legend lists categories). */
|
|
262
|
+
varyColors: boolean;
|
|
263
|
+
/** Likert, with an odd number of answers: the middle one straddles the centre line (`split`) or is drawn apart on the right (`separate`). */
|
|
264
|
+
likertNeutral: ChartLikertNeutral;
|
|
265
|
+
/** Likert: order the questions by agreement (`positive`), by disagreement (`negative`) or as given (`none`). */
|
|
266
|
+
likertSort: ChartLikertSort;
|
|
267
|
+
/** Parliament: the sweep of the hemicycle in degrees, 90–360. */
|
|
268
|
+
parliamentArc: number;
|
|
269
|
+
/** Parliament: seats needed for a majority, drawn as a line (`null`: half of the seats plus one). */
|
|
270
|
+
parliamentMajority: number | null;
|
|
271
|
+
/** Parliament: the caption under the seat total ("" writes "seats"). */
|
|
272
|
+
parliamentLabel: string;
|
|
273
|
+
/**
|
|
274
|
+
* Grouped data (treemaps and sunbursts). When set it is the chart's data: the categories are
|
|
275
|
+
* its top-level names and the first series holds their totals, so other types draw the totals.
|
|
276
|
+
*/
|
|
277
|
+
tree: ChartTreeNode[];
|
|
278
|
+
/** Sunburst: the caption under the total in the centre ("" for none). */
|
|
279
|
+
sunburstLabel: string;
|
|
206
280
|
}
|
|
207
281
|
/** What a click selects. */
|
|
208
282
|
export type ChartSelection = {
|
|
@@ -258,7 +332,7 @@ export interface ChartRect {
|
|
|
258
332
|
height: number;
|
|
259
333
|
}
|
|
260
334
|
/** What a mark is, for styling and tests. */
|
|
261
|
-
export type ChartMarkRole = 'background' | 'title' | 'subtitle' | 'grid' | 'axis' | 'tick' | 'tick-label' | 'axis-title' | 'bar' | 'line' | 'area' | 'point' | 'slice' | 'cell' | 'box' | 'whisker' | 'outlier' | 'connector' | 'trendline' | 'trendline-label' | 'error-bar' | 'data-label' | 'legend-swatch' | 'legend-label' | 'drag-readout' | 'selection' | 'empty';
|
|
335
|
+
export type ChartMarkRole = 'background' | 'title' | 'subtitle' | 'grid' | 'axis' | 'tick' | 'tick-label' | 'axis-title' | 'bar' | 'line' | 'area' | 'point' | 'slice' | 'cell' | 'box' | 'whisker' | 'outlier' | 'connector' | 'trendline' | 'trendline-label' | 'error-bar' | 'data-label' | 'legend-swatch' | 'legend-label' | 'drag-readout' | 'reference-line' | 'reference-band' | 'reference-label' | 'callout' | 'note' | 'selection' | 'empty';
|
|
262
336
|
interface ChartMarkBase {
|
|
263
337
|
/** Unique within the scene (a stable key for frameworks). */
|
|
264
338
|
key: string;
|
|
@@ -334,7 +408,7 @@ export interface ChartValueScale {
|
|
|
334
408
|
}
|
|
335
409
|
/** Something the layout had to leave out or shorten, as a sentence (for agents and screen readers). */
|
|
336
410
|
export interface ChartWarning {
|
|
337
|
-
code: 'labels-hidden' | 'labels-truncated' | 'legend-truncated' | 'points-decimated' | 'values-skipped' | 'data-labels-hidden' | 'type-fallback';
|
|
411
|
+
code: 'labels-hidden' | 'labels-truncated' | 'legend-truncated' | 'points-decimated' | 'values-skipped' | 'data-labels-hidden' | 'type-fallback' | 'annotations-skipped' | 'highlight-unmatched';
|
|
338
412
|
message: string;
|
|
339
413
|
}
|
|
340
414
|
/** A laid-out chart: drawing primitives in scene pixels, ready for SVG, canvas or anything else. */
|
|
@@ -11,10 +11,10 @@ var _chunkYN6JKAUEcjs = require('./chunk-YN6JKAUE.cjs');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkYGG7WDWTcjs = require('./chunk-YGG7WDWT.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkR3P2M7HUcjs = require('./chunk-R3P2M7HU.cjs');
|
|
18
18
|
|
|
19
19
|
// src/export/images.ts
|
|
20
20
|
var DOCX_IMAGE_TYPES = {
|
|
@@ -1028,12 +1028,12 @@ var DocxBuilder = (_class2 = class {
|
|
|
1028
1028
|
this.drop("node", "chart", "chart has no spec");
|
|
1029
1029
|
return;
|
|
1030
1030
|
}
|
|
1031
|
-
const spec =
|
|
1032
|
-
const written =
|
|
1031
|
+
const spec = _chunkR3P2M7HUcjs.normalizeChartSpec.call(void 0, raw).spec;
|
|
1032
|
+
const written = _chunkYGG7WDWTcjs.chartToOoxml.call(void 0, spec);
|
|
1033
1033
|
for (const issue of written.issues) this.drop("node", "chart", issue);
|
|
1034
1034
|
const name = `chart${this.charts.length + 1}.xml`;
|
|
1035
1035
|
this.charts.push(written.xml);
|
|
1036
|
-
const relId = this.rels.add(
|
|
1036
|
+
const relId = this.rels.add(_chunkYGG7WDWTcjs.CHART_OOXML_RELATIONSHIP, `charts/${name}`);
|
|
1037
1037
|
let width = _nullishCoalesce(pixelAttr(_optionalChain([node, 'access', _91 => _91.attrs, 'optionalAccess', _92 => _92.width])), () => ( MAX_IMAGE_WIDTH_PX));
|
|
1038
1038
|
let height = _nullishCoalesce(pixelAttr(_optionalChain([node, 'access', _93 => _93.attrs, 'optionalAccess', _94 => _94.height])), () => ( 320));
|
|
1039
1039
|
if (width > MAX_IMAGE_WIDTH_PX) {
|
|
@@ -1050,8 +1050,8 @@ var DocxBuilder = (_class2 = class {
|
|
|
1050
1050
|
drawing.empty("wp:extent", { cx, cy }).empty("wp:effectExtent", { l: 0, t: 0, r: 0, b: 0 });
|
|
1051
1051
|
drawing.empty("wp:docPr", { id, name: `Chart ${id}`, descr: title || void 0, title: title || void 0 });
|
|
1052
1052
|
drawing.empty("wp:cNvGraphicFramePr");
|
|
1053
|
-
drawing.open("a:graphic").open("a:graphicData", { uri:
|
|
1054
|
-
drawing.empty("c:chart", { "xmlns:c":
|
|
1053
|
+
drawing.open("a:graphic").open("a:graphicData", { uri: _chunkYGG7WDWTcjs.CHART_OOXML_NS });
|
|
1054
|
+
drawing.empty("c:chart", { "xmlns:c": _chunkYGG7WDWTcjs.CHART_OOXML_NS, "r:id": relId });
|
|
1055
1055
|
drawing.close("a:graphicData").close("a:graphic").close("wp:inline").close("w:drawing").close("w:r");
|
|
1056
1056
|
this.report.written.paragraphs++;
|
|
1057
1057
|
w.open("w:p");
|
|
@@ -1384,7 +1384,7 @@ var DocxBuilder = (_class2 = class {
|
|
|
1384
1384
|
if (people) add("word/people.xml", people, `${CT_WML}people+xml`);
|
|
1385
1385
|
parts.push({ name: "word/_rels/document.xml.rels", data: this.rels.xml() });
|
|
1386
1386
|
for (const file of this.media) parts.push({ name: `word/media/${file.name}`, data: file.bytes });
|
|
1387
|
-
this.charts.forEach((xml, i) => add(`word/charts/chart${i + 1}.xml`, xml,
|
|
1387
|
+
this.charts.forEach((xml, i) => add(`word/charts/chart${i + 1}.xml`, xml, _chunkYGG7WDWTcjs.CHART_OOXML_CONTENT_TYPE));
|
|
1388
1388
|
add("docProps/core.xml", this.coreXml(now), "application/vnd.openxmlformats-package.core-properties+xml");
|
|
1389
1389
|
const app = new XmlWriter();
|
|
1390
1390
|
app.open("Properties", { xmlns: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" });
|
|
@@ -2358,12 +2358,15 @@ var WetMedium = class {
|
|
|
2358
2358
|
sample(rect, cov) {
|
|
2359
2359
|
const s = this.world.sample(this.laneId, rect, cov);
|
|
2360
2360
|
if (!(s.wet > 0) || !(s.weight > 0)) return null;
|
|
2361
|
-
const
|
|
2362
|
-
const
|
|
2361
|
+
const k0 = s.pigment[0] + s.settled[0];
|
|
2362
|
+
const k1 = s.pigment[1] + s.settled[1];
|
|
2363
|
+
const k2 = s.pigment[2] + s.settled[2];
|
|
2364
|
+
const k3 = s.pigment[3] + s.settled[3];
|
|
2365
|
+
const kmax = Math.max(k0, k1, k2);
|
|
2363
2366
|
if (!(kmax > 1e-9)) return null;
|
|
2364
2367
|
const f = SAMPLE_K / kmax;
|
|
2365
|
-
const rgb = pigmentColor(
|
|
2366
|
-
const density = Math.min(1, (
|
|
2368
|
+
const rgb = pigmentColor(k0 * f, k1 * f, k2 * f, k3 * f);
|
|
2369
|
+
const density = Math.min(1, (k0 + k1 + k2) / s.wet / 0.06);
|
|
2367
2370
|
return { rgb, contact: s.wet / s.weight * density };
|
|
2368
2371
|
}
|
|
2369
2372
|
deposit(rect, cov, dep, paint, _pigment, field = null) {
|