@nxgt/material 3.38.0 → 3.41.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.
Files changed (112) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +3 -3
  3. package/dist/{async-slice-DqjtOYlO.js → async-slice-Dj0tAKRI.js} +2 -2
  4. package/dist/{button-D52ron-a.js → button-CTsT_LqL.js} +1 -1
  5. package/dist/charts.js +1733 -1364
  6. package/dist/{chip-0XYwSp9o.js → chip-DP7EyhtT.js} +1 -1
  7. package/dist/{code-editor-BetIXpJ6.js → code-editor-BWn0AXBf.js} +4 -4
  8. package/dist/code-editor.js +4 -4
  9. package/dist/{code-language-items-C7prxl_7.js → code-language-items-CCRuLYpA.js} +2 -2
  10. package/dist/components/components.css +1 -0
  11. package/dist/components/ui/widgets/native-charts/native-charts-reference.css +102 -0
  12. package/dist/{components-NoCZ44Ri.js → components-BUFDh6nQ.js} +16216 -15813
  13. package/dist/components.js +15 -15
  14. package/dist/{dialog-BCsT_aLo.js → dialog-uQld1gKm.js} +1 -1
  15. package/dist/dnd.js +1 -1
  16. package/dist/{dropdown-menu-Crt5QvTr.js → dropdown-menu-BA70o7HC.js} +1 -1
  17. package/dist/editor.js +7 -7
  18. package/dist/{empty-state-DFWq2CWB.js → empty-state-BzwyRX5J.js} +1 -1
  19. package/dist/hooks.js +2 -2
  20. package/dist/{i18n-provider-C0RBM8rH.js → i18n-provider-DkeMr5bw.js} +1 -1
  21. package/dist/i18n.js +5 -5
  22. package/dist/{icon-badge-XBoBIt_R.js → icon-badge-D_z5BGbc.js} +1 -1
  23. package/dist/lib/charts/index.d.ts +3 -1
  24. package/dist/lib/components/ui/collections/server-table/bulk-action-targets.d.ts +18 -0
  25. package/dist/lib/components/ui/collections/server-table/bulk-action.d.ts +50 -3
  26. package/dist/lib/components/ui/collections/server-table/partials/server-table-bulk-buttons.d.ts +5 -3
  27. package/dist/lib/components/ui/collections/server-table/partials/server-table-bulk-focus.d.ts +31 -0
  28. package/dist/lib/components/ui/collections/server-table/partials/server-table-bulk-more.d.ts +24 -0
  29. package/dist/lib/components/ui/collections/server-table/partials/server-table-bulk-notice.d.ts +16 -0
  30. package/dist/lib/components/ui/collections/server-table/partials/server-table-bulk-texts.d.ts +9 -0
  31. package/dist/lib/components/ui/collections/server-table/server-table.d.ts +1 -1
  32. package/dist/lib/components/ui/dates/date-field/date-field-content.d.ts +1 -1
  33. package/dist/lib/components/ui/dates/date-field/date-field-popover.d.ts +3 -1
  34. package/dist/lib/components/ui/dates/date-field/date-field-sheet-entry.d.ts +3 -2
  35. package/dist/lib/components/ui/dates/date-field/date-field-surface.d.ts +1 -1
  36. package/dist/lib/components/ui/dates/date-field/date-field-typed.d.ts +3 -3
  37. package/dist/lib/components/ui/dates/date-field/date-field.d.ts +23 -2
  38. package/dist/lib/components/ui/dates/date-field/use-typed-date.d.ts +3 -1
  39. package/dist/lib/components/ui/dates/date-field/use-zoned-content.d.ts +36 -0
  40. package/dist/lib/components/ui/dates/date-range-field/date-range-field.types.d.ts +1 -1
  41. package/dist/lib/components/ui/dates/picker-popover/hero-text.d.ts +1 -0
  42. package/dist/lib/components/ui/dates/picker-trigger/floating-clock.d.ts +7 -0
  43. package/dist/lib/components/ui/dates/picker-trigger/typed-day.d.ts +8 -0
  44. package/dist/lib/components/ui/dates/picker-trigger/use-zoned-date-props.d.ts +38 -0
  45. package/dist/lib/components/ui/dates/picker-trigger/use-zoned-value.d.ts +20 -0
  46. package/dist/lib/components/ui/dates/picker-trigger/zoned-bounds.d.ts +16 -0
  47. package/dist/lib/components/ui/dates/picker-trigger/zoned-matchers.d.ts +8 -0
  48. package/dist/lib/components/ui/dates/time-field/time-field.d.ts +14 -1
  49. package/dist/lib/components/ui/dates/time-field/time-form-field.d.ts +5 -1
  50. package/dist/lib/components/ui/dates/time-field/time-string-field.d.ts +3 -2
  51. package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
  52. package/dist/lib/components/ui/primitives/segmented-input/segment-date-time.d.ts +13 -0
  53. package/dist/lib/components/ui/primitives/segmented-input/segment-defs.d.ts +6 -0
  54. package/dist/lib/components/ui/primitives/segmented-input/segment-floating.d.ts +11 -0
  55. package/dist/lib/components/ui/primitives/segmented-input/segment-part.d.ts +19 -0
  56. package/dist/lib/components/ui/widgets/native-charts/core/point-tones.d.ts +17 -0
  57. package/dist/lib/components/ui/widgets/native-charts/core/reference-text.d.ts +30 -0
  58. package/dist/lib/components/ui/widgets/native-charts/core/reference.d.ts +45 -0
  59. package/dist/lib/components/ui/widgets/native-charts/core/summary.d.ts +3 -0
  60. package/dist/lib/components/ui/widgets/native-charts/core/table.d.ts +7 -0
  61. package/dist/lib/components/ui/widgets/native-charts/core/types.d.ts +25 -0
  62. package/dist/lib/components/ui/widgets/native-charts/hooks/chart-model-types.d.ts +18 -1
  63. package/dist/lib/components/ui/widgets/native-charts/hooks/model-parts.d.ts +3 -0
  64. package/dist/lib/components/ui/widgets/native-charts/hooks/model-series.d.ts +3 -0
  65. package/dist/lib/components/ui/widgets/native-charts/hooks/model-tones.d.ts +19 -0
  66. package/dist/lib/components/ui/widgets/native-charts/hooks/use-chart-model.d.ts +3 -3
  67. package/dist/lib/components/ui/widgets/native-charts/index.d.ts +1 -1
  68. package/dist/lib/components/ui/widgets/native-charts/line-chart/line-chart-types.d.ts +26 -1
  69. package/dist/lib/components/ui/widgets/native-charts/line-chart/line-geometry.d.ts +4 -0
  70. package/dist/lib/components/ui/widgets/native-charts/line-chart/partials/reference-marks.d.ts +17 -0
  71. package/dist/lib/components/ui/widgets/native-charts/line-chart/partials/tone-points.d.ts +11 -0
  72. package/dist/lib/components/ui/widgets/native-charts/partials/chart-tooltip.d.ts +3 -0
  73. package/dist/lib/i18n/resources/en/en.d.ts +23 -0
  74. package/dist/lib/i18n/resources/en/material.json.d.ts +23 -0
  75. package/dist/lib/i18n/resources/fr/fr.d.ts +23 -0
  76. package/dist/lib/i18n/resources/fr/material.json.d.ts +23 -0
  77. package/dist/lib/i18n/resources/resources.d.ts +46 -0
  78. package/dist/lib/i18n/translator.d.ts +1 -1
  79. package/dist/lib/lib/zoned-floating.d.ts +30 -0
  80. package/dist/lib/lib/zoned-instant.d.ts +16 -0
  81. package/dist/lib/lib/zoned.d.ts +11 -4
  82. package/dist/lib.js +1 -1
  83. package/dist/main.js +21 -21
  84. package/dist/map.js +4 -4
  85. package/dist/material.css +1 -1
  86. package/dist/pdf-reader.js +1 -1
  87. package/dist/print.js +2 -2
  88. package/dist/{public-CWIpzLzO.js → public-ib0sK0Hr.js} +6 -6
  89. package/dist/{rich-code-block-C4aBv4cA.js → rich-code-block-D_PTTZWQ.js} +4 -4
  90. package/dist/{sortable-provider-0uBi0zcP.js → sortable-provider-CrS51nKB.js} +1 -1
  91. package/dist/{spinner-CuxEwO0d.js → spinner-DLd_IHev.js} +1 -1
  92. package/dist/{stored-language-D8aemZhx.js → stored-language-B5SMR-W2.js} +46 -0
  93. package/dist/theme-picker.js +2 -2
  94. package/dist/{theme-toggle-ik5nV1P5.js → theme-toggle-wJYmnwgu.js} +1 -1
  95. package/dist/{toolbar-items-C97E5HRa.js → toolbar-items-BLjrk8uU.js} +2 -2
  96. package/dist/{translate-material-B84ufMSF.js → translate-material-BYRDtSEk.js} +2 -2
  97. package/dist/{translator-Bq8UHmvu.js → translator-C-_M57ZA.js} +1 -1
  98. package/dist/{use-chat-composer-DmDcEGp4.js → use-chat-composer-DrFgIE3T.js} +12 -12
  99. package/dist/{use-heading-spy-BgG7Q47k.js → use-heading-spy-wElRpO2G.js} +1 -1
  100. package/dist/{use-material-translation-CiYhVc39.js → use-material-translation-CFF73jk5.js} +2 -2
  101. package/docs/README.md +1 -1
  102. package/docs/components/data-table-filter-and-lists.md +59 -4
  103. package/docs/components/date-and-time.md +77 -3
  104. package/docs/components/rich-widgets.md +6 -0
  105. package/docs/guides/charts.md +78 -2
  106. package/docs/guides/forms.md +2 -2
  107. package/docs/guides/i18n.md +3 -2
  108. package/docs/roadmap.md +7 -0
  109. package/docs/troubleshooting.md +9 -1
  110. package/lib/components/components.css +1 -0
  111. package/lib/components/ui/widgets/native-charts/native-charts-reference.css +102 -0
  112. package/package.json +2 -2
