@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/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Arpit Arya
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,128 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @sheetpane/charts
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Charts for sheetpane — each chart in a workbook shown at its anchor: a frame with its title, type, series count and Show source cells (stage 1), drawn as our own SVG for bar, column, line, pie and scatter (stage 2) — through the `overlay` hook.**
|
|
4
|
+
|
|
5
|
+
A plugin: it registers against the one in-memory workbook of `@sheetpane/grid`
|
|
6
|
+
(`createWorkbook({ plugins: [...] })`, or `plugins="charts"` on the element), so
|
|
7
|
+
`<sheetpane-excel>` and `<sheetpane-errors>` both see its effect. Versioned in
|
|
8
|
+
lockstep with `@sheetpane/grid`.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { createWorkbook } from '@sheetpane/grid';
|
|
12
|
+
import { charts } from '@sheetpane/charts';
|
|
13
|
+
import { ui } from '@sheetpane/charts/ui';
|
|
14
|
+
|
|
15
|
+
el.workbook = createWorkbook({ plugins: [charts(), ui()] });
|
|
16
|
+
// stage 1 only (frames, no plot): charts({ draw: false })
|
|
17
|
+
// or: import '@sheetpane/charts/ui' and <sheetpane-excel plugins="charts">
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
- `@sheetpane/charts` — the headless plugin: the `overlay` provider.
|
|
21
|
+
- `@sheetpane/charts/ui` — the status line and a keyboard shortcut; opt-in.
|
|
22
|
+
|
|
23
|
+
No runtime dependencies, no chart library. Importing is safe in Node: nothing touches the DOM
|
|
24
|
+
until a chart renders.
|
|
25
|
+
|
|
26
|
+
## The frame (stage 1)
|
|
27
|
+
|
|
28
|
+
Every `graphicFrame` in a sheet's drawing that holds a chart (`c:chart r:id` → the chart part)
|
|
29
|
+
becomes one overlay item at its anchor, scrolling and zooming with its cells. The frame shows:
|
|
30
|
+
|
|
31
|
+
- the **title** — `c:title` rich text (runs joined, paragraphs joined by a space), a title
|
|
32
|
+
reference's cached text, the only series' name when the title has no text, else `Chart`;
|
|
33
|
+
- the **type and series count** — `column · 2 series`, `stacked bar · 3 series`,
|
|
34
|
+
`100% stacked column`, `line`, `pie`, `doughnut`, `scatter`, `area`, `radar`, `3-D column`,
|
|
35
|
+
`column + line` (a combination) …;
|
|
36
|
+
- **Show source cells** — selects the plotted cells (see below), in View and in Edit;
|
|
37
|
+
- **data changed — Excel will redraw**, once a user change (`value` or `formula`) lands in a
|
|
38
|
+
cell the chart reads — a series' values, categories or name. Undo takes it away again.
|
|
39
|
+
|
|
40
|
+
A chart that is not drawn lists `Not drawn here: area chart.` and, per series, the cells it
|
|
41
|
+
reads: `Sales — Data!A2:A5, Data!B2:B5`.
|
|
42
|
+
|
|
43
|
+
**Show source cells** selects the union of the series' `c:f` ranges when they tile one
|
|
44
|
+
rectangle (categories in A, values in B and C → `A2:C5`). The grid's selection is one
|
|
45
|
+
rectangle, so ranges that do not tile one (categories in E, values in H) select the first
|
|
46
|
+
series' values. A chart whose data is literal (`c:numLit`, no `c:f`) has nothing to select and
|
|
47
|
+
its button is disabled.
|
|
48
|
+
|
|
49
|
+
In Edit, a click on the chart away from its button selects the cell under the click, so that
|
|
50
|
+
cell can be flagged — as pictures do.
|
|
51
|
+
|
|
52
|
+
## The drawing (stage 2)
|
|
53
|
+
|
|
54
|
+
| type | drawn |
|
|
55
|
+
|---|---|
|
|
56
|
+
| `c:barChart`, `c:barDir="col"` | column — clustered, stacked or 100 % stacked |
|
|
57
|
+
| `c:barChart`, `c:barDir="bar"` | bar — the same groupings; the first category at the bottom, as in Excel |
|
|
58
|
+
| `c:lineChart` | line — standard, stacked or 100 % stacked; a missing point breaks the line |
|
|
59
|
+
| `c:pieChart`, `c:doughnutChart` | pie and doughnut — the first series, clockwise from `c:firstSliceAng` (12 o'clock) |
|
|
60
|
+
| `c:scatterChart` | scatter — x from `c:xVal` (text x values plot at 1, 2, 3 … as in Excel); lines when the style and the series' line say so |
|
|
61
|
+
|
|
62
|
+
Everything else — area, radar, stock, surface, bubble, 3-D, pie-of-pie, combination charts and
|
|
63
|
+
pivot charts — stays a stage-1 frame.
|
|
64
|
+
|
|
65
|
+
The SVG has a title band, a value axis with "nice" ticks (1, 2, 2.5 or 5 × 10ⁿ; zero included
|
|
66
|
+
unless the data sit in a narrow band far from it, as Excel does), category labels thinned so
|
|
67
|
+
they do not overlap, and a legend where the chart has one (`c:legend`: right, or bottom when
|
|
68
|
+
`legendPos` is top or bottom, or the chart is narrow). A negative bar is drawn in the error red
|
|
69
|
+
(the design board). Percent axes follow a `%` in the value axis' number format.
|
|
70
|
+
|
|
71
|
+
**Colours** come from the series' explicit fill (`c:spPr/a:solidFill` — `a:srgbClr`,
|
|
72
|
+
`a:schemeClr` through the workbook theme, `a:sysClr`, with `lumMod`, `lumOff`, `tint`,
|
|
73
|
+
`shade`), a line chart's line colour, per-point fills (`c:dPt`), else Excel's default style:
|
|
74
|
+
the theme's accents 1–6 by series index (`c:idx`) — or by point for `varyColors` pies — then
|
|
75
|
+
darker and lighter rounds. A workbook without a theme gets Office's accents.
|
|
76
|
+
|
|
77
|
+
**Values** are the series' cached points (`c:numCache`, `c:strCache`): what Excel drew when the
|
|
78
|
+
file was saved. With a `derive` plugin on the pane (`@sheetpane/formulas`), the chart reads the
|
|
79
|
+
live cells instead (`store.value`, `store.text` for labels) and redraws as they change; the SVG
|
|
80
|
+
carries `data-values="live"` or `"cache"`. Without one, an edit leaves the drawing as Excel
|
|
81
|
+
saved it, and the tag says so.
|
|
82
|
+
|
|
83
|
+
The SVG uses a `viewBox` the size of the anchor at 100 % and fills the item, so it scales with
|
|
84
|
+
zoom exactly as the cells do. Every mark carries what it stands for (`data-series`,
|
|
85
|
+
`data-point`, `data-value`; slices `data-start`/`data-end` in degrees), so tests compare the
|
|
86
|
+
drawing with the values rather than with pixels. No font is named anywhere (SR-LAW-5): the text
|
|
87
|
+
is the host's. Text from the file is escaped; colours from the file are validated `#RRGGBB`.
|
|
88
|
+
|
|
89
|
+
## Names
|
|
90
|
+
|
|
91
|
+
The item is `role="img"`; its `aria-label` is the chart's title once the part is read (the
|
|
92
|
+
drawing's description or name before that), and the SVG carries the same `role`, `aria-label`
|
|
93
|
+
and `<title>`.
|
|
94
|
+
|
|
95
|
+
## `@sheetpane/charts/ui`
|
|
96
|
+
|
|
97
|
+
- **Status line:** `Chart source: Data!A2:A5, Data!B2:B5, Data!C2:C5` while the selection lies in
|
|
98
|
+
a chart's plotted cells or under its frame; otherwise `2 charts` on a sheet that has some.
|
|
99
|
+
- **Mod+Shift+U** shows the source of the chart over the active cell, or of the sheet's only
|
|
100
|
+
chart — listed in the grid's keyboard help. The frame's own button sits inside the grid's
|
|
101
|
+
`role="img"` overlay wrapper, where assistive technology does not reach it; the shortcut is the
|
|
102
|
+
accessible route to the same action.
|
|
103
|
+
|
|
104
|
+
There is no `selbar` button: a selbar control has no "applies here" test, so it would show on
|
|
105
|
+
every selection, chart or not.
|
|
106
|
+
|
|
107
|
+
## Export
|
|
108
|
+
|
|
109
|
+
Nothing. Patch-mode export copies the chart parts byte for byte, so Excel redraws each chart
|
|
110
|
+
from the (possibly changed) cells when the file is opened.
|
|
111
|
+
|
|
112
|
+
## Limits
|
|
113
|
+
|
|
114
|
+
- **Placement uses the grid's geometry** (28 px rows, every row and column shown), as pictures
|
|
115
|
+
do — not Excel's row heights. Past the last column the grid draws, columns count 64 px each.
|
|
116
|
+
- One rectangle per selection (above). Data labels, trendlines, error bars, axis titles,
|
|
117
|
+
secondary axes, log scales and date axes are not drawn.
|
|
118
|
+
- Only charts on worksheets; chartsheets hold no cells and are not read.
|
|
119
|
+
- No chart is ever edited: no type switcher, no series editor, no resize.
|
|
120
|
+
|
|
121
|
+
## Dependencies
|
|
122
|
+
|
|
123
|
+
Anchors are placed with `@sheetpane/images`' `anchorRect` and `cellAt` (SR-IMAGES decision 3); `@sheetpane/images` is a peer.
|
|
124
|
+
|
|
125
|
+
Spec: [`work/open/W-21-charts.md`](../../work/open/W-21-charts.md).
|
|
126
|
+
How plugins plug in: [`work/compare/plugins.compare.md`](../../work/compare/plugins.compare.md).
|
|
127
|
+
|
|
128
|
+
**Using an AI coding agent?** `npx sheetpane-skills install` puts sheetpane's skills for Claude Code, Kiro and Codex into your repository.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Geometry } from '@sheetpane/grid';
|
|
2
|
+
export declare const EMU_PER_PX = 9525;
|
|
3
|
+
export interface AnchorPoint {
|
|
4
|
+
col: number;
|
|
5
|
+
colOff: number;
|
|
6
|
+
row: number;
|
|
7
|
+
rowOff: number;
|
|
8
|
+
}
|
|
9
|
+
export interface Anchor {
|
|
10
|
+
anchor: 'twoCell' | 'oneCell' | 'absolute';
|
|
11
|
+
from?: AnchorPoint;
|
|
12
|
+
to?: AnchorPoint;
|
|
13
|
+
ext?: {
|
|
14
|
+
cx: number;
|
|
15
|
+
cy: number;
|
|
16
|
+
};
|
|
17
|
+
pos?: {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface Rect {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
}
|
|
28
|
+
/** The rectangle an anchor covers, or `undefined` when the anchor lacks what its kind needs. */
|
|
29
|
+
export declare function anchorRect(a: Anchor, g: Geometry): Rect | undefined;
|
|
30
|
+
/** The zero-based cell under a point in sheet space (px at 100 %). */
|
|
31
|
+
export declare function cellAt(g: Geometry, x: number, y: number): {
|
|
32
|
+
row: number;
|
|
33
|
+
col: number;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* The grid's `Geometry` stops at the last column it draws: past it, `colX` returns that column's
|
|
37
|
+
* edge for every index while `colWidth` says 64 px. A chart is often anchored to the right of the
|
|
38
|
+
* data, so columns past the edge are extended here at 64 px each — what the grid's own fallback
|
|
39
|
+
* intends. A geometry that keeps growing is returned as it is.
|
|
40
|
+
*/
|
|
41
|
+
export declare function extendColumns(g: Geometry): Geometry;
|
|
42
|
+
//# sourceMappingURL=anchors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anchors.d.ts","sourceRoot":"","sources":["../src/anchors.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,eAAO,MAAM,UAAU,OAAO,CAAC;AAG/B,MAAM,WAAW,WAAW;IAAG,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AACzF,MAAM,WAAW,MAAM;IACrB,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;IAC3C,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,GAAG,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACjC,GAAG,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAChC;AACD,MAAM,WAAW,IAAI;IAAG,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AAY7E,gGAAgG;AAChG,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,CAenE;AAWD,sEAAsE;AACtE,wBAAgB,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAEtF;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAYnD"}
|
package/dist/anchors.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export const EMU_PER_PX = 9525;
|
|
2
|
+
const emuToPx = (emu) => emu / EMU_PER_PX;
|
|
3
|
+
const clamp = (v, lo, hi) => Math.min(Math.max(v, lo), hi);
|
|
4
|
+
const finite = (n) => (Number.isFinite(n) ? n : 0);
|
|
5
|
+
function pointToPx(g, p) {
|
|
6
|
+
return {
|
|
7
|
+
x: g.colX(p.col) + clamp(emuToPx(finite(p.colOff)), 0, g.colWidth(p.col)),
|
|
8
|
+
y: g.rowY(p.row) + clamp(emuToPx(finite(p.rowOff)), 0, g.rowHeight(p.row)),
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/** The rectangle an anchor covers, or `undefined` when the anchor lacks what its kind needs. */
|
|
12
|
+
export function anchorRect(a, g) {
|
|
13
|
+
if (a.anchor === 'twoCell') {
|
|
14
|
+
if (!a.from || !a.to)
|
|
15
|
+
return undefined;
|
|
16
|
+
const p0 = pointToPx(g, a.from), p1 = pointToPx(g, a.to);
|
|
17
|
+
return { x: Math.min(p0.x, p1.x), y: Math.min(p0.y, p1.y), width: Math.abs(p1.x - p0.x), height: Math.abs(p1.y - p0.y) };
|
|
18
|
+
}
|
|
19
|
+
if (!a.ext)
|
|
20
|
+
return undefined;
|
|
21
|
+
const width = emuToPx(finite(a.ext.cx)), height = emuToPx(finite(a.ext.cy));
|
|
22
|
+
if (a.anchor === 'oneCell') {
|
|
23
|
+
if (!a.from)
|
|
24
|
+
return undefined;
|
|
25
|
+
const p = pointToPx(g, a.from);
|
|
26
|
+
return { x: p.x, y: p.y, width, height };
|
|
27
|
+
}
|
|
28
|
+
if (!a.pos)
|
|
29
|
+
return undefined;
|
|
30
|
+
return { x: emuToPx(finite(a.pos.x)), y: emuToPx(finite(a.pos.y)), width, height };
|
|
31
|
+
}
|
|
32
|
+
function indexAt(at, v, max) {
|
|
33
|
+
let lo = 0, hi = max - 1;
|
|
34
|
+
while (lo < hi) {
|
|
35
|
+
const mid = (lo + hi + 1) >> 1;
|
|
36
|
+
if (at(mid) <= v)
|
|
37
|
+
lo = mid;
|
|
38
|
+
else
|
|
39
|
+
hi = mid - 1;
|
|
40
|
+
}
|
|
41
|
+
return lo;
|
|
42
|
+
}
|
|
43
|
+
/** The zero-based cell under a point in sheet space (px at 100 %). */
|
|
44
|
+
export function cellAt(g, x, y) {
|
|
45
|
+
return { col: indexAt((c) => g.colX(c), Math.max(0, x), 16384), row: indexAt((r) => g.rowY(r), Math.max(0, y), 1048576) };
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The grid's `Geometry` stops at the last column it draws: past it, `colX` returns that column's
|
|
49
|
+
* edge for every index while `colWidth` says 64 px. A chart is often anchored to the right of the
|
|
50
|
+
* data, so columns past the edge are extended here at 64 px each — what the grid's own fallback
|
|
51
|
+
* intends. A geometry that keeps growing is returned as it is.
|
|
52
|
+
*/
|
|
53
|
+
export function extendColumns(g) {
|
|
54
|
+
const flat = (c) => g.colX(c + 1) <= g.colX(c);
|
|
55
|
+
if (!flat(16383))
|
|
56
|
+
return g;
|
|
57
|
+
let lo = 0, hi = 16383; // the first column whose right edge does not move
|
|
58
|
+
while (lo < hi) {
|
|
59
|
+
const mid = (lo + hi) >> 1;
|
|
60
|
+
if (flat(mid))
|
|
61
|
+
hi = mid;
|
|
62
|
+
else
|
|
63
|
+
lo = mid + 1;
|
|
64
|
+
}
|
|
65
|
+
const edge = lo, x = g.colX(edge);
|
|
66
|
+
return {
|
|
67
|
+
colX: (c) => (c <= edge ? g.colX(c) : x + (c - edge) * 64),
|
|
68
|
+
colWidth: (c) => (c < edge ? g.colWidth(c) : 64),
|
|
69
|
+
rowY: (r) => g.rowY(r),
|
|
70
|
+
rowHeight: (r) => g.rowHeight(r),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=anchors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anchors.js","sourceRoot":"","sources":["../src/anchors.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC;AAC/B,MAAM,OAAO,GAAG,CAAC,GAAW,EAAU,EAAE,CAAC,GAAG,GAAG,UAAU,CAAC;AAY1D,MAAM,KAAK,GAAG,CAAC,CAAS,EAAE,EAAU,EAAE,EAAU,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;AACnF,MAAM,MAAM,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3D,SAAS,SAAS,CAAC,CAAW,EAAE,CAAc;IAC5C,OAAO;QACL,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC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CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAChD,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QACtB,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;KACjC,CAAC;AACJ,CAAC"}
|
package/dist/colors.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** Office's default accents, for a workbook whose theme names none. */
|
|
2
|
+
export declare const OFFICE_ACCENTS: readonly ['4472C4', 'ED7D31', 'A5A5A5', 'FFC000', '5B9BD5', '70AD47'];
|
|
3
|
+
/** A colour element as the model keeps it, before the theme resolves it. */
|
|
4
|
+
export interface ColorSpec {
|
|
5
|
+
kind: 'srgb' | 'scheme' | 'sys';
|
|
6
|
+
val: string;
|
|
7
|
+
mods: {
|
|
8
|
+
name: string;
|
|
9
|
+
val: number;
|
|
10
|
+
}[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The theme's six accents, Office's where the workbook has none.
|
|
14
|
+
*
|
|
15
|
+
* @param themeColors - The workbook's theme colours by SpreadsheetML index (accents at 4–9), `RRGGBB`.
|
|
16
|
+
* @returns Six `RRGGBB` accents.
|
|
17
|
+
*/
|
|
18
|
+
export declare function accents(themeColors: readonly string[]): string[];
|
|
19
|
+
/**
|
|
20
|
+
* Applies DrawingML colour modifiers: `lumMod` / `lumOff` in HSL, then `shade` and `tint` (values in 1/1000 of a
|
|
21
|
+
* percent: 75000 = 75 %). Other modifiers are ignored.
|
|
22
|
+
*
|
|
23
|
+
* @param hex - The base colour, `RRGGBB`.
|
|
24
|
+
* @param mods - The modifiers in file order, each `{ name, val }`.
|
|
25
|
+
* @returns The modified colour, `RRGGBB`.
|
|
26
|
+
*/
|
|
27
|
+
export declare function modify(hex: string, mods: readonly {
|
|
28
|
+
name: string;
|
|
29
|
+
val: number;
|
|
30
|
+
}[]): string;
|
|
31
|
+
/**
|
|
32
|
+
* Resolves a chart colour (`srgbClr`, `schemeClr`, `sysClr` with its modifiers) to `#RRGGBB`.
|
|
33
|
+
*
|
|
34
|
+
* @param c - The colour spec, or `undefined`.
|
|
35
|
+
* @param themeColors - The workbook's theme colours, for a scheme colour.
|
|
36
|
+
* @returns `#RRGGBB`, or `undefined` when it names nothing this resolver knows.
|
|
37
|
+
*/
|
|
38
|
+
export declare function resolveColor(c: ColorSpec | undefined, themeColors: readonly string[]): string | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* The colour Excel's default chart style gives the n-th series (or pie slice) when the part
|
|
41
|
+
* names none: accents 1–6, then the same six darker, then lighter.
|
|
42
|
+
*
|
|
43
|
+
* @param n - The series' `c:idx` (or the slice's index).
|
|
44
|
+
* @param themeColors - The workbook's theme colours.
|
|
45
|
+
* @returns `#RRGGBB`.
|
|
46
|
+
*/
|
|
47
|
+
export declare function defaultColor(n: number, themeColors: readonly string[]): string;
|
|
48
|
+
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../src/colors.ts"],"names":[],"mappings":"AAGA,uEAAuE;AACvE,eAAO,MAAM,cAAc,YAAI,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAEpG,4EAA4E;AAC5E,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACvC;AAWD;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAEhE;AAoCD;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,MAAM,CAc1F;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAIzG;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAI9E"}
|
package/dist/colors.js
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// DrawingML colours → `#RRGGBB`. Pure, no DOM: `srgbClr`, `schemeClr` (through the workbook
|
|
2
|
+
// theme) and `sysClr` with the modifiers Excel writes most (`lumMod`, `lumOff`, `tint`, `shade`).
|
|
3
|
+
/** Office's default accents, for a workbook whose theme names none. */
|
|
4
|
+
export const OFFICE_ACCENTS = ['4472C4', 'ED7D31', 'A5A5A5', 'FFC000', '5B9BD5', '70AD47'];
|
|
5
|
+
/** DrawingML scheme names → SpreadsheetML theme index (0 lt1, 1 dk1, 2 lt2, 3 dk2, 4–9 accents, 10 hlink, 11 folHlink). */
|
|
6
|
+
const SCHEME = {
|
|
7
|
+
lt1: 0, bg1: 0, dk1: 1, tx1: 1, lt2: 2, bg2: 2, dk2: 3, tx2: 3,
|
|
8
|
+
accent1: 4, accent2: 5, accent3: 6, accent4: 7, accent5: 8, accent6: 9, hlink: 10, folHlink: 11,
|
|
9
|
+
};
|
|
10
|
+
const SCHEME_FALLBACK = { 0: 'FFFFFF', 1: '000000', 2: 'E7E6E6', 3: '44546A', 10: '0563C1', 11: '954F72' };
|
|
11
|
+
const hex6 = (s) => (s && /^[0-9A-Fa-f]{6}$/.test(s) ? s.toUpperCase() : undefined);
|
|
12
|
+
/**
|
|
13
|
+
* The theme's six accents, Office's where the workbook has none.
|
|
14
|
+
*
|
|
15
|
+
* @param themeColors - The workbook's theme colours by SpreadsheetML index (accents at 4–9), `RRGGBB`.
|
|
16
|
+
* @returns Six `RRGGBB` accents.
|
|
17
|
+
*/
|
|
18
|
+
export function accents(themeColors) {
|
|
19
|
+
return OFFICE_ACCENTS.map((d, i) => hex6(themeColors[4 + i]) ?? d);
|
|
20
|
+
}
|
|
21
|
+
function themeColor(themeColors, name) {
|
|
22
|
+
const i = SCHEME[name];
|
|
23
|
+
if (i === undefined)
|
|
24
|
+
return undefined;
|
|
25
|
+
if (i >= 4 && i <= 9)
|
|
26
|
+
return accents(themeColors)[i - 4];
|
|
27
|
+
return hex6(themeColors[i]) ?? SCHEME_FALLBACK[i];
|
|
28
|
+
}
|
|
29
|
+
function toRgb(h) {
|
|
30
|
+
return [parseInt(h.slice(0, 2), 16), parseInt(h.slice(2, 4), 16), parseInt(h.slice(4, 6), 16)];
|
|
31
|
+
}
|
|
32
|
+
const toHex = (rgb) => rgb.map((v) => Math.round(Math.min(255, Math.max(0, v))).toString(16).padStart(2, '0')).join('').toUpperCase();
|
|
33
|
+
function rgbToHsl([r, g, b]) {
|
|
34
|
+
r /= 255;
|
|
35
|
+
g /= 255;
|
|
36
|
+
b /= 255;
|
|
37
|
+
const max = Math.max(r, g, b), min = Math.min(r, g, b), l = (max + min) / 2;
|
|
38
|
+
if (max === min)
|
|
39
|
+
return [0, 0, l];
|
|
40
|
+
const d = max - min, s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
41
|
+
const h = max === r ? (g - b) / d + (g < b ? 6 : 0) : max === g ? (b - r) / d + 2 : (r - g) / d + 4;
|
|
42
|
+
return [h / 6, s, l];
|
|
43
|
+
}
|
|
44
|
+
function hslToRgb([h, s, l]) {
|
|
45
|
+
if (s === 0)
|
|
46
|
+
return [l * 255, l * 255, l * 255];
|
|
47
|
+
const q = l < 0.5 ? l * (1 + s) : l + s - l * s, p = 2 * l - q;
|
|
48
|
+
const f = (t) => {
|
|
49
|
+
if (t < 0)
|
|
50
|
+
t += 1;
|
|
51
|
+
if (t > 1)
|
|
52
|
+
t -= 1;
|
|
53
|
+
if (t < 1 / 6)
|
|
54
|
+
return p + (q - p) * 6 * t;
|
|
55
|
+
if (t < 1 / 2)
|
|
56
|
+
return q;
|
|
57
|
+
if (t < 2 / 3)
|
|
58
|
+
return p + (q - p) * (2 / 3 - t) * 6;
|
|
59
|
+
return p;
|
|
60
|
+
};
|
|
61
|
+
return [f(h + 1 / 3) * 255, f(h) * 255, f(h - 1 / 3) * 255];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Applies DrawingML colour modifiers: `lumMod` / `lumOff` in HSL, then `shade` and `tint` (values in 1/1000 of a
|
|
65
|
+
* percent: 75000 = 75 %). Other modifiers are ignored.
|
|
66
|
+
*
|
|
67
|
+
* @param hex - The base colour, `RRGGBB`.
|
|
68
|
+
* @param mods - The modifiers in file order, each `{ name, val }`.
|
|
69
|
+
* @returns The modified colour, `RRGGBB`.
|
|
70
|
+
*/
|
|
71
|
+
export function modify(hex, mods) {
|
|
72
|
+
let rgb = toRgb(hex);
|
|
73
|
+
const lumMod = mods.find((m) => m.name === 'lumMod'), lumOff = mods.find((m) => m.name === 'lumOff');
|
|
74
|
+
if (lumMod || lumOff) {
|
|
75
|
+
const hsl = rgbToHsl(rgb);
|
|
76
|
+
hsl[2] = Math.min(1, Math.max(0, hsl[2] * ((lumMod?.val ?? 100000) / 100000) + (lumOff?.val ?? 0) / 100000));
|
|
77
|
+
rgb = hslToRgb(hsl);
|
|
78
|
+
}
|
|
79
|
+
for (const m of mods) {
|
|
80
|
+
const k = m.val / 100000;
|
|
81
|
+
if (m.name === 'shade')
|
|
82
|
+
rgb = rgb.map((v) => v * k);
|
|
83
|
+
else if (m.name === 'tint')
|
|
84
|
+
rgb = rgb.map((v) => v + (255 - v) * (1 - k));
|
|
85
|
+
}
|
|
86
|
+
return toHex(rgb);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Resolves a chart colour (`srgbClr`, `schemeClr`, `sysClr` with its modifiers) to `#RRGGBB`.
|
|
90
|
+
*
|
|
91
|
+
* @param c - The colour spec, or `undefined`.
|
|
92
|
+
* @param themeColors - The workbook's theme colours, for a scheme colour.
|
|
93
|
+
* @returns `#RRGGBB`, or `undefined` when it names nothing this resolver knows.
|
|
94
|
+
*/
|
|
95
|
+
export function resolveColor(c, themeColors) {
|
|
96
|
+
if (!c)
|
|
97
|
+
return undefined;
|
|
98
|
+
const base = c.kind === 'srgb' ? hex6(c.val) : c.kind === 'scheme' ? themeColor(themeColors, c.val) : hex6(c.val);
|
|
99
|
+
return base ? `#${modify(base, c.mods)}` : undefined;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The colour Excel's default chart style gives the n-th series (or pie slice) when the part
|
|
103
|
+
* names none: accents 1–6, then the same six darker, then lighter.
|
|
104
|
+
*
|
|
105
|
+
* @param n - The series' `c:idx` (or the slice's index).
|
|
106
|
+
* @param themeColors - The workbook's theme colours.
|
|
107
|
+
* @returns `#RRGGBB`.
|
|
108
|
+
*/
|
|
109
|
+
export function defaultColor(n, themeColors) {
|
|
110
|
+
const a = accents(themeColors)[n % 6], round = Math.floor(n / 6) % 3;
|
|
111
|
+
if (round === 0)
|
|
112
|
+
return `#${a}`;
|
|
113
|
+
return `#${modify(a, round === 1 ? [{ name: 'lumMod', val: 60000 }] : [{ name: 'lumMod', val: 80000 }, { name: 'lumOff', val: 20000 }])}`;
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=colors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.js","sourceRoot":"","sources":["../src/colors.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,kGAAkG;AAElG,uEAAuE;AACvE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAA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,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAClH,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACvD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,CAAS,EAAE,WAA8B;IACpE,MAAM,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAE,EAAE,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACtE,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC,EAAE,CAAC;IAChC,OAAO,IAAI,MAAM,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC;AAC5I,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { type Geometry, type OverlayItem, type Plugin, type PluginContext, type Snapshot } from '@sheetpane/grid';
|
|
2
|
+
import { type ChartModel } from './model.js';
|
|
3
|
+
import { type SourceRange } from './refs.js';
|
|
4
|
+
import { type PlotData } from './svg.js';
|
|
5
|
+
export { parseChart } from './model.js';
|
|
6
|
+
export type { ChartModel, SeriesModel, GroupModel, DataRef, DrawKind, Grouping } from './model.js';
|
|
7
|
+
export { parseFormulaRefs, selectionFor, qualified, cellsOf, type SourceRange } from './refs.js';
|
|
8
|
+
export { resolveColor, defaultColor, accents, modify, OFFICE_ACCENTS, type ColorSpec } from './colors.js';
|
|
9
|
+
export { drawChart, frameSvg, niceScale, stackedValues, formatNumber, withZero, HEAD, CHANGED_TAG, type PlotData, type PlotSeries, type Scale } from './svg.js';
|
|
10
|
+
/** The plugin's id, and the name `plugins="…"` takes. */
|
|
11
|
+
export declare const PLUGIN_ID = "charts";
|
|
12
|
+
type Book = PluginContext['book'];
|
|
13
|
+
type Store = PluginContext['store'];
|
|
14
|
+
type Drawing = Book['sheets'][number]['drawings'][number];
|
|
15
|
+
/** Options for {@link charts}. */
|
|
16
|
+
export interface ChartsOptions {
|
|
17
|
+
/** `false` keeps every chart a stage-1 frame (no SVG plot). Default `true`. */
|
|
18
|
+
draw?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The parsed chart part, read through `book.part()` on first ask and cached per workbook.
|
|
22
|
+
*
|
|
23
|
+
* @param book - The workbook.
|
|
24
|
+
* @param path - The chart part's path, e.g. `xl/charts/chart1.xml`.
|
|
25
|
+
* @returns The model; `undefined` when the part is missing or unreadable.
|
|
26
|
+
*/
|
|
27
|
+
export declare function chartModel(book: Book, path: string): Promise<ChartModel | undefined>;
|
|
28
|
+
/**
|
|
29
|
+
* The chart model if it is parsed already, without reading anything.
|
|
30
|
+
*
|
|
31
|
+
* @param book - The workbook.
|
|
32
|
+
* @param path - The chart part's path.
|
|
33
|
+
* @returns The model, `null` (unreadable) or `undefined` (not read yet).
|
|
34
|
+
*/
|
|
35
|
+
export declare function chartModelNow(book: Book, path: string): ChartModel | null | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* The chart drawings of a sheet, with their index among the sheet's drawings.
|
|
38
|
+
*
|
|
39
|
+
* @param book - The workbook, or `undefined`.
|
|
40
|
+
* @param sheet - The sheet's name.
|
|
41
|
+
* @returns One `{ drawing, index, path }` per chart; empty for none.
|
|
42
|
+
*/
|
|
43
|
+
export declare function chartsOn(book: Book | undefined, sheet: string): {
|
|
44
|
+
drawing: Drawing;
|
|
45
|
+
index: number;
|
|
46
|
+
path: string;
|
|
47
|
+
}[];
|
|
48
|
+
/** True when the pane computes formulas (a `derive` plugin), so the cells are live. */
|
|
49
|
+
export declare const isLive: (store: Store) => boolean;
|
|
50
|
+
/**
|
|
51
|
+
* What stage 2 draws: the chart's one group, its series coloured and valued — the cached points, or the live cells
|
|
52
|
+
* when `live` and the ranges are readable.
|
|
53
|
+
*
|
|
54
|
+
* @param m - The chart model.
|
|
55
|
+
* @param book - The workbook (its theme and sheets).
|
|
56
|
+
* @param store - The store, for live values; `undefined` uses the cache.
|
|
57
|
+
* @param live - Whether the pane computes formulas (a `derive` plugin), so the cells are current.
|
|
58
|
+
* @returns The plot data, or `undefined` when the chart is not drawable.
|
|
59
|
+
*/
|
|
60
|
+
export declare function plotData(m: ChartModel, book: Book, store: Store | undefined, live: boolean): PlotData | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Whether a user changed a value inside one of the ranges (snapshot `changes`, kinds `value` and `formula`).
|
|
63
|
+
*
|
|
64
|
+
* @param snap - A snapshot of the store.
|
|
65
|
+
* @param ranges - The ranges a chart reads.
|
|
66
|
+
* @returns `true` when at least one such change lies in them.
|
|
67
|
+
*/
|
|
68
|
+
export declare function changedInside(snap: Snapshot, ranges: readonly SourceRange[]): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* The chart's plotted ranges that exist in this workbook, as one selection (see {@link selectionFor}).
|
|
71
|
+
*
|
|
72
|
+
* @param m - The chart model.
|
|
73
|
+
* @param book - The workbook.
|
|
74
|
+
* @returns A selection for `store.select()`, or `undefined` when the data is literal or names no sheet here.
|
|
75
|
+
*/
|
|
76
|
+
export declare function sourceSelection(m: ChartModel, book: Book): {
|
|
77
|
+
sheet: string;
|
|
78
|
+
ref: string;
|
|
79
|
+
range?: string;
|
|
80
|
+
} | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Shows a chart's source: selects the union of its plotted ranges (or the first one — see {@link selectionFor}).
|
|
83
|
+
*
|
|
84
|
+
* @param store - The workbook store.
|
|
85
|
+
* @param m - The chart model.
|
|
86
|
+
* @returns `true` when something was selected; `false` when there was nothing to select.
|
|
87
|
+
*/
|
|
88
|
+
export declare function showSource(store: Store, m: ChartModel): boolean;
|
|
89
|
+
/** `bar · 2 series`. */
|
|
90
|
+
export declare const metaOf: (m: ChartModel) => string;
|
|
91
|
+
/**
|
|
92
|
+
* The chart whose frame covers the middle of a cell (the topmost), once the grid has drawn that sheet.
|
|
93
|
+
*
|
|
94
|
+
* @param book - The workbook, or `undefined`.
|
|
95
|
+
* @param sheet - The sheet's name.
|
|
96
|
+
* @param row - The cell's row, 0-based.
|
|
97
|
+
* @param col - The cell's column, 0-based.
|
|
98
|
+
* @returns `{ path, index }` of the chart, or `undefined`.
|
|
99
|
+
*/
|
|
100
|
+
export declare function chartAt(book: Book | undefined, sheet: string, row: number, col: number): {
|
|
101
|
+
path: string;
|
|
102
|
+
index: number;
|
|
103
|
+
} | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* The chart items of one sheet, with their rectangles in sheet space: one item per chart drawing with an area.
|
|
106
|
+
*
|
|
107
|
+
* @param sheet - The sheet's name.
|
|
108
|
+
* @param ctx - The plugin context with the grid's geometry, as the `overlay` hook receives it.
|
|
109
|
+
* @param o - The plugin's options (`draw: false` keeps every chart a frame).
|
|
110
|
+
* @returns The overlay items.
|
|
111
|
+
*/
|
|
112
|
+
export declare function chartItems(sheet: string, ctx: PluginContext & {
|
|
113
|
+
geometry: Geometry;
|
|
114
|
+
}, o?: ChartsOptions): OverlayItem[];
|
|
115
|
+
/**
|
|
116
|
+
* The charts plugin: draws each chart of the workbook at its anchor through the `overlay` hook, view only. Every
|
|
117
|
+
* chart gets a frame with its title, type and series count and a Show source cells button; bar, column, line, pie,
|
|
118
|
+
* doughnut and scatter charts are drawn as SVG (no chart library, no font named), from the cached points or, with a
|
|
119
|
+
* `derive` plugin such as `@sheetpane/formulas`, the live cells. A "data changed — Excel will redraw" tag shows once a
|
|
120
|
+
* plotted cell is edited. Export copies the chart parts unchanged. Importing this module registers it as `charts`;
|
|
121
|
+
* add `ui()` from `@sheetpane/charts/ui` for the status line and the shortcut.
|
|
122
|
+
*
|
|
123
|
+
* @param o - `draw: false` keeps every chart a frame.
|
|
124
|
+
* @returns The plugin (`id: 'charts'`).
|
|
125
|
+
* @see https://github.com/arpitarya/sheetpane/blob/main/records/0113_CHARTS.md
|
|
126
|
+
* @example
|
|
127
|
+
* ```ts
|
|
128
|
+
* import { createWorkbook } from '@sheetpane/grid';
|
|
129
|
+
* import { charts } from '@sheetpane/charts';
|
|
130
|
+
* import { formulas } from '@sheetpane/formulas';
|
|
131
|
+
*
|
|
132
|
+
* const book = createWorkbook({ plugins: [charts(), formulas()] });
|
|
133
|
+
* await book.load(bytes, 'dashboard.xlsx');
|
|
134
|
+
* ```
|
|
135
|
+
* @example
|
|
136
|
+
* ```ts
|
|
137
|
+
* import '@sheetpane/charts'; // registers `charts`
|
|
138
|
+
* excel.setAttribute('plugins', 'charts');
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
export declare function charts(o?: ChartsOptions): Plugin;
|
|
142
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAkB,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,KAAK,aAAa,EAAE,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGlI,OAAO,EAAc,KAAK,UAAU,EAAoB,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAkE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7G,OAAO,EAAuB,KAAK,QAAQ,EAAmB,MAAM,UAAU,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,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