@martinomagnifico/tablechart 0.1.2 → 1.0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.0.0] - 2026-10-10
4
+
5
+ Now at version 1!
6
+
7
+ ### Added
8
+
9
+ - Scale break on bar charts.
10
+ - `--tablechart-break-gap` for the space between the lines of a scale break.
11
+ - Step by step charts with `data-fragment`, with Previous and Next buttons and a small API. Moved from reveal.js-tablechart.
12
+ - The `closing` option and `data-chart-closing` for the last total of a waterfall.
13
+ - `--tablechart-inside-align` for numbers inside bars: `start`, `center` or `end`.
14
+
15
+ ### Changed
16
+
17
+ - The last total of a waterfall grows down from the step before it.
18
+ - Some styling changes for bar and column values.
19
+ - Waterfall connectors draw from left to right, and wait for both columns they join.
20
+ - A line or area is now a single path, revealed by a clip. Dashes keep their pattern, areas have no seams.
21
+ - Scale break lines are solid by default, with round ends.
22
+ - The zigzag of a scale break is now one up-down-up across each column, and right-left-right for bars.
23
+ - No scale break on line and area charts. Those were uncomprehensible.
24
+
25
+ ### Fixed
26
+
27
+ - Scale breaks on grouped column charts cut each column at its own width.
28
+
29
+
30
+
31
+
32
+ ## [0.1.3] - 2026-10-07
33
+
34
+ ### Fixed
35
+
36
+ - Fixed a layout issue with aspect ratio.
37
+
38
+
39
+
3
40
  ## [0.1.2] - 2026-10-07
4
41
 
5
42
  ### Added
@@ -53,6 +53,12 @@ export declare interface ChartState {
53
53
  series: number;
54
54
  after: number;
55
55
  }[];
56
+ /** The steps of a chart that steps (`data-fragment`); null for one that does not. */
57
+ plan: StepPlan | null;
58
+ /** How many steps are shown. */
59
+ step: number;
60
+ /** The Previous and Next buttons, if Tablechart made them. */
61
+ controls: HTMLElement | null;
56
62
  checks: Check[];
57
63
  }
58
64
 
@@ -112,12 +118,22 @@ export declare interface Config {
112
118
  labels: "outside" | "inside";
113
119
  /** How a line or area runs between points: `straight`, `step` or `smooth`. A figure overrides it with `data-chart-shape`. */
114
120
  shape: "straight" | "step" | "smooth";
121
+ /** How the closing total of a waterfall grows: `down` from the step before it to the baseline, or `up` from the baseline. A figure overrides it with `data-chart-closing`. */
122
+ closing: "down" | "up";
115
123
  /** Names of several lines in a legend instead of at the end of each line. A figure overrides it with `data-chart-legend`. */
116
124
  legend: boolean;
117
125
  /** Pointing at a row shows numbers that were left out for lack of room. A figure turns it off with `data-chart-hover="false"`. */
118
126
  hover: boolean;
119
127
  /** The name of the total that a donut without a total row works out, for screen readers. */
120
128
  totallabel: string;
129
+ /** Previous and Next buttons under a chart that steps (`data-fragment`). `false` leaves them out, for buttons of your own. */
130
+ controls: boolean;
131
+ /** The text of the Previous button. */
132
+ previouslabel: string;
133
+ /** The text of the Next button. */
134
+ nextlabel: string;
135
+ /** Read by screen readers after the text of each button, so they know it only changes the chart. */
136
+ stephint: string;
121
137
  /** How much of a chart must be in view before it builds, from 0 to 1. */
122
138
  threshold: number;
123
139
  /** Build again each time a chart scrolls back into view, not only the first time. */
@@ -152,7 +168,16 @@ declare interface Geometry {
152
168
  note: number;
153
169
  /** Where the break's mark goes, as a value. Null when the scale runs straight through. */
154
170
  breakAt: number | null;
171
+ /** The break itself, for a chart that makes a scale of its own, such as a bar chart. */
172
+ squeeze: Squeeze | null;
173
+ /** The empty space where the scale jumps, in viewBox units. */
174
+ breakGap: number;
175
+ /** Where a bar chart is cut across, in viewBox units; set by its drawing. */
176
+ breakX?: number;
155
177
  labels: "outside" | "inside";
178
+ closing: "down" | "up";
179
+ /** Where a number inside its bar goes, from `--tablechart-inside-align`; null for the chart's own default. */
180
+ insideAlign: "start" | "center" | "end" | null;
156
181
  stacked: boolean;
157
182
  shape: Shape;
158
183
  /** Empty when the chart is not stacked or its kind shows no totals. */
@@ -239,6 +264,38 @@ declare type Shape = "straight" | "step" | "smooth";
239
264
 
240
265
  export declare const SHOWN_CLASS = "is-shown";
241
266
 
267
+ /** A break in the scale: values from `lo` to `hi` get `share` of the length, and the cut is at `gap`. */
268
+ declare interface Squeeze {
269
+ lo: number;
270
+ hi: number;
271
+ gap: number;
272
+ share: number;
273
+ }
274
+
275
+ /** The steps of one chart: which step shows each row, column and annotation, and how many steps there are. */
276
+ export declare interface StepPlan {
277
+ rows: {
278
+ step: number | null;
279
+ slot: number;
280
+ }[];
281
+ series: {
282
+ step: number | null;
283
+ }[];
284
+ notes: {
285
+ step: number | null;
286
+ after: number;
287
+ }[];
288
+ count: number;
289
+ /** The `data-fragment-index` of each step, if it asked for one, so a presentation can make a fragment for each. */
290
+ indexes: (string | null)[];
291
+ }
292
+
293
+ /**
294
+ * Shows the chart up to step `step`, from 0 (only what has no step) to the number of steps (all of it).
295
+ * Says so with a `tablechart:step` event on the figure, unless `quietly`.
296
+ */
297
+ export declare const stepTo: (state: ChartState, step: number, quietly?: boolean) => void;
298
+
242
299
  /** Removes what `build` added, so the chart can be built again. */
243
300
  export declare const unbuild: (state: ChartState) => void;
244
301
 
@@ -1,2 +1,2 @@
1
- import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, s as p, u as m, v as h } from "./tablechart-shared.mjs";
2
- export { l as PLACED_CLASS, o as PLOT_CLASS, a as QUEUED_CLASS, e as SHOWN_CLASS, t as adoptTables, f as assignKeys, n as build, h as defaultConfig, u as entranceOf, c as layout, d as loadSources, s as prepare, p as readMarkdownRows, m as relabel, r as setShown, i as unbuild };
1
+ import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, s as p, u as m, v as h, y as g } from "./tablechart-shared.mjs";
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 };