@martinomagnifico/tablechart 1.0.3 → 1.0.4
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/CHANGELOG.md +27 -0
- package/README.md +2 -2
- package/dist/tablechart-core.d.mts +26 -0
- package/dist/tablechart-core.mjs +1 -2
- package/dist/tablechart-shared.d.mts +302 -0
- package/dist/tablechart-shared.mjs +825 -744
- package/dist/tablechart.css +1 -1
- package/dist/tablechart.d.mts +2 -0
- package/dist/tablechart.js +1 -1
- package/dist/tablechart.mjs +1 -2
- package/package.json +12 -8
- package/dist/tablechart-core.d.ts +0 -313
- package/dist/tablechart.d.ts +0 -85
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.0.4] - 2026-10-14
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `--tablechart-animation-element-duration`, `--tablechart-animation-stagger` and `--tablechart-animation-max`: the time of one element, when the next one starts, and a ceiling for a whole chart, which is 4x the standard element duration, so 2s by default.
|
|
8
|
+
- `data-chart-animate="sweep"` on a donut draws the ring in one sweep, and on a waterfall builds it at one speed.
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- A large chart builds within 2s: the starts of its elements move closer together.
|
|
13
|
+
- A waterfall grows column by column, one after the other: its stagger is 0.6 by default. Under the maximum its columns get shorter.
|
|
14
|
+
- CSS variables that set the same part of a chart now start there variable name in the same way, such as `--tablechart-animation-` and `--tablechart-name-`. See the list of old and new names on the CSS variables page.
|
|
15
|
+
- `--tablechart-name-size` now sets all names, also those under the bars.
|
|
16
|
+
- The callout of an annotation is now called the badge in the docs, like its variables.
|
|
17
|
+
- `data-chart-animate` and the `animate` option take `grow` and `sweep`, the same on every chart type. `up` and `across` are the old names.
|
|
18
|
+
- The types are now `tablechart.d.mts` and `tablechart-core.d.mts`, next to the ES modules, and share `tablechart-shared.d.mts` like the modules share their code. They are made with rolldown-plugin-dts instead of API Extractor.
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- With steps, the closing total of a waterfall grows from the baseline if the column before it is not there yet.
|
|
23
|
+
- Importing `@martinomagnifico/tablechart/core` in TypeScript no longer fails with "Cannot find name 'TablechartChart'".
|
|
24
|
+
|
|
25
|
+
### Deprecated
|
|
26
|
+
|
|
27
|
+
- The old variable names and the animate values `up` and `across`, removed in the next minor version. The console lists the ones a page still uses.
|
|
28
|
+
|
|
29
|
+
|
|
3
30
|
## [1.0.3] - 2026-10-11
|
|
4
31
|
|
|
5
32
|
### Added
|
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ Tablechart makes simple charts from a table: an HTML table, a Markdown table or
|
|
|
14
14
|
* **The table stays:** it is hidden from sight, but screen readers, search engines and translation scripts still read it. Without JavaScript, the table is all there is.
|
|
15
15
|
* **Real text:** names and numbers are HTML, so they use the font of the page and do not scale with the drawing.
|
|
16
16
|
* **CSS for the looks:** colours, sizes and animation are CSS variables. Light and dark mode follow the page.
|
|
17
|
-
* **Annotations:**
|
|
17
|
+
* **Annotations:** badges, brackets, trend arrows and a break in the scale
|
|
18
18
|
* **Step by step:** show the rows one at a time, with Previous and Next buttons
|
|
19
19
|
* **Animation:** a chart builds when it scrolls into view
|
|
20
20
|
|
|
@@ -70,7 +70,7 @@ Use `bar`, `line`, `area`, `waterfall` or `donut` for the other types. With more
|
|
|
70
70
|
|
|
71
71
|
```js
|
|
72
72
|
init({
|
|
73
|
-
animate: true, // Animate a chart when it builds: true, false, "
|
|
73
|
+
animate: true, // Animate a chart when it builds: true, false, "grow" or "sweep"
|
|
74
74
|
threshold: 0.5, // How much of a chart must be in view before it builds
|
|
75
75
|
replay: false, // Build again each time a chart scrolls back into view
|
|
76
76
|
controls: true, // Previous and Next buttons on a chart that steps
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { _ as stepTo, c as PLACED_CLASS, d as SHOWN_CLASS, f as defaultConfig, g as StepPlan, h as Series, i as entranceOf, l as PLOT_CLASS, m as Row, o as prepare, p as ChartState, s as Config, u as QUEUED_CLASS } from "./tablechart-shared.mjs";
|
|
2
|
+
//#region src/js/core.d.ts
|
|
3
|
+
/** Pass 2: everything a reader will read, before a translation script looks. */
|
|
4
|
+
export declare const build: (figure: HTMLElement, config: Config, asKind?: string | null) => ChartState | null;
|
|
5
|
+
/** Pass 3. Needs layout; makes no text, only places it. */
|
|
6
|
+
export declare const layout: (state: ChartState, config: Config) => boolean;
|
|
7
|
+
/** Numbers are reformatted in place, so a language change costs no redraw. */
|
|
8
|
+
export declare const relabel: (state: ChartState, config: Config) => void;
|
|
9
|
+
/** Removes what `build` added, so the chart can be built again. */
|
|
10
|
+
export declare const unbuild: (state: ChartState) => void;
|
|
11
|
+
/** One class, `is-shown`, starts the whole build. */
|
|
12
|
+
export declare const setShown: (state: ChartState, shown: boolean) => void;
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/js/functions/sources.d.ts
|
|
15
|
+
/** A Markdown table, or a caption with chart attributes, is wrapped in a div with the caption and annotations beside it. */
|
|
16
|
+
export declare const adoptTables: (figures: HTMLElement[]) => HTMLElement[];
|
|
17
|
+
/** `data-chart-src` fills the figure's table with the rows of a JSON file, keeping a header row the author wrote; a file that fails is reported. */
|
|
18
|
+
export declare const loadSources: (figures: HTMLElement[]) => Promise<void>;
|
|
19
|
+
/** In a Markdown table, a bold label makes the row a total, and a bold header puts that series in focus. */
|
|
20
|
+
export declare const readMarkdownRows: (figures: HTMLElement[]) => void;
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/js/functions/read-table.d.ts
|
|
23
|
+
/** Writes translation keys such as `harvest-row1` onto a figure with `data-chart-keys`; a duplicate prefix gets a number. */
|
|
24
|
+
export declare const assignKeys: (figures: HTMLElement[], langattribute: string | false) => void;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { type ChartState, type Config, PLACED_CLASS, PLOT_CLASS, QUEUED_CLASS, type Row, SHOWN_CLASS, type Series, type StepPlan, defaultConfig, entranceOf, prepare, stepTo };
|
package/dist/tablechart-core.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { o as PLACED_CLASS, a as PLOT_CLASS, e as QUEUED_CLASS, h as SHOWN_CLASS, t as adoptTables, l as assignKeys, n as build, g as defaultConfig, u as entranceOf, c as layout, d as loadSources, s as prepare, p as readMarkdownRows, m as relabel, r as setShown, f as stepTo, i as unbuild };
|
|
1
|
+
export { h as PLACED_CLASS, g as PLOT_CLASS, _ as QUEUED_CLASS, v as SHOWN_CLASS, a as adoptTables, m as assignKeys, c as build, y as defaultConfig, n as entranceOf, l as layout, o as loadSources, i as prepare, s as readMarkdownRows, u as relabel, d as setShown, p as stepTo, f as unbuild } from "./tablechart-shared.mjs";
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
//#region src/js/functions/scale.d.ts
|
|
2
|
+
/** A break in the scale: values from `lo` to `hi` get `share` of the length, and the cut is at `gap`. */
|
|
3
|
+
interface Squeeze {
|
|
4
|
+
lo: number;
|
|
5
|
+
hi: number;
|
|
6
|
+
gap: number;
|
|
7
|
+
share: number;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/js/steps.d.ts
|
|
11
|
+
/** The steps of one chart: which step shows each row, column and annotation, and how many steps there are. */
|
|
12
|
+
interface StepPlan {
|
|
13
|
+
rows: {
|
|
14
|
+
step: number | null;
|
|
15
|
+
slot: number;
|
|
16
|
+
}[];
|
|
17
|
+
series: {
|
|
18
|
+
step: number | null;
|
|
19
|
+
}[];
|
|
20
|
+
/** A cell on a step of its own, by row and then by column. */
|
|
21
|
+
cells: {
|
|
22
|
+
step: number | null;
|
|
23
|
+
slot: number;
|
|
24
|
+
}[][];
|
|
25
|
+
notes: {
|
|
26
|
+
step: number | null;
|
|
27
|
+
after: number;
|
|
28
|
+
}[];
|
|
29
|
+
count: number;
|
|
30
|
+
/** The `data-fragment-index` of each step, if it asked for one, so a presentation can make a fragment for each. */
|
|
31
|
+
indexes: (string | null)[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Shows the chart up to step `step`, from 0 (only what has no step) to the number of steps (all of it).
|
|
35
|
+
* Says so with a `tablechart:step` event on the figure, unless `quietly`.
|
|
36
|
+
*/
|
|
37
|
+
declare const stepTo: (state: ChartState, step: number, quietly?: boolean) => void;
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/js/types.d.ts
|
|
40
|
+
/** How a line or an area runs from one point to the next. */
|
|
41
|
+
type Shape = "straight" | "step" | "smooth";
|
|
42
|
+
/** How a chart builds: each element grows from zero, or the chart is revealed in one movement. */
|
|
43
|
+
type Motion = "grow" | "sweep";
|
|
44
|
+
interface Cell {
|
|
45
|
+
raw: string;
|
|
46
|
+
/** As written, so its decimal places survive. Empty when the cell holds no number. */
|
|
47
|
+
number: string;
|
|
48
|
+
/** Text around the number, such as `%` or a footnote `*`, kept either side of the formatted number. */
|
|
49
|
+
prefix: string;
|
|
50
|
+
suffix: string;
|
|
51
|
+
/** No number, such as "n/a": no mark, and the label says what the cell says. Counts as zero. */
|
|
52
|
+
missing: boolean;
|
|
53
|
+
value: number;
|
|
54
|
+
}
|
|
55
|
+
interface Row extends Cell {
|
|
56
|
+
label: string;
|
|
57
|
+
key: string | null;
|
|
58
|
+
cells: Cell[];
|
|
59
|
+
/** Copied to everything drawn for the row, so one class styles all of it. */
|
|
60
|
+
classes: string[];
|
|
61
|
+
isTotal: boolean;
|
|
62
|
+
/** The stagger counts from here. */
|
|
63
|
+
slot: number;
|
|
64
|
+
}
|
|
65
|
+
interface Series {
|
|
66
|
+
name: string;
|
|
67
|
+
key: string | null;
|
|
68
|
+
/** `data-kind="focus"`, or bold in Markdown: the others are shown fainter. */
|
|
69
|
+
focus: boolean;
|
|
70
|
+
/** `data-marker` on the header, such as `square` or `diamond open`. */
|
|
71
|
+
marker: string | null;
|
|
72
|
+
line: "dashed" | "dotted" | null;
|
|
73
|
+
}
|
|
74
|
+
interface Segment extends Row {
|
|
75
|
+
from: number;
|
|
76
|
+
to: number;
|
|
77
|
+
kind: "bar" | "up" | "down" | "total";
|
|
78
|
+
}
|
|
79
|
+
/** Scales only, no pixel positions, so an annotation follows the data. */
|
|
80
|
+
interface Geometry {
|
|
81
|
+
rows: Row[];
|
|
82
|
+
segments: Segment[];
|
|
83
|
+
cx: (index: number) => number;
|
|
84
|
+
y: (value: number) => number;
|
|
85
|
+
barWidth: number;
|
|
86
|
+
barMax: number;
|
|
87
|
+
height: number;
|
|
88
|
+
/** viewBox units per screen pixel. */
|
|
89
|
+
unit: number;
|
|
90
|
+
labelHeight: number;
|
|
91
|
+
badgeHeight: number;
|
|
92
|
+
/** How many stagger steps the data takes, so commentary can land after it. */
|
|
93
|
+
after: number;
|
|
94
|
+
/** An annotation's number in the figure, from 1, set as `data-note` on its marks. Zero for the chart. */
|
|
95
|
+
note: number;
|
|
96
|
+
/** Where the break's mark goes, as a value. Null when the scale runs straight through. */
|
|
97
|
+
breakAt: number | null;
|
|
98
|
+
/** The break itself, for a chart that makes a scale of its own, such as a bar chart. */
|
|
99
|
+
squeeze: Squeeze | null;
|
|
100
|
+
/** The empty space where the scale jumps, in viewBox units. */
|
|
101
|
+
breakGap: number;
|
|
102
|
+
/** Where a bar chart is cut across, in viewBox units; set by its drawing. */
|
|
103
|
+
breakX?: number;
|
|
104
|
+
labels: "outside" | "inside";
|
|
105
|
+
/** Where a number inside its bar goes, from `--tablechart-value-align`; null for the chart's own default. */
|
|
106
|
+
insideAlign: "start" | "center" | "end" | null;
|
|
107
|
+
stacked: boolean;
|
|
108
|
+
shape: Shape;
|
|
109
|
+
/** Empty when the chart is not stacked or its kind shows no totals. */
|
|
110
|
+
totals: HTMLElement[];
|
|
111
|
+
svg: SVGSVGElement;
|
|
112
|
+
plot: HTMLElement;
|
|
113
|
+
/** Made by `build`; a chart only places them. */
|
|
114
|
+
values: HTMLElement[];
|
|
115
|
+
series: Series[];
|
|
116
|
+
seriesValues: HTMLElement[][];
|
|
117
|
+
/** Empty with one series. */
|
|
118
|
+
names: HTMLElement[];
|
|
119
|
+
/** A chart with its names beside the marks places these; one with them under the plot does not. */
|
|
120
|
+
categories: HTMLElement[];
|
|
121
|
+
centre: HTMLElement | null;
|
|
122
|
+
config: Config;
|
|
123
|
+
/** Numbers an annotation worked out, against the ones the author wrote. */
|
|
124
|
+
checks: Check[];
|
|
125
|
+
}
|
|
126
|
+
interface Check {
|
|
127
|
+
label: string;
|
|
128
|
+
computed: number;
|
|
129
|
+
stated: number;
|
|
130
|
+
agrees: boolean;
|
|
131
|
+
}
|
|
132
|
+
interface ChartType {
|
|
133
|
+
aspect?: number;
|
|
134
|
+
/** A row marked as a total goes in the middle rather than among the marks. */
|
|
135
|
+
centre?: boolean;
|
|
136
|
+
/** A break in the scale works here; a waterfall keeps its floating steps clear of it. */
|
|
137
|
+
breakable?: boolean;
|
|
138
|
+
stackable?: boolean;
|
|
139
|
+
/** A stack is a running sum, so each line follows the one under it; otherwise values below zero stack down from zero. */
|
|
140
|
+
running?: boolean;
|
|
141
|
+
totals?: boolean;
|
|
142
|
+
/** The sample in front of a legend name when it is not a line; the legend shows only when asked. */
|
|
143
|
+
swatch?: "box";
|
|
144
|
+
categories?: "under" | "beside";
|
|
145
|
+
series?: boolean;
|
|
146
|
+
/** With several series, always a legend, with a sample of this shape. */
|
|
147
|
+
legend?: "box";
|
|
148
|
+
headroom?: (geo: HeadroomInput) => number;
|
|
149
|
+
minHeight?: (input: {
|
|
150
|
+
labelHeight: number;
|
|
151
|
+
nameHeight: number;
|
|
152
|
+
unit: number;
|
|
153
|
+
rows: number;
|
|
154
|
+
series: number;
|
|
155
|
+
stacked: boolean;
|
|
156
|
+
}) => number;
|
|
157
|
+
/** Room under the baseline for numbers that hang below a mark near it. */
|
|
158
|
+
footroom?: (geo: HeadroomInput) => number;
|
|
159
|
+
/** Default: one bar per row from the baseline. */
|
|
160
|
+
segments?: (rows: Row[]) => Segment[];
|
|
161
|
+
draw: (geo: Geometry) => void;
|
|
162
|
+
}
|
|
163
|
+
interface HeadroomInput {
|
|
164
|
+
labelHeight: number;
|
|
165
|
+
badgeHeight: number;
|
|
166
|
+
hasAnnotations: boolean;
|
|
167
|
+
unit: number;
|
|
168
|
+
series: number;
|
|
169
|
+
focused: boolean;
|
|
170
|
+
stacked: boolean;
|
|
171
|
+
}
|
|
172
|
+
/** `create` runs before layout, so a translation script finds its text; `draw` only places it. */
|
|
173
|
+
interface AnnotationType {
|
|
174
|
+
create: (spec: HTMLElement, plot: HTMLElement) => HTMLElement | null;
|
|
175
|
+
draw: (spec: HTMLElement, badge: HTMLElement | null, geo: Geometry) => void;
|
|
176
|
+
}
|
|
177
|
+
interface ChartState {
|
|
178
|
+
figure: HTMLElement;
|
|
179
|
+
plot: HTMLElement;
|
|
180
|
+
svg: SVGSVGElement;
|
|
181
|
+
rows: Row[];
|
|
182
|
+
decimals: number;
|
|
183
|
+
type: ChartType;
|
|
184
|
+
values: HTMLElement[];
|
|
185
|
+
series: Series[];
|
|
186
|
+
seriesValues: HTMLElement[][];
|
|
187
|
+
names: HTMLElement[];
|
|
188
|
+
categories: HTMLElement[];
|
|
189
|
+
centre: HTMLElement | null;
|
|
190
|
+
stacked: boolean;
|
|
191
|
+
totals: HTMLElement[];
|
|
192
|
+
totalCell: HTMLElement | null;
|
|
193
|
+
/** In screen pixels from the plot's corner. Null for a chart whose rows are not side by side. */
|
|
194
|
+
rowAt: ((x: number, y: number) => number | null) | null;
|
|
195
|
+
/** As percentages: left, top, width and height. */
|
|
196
|
+
rowBox: ((index: number) => [number, number, number, number]) | null;
|
|
197
|
+
annotations: {
|
|
198
|
+
spec: HTMLElement;
|
|
199
|
+
type: AnnotationType;
|
|
200
|
+
badge: HTMLElement | null;
|
|
201
|
+
/** From 0; `data-series` counts from 1. */
|
|
202
|
+
series: number;
|
|
203
|
+
after: number;
|
|
204
|
+
}[];
|
|
205
|
+
/** The steps of a chart that steps (`data-fragment`); null for one that does not. */
|
|
206
|
+
plan: StepPlan | null;
|
|
207
|
+
/** How many steps are shown. */
|
|
208
|
+
step: number;
|
|
209
|
+
/** The Previous and Next buttons, if Tablechart made them. */
|
|
210
|
+
controls: HTMLElement | null;
|
|
211
|
+
checks: Check[];
|
|
212
|
+
}
|
|
213
|
+
//#endregion
|
|
214
|
+
//#region src/js/config.d.ts
|
|
215
|
+
declare const PLOT_CLASS = "tablechart-plot";
|
|
216
|
+
declare const PLACED_CLASS = "is-placed";
|
|
217
|
+
declare const SHOWN_CLASS = "is-shown";
|
|
218
|
+
declare const QUEUED_CLASS = "tablechart-queued";
|
|
219
|
+
interface Config {
|
|
220
|
+
/** Which elements Tablechart turns into charts. */
|
|
221
|
+
selector: string;
|
|
222
|
+
/** Height of the plot as a share of its width. */
|
|
223
|
+
aspect: number;
|
|
224
|
+
/** Share of a band that a bar fills. */
|
|
225
|
+
barfill: number;
|
|
226
|
+
/** Share of a donut's radius that the ring itself takes. */
|
|
227
|
+
ringfill: number;
|
|
228
|
+
/** Locale for numbers. Unset, the document's language is used and followed when it changes. */
|
|
229
|
+
locale?: string;
|
|
230
|
+
/** Animate a chart when it builds. `"grow"` grows each element from zero, `"sweep"` reveals the chart in one movement; a figure overrides it with `data-chart-animate`. `"up"` and `"across"` are their old names. */
|
|
231
|
+
animate: boolean | Motion | "across" | "up";
|
|
232
|
+
/** How far an animated parent is in before its chart builds: 0 when it starts moving, 1 when it is in. A figure overrides it with `data-chart-entrance`. */
|
|
233
|
+
entrance: number;
|
|
234
|
+
/** Where a column's number goes: on the bar, or inside it. A figure overrides it with `data-chart-labels`. */
|
|
235
|
+
labels: "outside" | "inside";
|
|
236
|
+
/** How a line or area runs between points: `straight`, `step` or `smooth`. A figure overrides it with `data-chart-shape`. */
|
|
237
|
+
shape: "straight" | "step" | "smooth";
|
|
238
|
+
/** Names of several lines in a legend instead of at the end of each line. A figure overrides it with `data-chart-legend`. */
|
|
239
|
+
legend: boolean;
|
|
240
|
+
/** Pointing at a row shows numbers that were left out for lack of room. A figure turns it off with `data-chart-hover="false"`. */
|
|
241
|
+
hover: boolean;
|
|
242
|
+
/** The name of the total that a donut without a total row works out, for screen readers. */
|
|
243
|
+
totallabel: string;
|
|
244
|
+
/** Previous and Next buttons under a chart that steps (`data-fragment`). `false` leaves them out, for buttons of your own. */
|
|
245
|
+
controls: boolean;
|
|
246
|
+
/** The text of the Previous button. */
|
|
247
|
+
previouslabel: string;
|
|
248
|
+
/** The text of the Next button. */
|
|
249
|
+
nextlabel: string;
|
|
250
|
+
/** Read by screen readers after the text of each button, so they know it only changes the chart. */
|
|
251
|
+
stephint: string;
|
|
252
|
+
/** How much of a chart must be in view before it builds, from 0 to 1. */
|
|
253
|
+
threshold: number;
|
|
254
|
+
/** Build again each time a chart scrolls back into view, not only the first time. */
|
|
255
|
+
replay: boolean;
|
|
256
|
+
/** The attribute for translation keys, for a translation script. `false` turns keys off. */
|
|
257
|
+
langattribute: string | false;
|
|
258
|
+
/** Show messages in the console for whoever is working on the page. */
|
|
259
|
+
debug?: boolean;
|
|
260
|
+
}
|
|
261
|
+
declare const defaultConfig: Config;
|
|
262
|
+
//#endregion
|
|
263
|
+
//#region src/js/init.d.ts
|
|
264
|
+
interface TablechartChart {
|
|
265
|
+
figure: HTMLElement;
|
|
266
|
+
/** Lays the chart out again, for example after a script has changed its text. */
|
|
267
|
+
refresh(): void;
|
|
268
|
+
/** Stops watching scroll, size and language. The chart stays as it is. */
|
|
269
|
+
destroy(): void;
|
|
270
|
+
/** On a chart that steps (`data-fragment`): shows one step more. */
|
|
271
|
+
next(): void;
|
|
272
|
+
/** On a chart that steps: shows one step less. */
|
|
273
|
+
previous(): void;
|
|
274
|
+
/** On a chart that steps: shows the chart up to `step`, from 0 to `steps`. */
|
|
275
|
+
stepTo(step: number): void;
|
|
276
|
+
/** How many steps are shown. */
|
|
277
|
+
readonly step: number;
|
|
278
|
+
/** How many steps the chart has; 0 for a chart that does not step. */
|
|
279
|
+
readonly steps: number;
|
|
280
|
+
}
|
|
281
|
+
interface TablechartInstance {
|
|
282
|
+
charts: TablechartChart[];
|
|
283
|
+
/** Lays out every chart again, for example after a script has changed its text. */
|
|
284
|
+
refresh(): void;
|
|
285
|
+
/** Stops watching scroll, size and language. The charts stay as they are. */
|
|
286
|
+
destroy(): void;
|
|
287
|
+
}
|
|
288
|
+
declare global {
|
|
289
|
+
interface HTMLElement {
|
|
290
|
+
tablechart?: TablechartChart;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
/** How far an animated parent is in before the chart builds: the figure's `data-chart-entrance`, or else the option. */
|
|
294
|
+
declare const entranceOf: (figure: HTMLElement, config: Config) => number;
|
|
295
|
+
/** Turns elements into figures with a table and translation keys, all at once, so duplicate keys are found. */
|
|
296
|
+
declare const prepare: (found: HTMLElement[], config: Config) => Promise<HTMLElement[]>;
|
|
297
|
+
/** Makes a chart of one element; returns the existing chart if there is one, or null without data. */
|
|
298
|
+
declare const create: (element: HTMLElement, options?: Partial<Config>) => Promise<TablechartChart | null>;
|
|
299
|
+
/** Makes a chart of every element in `root` that matches the selector, skipping existing charts. */
|
|
300
|
+
declare const init: (options?: Partial<Config>, root?: ParentNode) => Promise<TablechartInstance>;
|
|
301
|
+
//#endregion
|
|
302
|
+
export { stepTo as _, init as a, PLACED_CLASS as c, SHOWN_CLASS as d, defaultConfig as f, StepPlan as g, Series as h, entranceOf as i, PLOT_CLASS as l, Row as m, TablechartInstance as n, prepare as o, ChartState as p, create as r, Config as s, TablechartChart as t, QUEUED_CLASS as u };
|