@umriss-ui/charts 0.5.0 → 0.6.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 +31 -0
- package/README.md +13 -2
- package/dist/charts.css +1 -1
- package/dist/charts.js +2008 -1598
- package/dist/de.d.ts +29 -0
- package/dist/index.d.ts +33 -2
- package/dist/wording/de.d.ts +2 -0
- package/dist/wording/de.js +13 -0
- package/package.json +6 -2
package/dist/de.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
declare interface ChartsWording {
|
|
2
|
+
/** What a screen reader calls the plot area that takes the keys
|
|
3
|
+
(`aria-roledescription`). */
|
|
4
|
+
roleDescription: string;
|
|
5
|
+
/** Shown in the plot area when no visible series has a point to show. */
|
|
6
|
+
empty: string;
|
|
7
|
+
/** The summary's visible series, by name. */
|
|
8
|
+
seriesList: (names: readonly string[]) => string;
|
|
9
|
+
/** The summary's visible stretch of the x axis, both ends formatted. */
|
|
10
|
+
visibleRange: (from: string, to: string) => string;
|
|
11
|
+
/** The summary's lowest and highest value of one series in that stretch. */
|
|
12
|
+
seriesExtent: (name: string, min: string, max: string) => string;
|
|
13
|
+
/** What is read after a key: the position, then each series with its value
|
|
14
|
+
(and its own x where it stands on another x axis), the emphasised one
|
|
15
|
+
first. */
|
|
16
|
+
readout: (x: string, rows: readonly {
|
|
17
|
+
name: string;
|
|
18
|
+
value: string;
|
|
19
|
+
x: string;
|
|
20
|
+
}[]) => string;
|
|
21
|
+
/** The keys that walk the chart. */
|
|
22
|
+
walkHelp: string;
|
|
23
|
+
/** The keys that zoom and pan it - only where the chart can be zoomed. */
|
|
24
|
+
zoomHelp: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export declare const GERMAN_CHARTS_WORDING: ChartsWording;
|
|
28
|
+
|
|
29
|
+
export { }
|
package/dist/index.d.ts
CHANGED
|
@@ -211,9 +211,12 @@ export declare interface ChartProps<T> {
|
|
|
211
211
|
style?: CSSProperties;
|
|
212
212
|
/** Shown in the middle of the plot area when no visible series has a point
|
|
213
213
|
to show - no data, only gaps, or every series hidden. Axes and frame
|
|
214
|
-
stay. Without a value
|
|
215
|
-
caller's. */
|
|
214
|
+
stay. Without a value the wording's `empty`; this prop wins over it. */
|
|
216
215
|
empty?: ReactNode;
|
|
216
|
+
/** The chart's words (ADR-0031): English without a value, entries left out
|
|
217
|
+
fall back to English. German: `GERMAN_CHARTS_WORDING` from
|
|
218
|
+
`@umriss-ui/charts/wording/de`. */
|
|
219
|
+
wording?: Partial<ChartsWording>;
|
|
217
220
|
/** Charts with the same id share the pointer's x position, in domain units:
|
|
218
221
|
each draws its crosshair there, the tooltip stays with the chart under
|
|
219
222
|
the pointer. Zoom is not shared - give every chart the same controlled
|
|
@@ -227,6 +230,32 @@ export declare interface ChartProps<T> {
|
|
|
227
230
|
children?: ReactNode;
|
|
228
231
|
}
|
|
229
232
|
|
|
233
|
+
export declare interface ChartsWording {
|
|
234
|
+
/** What a screen reader calls the plot area that takes the keys
|
|
235
|
+
(`aria-roledescription`). */
|
|
236
|
+
roleDescription: string;
|
|
237
|
+
/** Shown in the plot area when no visible series has a point to show. */
|
|
238
|
+
empty: string;
|
|
239
|
+
/** The summary's visible series, by name. */
|
|
240
|
+
seriesList: (names: readonly string[]) => string;
|
|
241
|
+
/** The summary's visible stretch of the x axis, both ends formatted. */
|
|
242
|
+
visibleRange: (from: string, to: string) => string;
|
|
243
|
+
/** The summary's lowest and highest value of one series in that stretch. */
|
|
244
|
+
seriesExtent: (name: string, min: string, max: string) => string;
|
|
245
|
+
/** What is read after a key: the position, then each series with its value
|
|
246
|
+
(and its own x where it stands on another x axis), the emphasised one
|
|
247
|
+
first. */
|
|
248
|
+
readout: (x: string, rows: readonly {
|
|
249
|
+
name: string;
|
|
250
|
+
value: string;
|
|
251
|
+
x: string;
|
|
252
|
+
}[]) => string;
|
|
253
|
+
/** The keys that walk the chart. */
|
|
254
|
+
walkHelp: string;
|
|
255
|
+
/** The keys that zoom and pan it - only where the chart can be zoomed. */
|
|
256
|
+
zoomHelp: string;
|
|
257
|
+
}
|
|
258
|
+
|
|
230
259
|
declare interface CommonProps {
|
|
231
260
|
/** Axis on which the value lies. Without one, the first axis of the
|
|
232
261
|
orientation. */
|
|
@@ -356,6 +385,8 @@ export declare function controlLimits(values: readonly number[], origin: Control
|
|
|
356
385
|
|
|
357
386
|
export declare const DAY: number;
|
|
358
387
|
|
|
388
|
+
export declare const DEFAULT_CHARTS_WORDING: ChartsWording;
|
|
389
|
+
|
|
359
390
|
/** Default gradient: a sequential set, light to dark, so that it stays readable
|
|
360
391
|
as an order of lightness even without colour. It is a default, not a
|
|
361
392
|
restriction - whoever has a scale of their own names it. */
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const t = {
|
|
2
|
+
roleDescription: "Diagramm",
|
|
3
|
+
empty: "Keine Daten",
|
|
4
|
+
seriesList: (e) => `${e.length === 1 ? "1 Serie" : `${e.length} Serien`}: ${e.join(", ")}.`,
|
|
5
|
+
visibleRange: (e, n) => `Von ${e} bis ${n}.`,
|
|
6
|
+
seriesExtent: (e, n, i) => `${e} von ${n} bis ${i}.`,
|
|
7
|
+
readout: (e, n) => [`${e}.`, ...n.map((i) => `${i.name} ${i.value}${i.x === "" ? "" : ` bei ${i.x}`}.`)].join(" "),
|
|
8
|
+
walkHelp: "Pfeil links und rechts gehen durch die Werte, Pfeil hoch und runter wechseln die Serie, Pos1 und Ende springen zum ersten und letzten Wert, Escape hebt die Markierung auf.",
|
|
9
|
+
zoomHelp: "Plus und Minus zoomen, Umschalt mit Pfeil links oder rechts verschiebt, 0 zeigt alles."
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
t as GERMAN_CHARTS_WORDING
|
|
13
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umriss-ui/charts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Canvas-based chart library - few chart kinds, uncompromisingly clean, high performance.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Roman Händler",
|
|
@@ -39,6 +39,10 @@
|
|
|
39
39
|
"types": "./dist/index.d.ts",
|
|
40
40
|
"import": "./dist/charts.js"
|
|
41
41
|
},
|
|
42
|
+
"./wording/de": {
|
|
43
|
+
"types": "./dist/de.d.ts",
|
|
44
|
+
"import": "./dist/wording/de.js"
|
|
45
|
+
},
|
|
42
46
|
"./styles.css": "./dist/charts.css"
|
|
43
47
|
},
|
|
44
48
|
"peerDependencies": {
|
|
@@ -58,7 +62,7 @@
|
|
|
58
62
|
"vite": "^6.0.0",
|
|
59
63
|
"vite-plugin-dts": "^4.3.0",
|
|
60
64
|
"@umriss-ui/demo": "0.0.0",
|
|
61
|
-
"@umriss-ui/core": "0.
|
|
65
|
+
"@umriss-ui/core": "0.9.2"
|
|
62
66
|
},
|
|
63
67
|
"scripts": {
|
|
64
68
|
"props": "node --disable-warning=ExperimentalWarning --experimental-strip-types demo/props.ts",
|