@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/vector/index.js
CHANGED
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
reverseMorphContour,
|
|
39
39
|
subpathToMorphContour,
|
|
40
40
|
turnMorphContour
|
|
41
|
-
} from "../chunk-
|
|
41
|
+
} from "../chunk-QY4KUDMY.js";
|
|
42
42
|
import {
|
|
43
43
|
DEFAULT_VECTOR_FONT,
|
|
44
44
|
IDENTITY_MATRIX,
|
|
@@ -507,8 +507,8 @@ import {
|
|
|
507
507
|
withVectorStrokes,
|
|
508
508
|
withVectorTargetPaint,
|
|
509
509
|
zigzagPaths
|
|
510
|
-
} from "../chunk-
|
|
511
|
-
import "../chunk-
|
|
510
|
+
} from "../chunk-SET6KJOP.js";
|
|
511
|
+
import "../chunk-YXKLVD56.js";
|
|
512
512
|
import {
|
|
513
513
|
createProvenance
|
|
514
514
|
} from "../chunk-M6DNZNVY.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixerate/editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.163.0",
|
|
4
4
|
"description": "UI-agnostic rich text and media editing core library",
|
|
5
5
|
"author": "Pixerate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -371,7 +371,7 @@
|
|
|
371
371
|
"prosemirror-markdown": "^1.13.9"
|
|
372
372
|
},
|
|
373
373
|
"devDependencies": {
|
|
374
|
-
"@anthropic-ai/sdk": "
|
|
374
|
+
"@anthropic-ai/sdk": "1.1.0",
|
|
375
375
|
"@dagrejs/dagre": "^1.1.8",
|
|
376
376
|
"@tiptap/core": "^2.27.3",
|
|
377
377
|
"@tiptap/pm": "^2.27.3",
|
|
@@ -379,7 +379,7 @@
|
|
|
379
379
|
"@types/markdown-it": "^14.2.0",
|
|
380
380
|
"@types/node": "^26.6.5",
|
|
381
381
|
"assemblyscript": "0.28.20",
|
|
382
|
-
"fast-check": "^
|
|
382
|
+
"fast-check": "^4.10.2",
|
|
383
383
|
"mermaid": "12.2.0",
|
|
384
384
|
"tiptap-markdown": "^0.8.10",
|
|
385
385
|
"tsup": "^9.0.0",
|
|
@@ -107,6 +107,19 @@ batching and error codes.
|
|
|
107
107
|
| `canvas_select` | Replace the selection (an empty list clears it). Use it to show the user a result and to target commands that act on the selection. |
|
|
108
108
|
| `canvas_highlight` | Flash nodes to point the user at them: `color` (default `#3b82f6`), `durationMs` (default 2000, max 60000). Changes nothing. |
|
|
109
109
|
|
|
110
|
+
### Explode and collapse
|
|
111
|
+
|
|
112
|
+
Hosts with expandable nodes (a task that opens into subtasks, a Gantt bar into its steps) add these.
|
|
113
|
+
Exploding shows the node's child nodes and moves the surrounding nodes to make room; collapsing
|
|
114
|
+
removes the children and puts the moved nodes back. It is a view change, not an edit: it is not an
|
|
115
|
+
undo step and is not saved with the document. The host decides what the children are.
|
|
116
|
+
|
|
117
|
+
| Tool | Use it to |
|
|
118
|
+
| --- | --- |
|
|
119
|
+
| `list_explodable_nodes` | List the nodes that can explode (`id`, `label`, `exploded`, `collapsing`), the ids `exploded` and `collapsing` now, whether several can be open at once (`multiple`), and the `readOnly` reason if exploding is disabled. Call it first: it is the only source of explodable ids. |
|
|
120
|
+
| `explode_node` | Explode `node` (an id from `list_explodable_nodes`). Unless `multiple`, the node exploded before collapses (it comes back in `collapsed`). Exploding an exploded node changes nothing (`changed: false`). Returns the ids now `exploded`. Then use `get_editor_state` or `capture_view` to read or see the children. |
|
|
121
|
+
| `collapse_node` | Collapse an exploded `node`. Returns the ids still `exploded` and those still `collapsing` (their children leave when the collapse animation ends). Fails when the node is not exploded. |
|
|
122
|
+
|
|
110
123
|
### Write: components
|
|
111
124
|
|
|
112
125
|
These are strict-schema tools. Each returns `{ ids }` of what it created or changed, or fails with
|
|
@@ -288,6 +301,9 @@ effects provider (for example Flair); without one the read tools say so and the
|
|
|
288
301
|
- With agent playback on, the cursor clicks where `canvas_add_node` will place the node, drags
|
|
289
302
|
`canvas_connect` from source to target, and rings the nodes a layout or arrange command moved.
|
|
290
303
|
Nothing about the calls changes: still read ids with `get_editor_state` and pass them back.
|
|
304
|
+
- **Exploded children are temporary.** Do not edit, connect or lay out nodes that only exist
|
|
305
|
+
while a node is exploded: they vanish on collapse. Collapse before `canvas_layout`, and do not
|
|
306
|
+
save positions read while a node is exploded (the moved nodes return to their old places).
|
|
291
307
|
- `canvas_update_node` changes `data` only. Move nodes with layout, align or distribute commands,
|
|
292
308
|
or by the host's own means; do not expect `position` inside `data` to move anything.
|
|
293
309
|
- Align needs at least two nodes and distribute at least three; locked nodes never move. Shape
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pixerate-chart
|
|
3
|
-
description: How to build, edit and check charts in the Pixerate chart editor through its agent tools and chart.* commands - bar, column, line, area, scatter, bubble, pie, donut, radar, waterfall, histogram, box plot, funnel and
|
|
3
|
+
description: How to build, edit and check charts in the Pixerate chart editor through its agent tools and chart.* commands - bar, column, line, area, scatter, bubble, pie, donut, radar, waterfall, histogram, box plot, funnel, treemap (flat or grouped), sunburst, slope, Likert (survey) and parliament charts; series, categories, stacking, secondary axis, log axis, number formats, data labels, legend, trendline, error bars, reference lines and target bands, callouts, highlighting, footnotes, colour palettes and colour-blind checks, CSV and Mermaid import, Office chart XML export, and reading charts out of open .xlsx, .pptx and .docx files. Use when a chart editor's tools (get_chart, update_chart, set_chart_values, list_file_charts...) are available or the user asks to make, restyle, fix or explain a chart.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Charts
|
|
@@ -10,10 +10,19 @@ A chart editor holds one `ChartSpec`: a `type`, `title` / `subtitle`, `xAxis` /
|
|
|
10
10
|
a list of `categories` (strings, in order) and a list of `series`. Each series has an `id`
|
|
11
11
|
(such as `series-1`), a `name` and one value per category (`null` is a gap), plus optional
|
|
12
12
|
per-series settings (type for combos, secondary axis, marker, colour, format, trendlines,
|
|
13
|
-
error bars).
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
series
|
|
13
|
+
error bars, callouts). Annotations sit on the spec: `note` (footnote), `highlight` (names of
|
|
14
|
+
categories and series to keep bright), `referenceLines`, `referenceBands` and `varyColors`. Tools take a series by id or exact name and a category by 0-based index or
|
|
15
|
+
exact label; `get_chart` returns both. Pie, donut, funnel, treemap and parliament draw only
|
|
16
|
+
the first visible series, one slice (or group of seats) per category; histogram and box read
|
|
17
|
+
every value of the visible series. A slope chart joins the first series (before) to the
|
|
18
|
+
second (after) for each category; a Likert chart reads each category as a question and the
|
|
19
|
+
series as its answers, ordered from most negative to most positive.
|
|
20
|
+
|
|
21
|
+
Grouped data lives in `spec.tree` (items `{name, value}`, groups `{name, children}`, up to 6
|
|
22
|
+
levels). When a tree is set it *is* the data: the categories are its top-level group names
|
|
23
|
+
and the first series their totals, so a treemap nests the groups, a sunburst draws them as
|
|
24
|
+
rings, and any other type draws the totals. Nodes are addressed by `path`, the names from the
|
|
25
|
+
top down (`["Europe", "France"]`); `get_chart` returns them as `treeTable`.
|
|
17
26
|
|
|
18
27
|
Read `pixerate-agent-tools` first for tool naming, errors and `run_commands` batching.
|
|
19
28
|
Charts inside a rich-text document are not edited with these tools: use `insert_chart`,
|
|
@@ -34,10 +43,15 @@ Charts inside a rich-text document are not edited with these tools: use `insert_
|
|
|
34
43
|
4. **Style in one call.** Put type, titles, axes, legend, stacking and labels in a single
|
|
35
44
|
`update_chart`; it is all-or-nothing and one undo step. Use `apply_chart_preset` for a
|
|
36
45
|
coherent layout or colour scheme, `update_chart_series` for per-series settings.
|
|
37
|
-
5. **
|
|
46
|
+
5. **Point the reader at the message.** Once the data and style are right, annotate:
|
|
47
|
+
`add_chart_reference_line` for a target or average, `add_chart_reference_band` for a
|
|
48
|
+
normal or target range, `set_chart_callout` on the one or two points the title talks
|
|
49
|
+
about, `highlight_chart` to mute what does not matter, and `note` (in `update_chart`) for
|
|
50
|
+
the source.
|
|
51
|
+
6. **Check.** Read the `warnings` that `get_chart` and `render_chart` return (hidden or
|
|
38
52
|
thinned labels, crowded legend, skipped values) and run `check_chart_colors`. Fix every
|
|
39
53
|
problem.
|
|
40
|
-
|
|
54
|
+
7. **Look once.** `render_chart` with `format: "png"` after a batch of edits, at the size
|
|
41
55
|
the chart will be shown, to check overlap and legibility. Use `undo_chart` for your own
|
|
42
56
|
mistakes.
|
|
43
57
|
|
|
@@ -49,7 +63,15 @@ Charts inside a rich-text document are not edited with these tools: use `insert_
|
|
|
49
63
|
stacked bar or `stacking: "percent"` for shares across groups; pie or donut only for one
|
|
50
64
|
whole with few parts. Distribution: histogram (`bins`, default the square root of n) or
|
|
51
65
|
box. Relationship: scatter with `series.x`, bubble with `sizes` for a third measure.
|
|
52
|
-
Running totals and bridges: waterfall (`showTotal`). Staged drop-off: funnel.
|
|
66
|
+
Running totals and bridges: waterfall (`showTotal`). Staged drop-off: funnel. What rose
|
|
67
|
+
and what fell between two points in time: slope (two series, the names are the column
|
|
68
|
+
captions). Agree-to-disagree survey answers: likert (`likertSort: "positive"` ranks the
|
|
69
|
+
questions; `likertNeutral: "separate"` keeps the middle answer out of the comparison).
|
|
70
|
+
Parts of parts (regions → countries, budget → departments → teams): a treemap with grouped
|
|
71
|
+
data for comparing sizes, a sunburst for showing the levels (`sunburstLabel` captions the
|
|
72
|
+
total in the middle). Load the levels with `import_chart_tree_csv` or `set_chart_tree`.
|
|
73
|
+
Seats or votes per group with a majority: parliament (`parliamentMajority`,
|
|
74
|
+
`parliamentArc`, `parliamentLabel`).
|
|
53
75
|
- **Bars start at zero.** Bar length encodes the value, so never set a non-zero `min` on the
|
|
54
76
|
value axis of a bar, column or area chart. Line and scatter charts may zoom to the data
|
|
55
77
|
range when the change, not the magnitude, is the point.
|
|
@@ -81,6 +103,19 @@ Charts inside a rich-text document are not edited with these tools: use `insert_
|
|
|
81
103
|
(`showR2`) and read it with `get_chart_trendline` before describing the trend; label any
|
|
82
104
|
`forward` forecast as a projection. Exponential, power and log fits need positive values;
|
|
83
105
|
category charts fit against x = 1, 2, 3.
|
|
106
|
+
- **Annotate sparingly.** One or two reference lines, one band and a couple of callouts at
|
|
107
|
+
most; every label competes with the data. Label every reference line (`label`) so the
|
|
108
|
+
reader knows what it is, and keep callouts to a few words that say *why* the point
|
|
109
|
+
matters ("Launch", "Strike"), not its value (that is what data labels are for).
|
|
110
|
+
- **Highlight instead of recolouring.** To show one bar or series against the rest, use
|
|
111
|
+
`highlight_chart` (it mutes the rest and keeps the palette) rather than greying series by
|
|
112
|
+
hand. Name categories to pick bars or points, series to pick whole lines. Clear it with
|
|
113
|
+
`names: []`.
|
|
114
|
+
- **One series, many categories:** `varyColors: true` gives each bar its own palette colour
|
|
115
|
+
and a category legend. Use it only when colour carries meaning (brands, teams); a ranked
|
|
116
|
+
bar chart reads better in one colour.
|
|
117
|
+
- **Cite the source** in `note` ("Source: ONS, 2025"); it sits under the chart, apart from
|
|
118
|
+
the title.
|
|
84
119
|
- **Error bars:** say what they are (standard deviation, standard error, confidence) in the
|
|
85
120
|
title or subtitle.
|
|
86
121
|
|
|
@@ -109,7 +144,7 @@ it changed.
|
|
|
109
144
|
|
|
110
145
|
| Tool | Use it to |
|
|
111
146
|
| --- | --- |
|
|
112
|
-
| `update_chart` | Change presentation in one all-or-nothing call: `type`, `title`, `subtitle`, `xAxis` / `yAxis` / `yAxis2` (show, title, min, max, step, gridlines, format, kind `"date"`, scale `"log"`, logBase, reverse), `legend` (show, position top / bottom / left / right), `stacking` (none / stacked / percent), `orientation`, `curve`, `points`, `dataLabels`, `labelPosition`, `palette`, `innerRadius` (donut hole, 0-0.9), `gapWidth`, `overlap`, `bins`, `showTotal`, `radarTicks` (radar ring count 1-50, null for round numbers), `radarGraticule` (radar rings as `polygon` or `circle`). Invalid values change nothing and come back as sentences. Returns the spec. |
|
|
147
|
+
| `update_chart` | Change presentation in one all-or-nothing call: `type`, `title`, `subtitle`, `xAxis` / `yAxis` / `yAxis2` (show, title, min, max, step, gridlines, format, kind `"date"`, scale `"log"`, logBase, reverse), `legend` (show, position top / bottom / left / right), `stacking` (none / stacked / percent), `orientation`, `curve`, `points`, `dataLabels`, `labelPosition`, `palette`, `innerRadius` (donut hole, 0-0.9), `gapWidth`, `overlap`, `bins`, `showTotal`, `radarTicks` (radar ring count 1-50, null for round numbers), `radarGraticule` (radar rings as `polygon` or `circle`), `note` (footnote, "" for none), `highlight` (whole list of names), `referenceLines` / `referenceBands` (whole lists; prefer the add tools), `varyColors` (one colour per category on a one-series chart), `likertNeutral` (`split` / `separate`), `likertSort` (`none` / `positive` / `negative`), `parliamentArc` (90-360 degrees), `parliamentMajority` (seats, null for half plus one), `parliamentLabel` (caption under the total), `sunburstLabel` (caption under a sunburst's total). Invalid values change nothing and come back as sentences. Returns the spec. |
|
|
113
148
|
| `set_chart_data` | Replace `categories` and / or all `series` (each with `name`, `values` and optional settings). Values are padded with gaps to the categories. Use for whole tables and for re-sorting. Returns the table and series ids. |
|
|
114
149
|
| `set_chart_values` | Set individual `cells` (`series`, `category`, `value`) all-or-nothing. Values may be numbers, numeric text (`"1,200"`, `"12%"`, `"$40"`, `"(3)"`) or `null` for a gap. Returns the stored values. Acted out with a cursor when the host has a director. |
|
|
115
150
|
| `add_chart_series` | Add a series (`name` required; `values`, `color`, `type` for a combo, `axis: "secondary"`, `x` / `sizes` for scatter and bubble, marker, format, error bars, `id`, `at`). Selects it and returns its id. |
|
|
@@ -123,6 +158,19 @@ it changed.
|
|
|
123
158
|
| `load_file_chart` | Replace the editor's chart with one from an Office file (`file` or `data`, `chartId`). Returns the spec, read problems and the features the editor could not keep; tell the user about any. |
|
|
124
159
|
| `add_chart_trendline` | Fit a trendline to a series (`type`: linear, exponential, logarithmic, power, polynomial with `order` 2-6, moving-average with `period`; `forward` / `backward` in x units, `intercept`, `showEquation`, `showR2`). Unstacked bar, line, area, scatter and bubble charts only. Returns its index, coefficients, R2 and equation. |
|
|
125
160
|
| `remove_chart_trendline` | Delete a trendline by `series` and `index`. |
|
|
161
|
+
| `add_chart_reference_line` | Draw a dashed line across the plot at `value` (a target, floor or average) with an optional `label`, `color` and `axis` (`y` default, `y2` for the secondary axis, `x` for numeric x on scatter and bubble). Bar, line, area, scatter and bubble charts; the axis grows to keep it in view. Returns its `index`. |
|
|
162
|
+
| `update_chart_reference_line` | Change a reference line by `index` (from `add_chart_reference_line` or `spec.referenceLines`); `null` removes the label, colour or axis. Returns the line as stored. |
|
|
163
|
+
| `remove_chart_reference_line` | Delete a reference line by `index`; later ones move up. Returns the rest. |
|
|
164
|
+
| `add_chart_reference_band` | Shade a range from `from` to `to` (a target or normal range) under the data, with an optional `label`, `color` and `axis`. Same charts as reference lines. Returns its `index`. |
|
|
165
|
+
| `update_chart_reference_band` | Change a reference band by `index`; `null` removes the label, colour or axis. |
|
|
166
|
+
| `remove_chart_reference_band` | Delete a reference band by `index`. Returns the rest. |
|
|
167
|
+
| `set_chart_callout` | Pin a short `label` to one bar or point (`series`, `category`) with a leader line; `label: null` removes it. The point needs a value. Bar, line, area, scatter and bubble charts. Selects the point. |
|
|
168
|
+
| `highlight_chart` | Keep the named categories and series (`names`) bright and mute everything else; `[]` clears it. Unknown names change nothing and are listed. Returns the matched category indexes and series ids. |
|
|
169
|
+
| `set_chart_tree` | Replace the data with grouped data (`tree`: items `{name, value}`, groups `{name, children}`, up to 6 levels, sibling names unique) for grouped treemaps and sunbursts; `[]` goes back to plain data and keeps the totals. Returns the tree, group totals and depth. |
|
|
170
|
+
| `import_chart_tree_csv` | Replace the data with grouped data from CSV / TSV: names in every column but the last (group, ..., item), the value last; a blank group name repeats the one above. The quickest way to load a spreadsheet's hierarchy. |
|
|
171
|
+
| `add_chart_tree_node` | Add an item or a group (`node`) under the group at `parent` (a path; `[]` for the top level) at `at`. Returns its `path` and the parent's new total. |
|
|
172
|
+
| `update_chart_tree_node` | Rename a node, set an item's `value`, or set a node's `color` (null for the palette) by `path`. Groups have no value of their own. Returns the path (new after a rename). |
|
|
173
|
+
| `remove_chart_tree_node` | Delete a node and everything under it by `path`. Returns the group totals left. |
|
|
126
174
|
| `apply_chart_preset` | Apply a quick `layout` and / or a `colors` scheme from `list_chart_presets` in one step. |
|
|
127
175
|
| `transpose_chart` | Swap series and categories. Drops per-series colours and settings, so restyle afterwards. |
|
|
128
176
|
| `select_chart_element` | Select part of the chart (`kind`: none, chart, title, subtitle, legend, axis, series, point, category, trendline) for the user to see or before `press_chart_key`. |
|
|
@@ -166,6 +214,19 @@ several charts may register them with another prefix.
|
|
|
166
214
|
| `chart.removeCategory` | Delete a category by index or label. |
|
|
167
215
|
| `chart.addTrendline` | Fit a trendline (as `add_chart_trendline`). |
|
|
168
216
|
| `chart.removeTrendline` | Delete a trendline. |
|
|
217
|
+
| `chart.addReferenceLine` | Add a reference line (as `add_chart_reference_line`). |
|
|
218
|
+
| `chart.updateReferenceLine` | Change a reference line by index. |
|
|
219
|
+
| `chart.removeReferenceLine` | Delete a reference line by index. |
|
|
220
|
+
| `chart.addReferenceBand` | Add a reference band (as `add_chart_reference_band`). |
|
|
221
|
+
| `chart.updateReferenceBand` | Change a reference band by index. |
|
|
222
|
+
| `chart.removeReferenceBand` | Delete a reference band by index. |
|
|
223
|
+
| `chart.setCallout` | Pin or remove a point's callout (as `set_chart_callout`). |
|
|
224
|
+
| `chart.highlight` | Highlight categories and series (as `highlight_chart`). |
|
|
225
|
+
| `chart.setTree` | Replace the grouped data (as `set_chart_tree`). |
|
|
226
|
+
| `chart.importTreeCsv` | Replace the data with grouped data from CSV / TSV. |
|
|
227
|
+
| `chart.addTreeNode` | Add an item or group; returns its path. |
|
|
228
|
+
| `chart.updateTreeNode` | Rename, revalue or recolour a node by path. |
|
|
229
|
+
| `chart.removeTreeNode` | Delete a node by path. |
|
|
169
230
|
| `chart.applyPreset` | Apply a quick layout and / or colour scheme. |
|
|
170
231
|
| `chart.transpose` | Swap series and categories. |
|
|
171
232
|
| `chart.importCsv` | Replace data from CSV / TSV (no automatic chart type). |
|
|
@@ -190,6 +251,28 @@ several charts may register them with another prefix.
|
|
|
190
251
|
- Percent-stacked charts, pies and gaps cannot be dragged; use `set_chart_values`.
|
|
191
252
|
- Radar needs at least three categories (it draws as a line chart until then); trendlines
|
|
192
253
|
are refused on stacked charts, pies and the other single-series families.
|
|
254
|
+
- Likert answers must be entered in order, most negative first: the chart puts the first
|
|
255
|
+
half left of the centre line and colours them orange, the last half right in purple.
|
|
256
|
+
Values are counts or shares; each question is scaled to its own total.
|
|
257
|
+
- A slope chart needs exactly two visible series; with one it draws a line chart (a
|
|
258
|
+
`type-fallback` warning), and a third is not drawn. Hide the extra series or move them.
|
|
259
|
+
- Parliament seats are rounded to whole numbers; more than 2,000 seats are not drawn.
|
|
260
|
+
- While a chart has grouped data, cell edits (`set_chart_values`, adding, renaming or deleting
|
|
261
|
+
categories, `transpose_chart`) are refused, because the totals come from the tree. Edit the
|
|
262
|
+
nodes, or replace the data (`set_chart_data`, `import_chart_csv`), which clears the tree.
|
|
263
|
+
- Highlight, selection and colours work per top-level group: every item in a group selects
|
|
264
|
+
and highlights that group. Give a node its own `color` with `update_chart_tree_node`.
|
|
265
|
+
- Office export writes a grouped treemap or sunburst as a pie or doughnut of the group totals
|
|
266
|
+
(DrawingML has no hierarchy); Office chartex imports keep the levels.
|
|
267
|
+
- Reference lines, bands and callouts are drawn on bar, line, area, scatter and bubble
|
|
268
|
+
charts only. Switching to another type keeps them in the spec but leaves them out of the
|
|
269
|
+
drawing (an `annotations-skipped` warning says so); they come back when you switch back.
|
|
270
|
+
- Reference values on a log axis must be above 0, and `axis: "y2"` needs a visible series on
|
|
271
|
+
the secondary axis. A line outside a fixed `min` / `max` is not drawn.
|
|
272
|
+
- Callouts and highlight names follow the data: removing a category drops its callouts and
|
|
273
|
+
its highlight entry, renaming a category or series keeps it highlighted.
|
|
274
|
+
- Office export has no reference lines, bands, callouts, highlight or note; `export_chart_ooxml`
|
|
275
|
+
lists them as not written. `varyColors` is kept.
|
|
193
276
|
- Radar `radarTicks` and `radarGraticule` are Mermaid's `ticks` and `graticule`. A
|
|
194
277
|
`radar-beta` block with no `graticule` line imports as `circle`, because that is what
|
|
195
278
|
Mermaid draws; set `radarGraticule: "polygon"` if the user wants the editor's default look.
|
|
@@ -420,8 +420,6 @@ for the controls and presets.
|
|
|
420
420
|
| `export_psd` | Export a PSD with every layer, the paper as a locked bottom layer, and the composite. Pigment and painterly modes are written as their nearest standard mode (`list_blend_modes` `psd`). Returns base64, size, `psb` and `warnings`. |
|
|
421
421
|
| `export_time_lapse` | Repaint the painting from its recorded strokes and events as a time-lapse: `frames` (about how many), `fps`, `maxSide`, `wetStepsPerFrame` (frames while wet paint flows), `holdMs`. Returns a contact sheet image, the frame count, size, duration, a video project of the frames and the ffmpeg command that renders `timelapse.mp4`; `includeFrames` adds every frame as base64 PNG. Changes nothing. |
|
|
422
422
|
| `export_high_res` | Repaint the painting from its strokes at `scale` 1..8 (brushes, grain, fills and wet events scaled): a PNG with real detail instead of upscaled pixels. Returns base64, size. Layers not painted with strokes come out empty. |
|
|
423
|
-
| `save_document` | Deprecated, kept for one minor version: use `get_paint_document` or `save_paint_document`. Returns the document JSON with PNG data URLs inline (large). |
|
|
424
|
-
| `open_document` | Deprecated, kept for one minor version: use `load_paint_document` or `open_saved_paint_document`. Opens a document JSON from `save_document`, clearing the undo history. |
|
|
425
423
|
|
|
426
424
|
### Save and open
|
|
427
425
|
|