@@ -0,0 +1,45 @@
1
+ import { ChartBand, ChartThreshold } from './types.js';
2
+ /**
3
+ * The maths of a line chart's reference bands and threshold lines: they are
4
+ * cleaned once (a range given backwards, a value that is not a number), fed
5
+ * to the value domain so the chart shows them, clipped to the domain when an
6
+ * axis pins it, and counted against the data for the summary.
7
+ */
8
+ /** A value-axis span, low then high. */
9
+ export type Domain = readonly [number, number];
10
+ /** The bands with a finite range, each as `from <= to`; the rest are dropped. */
11
+ export declare function normalizeBands(bands: readonly ChartBand[] | undefined): ChartBand[];
12
+ /** The thresholds with a finite value. */
13
+ export declare function normalizeThresholds(thresholds: readonly ChartThreshold[] | undefined): ChartThreshold[];
14
+ /** Every value a band or a threshold marks: the value domain grows to hold them. */
15
+ export declare function referenceValues(bands: readonly ChartBand[], thresholds: readonly ChartThreshold[]): number[];
16
+ /** The part of `band` inside `domain`; null when none of it is, or it has no height. */
17
+ export declare function clipBand(band: Pick<ChartBand, 'from' | 'to'>, domain: Domain): {
18
+ from: number;
19
+ to: number;
20
+ } | null;
21
+ /** A band's box on the plot, `y` mapping a value to a pixel: its top and height, clipped to the domain; null when it is out of view. */
22
+ export declare function bandBox(band: Pick<ChartBand, 'from' | 'to'>, domain: Domain, y: (value: number) => number): {
23
+ top: number;
24
+ height: number;
25
+ } | null;
26
+ /** Where a threshold's line falls; null when its value is outside the domain. */
27
+ export declare function thresholdAt(value: number, domain: Domain, y: (value: number) => number): number | null;
28
+ /** The baseline of a band's label: inside the band under its top edge, or above a band too thin to hold it. */
29
+ export declare function bandLabelBaseline(top: number, height: number): number;
30
+ /** The baseline of a threshold's label: above its line, or under it at the top of the plot. */
31
+ export declare function thresholdLabelBaseline(lineY: number): number;
32
+ /** How many of `values` lie outside `band` (a missing value is not counted), and how many there are. */
33
+ export declare function outsideBand(values: readonly (number | null | undefined)[], band: Pick<ChartBand, 'from' | 'to'>): {
34
+ outside: number;
35
+ total: number;
36
+ };
37
+ /**
38
+ * How a label sits at a plot's physical `edge` (the plot is drawn left to
39
+ * right whatever the page): a label in a right-to-left script is set `rtl`,
40
+ * and the anchor that grows it inward from that edge flips with it.
41
+ */
42
+ export declare function labelFlow(label: string, edge: 'left' | 'right'): {
43
+ direction: 'ltr' | 'rtl';
44
+ textAnchor: 'start' | 'end';
45
+ };
@@ -20,6 +20,8 @@ export type SummaryInput = {
20
20
  series: readonly SummarySeries[];
21
21
  /** The hidden series' labels. */
22
22
  hidden?: readonly string[];
23
+ /** Sentences a chart adds after its series' (a line chart's bands, thresholds and toned points). */
24
+ extra?: readonly string[];
23
25
  };
