@orianatech/pire 0.10.0 → 0.11.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/dist/components/data/BarChart.d.cts +32 -0
- package/dist/components/data/BarChart.d.ts +33 -0
- package/dist/components/data/BarChart.d.ts.map +1 -0
- package/dist/components/data/ChartFrame.d.cts +62 -0
- package/dist/components/data/ChartFrame.d.ts +63 -0
- package/dist/components/data/ChartFrame.d.ts.map +1 -0
- package/dist/components/data/DonutChart.d.cts +26 -0
- package/dist/components/data/DonutChart.d.ts +27 -0
- package/dist/components/data/DonutChart.d.ts.map +1 -0
- package/dist/components/data/LineChart.d.cts +29 -0
- package/dist/components/data/LineChart.d.ts +30 -0
- package/dist/components/data/LineChart.d.ts.map +1 -0
- package/dist/components/data/chartGeometry.d.cts +67 -0
- package/dist/components/data/chartGeometry.d.ts +68 -0
- package/dist/components/data/chartGeometry.d.ts.map +1 -0
- package/dist/components.css +90 -0
- package/dist/i18n/messages.d.cts +6 -0
- package/dist/i18n/messages.d.ts +6 -0
- package/dist/i18n/messages.d.ts.map +1 -1
- package/dist/index.cjs +574 -71
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +570 -71
- package/dist/index.js.map +1 -1
- package/dist/tokens/colors.css +36 -3
- package/dist/tokens/themes.css +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { ChartBaseProps } from './ChartFrame.cjs';
|
|
3
|
+
export interface BarChartProps extends ChartBaseProps {
|
|
4
|
+
/**
|
|
5
|
+
* `horizontal` puts categories down the side, which is what long ERP labels need — product
|
|
6
|
+
* names and account descriptions do not fit under a vertical bar without turning sideways.
|
|
7
|
+
* Use `vertical` when the categories are periods and reading left-to-right means time.
|
|
8
|
+
*/
|
|
9
|
+
orientation?: 'horizontal' | 'vertical';
|
|
10
|
+
/**
|
|
11
|
+
* Stack the series into one bar per category, for parts of a total.
|
|
12
|
+
*
|
|
13
|
+
* Only the first segment and the total are easy to compare across categories, because the
|
|
14
|
+
* middle segments start at different offsets. If the comparison matters more than the total,
|
|
15
|
+
* leave this off and let the bars sit side by side.
|
|
16
|
+
*/
|
|
17
|
+
stacked?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Print each value beside its bar. Defaults on for a single series — where the chart is a
|
|
20
|
+
* ranking and the number is half the answer — and off beyond that, where a label per bar
|
|
21
|
+
* turns into noise. The tooltip and the data table always carry every value.
|
|
22
|
+
*/
|
|
23
|
+
showValues?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Magnitude and ranking — how big, and in what order.
|
|
27
|
+
*
|
|
28
|
+
* Laid out in HTML rather than SVG so category labels are real text: they wrap, truncate and
|
|
29
|
+
* inherit type tokens, none of which survives a scaled `viewBox`. The bar axis always starts at
|
|
30
|
+
* zero, since a bar encodes length, and a truncated axis overstates the difference.
|
|
31
|
+
*/
|
|
32
|
+
export declare function BarChart({ categories, series: rawSeries, title, description, formatValue, height, emptyState, showDataTable, orientation, stacked, showValues, className, style, ...rest }: BarChartProps): React.JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { ChartBaseProps } from './ChartFrame.js';
|
|
3
|
+
export interface BarChartProps extends ChartBaseProps {
|
|
4
|
+
/**
|
|
5
|
+
* `horizontal` puts categories down the side, which is what long ERP labels need — product
|
|
6
|
+
* names and account descriptions do not fit under a vertical bar without turning sideways.
|
|
7
|
+
* Use `vertical` when the categories are periods and reading left-to-right means time.
|
|
8
|
+
*/
|
|
9
|
+
orientation?: 'horizontal' | 'vertical';
|
|
10
|
+
/**
|
|
11
|
+
* Stack the series into one bar per category, for parts of a total.
|
|
12
|
+
*
|
|
13
|
+
* Only the first segment and the total are easy to compare across categories, because the
|
|
14
|
+
* middle segments start at different offsets. If the comparison matters more than the total,
|
|
15
|
+
* leave this off and let the bars sit side by side.
|
|
16
|
+
*/
|
|
17
|
+
stacked?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Print each value beside its bar. Defaults on for a single series — where the chart is a
|
|
20
|
+
* ranking and the number is half the answer — and off beyond that, where a label per bar
|
|
21
|
+
* turns into noise. The tooltip and the data table always carry every value.
|
|
22
|
+
*/
|
|
23
|
+
showValues?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Magnitude and ranking — how big, and in what order.
|
|
27
|
+
*
|
|
28
|
+
* Laid out in HTML rather than SVG so category labels are real text: they wrap, truncate and
|
|
29
|
+
* inherit type tokens, none of which survives a scaled `viewBox`. The bar axis always starts at
|
|
30
|
+
* zero, since a bar encodes length, and a truncated axis overstates the difference.
|
|
31
|
+
*/
|
|
32
|
+
export declare function BarChart({ categories, series: rawSeries, title, description, formatValue, height, emptyState, showDataTable, orientation, stacked, showValues, className, style, ...rest }: BarChartProps): React.JSX.Element;
|
|
33
|
+
//# sourceMappingURL=BarChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarChart.d.ts","sourceRoot":"","sources":["../../../src/components/data/BarChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAQnD,MAAM,WAAW,aAAc,SAAQ,cAAc;IACnD;;;;OAIG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EACvB,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,WAAgC,EACnF,MAAY,EAAE,UAAU,EAAE,aAAa,EAAE,WAA0B,EAAE,OAAe,EACpF,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,EACtC,EAAE,aAAa,qBAoFf"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { ChartSeries } from './chartGeometry.cjs';
|
|
3
|
+
/** Props every chart shares. Each chart adds its own encoding options on top. */
|
|
4
|
+
export interface ChartBaseProps {
|
|
5
|
+
/**
|
|
6
|
+
* What the chart shows, in a sentence. Required: a chart with no accessible name is
|
|
7
|
+
* an unlabelled image, and the visible title cannot be relied on — charts are often
|
|
8
|
+
* placed under a heading that already says something different.
|
|
9
|
+
*/
|
|
10
|
+
'aria-label': string;
|
|
11
|
+
/** Category axis labels. `series[].values` line up with these by index. */
|
|
12
|
+
categories: string[];
|
|
13
|
+
series: ChartSeries[];
|
|
14
|
+
/** Shown above the plot. With a single series this is what names it, in place of a legend. */
|
|
15
|
+
title?: React.ReactNode;
|
|
16
|
+
/** Sits under the title in secondary ink — units, period, source. */
|
|
17
|
+
description?: React.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Formats every number that reaches a human: axis ticks, tooltips, the data table.
|
|
20
|
+
* Pire does not format — only the app knows the currency, the locale and the precision.
|
|
21
|
+
*/
|
|
22
|
+
formatValue?: (value: number) => string;
|
|
23
|
+
/** Plot height in pixels. Width always fills the container. */
|
|
24
|
+
height?: number;
|
|
25
|
+
/** Replaces the plot when there is nothing to draw. */
|
|
26
|
+
emptyState?: React.ReactNode;
|
|
27
|
+
/** Renders the underlying table visibly beneath the plot, instead of only for screen readers. */
|
|
28
|
+
showDataTable?: boolean;
|
|
29
|
+
className?: string;
|
|
30
|
+
style?: React.CSSProperties;
|
|
31
|
+
}
|
|
32
|
+
/** One swatch in the legend. What it identifies differs by chart — see `ChartFrameProps.legend`. */
|
|
33
|
+
export interface ChartLegendItem {
|
|
34
|
+
key: string;
|
|
35
|
+
label: string;
|
|
36
|
+
color: string;
|
|
37
|
+
}
|
|
38
|
+
export interface ChartFrameProps extends Pick<ChartBaseProps, 'title' | 'description' | 'categories' | 'series' | 'showDataTable' | 'className' | 'style'> {
|
|
39
|
+
label: string;
|
|
40
|
+
formatValue: (value: number) => string;
|
|
41
|
+
/**
|
|
42
|
+
* Rendered only when there are at least two entries — one thing needs no key to tell it from
|
|
43
|
+
* the others, and the title already names it.
|
|
44
|
+
*
|
|
45
|
+
* The chart decides what an entry stands for: bars and lines colour by series, a donut colours
|
|
46
|
+
* by segment. Passing the list ready-made keeps that decision with the chart that made it.
|
|
47
|
+
*/
|
|
48
|
+
legend?: ChartLegendItem[];
|
|
49
|
+
children: React.ReactNode;
|
|
50
|
+
}
|
|
51
|
+
/** Legend entries for a chart that colours by series — bars and lines. */
|
|
52
|
+
export declare function seriesLegend(series: ChartSeries[]): ChartLegendItem[];
|
|
53
|
+
/** Falls back to the browser's grouping so large figures stay readable without configuration. */
|
|
54
|
+
export declare const defaultFormatValue: (value: number) => string;
|
|
55
|
+
/**
|
|
56
|
+
* The shell around every Pire chart: heading, legend, plot, and the data table.
|
|
57
|
+
*
|
|
58
|
+
* The table is always in the DOM. A chart summarised in prose tells a screen-reader user what
|
|
59
|
+
* someone else concluded; the table gives them the same numbers everyone else is looking at.
|
|
60
|
+
* `showDataTable` only decides whether it is also visible.
|
|
61
|
+
*/
|
|
62
|
+
export declare function ChartFrame({ label, title, description, categories, series, formatValue, legend, showDataTable, className, style, children, }: ChartFrameProps): React.JSX.Element;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { ChartSeries } from './chartGeometry.js';
|
|
3
|
+
/** Props every chart shares. Each chart adds its own encoding options on top. */
|
|
4
|
+
export interface ChartBaseProps {
|
|
5
|
+
/**
|
|
6
|
+
* What the chart shows, in a sentence. Required: a chart with no accessible name is
|
|
7
|
+
* an unlabelled image, and the visible title cannot be relied on — charts are often
|
|
8
|
+
* placed under a heading that already says something different.
|
|
9
|
+
*/
|
|
10
|
+
'aria-label': string;
|
|
11
|
+
/** Category axis labels. `series[].values` line up with these by index. */
|
|
12
|
+
categories: string[];
|
|
13
|
+
series: ChartSeries[];
|
|
14
|
+
/** Shown above the plot. With a single series this is what names it, in place of a legend. */
|
|
15
|
+
title?: React.ReactNode;
|
|
16
|
+
/** Sits under the title in secondary ink — units, period, source. */
|
|
17
|
+
description?: React.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Formats every number that reaches a human: axis ticks, tooltips, the data table.
|
|
20
|
+
* Pire does not format — only the app knows the currency, the locale and the precision.
|
|
21
|
+
*/
|
|
22
|
+
formatValue?: (value: number) => string;
|
|
23
|
+
/** Plot height in pixels. Width always fills the container. */
|
|
24
|
+
height?: number;
|
|
25
|
+
/** Replaces the plot when there is nothing to draw. */
|
|
26
|
+
emptyState?: React.ReactNode;
|
|
27
|
+
/** Renders the underlying table visibly beneath the plot, instead of only for screen readers. */
|
|
28
|
+
showDataTable?: boolean;
|
|
29
|
+
className?: string;
|
|
30
|
+
style?: React.CSSProperties;
|
|
31
|
+
}
|
|
32
|
+
/** One swatch in the legend. What it identifies differs by chart — see `ChartFrameProps.legend`. */
|
|
33
|
+
export interface ChartLegendItem {
|
|
34
|
+
key: string;
|
|
35
|
+
label: string;
|
|
36
|
+
color: string;
|
|
37
|
+
}
|
|
38
|
+
export interface ChartFrameProps extends Pick<ChartBaseProps, 'title' | 'description' | 'categories' | 'series' | 'showDataTable' | 'className' | 'style'> {
|
|
39
|
+
label: string;
|
|
40
|
+
formatValue: (value: number) => string;
|
|
41
|
+
/**
|
|
42
|
+
* Rendered only when there are at least two entries — one thing needs no key to tell it from
|
|
43
|
+
* the others, and the title already names it.
|
|
44
|
+
*
|
|
45
|
+
* The chart decides what an entry stands for: bars and lines colour by series, a donut colours
|
|
46
|
+
* by segment. Passing the list ready-made keeps that decision with the chart that made it.
|
|
47
|
+
*/
|
|
48
|
+
legend?: ChartLegendItem[];
|
|
49
|
+
children: React.ReactNode;
|
|
50
|
+
}
|
|
51
|
+
/** Legend entries for a chart that colours by series — bars and lines. */
|
|
52
|
+
export declare function seriesLegend(series: ChartSeries[]): ChartLegendItem[];
|
|
53
|
+
/** Falls back to the browser's grouping so large figures stay readable without configuration. */
|
|
54
|
+
export declare const defaultFormatValue: (value: number) => string;
|
|
55
|
+
/**
|
|
56
|
+
* The shell around every Pire chart: heading, legend, plot, and the data table.
|
|
57
|
+
*
|
|
58
|
+
* The table is always in the DOM. A chart summarised in prose tells a screen-reader user what
|
|
59
|
+
* someone else concluded; the table gives them the same numbers everyone else is looking at.
|
|
60
|
+
* `showDataTable` only decides whether it is also visible.
|
|
61
|
+
*/
|
|
62
|
+
export declare function ChartFrame({ label, title, description, categories, series, formatValue, legend, showDataTable, className, style, children, }: ChartFrameProps): React.JSX.Element;
|
|
63
|
+
//# sourceMappingURL=ChartFrame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartFrame.d.ts","sourceRoot":"","sources":["../../../src/components/data/ChartFrame.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAKnD,iFAAiF;AACjF,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,8FAA8F;IAC9F,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,qEAAqE;IACrE,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,iGAAiG;IACjG,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,oGAAoG;AACpG,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAgB,SAC/B,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,aAAa,GAAG,YAAY,GAAG,QAAQ,GAAG,eAAe,GACpF,WAAW,GAAG,OAAO,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,eAAe,EAAE,CAAC;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,0EAA0E;AAC1E,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,eAAe,EAAE,CAIrE;AAED,iGAAiG;AACjG,eAAO,MAAM,kBAAkB,UAAW,MAAM,KAAG,MAAgC,CAAC;AAEpF;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EACjF,SAAS,EAAE,KAAK,EAAE,QAAQ,GAC3B,EAAE,eAAe,qBAuDjB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ChartBaseProps } from './ChartFrame.cjs';
|
|
3
|
+
export interface DonutChartProps extends ChartBaseProps {
|
|
4
|
+
/**
|
|
5
|
+
* What sits in the hole. Defaults to the total of every segment, which is the number a
|
|
6
|
+
* part-to-whole chart is implicitly about. Hovering a segment replaces it with that segment.
|
|
7
|
+
*/
|
|
8
|
+
centerLabel?: React.ReactNode;
|
|
9
|
+
/** Caption under the centre figure — "Total", "Invoiced", whatever the total means. */
|
|
10
|
+
centerCaption?: React.ReactNode;
|
|
11
|
+
/** Ring thickness in pixels. Thinner reads as a gauge, thicker as a pie. */
|
|
12
|
+
thickness?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Part-to-whole, at a glance.
|
|
16
|
+
*
|
|
17
|
+
* **Use this only when the reader needs the rough shape of a split, not the ranking.** People
|
|
18
|
+
* compare angles far worse than they compare lengths, so any question of the form "which is
|
|
19
|
+
* bigger" or "by how much" is a `BarChart`. Six segments is the ceiling, and it is a ceiling
|
|
20
|
+
* rather than a target: past three or four the small slices stop being readable at all.
|
|
21
|
+
*
|
|
22
|
+
* Unlike the other charts, colour here follows the *segment*, not the series — a donut draws one
|
|
23
|
+
* series, and its categories are what need telling apart. Pass exactly one series; anything after
|
|
24
|
+
* the first is ignored, with a dev warning.
|
|
25
|
+
*/
|
|
26
|
+
export declare function DonutChart({ categories, series, title, description, formatValue, height, emptyState, showDataTable, centerLabel, centerCaption, thickness, className, style, ...rest }: DonutChartProps): React.JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ChartBaseProps } from './ChartFrame.js';
|
|
3
|
+
export interface DonutChartProps extends ChartBaseProps {
|
|
4
|
+
/**
|
|
5
|
+
* What sits in the hole. Defaults to the total of every segment, which is the number a
|
|
6
|
+
* part-to-whole chart is implicitly about. Hovering a segment replaces it with that segment.
|
|
7
|
+
*/
|
|
8
|
+
centerLabel?: React.ReactNode;
|
|
9
|
+
/** Caption under the centre figure — "Total", "Invoiced", whatever the total means. */
|
|
10
|
+
centerCaption?: React.ReactNode;
|
|
11
|
+
/** Ring thickness in pixels. Thinner reads as a gauge, thicker as a pie. */
|
|
12
|
+
thickness?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Part-to-whole, at a glance.
|
|
16
|
+
*
|
|
17
|
+
* **Use this only when the reader needs the rough shape of a split, not the ranking.** People
|
|
18
|
+
* compare angles far worse than they compare lengths, so any question of the form "which is
|
|
19
|
+
* bigger" or "by how much" is a `BarChart`. Six segments is the ceiling, and it is a ceiling
|
|
20
|
+
* rather than a target: past three or four the small slices stop being readable at all.
|
|
21
|
+
*
|
|
22
|
+
* Unlike the other charts, colour here follows the *segment*, not the series — a donut draws one
|
|
23
|
+
* series, and its categories are what need telling apart. Pass exactly one series; anything after
|
|
24
|
+
* the first is ignored, with a dev warning.
|
|
25
|
+
*/
|
|
26
|
+
export declare function DonutChart({ categories, series, title, description, formatValue, height, emptyState, showDataTable, centerLabel, centerCaption, thickness, className, style, ...rest }: DonutChartProps): React.JSX.Element;
|
|
27
|
+
//# sourceMappingURL=DonutChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DonutChart.d.ts","sourceRoot":"","sources":["../../../src/components/data/DonutChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAmB,MAAM,cAAc,CAAC;AAKpE,MAAM,WAAW,eAAgB,SAAQ,cAAc;IACrD;;;OAGG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,uFAAuF;IACvF,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAKD;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,EACzB,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,WAAgC,EAAE,MAAY,EACtF,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,SAAc,EACrE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,EAC1B,EAAE,eAAe,qBAwFjB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ChartBaseProps } from './ChartFrame.cjs';
|
|
3
|
+
export interface LineChartProps extends ChartBaseProps {
|
|
4
|
+
/**
|
|
5
|
+
* Tint the area under each line. Reads well for one series; with several the fills overlap
|
|
6
|
+
* and the lower ones are read as smaller than they are, so it is ignored past the first.
|
|
7
|
+
*/
|
|
8
|
+
showArea?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Draw a dot at every point. On by default under about twenty points, where the dots show
|
|
11
|
+
* where the real readings are rather than implying data between them.
|
|
12
|
+
*/
|
|
13
|
+
showMarkers?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Let the axis start above zero, so a small movement in a large number stays visible.
|
|
16
|
+
*
|
|
17
|
+
* Legitimate for a line, which encodes change rather than length — but it does exaggerate,
|
|
18
|
+
* so leave it off whenever the size of the number is part of the point.
|
|
19
|
+
*/
|
|
20
|
+
zoomToData?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Change over time.
|
|
24
|
+
*
|
|
25
|
+
* Drawn in SVG at measured pixel coordinates rather than a scaled `viewBox`: scaling a viewBox
|
|
26
|
+
* to fit stretches the type and turns markers into ellipses. Gaps in a series break the line
|
|
27
|
+
* instead of interpolating across them — a missing month is not a straight line through it.
|
|
28
|
+
*/
|
|
29
|
+
export declare function LineChart({ categories, series: rawSeries, title, description, formatValue, height, emptyState, showDataTable, showArea, showMarkers, zoomToData, className, style, ...rest }: LineChartProps): React.JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ChartBaseProps } from './ChartFrame.js';
|
|
3
|
+
export interface LineChartProps extends ChartBaseProps {
|
|
4
|
+
/**
|
|
5
|
+
* Tint the area under each line. Reads well for one series; with several the fills overlap
|
|
6
|
+
* and the lower ones are read as smaller than they are, so it is ignored past the first.
|
|
7
|
+
*/
|
|
8
|
+
showArea?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Draw a dot at every point. On by default under about twenty points, where the dots show
|
|
11
|
+
* where the real readings are rather than implying data between them.
|
|
12
|
+
*/
|
|
13
|
+
showMarkers?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Let the axis start above zero, so a small movement in a large number stays visible.
|
|
16
|
+
*
|
|
17
|
+
* Legitimate for a line, which encodes change rather than length — but it does exaggerate,
|
|
18
|
+
* so leave it off whenever the size of the number is part of the point.
|
|
19
|
+
*/
|
|
20
|
+
zoomToData?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Change over time.
|
|
24
|
+
*
|
|
25
|
+
* Drawn in SVG at measured pixel coordinates rather than a scaled `viewBox`: scaling a viewBox
|
|
26
|
+
* to fit stretches the type and turns markers into ellipses. Gaps in a series break the line
|
|
27
|
+
* instead of interpolating across them — a missing month is not a straight line through it.
|
|
28
|
+
*/
|
|
29
|
+
export declare function LineChart({ categories, series: rawSeries, title, description, formatValue, height, emptyState, showDataTable, showArea, showMarkers, zoomToData, className, style, ...rest }: LineChartProps): React.JSX.Element;
|
|
30
|
+
//# sourceMappingURL=LineChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../src/components/data/LineChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAOnD,MAAM,WAAW,cAAe,SAAQ,cAAc;IACpD;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAoCD;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,EACxB,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,WAAgC,EACnF,MAAY,EAAE,UAAU,EAAE,aAAa,EAAE,QAAgB,EAAE,WAAW,EAAE,UAAkB,EAC1F,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,EAC1B,EAAE,cAAc,qBAwIhB"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scale maths and slot assignment shared by the chart components.
|
|
3
|
+
*
|
|
4
|
+
* Kept free of React and of the DOM so the arithmetic — which is where charts go quietly
|
|
5
|
+
* wrong — can be tested directly rather than through a rendered SVG.
|
|
6
|
+
*/
|
|
7
|
+
/** One measured thing, drawn across every category. */
|
|
8
|
+
export interface ChartSeries {
|
|
9
|
+
/** Stable across re-renders and across filter changes. Colour follows this, not position. */
|
|
10
|
+
id: string;
|
|
11
|
+
/** Shown in the legend, the tooltip and the data table. */
|
|
12
|
+
label: string;
|
|
13
|
+
/** One entry per category, in the same order. `null` is a gap in the data, never a zero. */
|
|
14
|
+
values: (number | null)[];
|
|
15
|
+
/**
|
|
16
|
+
* Pin this series to a specific `--viz` slot, 1–6. Without it slots are handed out in
|
|
17
|
+
* order. Use it when the same entity appears on several charts and must keep one colour.
|
|
18
|
+
*/
|
|
19
|
+
colorIndex?: number;
|
|
20
|
+
}
|
|
21
|
+
/** How many distinct series colours the palette defines. Validated as a set; do not extend. */
|
|
22
|
+
export declare const VIZ_SLOT_COUNT = 6;
|
|
23
|
+
export interface ChartScale {
|
|
24
|
+
min: number;
|
|
25
|
+
max: number;
|
|
26
|
+
/** Ascending, always including `min` and `max`. */
|
|
27
|
+
ticks: number[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A rounded axis covering `values`.
|
|
31
|
+
*
|
|
32
|
+
* `startAtZero` defaults to true because a bar's length is only readable when the axis starts
|
|
33
|
+
* at zero — a truncated bar axis exaggerates differences, which is the commonest way a chart
|
|
34
|
+
* misleads. Lines may pass false, since a line encodes change rather than magnitude.
|
|
35
|
+
*/
|
|
36
|
+
export declare function linearScale(values: (number | null | undefined)[], tickCount?: number, startAtZero?: boolean): ChartScale;
|
|
37
|
+
/** Where `value` sits on `scale`, as 0–1 from the axis minimum. */
|
|
38
|
+
export declare function scalePosition(value: number, scale: ChartScale): number;
|
|
39
|
+
/**
|
|
40
|
+
* The CSS colour for a series.
|
|
41
|
+
*
|
|
42
|
+
* Slots are handed out in declaration order and never cycled: past the sixth, identity by
|
|
43
|
+
* colour alone stops being reliable, so the overflow folds into one "other" neutral instead
|
|
44
|
+
* of inventing a seventh hue. Aggregate upstream when you have more than six.
|
|
45
|
+
*/
|
|
46
|
+
export declare function seriesColor(series: ChartSeries, index: number): string;
|
|
47
|
+
/** Dev-only nudge: more series than the palette can tell apart is a data-shape problem. */
|
|
48
|
+
export declare function warnOnSlotOverflow(series: ChartSeries[], chartLabel: string): void;
|
|
49
|
+
/**
|
|
50
|
+
* Dev-only checks specific to a donut, where the failure modes are about shape rather than count.
|
|
51
|
+
*
|
|
52
|
+
* Negative values are the important one: an arc length cannot be negative, so a refund or a
|
|
53
|
+
* reversal silently draws as its own absolute value and the chart reads as confidently wrong.
|
|
54
|
+
*/
|
|
55
|
+
export declare function warnOnDonutShape(series: ChartSeries[], categoryCount: number, chartLabel: string): void;
|
|
56
|
+
/** Sum of a category's values across series, skipping gaps. Used for stacked totals. */
|
|
57
|
+
export declare function stackTotal(series: ChartSeries[], categoryIndex: number): number;
|
|
58
|
+
/** Every plotted number in one flat list — what the scale is derived from. */
|
|
59
|
+
export declare function flatValues(series: ChartSeries[]): (number | null)[];
|
|
60
|
+
/**
|
|
61
|
+
* Trims each series to the category count.
|
|
62
|
+
*
|
|
63
|
+
* A series longer than the axis would otherwise plot points past the last category, stacked on
|
|
64
|
+
* top of each other at an undefined position. Shorter series need no padding — reading past the
|
|
65
|
+
* end already yields `undefined`, which every call site treats as a gap.
|
|
66
|
+
*/
|
|
67
|
+
export declare function alignToCategories(series: ChartSeries[], categoryCount: number): ChartSeries[];
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scale maths and slot assignment shared by the chart components.
|
|
3
|
+
*
|
|
4
|
+
* Kept free of React and of the DOM so the arithmetic — which is where charts go quietly
|
|
5
|
+
* wrong — can be tested directly rather than through a rendered SVG.
|
|
6
|
+
*/
|
|
7
|
+
/** One measured thing, drawn across every category. */
|
|
8
|
+
export interface ChartSeries {
|
|
9
|
+
/** Stable across re-renders and across filter changes. Colour follows this, not position. */
|
|
10
|
+
id: string;
|
|
11
|
+
/** Shown in the legend, the tooltip and the data table. */
|
|
12
|
+
label: string;
|
|
13
|
+
/** One entry per category, in the same order. `null` is a gap in the data, never a zero. */
|
|
14
|
+
values: (number | null)[];
|
|
15
|
+
/**
|
|
16
|
+
* Pin this series to a specific `--viz` slot, 1–6. Without it slots are handed out in
|
|
17
|
+
* order. Use it when the same entity appears on several charts and must keep one colour.
|
|
18
|
+
*/
|
|
19
|
+
colorIndex?: number;
|
|
20
|
+
}
|
|
21
|
+
/** How many distinct series colours the palette defines. Validated as a set; do not extend. */
|
|
22
|
+
export declare const VIZ_SLOT_COUNT = 6;
|
|
23
|
+
export interface ChartScale {
|
|
24
|
+
min: number;
|
|
25
|
+
max: number;
|
|
26
|
+
/** Ascending, always including `min` and `max`. */
|
|
27
|
+
ticks: number[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A rounded axis covering `values`.
|
|
31
|
+
*
|
|
32
|
+
* `startAtZero` defaults to true because a bar's length is only readable when the axis starts
|
|
33
|
+
* at zero — a truncated bar axis exaggerates differences, which is the commonest way a chart
|
|
34
|
+
* misleads. Lines may pass false, since a line encodes change rather than magnitude.
|
|
35
|
+
*/
|
|
36
|
+
export declare function linearScale(values: (number | null | undefined)[], tickCount?: number, startAtZero?: boolean): ChartScale;
|
|
37
|
+
/** Where `value` sits on `scale`, as 0–1 from the axis minimum. */
|
|
38
|
+
export declare function scalePosition(value: number, scale: ChartScale): number;
|
|
39
|
+
/**
|
|
40
|
+
* The CSS colour for a series.
|
|
41
|
+
*
|
|
42
|
+
* Slots are handed out in declaration order and never cycled: past the sixth, identity by
|
|
43
|
+
* colour alone stops being reliable, so the overflow folds into one "other" neutral instead
|
|
44
|
+
* of inventing a seventh hue. Aggregate upstream when you have more than six.
|
|
45
|
+
*/
|
|
46
|
+
export declare function seriesColor(series: ChartSeries, index: number): string;
|
|
47
|
+
/** Dev-only nudge: more series than the palette can tell apart is a data-shape problem. */
|
|
48
|
+
export declare function warnOnSlotOverflow(series: ChartSeries[], chartLabel: string): void;
|
|
49
|
+
/**
|
|
50
|
+
* Dev-only checks specific to a donut, where the failure modes are about shape rather than count.
|
|
51
|
+
*
|
|
52
|
+
* Negative values are the important one: an arc length cannot be negative, so a refund or a
|
|
53
|
+
* reversal silently draws as its own absolute value and the chart reads as confidently wrong.
|
|
54
|
+
*/
|
|
55
|
+
export declare function warnOnDonutShape(series: ChartSeries[], categoryCount: number, chartLabel: string): void;
|
|
56
|
+
/** Sum of a category's values across series, skipping gaps. Used for stacked totals. */
|
|
57
|
+
export declare function stackTotal(series: ChartSeries[], categoryIndex: number): number;
|
|
58
|
+
/** Every plotted number in one flat list — what the scale is derived from. */
|
|
59
|
+
export declare function flatValues(series: ChartSeries[]): (number | null)[];
|
|
60
|
+
/**
|
|
61
|
+
* Trims each series to the category count.
|
|
62
|
+
*
|
|
63
|
+
* A series longer than the axis would otherwise plot points past the last category, stacked on
|
|
64
|
+
* top of each other at an undefined position. Shorter series need no padding — reading past the
|
|
65
|
+
* end already yields `undefined`, which every call site treats as a gap.
|
|
66
|
+
*/
|
|
67
|
+
export declare function alignToCategories(series: ChartSeries[], categoryCount: number): ChartSeries[];
|
|
68
|
+
//# sourceMappingURL=chartGeometry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chartGeometry.d.ts","sourceRoot":"","sources":["../../../src/components/data/chartGeometry.ts"],"names":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U,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAEnE;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,aAAa,EAAE,MAAM,GAAG,WAAW,EAAE,CAI7F"}
|
package/dist/components.css
CHANGED
|
@@ -548,6 +548,96 @@
|
|
|
548
548
|
the real header stays mounted above — which is what stops the grid resizing mid-reload. */
|
|
549
549
|
.pire-table-loading{display:flex;flex-direction:column}
|
|
550
550
|
|
|
551
|
+
/* ---- Charts --------------------------------------------------------------- */
|
|
552
|
+
/* width:100% is load-bearing, not cosmetic. Bar lengths are percentages of the track, and a
|
|
553
|
+
percentage cannot resolve against an indefinite width — drop the chart into a flex container
|
|
554
|
+
with `align-items:flex-start` and every bar collapses to its 2px floor. */
|
|
555
|
+
.pire-chart{display:flex;flex-direction:column;gap:var(--sp-3);margin:0;min-width:0;width:100%}
|
|
556
|
+
.pire-chart-head{display:flex;flex-direction:column;gap:var(--sp-1)}
|
|
557
|
+
.pire-chart-title{font:var(--type-body-strong);color:var(--text-primary)}
|
|
558
|
+
.pire-chart-desc{font:var(--type-caption);color:var(--text-secondary)}
|
|
559
|
+
.pire-chart-empty{padding:var(--sp-10);text-align:center;color:var(--text-secondary);font:var(--type-body)}
|
|
560
|
+
|
|
561
|
+
/* Legend text stays in ink; the swatch beside it is what carries identity. Colouring the label
|
|
562
|
+
to match its series is the commonest way a chart fails contrast. */
|
|
563
|
+
.pire-chart-legend{display:flex;flex-wrap:wrap;gap:var(--sp-1) var(--sp-4);margin:0;padding:0;list-style:none}
|
|
564
|
+
.pire-chart-legend-item{display:inline-flex;align-items:center;gap:var(--sp-2);font:var(--type-caption);color:var(--text-secondary)}
|
|
565
|
+
.pire-chart-swatch{width:10px;height:10px;border-radius:var(--radius-1);flex:0 0 auto}
|
|
566
|
+
|
|
567
|
+
/* ---- Charts: bars --------------------------------------------------------- */
|
|
568
|
+
.pire-chart-bars{display:flex;gap:var(--sp-2)}
|
|
569
|
+
.pire-chart-bars[data-orientation="horizontal"]{flex-direction:column}
|
|
570
|
+
.pire-chart-bars[data-orientation="vertical"]{flex-direction:row;align-items:stretch;height:var(--pire-chart-height)}
|
|
571
|
+
|
|
572
|
+
.pire-chart-group{display:flex;min-width:0}
|
|
573
|
+
.pire-chart-bars[data-orientation="horizontal"] .pire-chart-group{align-items:center;gap:var(--sp-3)}
|
|
574
|
+
.pire-chart-bars[data-orientation="vertical"] .pire-chart-group{flex:1 1 0;flex-direction:column-reverse;justify-content:flex-start;gap:var(--sp-2);min-width:0}
|
|
575
|
+
|
|
576
|
+
.pire-chart-cat{font:var(--type-caption);color:var(--text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
577
|
+
.pire-chart-bars[data-orientation="horizontal"] .pire-chart-cat{flex:0 0 auto;width:var(--pire-chart-cat-width,120px);text-align:right}
|
|
578
|
+
.pire-chart-bars[data-orientation="vertical"] .pire-chart-cat{text-align:center;width:100%}
|
|
579
|
+
|
|
580
|
+
.pire-chart-val{font:var(--type-caption);font-variant-numeric:tabular-nums;color:var(--text-secondary);white-space:nowrap}
|
|
581
|
+
.pire-chart-bars[data-orientation="horizontal"] .pire-chart-val{flex:0 0 auto;text-align:right;min-width:64px}
|
|
582
|
+
/* Rides on top of its own bar, so the figure moves with the mark it describes. */
|
|
583
|
+
.pire-chart-barval{position:absolute;bottom:100%;left:50%;transform:translateX(-50%);padding-block-end:var(--sp-1);font:var(--type-caption);font-variant-numeric:tabular-nums;color:var(--text-secondary);white-space:nowrap}
|
|
584
|
+
|
|
585
|
+
/* The 2px gap is the spacer that keeps adjacent fills from reading as one mark. */
|
|
586
|
+
.pire-chart-track{display:flex;gap:var(--sp-0h);flex:1 1 auto;min-width:0}
|
|
587
|
+
.pire-chart-bars[data-orientation="horizontal"] .pire-chart-track{flex-direction:column;min-height:12px}
|
|
588
|
+
/* The top padding is where a vertical bar's own value label sits — without it the tallest
|
|
589
|
+
bar's figure is clipped by the top of the plot. */
|
|
590
|
+
.pire-chart-bars[data-orientation="vertical"] .pire-chart-track{flex-direction:row;align-items:flex-end;justify-content:center;flex:1 1 auto;min-height:0;padding-block-start:var(--sp-5)}
|
|
591
|
+
.pire-chart-bars[data-stacked="true"][data-orientation="horizontal"] .pire-chart-track{flex-direction:row}
|
|
592
|
+
/* flex-start, not the centre the unstacked rule sets: under column-reverse the main axis starts
|
|
593
|
+
at the bottom, which is where a stack has to sit. Centred, the whole column floats off its
|
|
594
|
+
own zero line and the shortest stacks drift furthest. */
|
|
595
|
+
.pire-chart-bars[data-stacked="true"][data-orientation="vertical"] .pire-chart-track{flex-direction:column-reverse;align-items:stretch;justify-content:flex-start}
|
|
596
|
+
|
|
597
|
+
/* Only the data end is rounded. Rounding the baseline end would lift the mark off its own
|
|
598
|
+
zero line and read as a value slightly above zero. */
|
|
599
|
+
.pire-chart-bar{position:relative;background:var(--pire-bar-color);flex:0 0 auto}
|
|
600
|
+
.pire-chart-bars[data-orientation="horizontal"] .pire-chart-bar{width:var(--pire-bar-size);min-height:10px;flex:1 1 auto;border-radius:0 var(--radius-2) var(--radius-2) 0;min-width:2px}
|
|
601
|
+
.pire-chart-bars[data-orientation="vertical"] .pire-chart-bar{height:var(--pire-bar-size);flex:1 1 auto;max-width:40px;border-radius:var(--radius-2) var(--radius-2) 0 0;min-height:2px}
|
|
602
|
+
.pire-chart-bars[data-stacked="true"][data-orientation="horizontal"] .pire-chart-bar{flex:0 0 var(--pire-bar-size);width:auto;border-radius:0}
|
|
603
|
+
.pire-chart-bars[data-stacked="true"][data-orientation="vertical"] .pire-chart-bar{flex:0 0 var(--pire-bar-size);height:auto;border-radius:0}
|
|
604
|
+
|
|
605
|
+
/* ---- Charts: lines -------------------------------------------------------- */
|
|
606
|
+
.pire-chart-lines{position:relative;width:100%;min-width:0}
|
|
607
|
+
.pire-chart-svg{display:block;overflow:visible}
|
|
608
|
+
.pire-chart-grid line{stroke:var(--viz-grid);stroke-width:1}
|
|
609
|
+
.pire-chart-tick text{font:var(--type-micro);fill:var(--text-tertiary);font-variant-numeric:tabular-nums}
|
|
610
|
+
.pire-chart-line path{stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
|
|
611
|
+
.pire-chart-area{opacity:.14}
|
|
612
|
+
/* A ring in the surface colour keeps overlapping markers from merging into one blob. */
|
|
613
|
+
.pire-chart-marker circle{stroke:var(--surface-card);stroke-width:2}
|
|
614
|
+
|
|
615
|
+
/* ---- Charts: hover -------------------------------------------------------- */
|
|
616
|
+
.pire-chart-hover{position:absolute;display:flex}
|
|
617
|
+
.pire-chart-band{position:relative;flex:1 1 0}
|
|
618
|
+
.pire-chart-band::before{content:"";position:absolute;inset-block:0;left:50%;width:1px;background:var(--border-strong);opacity:0}
|
|
619
|
+
.pire-chart-band:hover::before{opacity:1}
|
|
620
|
+
|
|
621
|
+
/* CSS-only, because the plot is aria-hidden and the data table already carries every value —
|
|
622
|
+
this is a pointer affordance, not the accessible path to the numbers. */
|
|
623
|
+
.pire-chart-tip{position:absolute;bottom:100%;left:50%;transform:translate(-50%,-6px);display:flex;flex-direction:column;gap:2px;padding:var(--sp-2) var(--sp-3);background:var(--surface-card);border:1px solid var(--border-default);border-radius:var(--radius-2);box-shadow:var(--shadow-2);font:var(--type-caption);color:var(--text-primary);white-space:nowrap;opacity:0;pointer-events:none;z-index:1}
|
|
624
|
+
.pire-chart-tip-row{font-variant-numeric:tabular-nums;color:var(--text-secondary)}
|
|
625
|
+
.pire-chart-band:hover .pire-chart-tip,.pire-chart-bar:hover .pire-chart-tip{opacity:1}
|
|
626
|
+
.pire-chart-bar .pire-chart-tip{bottom:auto;top:50%;left:100%;transform:translate(var(--sp-2),-50%)}
|
|
627
|
+
|
|
628
|
+
/* ---- Charts: donut -------------------------------------------------------- */
|
|
629
|
+
.pire-chart-donut{position:relative;display:flex;align-items:center;justify-content:center}
|
|
630
|
+
.pire-chart-arc{fill:none;transition:opacity var(--dur-base) var(--ease-standard)}
|
|
631
|
+
.pire-chart-arc[data-hovered="true"]{opacity:.78}
|
|
632
|
+
.pire-chart-donut-center{position:absolute;display:flex;flex-direction:column;align-items:center;gap:2px;text-align:center;pointer-events:none}
|
|
633
|
+
.pire-chart-donut-value{font:var(--type-numeric);font-variant-numeric:tabular-nums;color:var(--text-primary)}
|
|
634
|
+
.pire-chart-donut-caption{font:var(--type-caption);color:var(--text-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
|
|
635
|
+
|
|
636
|
+
.pire-chart-table table{width:100%;border-collapse:collapse;font:var(--type-caption)}
|
|
637
|
+
.pire-chart-table caption{text-align:left;padding-block-end:var(--sp-2);color:var(--text-secondary)}
|
|
638
|
+
.pire-chart-table th,.pire-chart-table td{padding:var(--sp-1) var(--sp-2);border-block-end:1px solid var(--border-subtle);text-align:left;color:var(--text-primary)}
|
|
639
|
+
.pire-chart-table td{font-variant-numeric:tabular-nums}
|
|
640
|
+
|
|
551
641
|
/* ---- Reduced motion --------------------------------------------------- */
|
|
552
642
|
@media (prefers-reduced-motion: reduce){.pire-modal,.pire-toast,.pire-popover,.pire-tooltip,.pire-sidepanel{animation:none}
|
|
553
643
|
/* The skeleton also drops its background sweep, not just the animation: an infinite shimmer is
|
package/dist/i18n/messages.d.cts
CHANGED
|
@@ -73,6 +73,12 @@ export interface PireMessages {
|
|
|
73
73
|
fileUploadUploading: string;
|
|
74
74
|
/** Instruction inside the drop surface. */
|
|
75
75
|
fileDropZonePrompt: string;
|
|
76
|
+
/** Heading of the category column in a chart's data table. */
|
|
77
|
+
chartCategoryHeader: string;
|
|
78
|
+
/** Cell text where a chart series has no reading for a category. Never "0" — a gap is not a zero. */
|
|
79
|
+
chartNoValue: string;
|
|
80
|
+
/** Shown in place of the plot when a chart has nothing to draw. */
|
|
81
|
+
chartEmpty: string;
|
|
76
82
|
}
|
|
77
83
|
export declare const enMessages: PireMessages;
|
|
78
84
|
export declare const esMessages: PireMessages;
|
package/dist/i18n/messages.d.ts
CHANGED
|
@@ -73,6 +73,12 @@ export interface PireMessages {
|
|
|
73
73
|
fileUploadUploading: string;
|
|
74
74
|
/** Instruction inside the drop surface. */
|
|
75
75
|
fileDropZonePrompt: string;
|
|
76
|
+
/** Heading of the category column in a chart's data table. */
|
|
77
|
+
chartCategoryHeader: string;
|
|
78
|
+
/** Cell text where a chart series has no reading for a category. Never "0" — a gap is not a zero. */
|
|
79
|
+
chartNoValue: string;
|
|
80
|
+
/** Shown in place of the plot when a chart has nothing to draw. */
|
|
81
|
+
chartEmpty: string;
|
|
76
82
|
}
|
|
77
83
|
export declare const enMessages: PireMessages;
|
|
78
84
|
export declare const esMessages: PireMessages;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/i18n/messages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,WAAW,YAAY;IAC3B,iCAAiC;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,8EAA8E;IAC9E,WAAW,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,iBAAiB,EAAE,MAAM,CAAC;IAE1B,qEAAqE;IACrE,kBAAkB,EAAE,MAAM,CAAC;IAC3B,qDAAqD;IACrD,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oDAAoD;IACpD,gBAAgB,EAAE,MAAM,CAAC;IAEzB,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,cAAc,EAAE,MAAM,CAAC;IAEvB,6DAA6D;IAC7D,oBAAoB,EAAE,MAAM,CAAC;IAC7B,uDAAuD;IACvD,YAAY,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,gBAAgB,EAAE,MAAM,CAAC;IAEzB,kEAAkE;IAClE,uBAAuB,EAAE,MAAM,CAAC;IAChC,mEAAmE;IACnE,eAAe,EAAE,MAAM,CAAC;IAExB,qEAAqE;IACrE,sBAAsB,EAAE,MAAM,CAAC;IAC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