@pixerate/editor 0.222.3 → 0.223.1

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.
Files changed (36) hide show
  1. package/dist/agent/index.cjs +13 -3
  2. package/dist/agent/index.js +12 -2
  3. package/dist/bridge/cli.cjs +3 -3
  4. package/dist/bridge/cli.js +2 -2
  5. package/dist/bridge/index.cjs +3 -3
  6. package/dist/bridge/index.js +2 -2
  7. package/dist/{chunk-I5MRJW7B.js → chunk-67JAEU53.js} +1 -1
  8. package/dist/{chunk-U4QN36YT.cjs → chunk-BDT2IYXK.cjs} +128 -16
  9. package/dist/{chunk-S4EIAIEW.cjs → chunk-OJTZKDLJ.cjs} +7 -7
  10. package/dist/{chunk-XZB3TJ6K.js → chunk-SAN4SBBS.js} +25 -7
  11. package/dist/{chunk-GI3AVES4.js → chunk-SVHXD2VH.js} +117 -5
  12. package/dist/{chunk-AMX23CSN.cjs → chunk-Z7BVK32C.cjs} +25 -7
  13. package/dist/image-editor/index.cjs +12 -11
  14. package/dist/image-editor/index.js +12 -11
  15. package/dist/image-editor/layers/panel.d.cts +6 -2
  16. package/dist/image-editor/layers/panel.d.ts +6 -2
  17. package/dist/tools/index.cjs +13 -3
  18. package/dist/tools/index.d.cts +1 -0
  19. package/dist/tools/index.d.ts +1 -0
  20. package/dist/tools/index.js +12 -2
  21. package/dist/tools/skill-evals.d.cts +107 -0
  22. package/dist/tools/skill-evals.d.ts +107 -0
  23. package/dist/tools/skills.d.cts +12 -1
  24. package/dist/tools/skills.d.ts +12 -1
  25. package/package.json +1 -1
  26. package/skills/README.md +7 -2
  27. package/skills/pixerate-agent-tools/SKILL.md +5 -3
  28. package/skills/pixerate-chart/SKILL.md +8 -0
  29. package/skills/pixerate-chart-annotate/SKILL.md +96 -0
  30. package/skills/pixerate-chart-annotate/evals/highlight-the-point.json +78 -0
  31. package/skills/pixerate-chart-annotate/evals/source-and-units.json +76 -0
  32. package/skills/pixerate-chart-annotate/evals/target-line.json +85 -0
  33. package/skills/pixerate-chart-choose-and-build/SKILL.md +100 -0
  34. package/skills/pixerate-chart-choose-and-build/evals/colour-blind-safe.json +113 -0
  35. package/skills/pixerate-chart-choose-and-build/evals/honest-baseline.json +81 -0
  36. package/skills/pixerate-chart-choose-and-build/evals/trend-over-time.json +175 -0
