@sheetpane/charts 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +127 -2
- package/dist/anchors.d.ts +42 -0
- package/dist/anchors.d.ts.map +1 -0
- package/dist/anchors.js +73 -0
- package/dist/anchors.js.map +1 -0
- package/dist/colors.d.ts +48 -0
- package/dist/colors.d.ts.map +1 -0
- package/dist/colors.js +115 -0
- package/dist/colors.js.map +1 -0
- package/dist/index.d.ts +142 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +400 -0
- package/dist/index.js.map +1 -0
- package/dist/model.d.ts +85 -0
- package/dist/model.d.ts.map +1 -0
- package/dist/model.js +228 -0
- package/dist/model.js.map +1 -0
- package/dist/refs.d.ts +65 -0
- package/dist/refs.d.ts.map +1 -0
- package/dist/refs.js +144 -0
- package/dist/refs.js.map +1 -0
- package/dist/svg.d.ts +124 -0
- package/dist/svg.d.ts.map +1 -0
- package/dist/svg.js +398 -0
- package/dist/svg.js.map +1 -0
- package/dist/ui.d.ts +69 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +143 -0
- package/dist/ui.js.map +1 -0
- package/package.json +51 -3
package/dist/index.js
ADDED
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
// @sheetpane/charts — the charts in a workbook, drawn in sheet space through the `overlay` hook
|
|
2
|
+
// (W-21). Stage 1: a frame at the chart's anchor with its title, type and series count, a
|
|
3
|
+
// **Show source cells** button, and a "data changed — Excel will redraw" tag once a plotted cell
|
|
4
|
+
// was edited. Stage 2: bar, column, line, pie, doughnut and scatter drawn as our own SVG.
|
|
5
|
+
// View only: patch-mode export copies the chart parts byte for byte, so Excel redraws them from
|
|
6
|
+
// the (possibly changed) cells. Importing is safe in Node: no DOM until an item renders.
|
|
7
|
+
import { registerPlugin } from '@sheetpane/grid';
|
|
8
|
+
import { anchorRect, cellAt } from '@sheetpane/images';
|
|
9
|
+
import { defaultColor, resolveColor } from './colors.js';
|
|
10
|
+
import { parseChart } from './model.js';
|
|
11
|
+
import { cellRef, cellsOf, contains, parseCell, qualified, selectionFor } from './refs.js';
|
|
12
|
+
import { drawChart, frameSvg } from './svg.js';
|
|
13
|
+
export { parseChart } from './model.js';
|
|
14
|
+
export { parseFormulaRefs, selectionFor, qualified, cellsOf } from './refs.js';
|
|
15
|
+
export { resolveColor, defaultColor, accents, modify, OFFICE_ACCENTS } from './colors.js';
|
|
16
|
+
export { drawChart, frameSvg, niceScale, stackedValues, formatNumber, withZero, HEAD, CHANGED_TAG } from './svg.js';
|
|
17
|
+
/** The plugin's id, and the name `plugins="…"` takes. */
|
|
18
|
+
export const PLUGIN_ID = 'charts';
|
|
19
|
+
// ── models: each chart part parsed once per workbook, on first ask ─────────────
|
|
20
|
+
const pending = new WeakMap();
|
|
21
|
+
const parsed = new WeakMap();
|
|
22
|
+
/**
|
|
23
|
+
* The parsed chart part, read through `book.part()` on first ask and cached per workbook.
|
|
24
|
+
*
|
|
25
|
+
* @param book - The workbook.
|
|
26
|
+
* @param path - The chart part's path, e.g. `xl/charts/chart1.xml`.
|
|
27
|
+
* @returns The model; `undefined` when the part is missing or unreadable.
|
|
28
|
+
*/
|
|
29
|
+
export function chartModel(book, path) {
|
|
30
|
+
let byPath = pending.get(book);
|
|
31
|
+
if (!byPath) {
|
|
32
|
+
byPath = new Map();
|
|
33
|
+
pending.set(book, byPath);
|
|
34
|
+
}
|
|
35
|
+
let p = byPath.get(path);
|
|
36
|
+
if (!p) {
|
|
37
|
+
p = (async () => {
|
|
38
|
+
let model;
|
|
39
|
+
try {
|
|
40
|
+
const bytes = await book.part(path);
|
|
41
|
+
if (bytes)
|
|
42
|
+
model = parseChart(new TextDecoder().decode(bytes));
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
model = undefined;
|
|
46
|
+
}
|
|
47
|
+
let done = parsed.get(book);
|
|
48
|
+
if (!done) {
|
|
49
|
+
done = new Map();
|
|
50
|
+
parsed.set(book, done);
|
|
51
|
+
}
|
|
52
|
+
done.set(path, model ?? null);
|
|
53
|
+
return model;
|
|
54
|
+
})();
|
|
55
|
+
byPath.set(path, p);
|
|
56
|
+
}
|
|
57
|
+
return p;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The chart model if it is parsed already, without reading anything.
|
|
61
|
+
*
|
|
62
|
+
* @param book - The workbook.
|
|
63
|
+
* @param path - The chart part's path.
|
|
64
|
+
* @returns The model, `null` (unreadable) or `undefined` (not read yet).
|
|
65
|
+
*/
|
|
66
|
+
export function chartModelNow(book, path) {
|
|
67
|
+
return parsed.get(book)?.get(path);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The chart drawings of a sheet, with their index among the sheet's drawings.
|
|
71
|
+
*
|
|
72
|
+
* @param book - The workbook, or `undefined`.
|
|
73
|
+
* @param sheet - The sheet's name.
|
|
74
|
+
* @returns One `{ drawing, index, path }` per chart; empty for none.
|
|
75
|
+
*/
|
|
76
|
+
export function chartsOn(book, sheet) {
|
|
77
|
+
const s = book?.sheets.find((x) => x.name === sheet);
|
|
78
|
+
if (!s)
|
|
79
|
+
return [];
|
|
80
|
+
return s.drawings.flatMap((d, index) => (d.kind === 'chart' && d.chart ? [{ drawing: d, index, path: d.chart }] : []));
|
|
81
|
+
}
|
|
82
|
+
// ── data: cached points, or the live cells when a `derive` plugin is installed ──
|
|
83
|
+
const asNumber = (v) => (typeof v === 'number' && Number.isFinite(v) ? v : null);
|
|
84
|
+
/** True when the pane computes formulas (a `derive` plugin), so the cells are live. */
|
|
85
|
+
export const isLive = (store) => store.plugins.some((p) => p.provides.includes('derive'));
|
|
86
|
+
function readable(book, ranges) {
|
|
87
|
+
return ranges.length > 0 && ranges.every((r) => book.sheets.some((s) => s.name === r.sheet));
|
|
88
|
+
}
|
|
89
|
+
function liveNumbers(store, ranges) {
|
|
90
|
+
return cellsOf(ranges).map((c) => asNumber(store.value(c.sheet, c.ref)));
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* What stage 2 draws: the chart's one group, its series coloured and valued — the cached points, or the live cells
|
|
94
|
+
* when `live` and the ranges are readable.
|
|
95
|
+
*
|
|
96
|
+
* @param m - The chart model.
|
|
97
|
+
* @param book - The workbook (its theme and sheets).
|
|
98
|
+
* @param store - The store, for live values; `undefined` uses the cache.
|
|
99
|
+
* @param live - Whether the pane computes formulas (a `derive` plugin), so the cells are current.
|
|
100
|
+
* @returns The plot data, or `undefined` when the chart is not drawable.
|
|
101
|
+
*/
|
|
102
|
+
export function plotData(m, book, store, live) {
|
|
103
|
+
const g = m.groups[0];
|
|
104
|
+
if (!m.drawable || !g)
|
|
105
|
+
return undefined;
|
|
106
|
+
const theme = book.themeColors;
|
|
107
|
+
const useLive = (ranges) => !!store && live && !!ranges && readable(book, ranges);
|
|
108
|
+
const catsOf = (s) => {
|
|
109
|
+
if (!s?.cat)
|
|
110
|
+
return [];
|
|
111
|
+
if (useLive(s.cat.ranges))
|
|
112
|
+
return cellsOf(s.cat.ranges).map((c) => store.text(c.sheet, c.ref));
|
|
113
|
+
return s.cat.points.map((p) => (p === null ? '' : String(p)));
|
|
114
|
+
};
|
|
115
|
+
const series = g.series.map((s, i) => {
|
|
116
|
+
const values = s.val ? (useLive(s.val.ranges) ? liveNumbers(store, s.val.ranges) : s.val.points.map(asNumber)) : [];
|
|
117
|
+
const name = s.tx && useLive(s.tx.ranges) ? cellsOf(s.tx.ranges).map((c) => store.text(c.sheet, c.ref)).join(' ') || s.name : s.name;
|
|
118
|
+
const fallback = defaultColor(Number.isFinite(s.idx) ? s.idx : i, theme);
|
|
119
|
+
const color = resolveColor(s.fill, theme) ?? (m.drawable === 'line' ? resolveColor(s.line, theme) : undefined) ?? fallback;
|
|
120
|
+
const lineColor = resolveColor(s.line, theme) ?? color;
|
|
121
|
+
const pointColors = values.map((_, j) => resolveColor(s.pointFills.get(j), theme) ?? (g.varyColors ? defaultColor(j, theme) : color));
|
|
122
|
+
const ps = { name, color, lineColor, noLine: s.noLine, values, pointColors };
|
|
123
|
+
if (m.drawable === 'scatter' && s.cat) {
|
|
124
|
+
const xs = useLive(s.cat.ranges) ? liveNumbers(store, s.cat.ranges) : s.cat.numeric ? s.cat.points.map(asNumber) : undefined;
|
|
125
|
+
// text x values: Excel plots such a series against 1, 2, 3 …
|
|
126
|
+
if (xs && xs.some((x) => x !== null))
|
|
127
|
+
ps.xs = xs;
|
|
128
|
+
}
|
|
129
|
+
return ps;
|
|
130
|
+
});
|
|
131
|
+
return {
|
|
132
|
+
kind: m.drawable, grouping: g.grouping, cats: catsOf(g.series.find((s) => s.cat) ?? g.series[0]), series,
|
|
133
|
+
gapWidth: g.gapWidth, holeSize: g.holeSize, firstSliceAng: g.firstSliceAng, scatterStyle: g.scatterStyle,
|
|
134
|
+
percent: !!m.valueFormat?.includes('%'), legend: m.legend,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Whether a user changed a value inside one of the ranges (snapshot `changes`, kinds `value` and `formula`).
|
|
139
|
+
*
|
|
140
|
+
* @param snap - A snapshot of the store.
|
|
141
|
+
* @param ranges - The ranges a chart reads.
|
|
142
|
+
* @returns `true` when at least one such change lies in them.
|
|
143
|
+
*/
|
|
144
|
+
export function changedInside(snap, ranges) {
|
|
145
|
+
if (!ranges.length)
|
|
146
|
+
return false;
|
|
147
|
+
for (const [k, c] of snap.changes) {
|
|
148
|
+
if (c.kind !== 'value' && c.kind !== 'formula')
|
|
149
|
+
continue;
|
|
150
|
+
const i = k.lastIndexOf('!'), p = parseCell(k.slice(i + 1));
|
|
151
|
+
if (p && ranges.some((r) => contains(r, k.slice(0, i), p.row, p.col)))
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* The chart's plotted ranges that exist in this workbook, as one selection (see {@link selectionFor}).
|
|
158
|
+
*
|
|
159
|
+
* @param m - The chart model.
|
|
160
|
+
* @param book - The workbook.
|
|
161
|
+
* @returns A selection for `store.select()`, or `undefined` when the data is literal or names no sheet here.
|
|
162
|
+
*/
|
|
163
|
+
export function sourceSelection(m, book) {
|
|
164
|
+
return selectionFor(m.plotted.filter((r) => book.sheets.some((s) => s.name === r.sheet)));
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Shows a chart's source: selects the union of its plotted ranges (or the first one — see {@link selectionFor}).
|
|
168
|
+
*
|
|
169
|
+
* @param store - The workbook store.
|
|
170
|
+
* @param m - The chart model.
|
|
171
|
+
* @returns `true` when something was selected; `false` when there was nothing to select.
|
|
172
|
+
*/
|
|
173
|
+
export function showSource(store, m) {
|
|
174
|
+
const book = store.book;
|
|
175
|
+
const sel = book && sourceSelection(m, book);
|
|
176
|
+
if (!sel)
|
|
177
|
+
return false;
|
|
178
|
+
store.select(sel);
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
181
|
+
/** `bar · 2 series`. */
|
|
182
|
+
export const metaOf = (m) => `${m.typeLabel} · ${m.series.length} series`;
|
|
183
|
+
/** Stage-1 lines: why it is not drawn, then each series and the cells it reads. */
|
|
184
|
+
function frameLines(m) {
|
|
185
|
+
const lines = m.notDrawn ? [`Not drawn here: ${m.notDrawn}.`] : [];
|
|
186
|
+
for (const s of m.series) {
|
|
187
|
+
const refs = [...(s.cat?.ranges ?? []), ...(s.val?.ranges ?? [])].map(qualified).join(', ');
|
|
188
|
+
lines.push(`${s.name}${refs ? ` — ${refs}` : ' — values stored in the chart'}`);
|
|
189
|
+
}
|
|
190
|
+
return lines;
|
|
191
|
+
}
|
|
192
|
+
// ── the overlay item ────────────────────────────────────────────────────────────
|
|
193
|
+
/** Each workbook gets a number, so item ids never repeat across two loads (the grid caches rendered items by id). */
|
|
194
|
+
const generations = new WeakMap();
|
|
195
|
+
let nextGeneration = 1;
|
|
196
|
+
const generationOf = (book) => {
|
|
197
|
+
let g = generations.get(book);
|
|
198
|
+
if (!g) {
|
|
199
|
+
g = nextGeneration++;
|
|
200
|
+
generations.set(book, g);
|
|
201
|
+
}
|
|
202
|
+
return g;
|
|
203
|
+
};
|
|
204
|
+
const FRAME = 'position:relative;box-sizing:border-box;width:100%;height:100%;overflow:hidden;background:var(--sp-surface,#FFFFFF);border:1px solid var(--sp-line-strong,#CBCBC5);border-radius:2px;color:var(--sp-ink,#16171A)';
|
|
205
|
+
const BUTTON = 'height:22px;padding:0 8px;font-size:11px;font-weight:500;line-height:1;white-space:nowrap;border:1px solid var(--sp-line-strong,#CBCBC5);border-radius:var(--sp-r-sm,4px);background:var(--sp-surface,#FFFFFF);color:var(--sp-ink-2,#45484F);cursor:pointer';
|
|
206
|
+
function renderChart(d, rect, sheet, ctx, draw) {
|
|
207
|
+
const book = ctx.book, store = ctx.store, path = d.chart;
|
|
208
|
+
const W = rect.width, H = rect.height;
|
|
209
|
+
const fallbackTitle = d.descr || d.name || 'Chart';
|
|
210
|
+
const root = document.createElement('div');
|
|
211
|
+
root.className = 'sp-chart';
|
|
212
|
+
root.dataset.chart = path;
|
|
213
|
+
root.dataset.state = 'pending';
|
|
214
|
+
root.style.cssText = FRAME;
|
|
215
|
+
const art = document.createElement('div');
|
|
216
|
+
art.className = 'sp-chart-art';
|
|
217
|
+
art.style.cssText = 'position:absolute;inset:0';
|
|
218
|
+
const button = document.createElement('button');
|
|
219
|
+
button.type = 'button';
|
|
220
|
+
button.className = 'sp-chart-src';
|
|
221
|
+
button.textContent = 'Show source cells';
|
|
222
|
+
button.style.cssText = `position:absolute;top:4px;right:4px;${BUTTON}`;
|
|
223
|
+
root.append(art, button);
|
|
224
|
+
art.innerHTML = frameSvg(fallbackTitle, 'reading the chart…', [], W, H);
|
|
225
|
+
let model;
|
|
226
|
+
let drawn = '';
|
|
227
|
+
let changed = false;
|
|
228
|
+
const live = isLive(store);
|
|
229
|
+
const paint = () => {
|
|
230
|
+
if (!model)
|
|
231
|
+
return;
|
|
232
|
+
const data = draw ? plotData(model, book, store, live) : undefined;
|
|
233
|
+
const attrs = `data-values="${data && live ? 'live' : 'cache'}"`;
|
|
234
|
+
const html = data ? drawChart(data, model.title, metaOf(model), W, H, attrs, changed) : frameSvg(model.title, metaOf(model), frameLines(model), W, H, attrs, changed);
|
|
235
|
+
if (html !== drawn) {
|
|
236
|
+
art.innerHTML = html;
|
|
237
|
+
drawn = html;
|
|
238
|
+
}
|
|
239
|
+
root.dataset.stage = data ? '2' : '1';
|
|
240
|
+
root.dataset.changed = String(changed);
|
|
241
|
+
};
|
|
242
|
+
let lastChanges, lastDerived;
|
|
243
|
+
const update = () => {
|
|
244
|
+
if (!model)
|
|
245
|
+
return;
|
|
246
|
+
const snap = store.getSnapshot();
|
|
247
|
+
if (snap.changes === lastChanges && snap.derived === lastDerived)
|
|
248
|
+
return;
|
|
249
|
+
const was = changed;
|
|
250
|
+
if (snap.changes !== lastChanges)
|
|
251
|
+
changed = changedInside(snap, model.sources);
|
|
252
|
+
if (changed !== was || live)
|
|
253
|
+
paint();
|
|
254
|
+
lastChanges = snap.changes;
|
|
255
|
+
lastDerived = snap.derived;
|
|
256
|
+
};
|
|
257
|
+
// Lives as long as the workbook: the grid drops every item when another one loads.
|
|
258
|
+
const unsubscribe = store.subscribe(() => {
|
|
259
|
+
if (store.book !== book) {
|
|
260
|
+
unsubscribe();
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
update();
|
|
264
|
+
});
|
|
265
|
+
button.addEventListener('click', (e) => {
|
|
266
|
+
e.stopPropagation();
|
|
267
|
+
void chartModel(book, path).then((m) => { if (m && store.book === book)
|
|
268
|
+
showSource(store, m); });
|
|
269
|
+
});
|
|
270
|
+
// Edit: a click on the chart (not its button) selects the cell under it, so that cell can be flagged.
|
|
271
|
+
root.addEventListener('click', (e) => {
|
|
272
|
+
if (e.target.closest('button') || store.getSnapshot().mode !== 'edit')
|
|
273
|
+
return;
|
|
274
|
+
const r = root.getBoundingClientRect();
|
|
275
|
+
if (!r.width || !r.height)
|
|
276
|
+
return;
|
|
277
|
+
const c = cellAt(ctx.geometry, rect.x + ((e.clientX - r.left) / r.width) * rect.width, rect.y + ((e.clientY - r.top) / r.height) * rect.height);
|
|
278
|
+
store.select({ sheet, ref: cellRef(c.row, c.col) });
|
|
279
|
+
});
|
|
280
|
+
void chartModel(book, path).then((m) => {
|
|
281
|
+
if (store.book !== book)
|
|
282
|
+
return;
|
|
283
|
+
if (!m) {
|
|
284
|
+
root.dataset.state = 'missing';
|
|
285
|
+
root.dataset.stage = '1';
|
|
286
|
+
button.disabled = true;
|
|
287
|
+
art.innerHTML = frameSvg(fallbackTitle, 'chart', ['The chart part could not be read — Excel still has it.'], W, H);
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
model = m;
|
|
291
|
+
root.dataset.state = 'ready';
|
|
292
|
+
root.dataset.type = m.groups.map((g) => g.element).join(' ');
|
|
293
|
+
root.dataset.series = String(m.series.length);
|
|
294
|
+
if (!sourceSelection(m, book)) {
|
|
295
|
+
button.disabled = true;
|
|
296
|
+
button.title = 'This chart’s data is stored in the chart, not in cells';
|
|
297
|
+
}
|
|
298
|
+
else
|
|
299
|
+
button.title = `Select ${m.plotted.map(qualified).join(', ')}`;
|
|
300
|
+
// The grid names the item from `alt` before the part is read; the title replaces it once known.
|
|
301
|
+
// the next overlay pass names the item from `alt`; until then, name it now that the title is known
|
|
302
|
+
const wrapper = root.parentElement;
|
|
303
|
+
if (wrapper?.classList.contains('olay'))
|
|
304
|
+
wrapper.setAttribute('aria-label', m.title);
|
|
305
|
+
paint();
|
|
306
|
+
update();
|
|
307
|
+
});
|
|
308
|
+
return root;
|
|
309
|
+
}
|
|
310
|
+
/** The last geometry the grid gave for each sheet of a workbook — what `chartAt` places anchors with. */
|
|
311
|
+
const geometries = new WeakMap();
|
|
312
|
+
/**
|
|
313
|
+
* The chart whose frame covers the middle of a cell (the topmost), once the grid has drawn that sheet.
|
|
314
|
+
*
|
|
315
|
+
* @param book - The workbook, or `undefined`.
|
|
316
|
+
* @param sheet - The sheet's name.
|
|
317
|
+
* @param row - The cell's row, 0-based.
|
|
318
|
+
* @param col - The cell's column, 0-based.
|
|
319
|
+
* @returns `{ path, index }` of the chart, or `undefined`.
|
|
320
|
+
*/
|
|
321
|
+
export function chartAt(book, sheet, row, col) {
|
|
322
|
+
const g = book && geometries.get(book)?.get(sheet);
|
|
323
|
+
if (!g)
|
|
324
|
+
return undefined;
|
|
325
|
+
const x = g.colX(col) + g.colWidth(col) / 2, y = g.rowY(row) + g.rowHeight(row) / 2;
|
|
326
|
+
const hits = chartsOn(book, sheet).filter(({ drawing }) => {
|
|
327
|
+
const r = anchorRect(drawing, g);
|
|
328
|
+
return !!r && x >= r.x && x <= r.x + r.width && y >= r.y && y <= r.y + r.height;
|
|
329
|
+
});
|
|
330
|
+
const top = hits[hits.length - 1]; // the last drawn is on top
|
|
331
|
+
return top && { path: top.path, index: top.index };
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* The chart items of one sheet, with their rectangles in sheet space: one item per chart drawing with an area.
|
|
335
|
+
*
|
|
336
|
+
* @param sheet - The sheet's name.
|
|
337
|
+
* @param ctx - The plugin context with the grid's geometry, as the `overlay` hook receives it.
|
|
338
|
+
* @param o - The plugin's options (`draw: false` keeps every chart a frame).
|
|
339
|
+
* @returns The overlay items.
|
|
340
|
+
*/
|
|
341
|
+
export function chartItems(sheet, ctx, o = {}) {
|
|
342
|
+
let bySheet = geometries.get(ctx.book);
|
|
343
|
+
if (!bySheet) {
|
|
344
|
+
bySheet = new Map();
|
|
345
|
+
geometries.set(ctx.book, bySheet);
|
|
346
|
+
}
|
|
347
|
+
bySheet.set(sheet, ctx.geometry);
|
|
348
|
+
const gen = generationOf(ctx.book);
|
|
349
|
+
const items = [];
|
|
350
|
+
for (const { drawing, index, path } of chartsOn(ctx.book, sheet)) {
|
|
351
|
+
const rect = anchorRect(drawing, ctx.geometry);
|
|
352
|
+
if (!rect || rect.width <= 0 || rect.height <= 0)
|
|
353
|
+
continue;
|
|
354
|
+
void chartModel(ctx.book, path);
|
|
355
|
+
const known = chartModelNow(ctx.book, path);
|
|
356
|
+
const d = { ...drawing, chart: path };
|
|
357
|
+
items.push({
|
|
358
|
+
id: `chart:${gen}:${index}:${path}`, sheet, rect,
|
|
359
|
+
alt: known?.title ?? (drawing.descr || drawing.name || 'Chart'),
|
|
360
|
+
role: 'group', // the frame holds a button (Show source cells); the drawing inside is the role="img"
|
|
361
|
+
render: () => renderChart(d, rect, sheet, ctx, o.draw !== false),
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
return items;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* The charts plugin: draws each chart of the workbook at its anchor through the `overlay` hook, view only. Every
|
|
368
|
+
* chart gets a frame with its title, type and series count and a Show source cells button; bar, column, line, pie,
|
|
369
|
+
* doughnut and scatter charts are drawn as SVG (no chart library, no font named), from the cached points or, with a
|
|
370
|
+
* `derive` plugin such as `@sheetpane/formulas`, the live cells. A "data changed — Excel will redraw" tag shows once a
|
|
371
|
+
* plotted cell is edited. Export copies the chart parts unchanged. Importing this module registers it as `charts`;
|
|
372
|
+
* add `ui()` from `@sheetpane/charts/ui` for the status line and the shortcut.
|
|
373
|
+
*
|
|
374
|
+
* @param o - `draw: false` keeps every chart a frame.
|
|
375
|
+
* @returns The plugin (`id: 'charts'`).
|
|
376
|
+
* @see https://github.com/arpitarya/sheetpane/blob/main/records/0113_CHARTS.md
|
|
377
|
+
* @example
|
|
378
|
+
* ```ts
|
|
379
|
+
* import { createWorkbook } from '@sheetpane/grid';
|
|
380
|
+
* import { charts } from '@sheetpane/charts';
|
|
381
|
+
* import { formulas } from '@sheetpane/formulas';
|
|
382
|
+
*
|
|
383
|
+
* const book = createWorkbook({ plugins: [charts(), formulas()] });
|
|
384
|
+
* await book.load(bytes, 'dashboard.xlsx');
|
|
385
|
+
* ```
|
|
386
|
+
* @example
|
|
387
|
+
* ```ts
|
|
388
|
+
* import '@sheetpane/charts'; // registers `charts`
|
|
389
|
+
* excel.setAttribute('plugins', 'charts');
|
|
390
|
+
* ```
|
|
391
|
+
*/
|
|
392
|
+
export function charts(o = {}) {
|
|
393
|
+
return {
|
|
394
|
+
id: PLUGIN_ID,
|
|
395
|
+
provides: ['overlay'],
|
|
396
|
+
overlay: (sheet, ctx) => chartItems(sheet, ctx, o),
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
registerPlugin(PLUGIN_ID, () => charts());
|
|
400
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,0FAA0F;AAC1F,iGAAiG;AACjG,0FAA0F;AAC1F,gGAAgG;AAChG,yFAAyF;AACzF,OAAO,EAAE,cAAc,EAAmF,MAAM,iBAAiB,CAAC;AAClI,OAAO,EAAE,UAAU,EAAE,MAAM,EAAa,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,UAAU,EAAqC,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAoB,MAAM,WAAW,CAAC;AAC7G,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAkC,MAAM,UAAU,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,EAAoB,MAAM,WAAW,CAAC;AAEjG,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAkB,MAAM,aAAa,CAAC;AAC1G,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE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AC,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC"}
|
package/dist/model.d.ts
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { ColorSpec } from './colors.js';
|
|
2
|
+
import { type SourceRange } from './refs.js';
|
|
3
|
+
/** The types stage 2 draws. */
|
|
4
|
+
export type DrawKind = 'bar' | 'column' | 'line' | 'pie' | 'doughnut' | 'scatter';
|
|
5
|
+
/** How a chart group's series combine: side by side, stacked, stacked to 100 %, or (lines, scatter) as they are. */
|
|
6
|
+
export type Grouping = 'clustered' | 'stacked' | 'percentStacked' | 'standard';
|
|
7
|
+
/** A reference and what Excel cached for it when it last saved the file. */
|
|
8
|
+
export interface DataRef {
|
|
9
|
+
/** The `c:f` formula, as written. */
|
|
10
|
+
f?: string;
|
|
11
|
+
ranges: SourceRange[];
|
|
12
|
+
/** Cached points by index (`c:pt idx`), `ptCount` long; a missing point is `null`. */
|
|
13
|
+
points: (string | number | null)[];
|
|
14
|
+
/** `c:numCache` (true) or `c:strCache` / a literal string list (false). */
|
|
15
|
+
numeric: boolean;
|
|
16
|
+
formatCode?: string;
|
|
17
|
+
}
|
|
18
|
+
/** One series of a chart part: its name, references and cached points, and explicit colours. */
|
|
19
|
+
export interface SeriesModel {
|
|
20
|
+
/** `c:idx` — what default colours count from. */
|
|
21
|
+
idx: number;
|
|
22
|
+
name: string;
|
|
23
|
+
tx?: DataRef;
|
|
24
|
+
/** Categories (`c:cat`) or, for scatter, x values (`c:xVal`). */
|
|
25
|
+
cat?: DataRef;
|
|
26
|
+
/** Values (`c:val`) or, for scatter, y values (`c:yVal`). */
|
|
27
|
+
val?: DataRef;
|
|
28
|
+
fill?: ColorSpec;
|
|
29
|
+
line?: ColorSpec;
|
|
30
|
+
/** `a:ln/a:noFill` on the series: no connecting line (scatter's default look). */
|
|
31
|
+
noLine: boolean;
|
|
32
|
+
/** Per-point fills (`c:dPt`), by point index. */
|
|
33
|
+
pointFills: Map<number, ColorSpec>;
|
|
34
|
+
}
|
|
35
|
+
/** One chart group of the plot area (`c:barChart`, `c:lineChart` …): its type, layout settings and series. */
|
|
36
|
+
export interface GroupModel {
|
|
37
|
+
/** The plot-area element's local name: `barChart`, `lineChart`, `pie3DChart` … */
|
|
38
|
+
element: string;
|
|
39
|
+
kind: DrawKind | undefined;
|
|
40
|
+
/** A short name for the frame: `column`, `stacked bar`, `3-D pie`, `area` … */
|
|
41
|
+
label: string;
|
|
42
|
+
grouping: Grouping;
|
|
43
|
+
varyColors: boolean;
|
|
44
|
+
/** Bars: gap between categories as a percentage of a bar's width (default 150). */
|
|
45
|
+
gapWidth: number;
|
|
46
|
+
/** Doughnut: hole size in percent (default 50). */
|
|
47
|
+
holeSize: number;
|
|
48
|
+
/** Pie: first slice angle in degrees, clockwise from 12 o'clock. */
|
|
49
|
+
firstSliceAng: number;
|
|
50
|
+
scatterStyle: string;
|
|
51
|
+
series: SeriesModel[];
|
|
52
|
+
}
|
|
53
|
+
/** A chart part read into plain data: title, groups, series, what can be drawn, and the ranges it reads. */
|
|
54
|
+
export interface ChartModel {
|
|
55
|
+
/** The chart's title, or `Chart` when it has none. */
|
|
56
|
+
title: string;
|
|
57
|
+
groups: GroupModel[];
|
|
58
|
+
series: SeriesModel[];
|
|
59
|
+
/** `bar`, `stacked column`, `line + column` … — what the frame says. */
|
|
60
|
+
typeLabel: string;
|
|
61
|
+
/** The type stage 2 draws, or undefined: the chart stays a stage-1 frame. */
|
|
62
|
+
drawable: DrawKind | undefined;
|
|
63
|
+
/** Why it is not drawn, when it is not. */
|
|
64
|
+
notDrawn?: string;
|
|
65
|
+
/** A pivot chart (`c:pivotSource`): Excel refreshes it from the pivot table. */
|
|
66
|
+
pivot: boolean;
|
|
67
|
+
/** Every range the series name — names, categories, values — without duplicates. */
|
|
68
|
+
sources: SourceRange[];
|
|
69
|
+
/** The plotted ranges — each series' values, then its categories — what Show source cells selects. */
|
|
70
|
+
plotted: SourceRange[];
|
|
71
|
+
/** The value axis number format (`c:valAx/c:numFmt`), when the file names one. */
|
|
72
|
+
valueFormat?: string;
|
|
73
|
+
/** Where the legend sits (`c:legend/c:legendPos`); `none` when the chart has no legend. */
|
|
74
|
+
legend: 'right' | 'bottom' | 'none';
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Parses a chart part's XML (`c:chartSpace`, by local name, so strict and transitional parts read the same).
|
|
78
|
+
* Uses DOMParser: browser only.
|
|
79
|
+
*
|
|
80
|
+
* @param xml - The chart part's text.
|
|
81
|
+
* @returns The model.
|
|
82
|
+
* @throws When the XML is not well-formed or holds no `chart`.
|
|
83
|
+
*/
|
|
84
|
+
export declare function parseChart(xml: string): ChartModel;
|
|
85
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAkC,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7E,+BAA+B;AAC/B,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS,CAAC;AAClF,oHAAoH;AACpH,MAAM,MAAM,QAAQ,GAAG,WAAW,GAAG,SAAS,GAAG,gBAAgB,GAAG,UAAU,CAAC;AAE/E,4EAA4E;AAC5E,MAAM,WAAW,OAAO;IACtB,qCAAqC;IACrC,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,sFAAsF;IACtF,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACnC,2EAA2E;IAC3E,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,gGAAgG;AAChG,MAAM,WAAW,WAAW;IAC1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