24
26
  /** The chart kind's name ("line chart"), also the plot's `aria-roledescription`. */
25
27
  export declare function kindName(t: ChartTranslate, kind: ChartKind): string;
@@ -30,6 +32,7 @@ export declare function summarize(t: ChartTranslate, input: SummaryInput): strin
30
32
  export declare function pointStatus(t: ChartTranslate, label: string, values: readonly {
31
33
  series: string;
32
34
  value: string;
35
+ tone?: string;
33
36
  }[]): string;
34
37
  /** The summary a chart shows: its `summary` prop (a text, or a function of the generated one), else the generated one. */
35
38
  export declare function applySummary(summary: string | ((auto: string) => string) | undefined, auto: string): string;
@@ -15,12 +15,19 @@ export type ChartTableModel = {
15
15
  corner: string;
16
16
  columns: TableColumn[];
17
17
  rows: TableRowModel[];
18
+ /** Lines read under the table (a line chart's reference bands and thresholds). */
19
+ notes?: string[];
18
20
  };
19
21
  export type TableSeries = {
20
22
  key: string;
21
23
  label: string;
22
24
  values: readonly (number | null | undefined)[];
23
25
  format: (value: number) => string;
26
+ /** Adds a column after the series' own: its header, and the word of each row (null for none). */
27
+ tone?: {
28
+ label: string;
29
+ words: readonly (string | null)[];
30
+ };
24
31
  };
25
32
  /**
26
33
  * Rows of `labels` × `series`. Hidden series stay out: the table shows what
@@ -95,6 +95,31 @@ export interface ChartPoint {
95
95
  * the colour's ink (lines, points and swatches in the ink).
96
96
  */
97
97
  export type ChartPalette = 'default' | 'soft';