@@ -0,0 +1,100 @@
1
+ ---
2
+ name: pixerate-chart-choose-and-build
3
+ description: The chart building workflow in the Pixerate chart editor - starting from the question the chart answers, choosing the chart type for it (change over time, comparison, part of a whole, distribution, relationship, flow, geography), loading clean data in order, honest axes (bars from zero, log only for orders of magnitude), units and number formats, colours that colour-blind readers can tell apart, and checking before handing it over. Use when asked to make, build, create, choose, recommend or fix a chart or graph, visualise or plot data, pick the right chart, or make a chart clearer, more honest or accessible, or when recommend_chart, set_chart_data, update_chart or check_chart_colors are available. Load with pixerate-chart, which lists every tool.
4
+ metadata:
5
+ kind: workflow
6
+ reference: pixerate-chart
7
+ ---
8
+
9
+ # Choosing and building a chart
10
+
11
+ A chart answers one question. Name the question first ("how did revenue change over the
12
+ year?", "which region sells most?"), and the type, the order of the data, the axes and the
13
+ title follow from it. Build in few calls: data in one, style in one, then check the warnings,
14
+ the colours and the numbers before anyone sees it.
15
+
16
+ This skill is the method. `pixerate-chart` has the full tool reference; for titles, highlights,
17
+ reference lines and notes that make the point, see `pixerate-chart-annotate`.
18
+
19
+ ## Goal and quality bar
20
+
21
+ - The type fits the question (see the decision table).
22
+ - The data is in a meaningful order: time in calendar order, categories sorted by value unless
23
+ they have a natural order.
24
+ - Axes are honest: bars and areas start at zero; a log scale only when values span orders of
25
+ magnitude, and labelled as such; a second axis only for a second unit.
26
+ - Units are stated (axis title or number `format`); the title says what the chart shows.
27
+ - Colours pass `check_chart_colors` (`ok: true`) and there are at most about seven series
28
+ colours.
29
+ - `get_chart` `summary.warnings` and `issues` are empty.
30
+
31
+ ## Inputs to confirm
32
+
33
+ - **The question** the chart must answer, and for whom (a report, a slide, a dashboard).
34
+ - **The data**: where it is (pasted, CSV, a spreadsheet, an Office file) and its units.
35
+ - **House style** if the host has one (`check_chart_style`).
36
+
37
+ ## Working method
38
+
39
+ 1. **Read.** `get_chart` (the spec, the data table, warnings); `list_file_charts` when the
40
+ data is in an open Office file.
41
+ 2. **Name the question and choose the type.** `recommend_chart` suggests types for the data;
42
+ check its suggestion against the question (see the table).
43
+ **Check:** you can say the question in one sentence and why this type answers it.
44
+ 3. **Load clean data in one call.** `set_chart_data` with categories in the right order and one
45
+ series per measure (or `import_chart_csv`); numbers as numbers, gaps as `null`.
46
+ **Check:** `get_chart` `spec.categories` and each series' `values` line up as intended.
47
+ 4. **Style in one call.** `update_chart` with `type`, `title`, axis `title` and `format`,
48
+ `legend`, `stacking`, `orientation`, `dataLabels`. Bars from zero (`yAxis.min` null or 0).
49
+ **Check:** `get_chart` spec; `summary.description` reads as the chart you meant.
50
+ 5. **Colours.** `check_chart_colors`; fix failing pairs with `update_chart_series` `color` (a
51
+ palette such as `#4269d0` / `#efb118` separates for most colour vision), or
52
+ `apply_chart_preset` for a tested palette.
53
+ **Check:** `check_chart_colors` `ok: true`.
54
+ 6. **Look.** `render_chart` once after the batch; fix anything that does not read.
55
+
56
+ ## Decision table
57
+
58
+ | Question | Type |
59
+ | --- | --- |
60
+ | How did it change over time? | `line` (one or a few series), `area` for totals, columns for few periods |
61
+ | Which is biggest? Compare categories | `bar`, horizontal for long labels, sorted by value |
62
+ | Part of a whole (few parts) | `pie` or `donut` (at most five slices), or a stacked bar |
63
+ | Part of a whole, nested | `treemap`, `sunburst` (`set_chart_tree`) |
64
+ | How are values distributed? | `histogram`, `box` |
65
+ | Do two measures relate? | `scatter`, `bubble` for a third measure |
66
+ | Before and after per category | `slope` |
67
+ | Contributions to a total | `waterfall` |
68
+ | Flows between stages | `sankey` (`set_chart_links`), `funnel` for one path |
69
+ | Survey answers | `likert` |
70
+ | By region on a map | `choropleth` |
71
+
72
+ ## Recipes
73
+
74
+ **Trend over time.** `set_chart_data` with categories in calendar order → `update_chart`
75
+ `{ type: "line", title, yAxis: { title: "Revenue (USD thousands)" } }` → `get_chart`.
76
+
77
+ **Colour-blind fix.** `check_chart_colors` → `update_chart_series` `color` on the clashing series
78
+ → `check_chart_colors` again.
79
+
80
+ **Honest bars.** `update_chart` `{ yAxis: { min: 0 } }`; when small differences matter, show the
81
+ differences themselves (a bar of the change) or a dot plot rather than a cut axis.
82
+
83
+ ## Pitfalls
84
+
85
+ - **Truncated bar axes** exaggerate differences; bars start at zero.
86
+ - **Pie charts with many or similar slices** cannot be read; use a sorted bar.
87
+ - **Red and green** as the only distinction fail for the most common colour-vision deficiency.
88
+ - **Unsorted categories** without a natural order hide the ranking.
89
+ - **Mixed units on one axis**, or a second axis for the same unit, mislead.
90
+ - **Missing units** leave the reader guessing; put them in the axis title or format.
91
+
92
+ ## Tools used
93
+
94
+ - `get_chart`, `render_chart`: the spec, data table, warnings, and a picture
95
+ - `recommend_chart`: types that suit the data
96
+ - `set_chart_data`, `import_chart_csv`, `transpose_chart`: load the data in order
97
+ - `update_chart`, `update_chart_series`, `apply_chart_preset`: type, titles, axes, formats and colours
98
+ - `check_chart_colors`, `check_chart_style`: colour-blind and house-style checks
99
+ - `list_file_charts`, `load_file_chart`: data from open Office files
100
+ - `undo_chart`: take back a step
@@ -0,0 +1,113 @@
1
+ {
2
+ "prompt": "Some of our readers are colour-blind and can't tell the two years apart in this chart. Fix the colours without changing the data.",
3
+ "fixture": {
4
+ "editor": "chart",
5
+ "setup": [
6
+ {
7
+ "tool": "set_chart_data",
8
+ "args": {
9
+ "categories": [
10
+ "North",
11
+ "South",
12
+ "East",
13
+ "West"
14
+ ],
15
+ "series": [
16
+ {
17
+ "name": "2025",
18
+ "values": [
19
+ 12,
20
+ 15,
21
+ 9,
22
+ 11
23
+ ],
24
+ "color": "#d62728"
25
+ },
26
+ {
27
+ "name": "2026",
28
+ "values": [
29
+ 14,
30
+ 13,
31
+ 12,
32
+ 15
33
+ ],
34
+ "color": "#2ca02c"
35
+ }
36
+ ]
37
+ }
38
+ },
39
+ {
40
+ "tool": "update_chart",
41
+ "args": {
42
+ "type": "bar",
43
+ "title": "Sales by region"
44
+ }
45
+ }
46
+ ]
47
+ },
48
+ "checks": [
49
+ {
50
+ "why": "the colours pass the colour-blind check",
51
+ "tool": "check_chart_colors",
52
+ "expect": {
53
+ "ok": true
54
+ }
55
+ },
56
+ {
57
+ "why": "the data is unchanged",
58
+ "tool": "get_chart",
59
+ "expect": {
60
+ "spec": {
61
+ "categories": [
62
+ "North",
63
+ "South",
64
+ "East",
65
+ "West"
66
+ ],
67
+ "series": [
68
+ {
69
+ "name": "2025",
70
+ "values": [
71
+ 12,
72
+ 15,
73
+ 9,
74
+ 11
75
+ ]
76
+ },
77
+ {
78
+ "name": "2026",
79
+ "values": [
80
+ 14,
81
+ 13,
82
+ 12,
83
+ 15
84
+ ]
85
+ }
86
+ ]
87
+ }
88
+ }
89
+ }
90
+ ],
91
+ "solution": [
92
+ {
93
+ "tool": "check_chart_colors"
94
+ },
95
+ {
96
+ "tool": "update_chart_series",
97
+ "args": {
98
+ "series": "2025",
99
+ "color": "#4269d0"
100
+ }
101
+ },
102
+ {
103
+ "tool": "update_chart_series",
104
+ "args": {
105
+ "series": "2026",
106
+ "color": "#efb118"
107
+ }
108
+ },
109
+ {
110
+ "tool": "check_chart_colors"
111
+ }
112
+ ]
113
+ }
@@ -0,0 +1,81 @@
1
+ {
2
+ "prompt": "This bar chart makes the differences between teams look huge, but they're small. Make it honest.",
3
+ "fixture": {
4
+ "editor": "chart",
5
+ "setup": [
6
+ {
7
+ "tool": "set_chart_data",
8
+ "args": {
9
+ "categories": [
10
+ "Team A",
11
+ "Team B",
12
+ "Team C",
13
+ "Team D"
14
+ ],
15
+ "series": [
16
+ {
17
+ "name": "Satisfaction (%)",
18
+ "values": [
19
+ 92,
20
+ 95,
21
+ 94,
22
+ 97
23
+ ]
24
+ }
25
+ ]
26
+ }
27
+ },
28
+ {
29
+ "tool": "update_chart",
30
+ "args": {
31
+ "type": "bar",
32
+ "title": "Satisfaction by team",
33
+ "yAxis": {
34
+ "min": 90,
35
+ "max": 98
36
+ }
37
+ }
38
+ }
39
+ ]
40
+ },
41
+ "checks": [
42
+ {
43
+ "why": "bars start at zero (or the chart is no longer bars)",
44
+ "tool": "get_chart",
45
+ "expect": {
46
+ "spec": {
47
+ "$expr": "v.type !== 'bar' || v.yAxis.min === null || v.yAxis.min === 0"
48
+ }
49
+ }
50
+ },
51
+ {
52
+ "why": "the data is unchanged",
53
+ "tool": "get_chart",
54
+ "expect": {
55
+ "spec": {
56
+ "series": [
57
+ {
58
+ "values": [
59
+ 92,
60
+ 95,
61
+ 94,
62
+ 97
63
+ ]
64
+ }
65
+ ]
66
+ }
67
+ }
68
+ }
69
+ ],
70
+ "solution": [
71
+ {
72
+ "tool": "update_chart",
73
+ "args": {
74
+ "yAxis": {
75
+ "min": 0,
76
+ "max": 100
77
+ }
78
+ }
79
+ }
80
+ ]
81
+ }
@@ -0,0 +1,175 @@
1
+ {
2
+ "prompt": "This is our 2026 monthly revenue in thousands of US dollars, pasted in a muddle. Make a chart that shows how revenue changed over the year.",
3
+ "fixture": {
4
+ "editor": "chart",
5
+ "setup": [
6
+ {
7
+ "tool": "set_chart_data",
8
+ "args": {
9
+ "categories": [
10
+ "Mar",
11
+ "Jan",
12
+ "Feb",
13
+ "Jun",
14
+ "Apr",
15
+ "May",
16
+ "Sep",
17
+ "Jul",
18
+ "Aug",
19
+ "Dec",
20
+ "Oct",
21
+ "Nov"
22
+ ],
23
+ "series": [
24
+ {
25
+ "name": "Revenue",
26
+ "values": [
27
+ 51,
28
+ 42,
29
+ 45,
30
+ 61,
31
+ 48,
32
+ 55,
33
+ 70,
34
+ 58,
35
+ 64,
36
+ 82,
37
+ 68,
38
+ 75
39
+ ]
40
+ }
41
+ ]
42
+ }
43
+ },
44
+ {
45
+ "tool": "update_chart",
46
+ "args": {
47
+ "type": "pie"
48
+ }
49
+ }
50
+ ]
51
+ },
52
+ "checks": [
53
+ {
54
+ "why": "a line or area chart for change over time",
55
+ "tool": "get_chart",
56
+ "expect": {
57
+ "spec": {
58
+ "type": {
59
+ "$in": [
60
+ "line",
61
+ "area"
62
+ ]
63
+ }
64
+ }
65
+ }
66
+ },
67
+ {
68
+ "why": "months in calendar order, with their own values",
69
+ "tool": "get_chart",
70
+ "expect": {
71
+ "spec": {
72
+ "categories": [
73
+ "Jan",
74
+ "Feb",
75
+ "Mar",
76
+ "Apr",
77
+ "May",
78
+ "Jun",
79
+ "Jul",
80
+ "Aug",
81
+ "Sep",
82
+ "Oct",
83
+ "Nov",
84
+ "Dec"
85
+ ],
86
+ "series": [
87
+ {
88
+ "values": [
89
+ 42,
90
+ 45,
91
+ 51,
92
+ 48,
93
+ 55,
94
+ 61,
95
+ 58,
96
+ 64,
97
+ 70,
98
+ 68,
99
+ 75,
100
+ 82
101
+ ]
102
+ }
103
+ ]
104
+ }
105
+ }
106
+ },
107
+ {
108
+ "why": "a title and a value axis that says the unit",
109
+ "tool": "get_chart",
110
+ "expect": {
111
+ "spec": {
112
+ "title": {
113
+ "$match": "\\S"
114
+ },
115
+ "yAxis": {
116
+ "$expr": "/usd|\\$|dollar/i.test(v.title) || v.format.style === 'currency' || /\\$/.test(v.format.prefix || '')"
117
+ }
118
+ }
119
+ }
120
+ }
121
+ ],
122
+ "solution": [
123
+ {
124
+ "tool": "get_chart"
125
+ },
126
+ {
127
+ "tool": "set_chart_data",
128
+ "args": {
129
+ "categories": [
130
+ "Jan",
131
+ "Feb",
132
+ "Mar",
133
+ "Apr",
134
+ "May",
135
+ "Jun",
136
+ "Jul",
137
+ "Aug",
138
+ "Sep",
139
+ "Oct",
140
+ "Nov",
141
+ "Dec"
142
+ ],
143
+ "series": [
144
+ {
145
+ "name": "Revenue",
146
+ "values": [
147
+ 42,
148
+ 45,
149
+ 51,
150
+ 48,
151
+ 55,
152
+ 61,
153
+ 58,
154
+ 64,
155
+ 70,
156
+ 68,
157
+ 75,
158
+ 82
159
+ ]
160
+ }
161
+ ]
162
+ }
163
+ },
164
+ {
165
+ "tool": "update_chart",
166
+ "args": {
167
+ "type": "line",
168
+ "title": "Revenue grew through 2026",
169
+ "yAxis": {
170
+ "title": "Revenue (USD thousands)"
171
+ }
172
+ }
173
+ }
174
+ ]
175
+ }