98
+ /**
99
+ * A shaded range of the value axis, drawn behind the lines: a normal range,
100
+ * a target zone. Its `label` is drawn in the band and listed in the summary
101
+ * and in "View data"; the shade is decorative, the label carries the meaning.
102
+ */
103
+ export interface ChartBand {
104
+ /** One end of the range, in the value axis' units (either order). */
105
+ from: number;
106
+ /** The other end. */
107
+ to: number;
108
+ /** Names the range: drawn in it, read by the summary and the table. */
109
+ label: string;
110
+ /** Tints the band and its label in the tone; default a neutral wash. */
111
+ tone?: Tone;
112
+ }
113
+ /** A horizontal line at a value, with a direct label at its end. */
114
+ export interface ChartThreshold {
115
+ value: number;
116
+ /** Names the line: drawn at its end, read by the summary and the table. */
117
+ label: string;
118
+ /** Draws the line and its label in the tone's colour; default the axis colour. */
119
+ tone?: Tone;
120
+ /** Dashed (default) or, with `false`, solid. */
121
+ dash?: boolean;
122
+ }
98
123
  /** What every chart accepts. */
99
124
  export interface ChartBaseProps {
100
125
  /** The card's title, and the chart's accessible name. */
@@ -1,7 +1,9 @@
1
+ import { Tone } from '../../../tones.js';
1
2
  import { ResolvedSeries } from '../core/colors.js';
2
3
  import { SeriesAxis } from '../core/combo-axes.js';
4
+ import { ToneMark, ToneWords } from '../core/point-tones.js';
3
5
  import { ChartTableModel } from '../core/table.js';
4
- import { ChartAxis, ChartBaseProps, ChartPoint, ChartRow, ChartSeries, ChartXAxis, RowKey } from '../core/types.js';
6
+ import { ChartAxis, ChartBand, ChartBaseProps, ChartPoint, ChartRow, ChartSeries, ChartThreshold, ChartXAxis, RowKey } from '../core/types.js';
5
7
  import { LegendItem } from '../partials/chart-legend.js';
6
8
  import { ModelSeries } from './model-series.js';
7
9
  import { useChartSize } from './use-chart-size.js';
@@ -26,7 +28,20 @@ export type ChartModelProps<T extends object = ChartRow> = ChartBaseProps & {
26
28
  /** The header of the View data table's category column (the x values; the heat map's row labels). Defaults, on the line, area and bar charts, to the x axis label when set, else a translated "Category"; the radar and heat map charts have no x axis label, so they always read "Category" unless this is set. */
27
29
  categoryLabel?: string;
28
30
  };
31
+ /** What a chart reads against its data: ranges and lines on the value axis, and a tone per point. */
32
+ export type ChartReferenceProps = {
33
+ bands?: ChartBand[];
34
+ thresholds?: ChartThreshold[];
35
+ pointTone?: (point: ChartPoint, series: ChartSeries) => Tone | undefined;
36
+ toneLabels?: ToneWords;
37
+ };
38
+ export type { ToneMark };
29
39
  export type ChartModel = {
40
+ /** The bands and thresholds, cleaned (`from <= to`, finite). */
41
+ refs: {
42
+ bands: ChartBand[];
43
+ thresholds: ChartThreshold[];
44
+ };
30
45
  size: ReturnType<typeof useChartSize<HTMLDivElement>>;
31
46
  /** Every series, resolved (colour, shape, dash, position). */
32
47
  series: ResolvedSeries[];
@@ -63,4 +78,6 @@ export type ChartModelOptions = {
63
78
  };
64
79
  /** Names the axis each series reads and formats it by that axis (two-axis charts). Keep it stable (memoized). */
65
80
  axes?: (series: ChartSeries) => SeriesAxis;
81
+ /** A line chart's bands, thresholds and point tones. Keep the arrays and the function stable (memoized): they key the summary and the table. */
82
+ reference?: ChartReferenceProps;
66
83
  };
@@ -14,6 +14,7 @@ export declare function summaryText(t: ChartTranslate, input: {
14
14
  series: readonly ResolvedSeries[];
15
15
  hidden: readonly string[];
16
16
  summary: Parameters<typeof applySummary>[0];
17
+ extra?: readonly string[];
17
18
  }): string;
18
19
  /** What the live status reads for row `index`; null when none is active. */
19
20
  export declare function statusText(t: ChartTranslate, labels: readonly string[], shown: readonly ModelSeries[], index: number | null): string | null;
@@ -26,6 +27,8 @@ export declare function viewTable(t: ChartTranslate, input: {
26
27
  shown: readonly ModelSeries[];
27
28
  categoryLabel?: string;
28
29
  axisLabel?: string;
30
+ /** Lines read under the table: the reference bands and thresholds. */
31
+ notes?: string[];
29
32
  }): ChartTableModel;
30
33
  /** The point at row `index` of the rows shown on the series at `position`; `offset` (a zoomed window's first row) makes its `index` the row of the full data. */
31
34
  export declare function pointAt(input: {
@@ -1,5 +1,6 @@
1
1
  import { PaintAttributes, ResolvedSeries } from '../core/colors.js';
2
2
  import { SeriesAxis } from '../core/combo-axes.js';
3
+ import { ToneMark } from '../core/point-tones.js';
3
4
  import { ChartAxis, ChartRow, ChartSeries } from '../core/types.js';
4
5
  /** A visible series, ready to draw: its paint, values and formatter. */
5
6
  export type ModelSeries = ResolvedSeries & {
@@ -10,6 +11,8 @@ export type ModelSeries = ResolvedSeries & {
10
11
  tag?: string;
11
12
  /** The label of the axis the series reads. */
12
13
  axisLabel?: string;
14
+ /** The tone of each row's point, null for none (`pointTone`); unset when no point of the series has one. */
15
+ tones?: (ToneMark | null)[];
13
16
  };
14
17
  /**
15
18
  * The visible series with their values and formatters. `axes` names the axis
@@ -0,0 +1,19 @@
1
+ import { ToneWords } from '../core/point-tones.js';
2
+ import { ChartTranslate } from '../core/translate.js';
3
+ import { ChartRow } from '../core/types.js';
4
+ import { ChartReferenceProps } from './chart-model-types.js';
5
+ import { ModelSeries } from './model-series.js';
6
+ /**
7
+ * Asks `pointTone` for the tone of every value of every visible series, and
8
+ * gives each series that has any the marks, with their words (`toneLabels`,
9
+ * else the library's neutral ones). The point it is given is the one
10
+ * `onPointClick` gets: `index` is the row of the full data, even in a zoomed window.
11
+ */
12
+ export declare function withPointTones(t: ChartTranslate, input: {
13
+ shown: ModelSeries[];
14
+ labels: readonly string[];
15
+ data: readonly ChartRow[];
16
+ offset?: number;
17
+ pointTone: NonNullable<ChartReferenceProps['pointTone']>;
18
+ words?: ToneWords;
19
+ }): ModelSeries[];
@@ -1,7 +1,7 @@
1
1
  import { ChartKind } from '../core/summary.js';
2
- import { ChartModel, ChartModelOptions, ChartModelProps } from './chart-model-types.js';
2
+ import { ChartModel, ChartModelOptions, ChartModelProps, ChartReferenceProps } from './chart-model-types.js';
3
3
  import { ModelSeries } from './model-series.js';
4
- export type { ChartModel, ChartModelOptions, ChartModelProps, ModelSeries };
4
+ export type { ChartModel, ChartModelOptions, ChartModelProps, ChartReferenceProps, ModelSeries, };
5
5
  /**
6
6
  * Everything a chart computes besides its SVG: series, visibility, labels,
7
7
  * the keyboard point, summary, status, legend and table. A chart calls it,
@@ -10,4 +10,4 @@ export type { ChartModel, ChartModelOptions, ChartModelProps, ModelSeries };
10
10
  * parts are memoized on the data, the series, the hidden ones and the
11
11
  * language, so a hover only recomputes the status.
12
12
  */
13
- export declare function useChartModel(props: ChartModelProps, kind: ChartKind, { keyMap, axes, span }?: ChartModelOptions): ChartModel;
13
+ export declare function useChartModel(props: ChartModelProps, kind: ChartKind, { keyMap, axes, span, reference }?: ChartModelOptions): ChartModel;
@@ -4,7 +4,7 @@ export type { BarChartProps, BarLayout, BarOrientation, } from './bar-chart/bar-
4
4
  export { ComboChart } from './combo-chart/combo-chart.js';
5
5
  export type { ComboChartProps } from './combo-chart/combo-chart-types.js';
6
6
  export type { ChartRange, ChartRangeProps, ChartScrollOptions, ChartZoomOptions, } from './core/range-types.js';
7
- export type { ChartAxis, ChartBaseProps, ChartColor, ChartPalette, ChartPoint, ChartRow, ChartSeries, ChartShape, ChartSlice, ChartValue, ChartXAxis, ComboSeries, RowKey, ScatterPoint, ScatterSeries, } from './core/types.js';
7
+ export type { ChartAxis, ChartBand, ChartBaseProps, ChartColor, ChartPalette, ChartPoint, ChartRow, ChartSeries, ChartShape, ChartSlice, ChartThreshold, ChartValue, ChartXAxis, ComboSeries, RowKey, ScatterPoint, ScatterSeries, } from './core/types.js';
8
8
  export { FunnelChart } from './funnel-chart/funnel-chart.js';
9
9
  export type { FunnelChartProps } from './funnel-chart/funnel-chart-types.js';
10
10
  export { Gauge } from './gauge/gauge.js';
@@ -1,6 +1,8 @@
1
+ import { Tone } from '../../../tones.js';
1
2
  import { ChartCurve } from '../core/lines.js';
3
+ import { ToneWords } from '../core/point-tones.js';
2
4
  import { ChartRangeProps } from '../core/range-types.js';
3
- import { ChartRow } from '../core/types.js';
5
+ import { ChartBand, ChartPoint, ChartRow, ChartSeries, ChartThreshold } from '../core/types.js';
4
6
  import { ChartModelProps } from '../hooks/use-chart-model.js';
5
7
  export type { ChartCurve };
6
8
  /**
@@ -13,6 +15,29 @@ export type LineChartProps<T extends object = ChartRow> = ChartModelProps<T> & C
13
15
  curve?: ChartCurve;
14
16
  /** Draws a dot on every value; patterns mode draws each series' shape instead. */
15
17
  points?: boolean;
18
+ /**
19
+ * Shaded ranges of the value axis behind the lines (a normal range, a
20
+ * target zone), each with its label. The value axis grows to show them
21
+ * unless `yAxis.min` / `max` pin it (a band is then clipped); the
22
+ * summary says how many values fall outside each, and "View data"
23
+ * lists them. Keep the array stable (memoize it).
24
+ */
25
+ bands?: ChartBand[];
26
+ /** Horizontal lines at a value with a label at their end, also in the summary and in "View data". Keep the array stable. */
27
+ thresholds?: ChartThreshold[];
28
+ /**
29
+ * The tone of a point, or undefined for none. A toned point is drawn
30
+ * as a ringed marker (never colour alone) and its word ("High") joins the
31
+ * tooltip, the live status, the summary and a tone column of "View data".
32
+ * It is given the point `onPointClick` gets (`index` is the row of the full
33
+ * data) and its series. Keep the function stable (`useCallback`).
34
+ */
35
+ pointTone?: (point: ChartPoint, series: ChartSeries) => Tone | undefined;
36
+ /**
37
+ * The word of each tone, in your language and domain ({ error: 'High' });
38
+ * unset, the library's neutral word ("Error", translated).
39
+ */
40
+ toneLabels?: ToneWords;
16
41
  };
17
42
  export type AreaChartProps<T extends object = ChartRow> = LineChartProps<T> & {
18
43
  /** Stacks the series on one another; the areas are all filled. Expects values of 0 or more: a negative value is subtracted from the band below. */
@@ -23,6 +23,8 @@ export type LineGeometry = {
23
23
  x: ScaleLinear<number, number>;
24
24
  y: ScaleLinear<number, number>;
25
25
  ticks: number[];
26
+ /** The value axis' span, low then high. */
27
+ domain: [number, number];
26
28
  /** The x labels, cut to the room each drawn one gets, and every how many is drawn. */
27
29
  labels: string[];
28
30
  step: number;
@@ -37,6 +39,8 @@ export type LineGeometryInput = {
37
39
  yAxis?: ChartAxis;
38
40
  curve?: ChartCurve;
39
41
  stacked?: boolean;
42
+ /** Values the domain must also hold: the bands' ends and the thresholds. */
43
+ extra?: readonly number[];
40
44
  /** The y axis' formatted tick labels decide the left margin. */
41
45
  margin: (ticks: number[]) => number;
42
46
  };
@@ -0,0 +1,17 @@
1
+ import { ChartModel } from '../../hooks/use-chart-model.js';
2
+ import { LineGeometry } from '../line-geometry.js';
3
+ /**
4
+ * The reference bands and threshold lines, behind the series: a band is a
5
+ * tint across the plot (decorative: its label carries the meaning), a
6
+ * threshold a dashed line. Both are clipped to the value axis, so a
7
+ * pinned `yAxis` or a zoomed window never draws outside the plot.
8
+ */
9
+ export declare function ReferenceLayer({ refs, geo, }: {
10
+ refs: ChartModel['refs'];
11
+ geo: LineGeometry;
12
+ }): import("react").JSX.Element;
13
+ /** The labels of the bands (inside, at the plot's left) and of the thresholds (above the line, at its right end), over the series. */
14
+ export declare function ReferenceLabels({ refs, geo, }: {
15
+ refs: ChartModel['refs'];
16
+ geo: LineGeometry;
17
+ }): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { LineGeometry } from '../line-geometry.js';
2
+ /**
3
+ * The points a `pointTone` marks: a ring in the tone's colour round the
4
+ * value, never a colour change alone, with the series' shape inside in
5
+ * patterns mode, else a dot. Drawn over the series' own dots. The ring stays
6
+ * on the plot's layer: the word itself is in the tooltip, the summary and the table.
7
+ */
8
+ export declare function TonePoints({ geo, patterns, }: {
9
+ geo: LineGeometry;
10
+ patterns?: boolean;
11
+ }): import("react").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { PaintAttributes } from '../core/colors.js';
3
+ import { ToneMark } from '../core/point-tones.js';
3
4
  /** The tooltip's drawn size, in px. */
4
5
  export type TipSize = {
5
6
  width: number;
@@ -12,6 +13,8 @@ export type TooltipRow = {
12
13
  paint: PaintAttributes;
13
14
  /** The axis the value belongs to, when the chart has two. */
14
15
  note?: string;
16
+ /** The point's tone and its word ("High"), when it has one. */
17
+ tone?: ToneMark;
15
18
  };
16
19
  /**
17
20
  * The tooltip's content, direction B: the x label, the first (active)
@@ -2076,6 +2076,7 @@ export declare const en: {
2076
2076
  "error-hint": string;
2077
2077
  "bulk-action": string;
2078
2078
  "bulk-action-name": string;
2079
+ "bulk-max-notice": string;
2079
2080
  "bulk-more": string;
2080
2081
  };
2081
2082
  "list-empty": {
@@ -2290,6 +2291,7 @@ export declare const en: {
2290
2291
  apply: string;
2291
2292
  "no-range": string;
2292
2293
  "type-date": string;
2294
+ "type-date-time": string;
2293
2295
  "type-range": string;
2294
2296
  "select-date": string;
2295
2297
  "select-dates": string;
@@ -2724,6 +2726,8 @@ export declare const en: {
2724
2726
  "no-data": string;
2725
2727
  loading: string;
2726
2728
  "status-value": string;
2729
+ "status-value-tone": string;
2730
+ "table-tone": string;
2727
2731
  "status-point": string;
2728
2732
  "table-caption": string;
2729
2733
  "status-slice": string;
@@ -2767,6 +2771,20 @@ export declare const en: {
2767
2771
  "zoom-reset": string;
2768
2772
  "zoom-showing": string;
2769
2773
  "zoom-range": string;
2774
+ tone: {
2775
+ primary: string;
2776
+ secondary: string;
2777
+ tertiary: string;
2778
+ success: string;
2779
+ info: string;
2780
+ warning: string;
2781
+ error: string;
2782
+ neutral: string;
2783
+ };
2784
+ reference: {
2785
+ band: string;
2786
+ threshold: string;
2787
+ };
2770
2788
  kind: {
2771
2789
  line: string;
2772
2790
  area: string;
@@ -2786,6 +2804,11 @@ export declare const en: {
2786
2804
  range: string;
2787
2805
  series: string;
2788
2806
  hidden: string;
2807
+ bands: string;
2808
+ thresholds: string;
2809
+ outside: string;
2810
+ tones: string;
2811
+ "tone-count": string;
2789
2812
  slices: string;
2790
2813
  largest: string;
2791
2814
  slice: string;
@@ -2066,6 +2066,7 @@ declare const _default: {
2066
2066
  "error-hint": "Check your connection, then try again.",
2067
2067
  "bulk-action": "{label} ({count})",
2068
2068
  "bulk-action-name": "{label} {count, plural, one {# row} other {# rows}}",
2069
+ "bulk-max-notice": "Select {max, plural, one {# row} other {# rows}} or fewer to {label}",
2069
2070
  "bulk-more": "More"
2070
2071
  },
2071
2072
  "list-empty": {
@@ -2280,6 +2281,7 @@ declare const _default: {
2280
2281
  "apply": "Apply",
2281
2282
  "no-range": "No dates yet",
2282
2283
  "type-date": "Type the date",
2284
+ "type-date-time": "Type the date and time",
2283
2285
  "type-range": "Type the dates",
2284
2286
  "select-date": "Select date",
2285
2287
  "select-dates": "Select dates",
@@ -2714,6 +2716,8 @@ declare const _default: {
2714
2716
  "no-data": "No data to show",
2715
2717
  "loading": "Loading chart",
2716
2718
  "status-value": "{series} {value}",
2719
+ "status-value-tone": "{series} {value} ({tone})",
2720
+ "table-tone": "{series} tone",
2717
2721
  "status-point": "{label}: {values}",
2718
2722
  "table-caption": "{title}: the data",
2719
2723
  "status-slice": "{label}: {value}, {share}",
@@ -2757,6 +2761,20 @@ declare const _default: {
2757
2761
  "zoom-reset": "Reset zoom",
2758
2762
  "zoom-showing": "Showing {from} to {to}",
2759
2763
  "zoom-range": "{from} to {to}",
2764
+ "tone": {
2765
+ "primary": "Primary",
2766
+ "secondary": "Secondary",
2767
+ "tertiary": "Tertiary",
2768
+ "success": "Success",
2769
+ "info": "Info",
2770
+ "warning": "Warning",
2771
+ "error": "Error",
2772
+ "neutral": "Neutral"
2773
+ },
2774
+ "reference": {
2775
+ "band": "{label}: {from} to {to}",
2776
+ "threshold": "{label}: {value}"
2777
+ },
2760
2778
  "kind": {
2761
2779
  "line": "line chart",
2762
2780
  "area": "area chart",
@@ -2776,6 +2794,11 @@ declare const _default: {
2776
2794
  "range": "{count, plural, one {# point} other {# points}}, from {first} to {last}.",
2777
2795
  "series": "{series}: from {start} to {end}, highest {max} ({maxAt}), lowest {min} ({minAt}).",
2778
2796
  "hidden": "Hidden: {series}.",
2797
+ "bands": "Reference ranges: {list}.",
2798
+ "thresholds": "Thresholds: {list}.",
2799
+ "outside": "{series}: {count} of {total, plural, one {# point} other {# points}} outside {band}.",
2800
+ "tones": "{series}: {list}, of {total, plural, one {# point} other {# points}}.",
2801
+ "tone-count": "{count} {tone}",
2779
2802
  "slices": "{count, plural, one {# slice} other {# slices}}, {total} in all.",
2780
2803
  "largest": "Largest: {list}.",
2781
2804
  "slice": "{label} {value} ({share})",
@@ -2076,6 +2076,7 @@ export declare const fr: {
2076
2076
  "error-hint": string;
2077
2077
  "bulk-action": string;
2078
2078
  "bulk-action-name": string;
2079
+ "bulk-max-notice": string;
2079
2080
  "bulk-more": string;
2080
2081
  };
2081
2082
  "list-empty": {
@@ -2290,6 +2291,7 @@ export declare const fr: {
2290
2291
  apply: string;
2291
2292
  "no-range": string;
2292
2293
  "type-date": string;
2294
+ "type-date-time": string;
2293
2295
  "type-range": string;
2294
2296
  "select-date": string;
2295
2297
  "select-dates": string;
@@ -2724,6 +2726,8 @@ export declare const fr: {
2724
2726
  "no-data": string;
2725
2727
  loading: string;
2726
2728
  "status-value": string;
2729
+ "status-value-tone": string;
2730
+ "table-tone": string;
2727
2731
  "status-point": string;
2728
2732
  "table-caption": string;
2729
2733
  "status-slice": string;
@@ -2767,6 +2771,20 @@ export declare const fr: {
2767
2771
  "zoom-reset": string;
2768
2772
  "zoom-showing": string;
2769
2773
  "zoom-range": string;
2774
+ tone: {
2775
+ primary: string;
2776
+ secondary: string;
2777
+ tertiary: string;
2778
+ success: string;
2779
+ info: string;
2780
+ warning: string;
2781
+ error: string;
2782
+ neutral: string;
2783
+ };
2784
+ reference: {
2785
+ band: string;
2786
+ threshold: string;
2787
+ };
2770
2788
  kind: {
2771
2789
  line: string;
2772
2790
  area: string;
@@ -2786,6 +2804,11 @@ export declare const fr: {
2786
2804
  range: string;
2787
2805
  series: string;
2788
2806
  hidden: string;
2807
+ bands: string;
2808
+ thresholds: string;
2809
+ outside: string;
2810
+ tones: string;
2811
+ "tone-count": string;
2789
2812
  slices: string;
2790
2813
  largest: string;
2791
2814
  slice: string;
@@ -2066,6 +2066,7 @@ declare const _default: {
2066
2066
  "error-hint": "Vérifiez votre connexion, puis réessayez.",
2067
2067
  "bulk-action": "{label} ({count})",
2068
2068
  "bulk-action-name": "{label} : {count, plural, one {# ligne} other {# lignes}}",
2069
+ "bulk-max-notice": "Sélectionnez {max, plural, one {# ligne} other {# lignes}} ou moins pour {label}",
2069
2070
  "bulk-more": "Plus"
2070
2071
  },
2071
2072
  "list-empty": {
@@ -2280,6 +2281,7 @@ declare const _default: {
2280
2281
  "apply": "Appliquer",
2281
2282
  "no-range": "Aucune date",
2282
2283
  "type-date": "Saisir la date",
2284
+ "type-date-time": "Saisir la date et l’heure",
2283
2285
  "type-range": "Saisir les dates",
2284
2286
  "select-date": "Choisir la date",
2285
2287
  "select-dates": "Choisir les dates",
@@ -2714,6 +2716,8 @@ declare const _default: {
2714
2716
  "no-data": "Aucune donnée à afficher",
2715
2717
  "loading": "Chargement du graphique",
2716
2718
  "status-value": "{series} {value}",
2719
+ "status-value-tone": "{series} {value} ({tone})",
2720
+ "table-tone": "{series} : ton",
2717
2721
  "status-point": "{label} : {values}",
2718
2722
  "table-caption": "{title} : les données",
2719
2723
  "status-slice": "{label} : {value}, {share}",
@@ -2757,6 +2761,20 @@ declare const _default: {
2757
2761
  "zoom-reset": "Réinitialiser le zoom",
2758
2762
  "zoom-showing": "Affichage de {from} à {to}",
2759
2763
  "zoom-range": "{from} à {to}",
2764
+ "tone": {
2765
+ "primary": "Principal",
2766
+ "secondary": "Secondaire",
2767
+ "tertiary": "Tertiaire",
2768
+ "success": "Succès",
2769
+ "info": "Information",
2770
+ "warning": "Alerte",
2771
+ "error": "Erreur",
2772
+ "neutral": "Neutre"
2773
+ },
2774
+ "reference": {
2775
+ "band": "{label} : de {from} à {to}",
2776
+ "threshold": "{label} : {value}"
2777
+ },
2760
2778
  "kind": {
2761
2779
  "line": "graphique en courbes",
2762
2780
  "area": "graphique en aires",
@@ -2776,6 +2794,11 @@ declare const _default: {
2776
2794
  "range": "{count, plural, one {# point} other {# points}}, de {first} à {last}.",
2777
2795
  "series": "{series} : de {start} à {end}, maximum {max} ({maxAt}), minimum {min} ({minAt}).",
2778
2796
  "hidden": "Masquées : {series}.",
2797
+ "bands": "Plages de référence : {list}.",
2798
+ "thresholds": "Seuils : {list}.",
2799
+ "outside": "{series} : {count} sur {total, plural, one {# point} other {# points}} hors de {band}.",
2800
+ "tones": "{series} : {list}, sur {total, plural, one {# point} other {# points}}.",
2801
+ "tone-count": "{count} {tone}",
2779
2802
  "slices": "{count, plural, one {# part} other {# parts}}, {total} au total.",
2780
2803
  "largest": "Les plus grandes : {list}.",
2781
2804
  "slice": "{label} {value} ({share})",