@fusion.dev/helix-headless 0.188.0 → 0.190.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/api.json +1 -1
- package/custom-elements.json +39844 -36049
- package/dist/element-events.generated.js +21 -7
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/spatial-heatmap/index.d.ts +1 -0
- package/dist/spatial-heatmap/index.js +1 -0
- package/dist/{isometric-heatmap → spatial-heatmap}/projection.d.ts +32 -6
- package/dist/{isometric-heatmap → spatial-heatmap}/projection.js +33 -8
- package/dist/spatial-heatmap/root/spatial-heatmap-root.d.ts +239 -0
- package/dist/spatial-heatmap/root/spatial-heatmap-root.js +252 -0
- package/dist/spatial-scatter-chart/field.d.ts +63 -0
- package/dist/spatial-scatter-chart/field.js +61 -0
- package/dist/spatial-scatter-chart/index.d.ts +2 -0
- package/dist/spatial-scatter-chart/index.js +2 -0
- package/dist/spatial-scatter-chart/root/spatial-scatter-chart-root.d.ts +207 -0
- package/dist/spatial-scatter-chart/root/spatial-scatter-chart-root.js +222 -0
- package/dist/spatial-scatter-chart/view.d.ts +93 -0
- package/dist/spatial-scatter-chart/view.js +115 -0
- package/dist/spatial-surface-chart/grid.d.ts +50 -0
- package/dist/spatial-surface-chart/grid.js +46 -0
- package/dist/spatial-surface-chart/index.d.ts +2 -0
- package/dist/spatial-surface-chart/index.js +2 -0
- package/dist/spatial-surface-chart/root/spatial-surface-chart-root.d.ts +234 -0
- package/dist/spatial-surface-chart/root/spatial-surface-chart-root.js +281 -0
- package/examples.json +1 -1
- package/lint.json +1 -1
- package/package.json +5 -5
- package/types/jsx.d.ts +5417 -3661
- package/types/svelte.d.ts +3 -1
- package/types/vue.d.ts +590 -298
- package/types/words.d.ts +153 -69
- package/dist/isometric-heatmap/index.d.ts +0 -1
- package/dist/isometric-heatmap/index.js +0 -1
- package/dist/isometric-heatmap/root/isometric-heatmap-root.d.ts +0 -118
- package/dist/isometric-heatmap/root/isometric-heatmap-root.js +0 -127
package/types/words.d.ts
CHANGED
|
@@ -1911,75 +1911,6 @@ declare module '@fusion.dev/helix-core' {
|
|
|
1911
1911
|
*/
|
|
1912
1912
|
revealLabel: Message
|
|
1913
1913
|
}
|
|
1914
|
-
'helix-isometric-heatmap': {
|
|
1915
|
-
/**
|
|
1916
|
-
* The name the `overview` gives the busiest reading, `{busiestLabel}` in
|
|
1917
|
-
* `overview-label`.
|
|
1918
|
-
*
|
|
1919
|
-
* English: `Busiest`
|
|
1920
|
-
*/
|
|
1921
|
-
busiestLabel: Message
|
|
1922
|
-
/**
|
|
1923
|
-
* The words shown in place of the drawing when the table has no readings,
|
|
1924
|
-
* and the fallback of the `empty` slot.
|
|
1925
|
-
*
|
|
1926
|
-
* English: `No readings`
|
|
1927
|
-
*/
|
|
1928
|
-
emptyText: Message
|
|
1929
|
-
/**
|
|
1930
|
-
* The words shown in place of the drawing while `loading` is set and
|
|
1931
|
-
* there are no readings yet, and the fallback of the `loading` slot.
|
|
1932
|
-
*
|
|
1933
|
-
* English: `Loading readings`
|
|
1934
|
-
*/
|
|
1935
|
-
loadingText: Message
|
|
1936
|
-
/**
|
|
1937
|
-
* The `overview`'s sentence. `{busiestLabel}` and `{totalLabel}` are
|
|
1938
|
-
* `busiest-label` and `total-label`, `{busiest}` the busiest reading's name
|
|
1939
|
-
* and its reading as the table writes it, and `{total}` the total of the
|
|
1940
|
-
* readings drawn, written in the locale.
|
|
1941
|
-
*
|
|
1942
|
-
* English: `{busiestLabel}: {busiest}; {totalLabel} {total}.`
|
|
1943
|
-
*/
|
|
1944
|
-
overviewLabel: Message
|
|
1945
|
-
/**
|
|
1946
|
-
* Where a reading the keys moved to stands among the readings, said after
|
|
1947
|
-
* it. `{position}` and `{count}` are replaced with the numbers, written in
|
|
1948
|
-
* `locale`.
|
|
1949
|
-
*
|
|
1950
|
-
* English: `{position} of {count}`
|
|
1951
|
-
*/
|
|
1952
|
-
positionLabel: Message
|
|
1953
|
-
/**
|
|
1954
|
-
* What the readout added for a selected cell, under `selection-mode`.
|
|
1955
|
-
*
|
|
1956
|
-
* English: `selected`
|
|
1957
|
-
*/
|
|
1958
|
-
selectedLabel: Message
|
|
1959
|
-
/**
|
|
1960
|
-
* What the `selection` part says after the selection changes. `{count}` is
|
|
1961
|
-
* how many cells are selected, written in the locale, and a language that
|
|
1962
|
-
* needs plural forms writes them: `{count, plural, one {# wybrany} few
|
|
1963
|
-
* {# wybrane} many {# wybranych} other {# wybranego}}`.
|
|
1964
|
-
*
|
|
1965
|
-
* English: `{count, plural, one {# selected} other {# selected}}`
|
|
1966
|
-
*/
|
|
1967
|
-
selectionLabel: Message
|
|
1968
|
-
/**
|
|
1969
|
-
* The strip's name where the chart has none: no `aria-label`, `label`, or
|
|
1970
|
-
* table caption.
|
|
1971
|
-
*
|
|
1972
|
-
* English: `Heatmap`
|
|
1973
|
-
*/
|
|
1974
|
-
stripLabel: Message
|
|
1975
|
-
/**
|
|
1976
|
-
* The name the `overview` gives the total of the readings drawn,
|
|
1977
|
-
* `{totalLabel}` in `overview-label`.
|
|
1978
|
-
*
|
|
1979
|
-
* English: `Total`
|
|
1980
|
-
*/
|
|
1981
|
-
totalLabel: Message
|
|
1982
|
-
}
|
|
1983
1914
|
'helix-lightbox': {
|
|
1984
1915
|
/**
|
|
1985
1916
|
* The close control's accessible name. Translate it with the rest of your
|
|
@@ -3023,6 +2954,159 @@ declare module '@fusion.dev/helix-core' {
|
|
|
3023
2954
|
*/
|
|
3024
2955
|
positionLabel: Message
|
|
3025
2956
|
}
|
|
2957
|
+
'helix-spatial-heatmap': {
|
|
2958
|
+
/**
|
|
2959
|
+
* The name the `overview` gives the busiest reading, `{busiestLabel}` in
|
|
2960
|
+
* `overview-label`.
|
|
2961
|
+
*
|
|
2962
|
+
* English: `Busiest`
|
|
2963
|
+
*/
|
|
2964
|
+
busiestLabel: Message
|
|
2965
|
+
/**
|
|
2966
|
+
* The words shown in place of the drawing when the table has no readings,
|
|
2967
|
+
* and the fallback of the `empty` slot.
|
|
2968
|
+
*
|
|
2969
|
+
* English: `No readings`
|
|
2970
|
+
*/
|
|
2971
|
+
emptyText: Message
|
|
2972
|
+
/**
|
|
2973
|
+
* The words shown in place of the drawing while `loading` is set and
|
|
2974
|
+
* there are no readings yet, and the fallback of the `loading` slot.
|
|
2975
|
+
*
|
|
2976
|
+
* English: `Loading readings`
|
|
2977
|
+
*/
|
|
2978
|
+
loadingText: Message
|
|
2979
|
+
/**
|
|
2980
|
+
* The `overview`'s sentence. `{busiestLabel}` and `{totalLabel}` are
|
|
2981
|
+
* `busiest-label` and `total-label`, `{busiest}` the busiest reading's name
|
|
2982
|
+
* and its reading as the table writes it, and `{total}` the total of the
|
|
2983
|
+
* readings drawn, written in the locale.
|
|
2984
|
+
*
|
|
2985
|
+
* English: `{busiestLabel}: {busiest}; {totalLabel} {total}.`
|
|
2986
|
+
*/
|
|
2987
|
+
overviewLabel: Message
|
|
2988
|
+
/**
|
|
2989
|
+
* Where a reading the keys moved to stands among the readings, said after
|
|
2990
|
+
* it. `{position}` and `{count}` are replaced with the numbers, written in
|
|
2991
|
+
* `locale`.
|
|
2992
|
+
*
|
|
2993
|
+
* English: `{position} of {count}`
|
|
2994
|
+
*/
|
|
2995
|
+
positionLabel: Message
|
|
2996
|
+
/**
|
|
2997
|
+
* What the readout added for a selected cell, under `selection-mode`.
|
|
2998
|
+
*
|
|
2999
|
+
* English: `selected`
|
|
3000
|
+
*/
|
|
3001
|
+
selectedLabel: Message
|
|
3002
|
+
/**
|
|
3003
|
+
* What the `selection` part says after the selection changes. `{count}` is
|
|
3004
|
+
* how many cells are selected, written in the locale, and a language that
|
|
3005
|
+
* needs plural forms writes them: `{count, plural, one {# wybrany} few
|
|
3006
|
+
* {# wybrane} many {# wybranych} other {# wybranego}}`.
|
|
3007
|
+
*
|
|
3008
|
+
* English: `{count, plural, one {# selected} other {# selected}}`
|
|
3009
|
+
*/
|
|
3010
|
+
selectionLabel: Message
|
|
3011
|
+
/**
|
|
3012
|
+
* The strip's name where the chart has none: no `aria-label`, `label`, or
|
|
3013
|
+
* table caption.
|
|
3014
|
+
*
|
|
3015
|
+
* English: `Heatmap`
|
|
3016
|
+
*/
|
|
3017
|
+
stripLabel: Message
|
|
3018
|
+
/**
|
|
3019
|
+
* The name the `overview` gives the total of the readings drawn,
|
|
3020
|
+
* `{totalLabel}` in `overview-label`.
|
|
3021
|
+
*
|
|
3022
|
+
* English: `Total`
|
|
3023
|
+
*/
|
|
3024
|
+
totalLabel: Message
|
|
3025
|
+
}
|
|
3026
|
+
'helix-spatial-scatter-chart': {
|
|
3027
|
+
/**
|
|
3028
|
+
* The words shown in place of the drawing when the table has no readings,
|
|
3029
|
+
* and the fallback of the `empty` slot.
|
|
3030
|
+
*
|
|
3031
|
+
* English: `No readings`
|
|
3032
|
+
*/
|
|
3033
|
+
emptyText: Message
|
|
3034
|
+
/**
|
|
3035
|
+
* The words shown in place of the drawing while `loading` is set and
|
|
3036
|
+
* there are no readings yet, and the fallback of the `loading` slot.
|
|
3037
|
+
*
|
|
3038
|
+
* English: `Loading readings`
|
|
3039
|
+
*/
|
|
3040
|
+
loadingText: Message
|
|
3041
|
+
/**
|
|
3042
|
+
* The plot's name where the chart has none: no `aria-label`, `label`, or table caption.
|
|
3043
|
+
*
|
|
3044
|
+
* English: `3D scatter chart`
|
|
3045
|
+
*/
|
|
3046
|
+
plotLabel: Message
|
|
3047
|
+
/**
|
|
3048
|
+
* Where a reading the keys moved to stands among the readings, said after
|
|
3049
|
+
* it. `{position}` and `{count}` are replaced with the numbers, written in
|
|
3050
|
+
* `locale`.
|
|
3051
|
+
*
|
|
3052
|
+
* English: `{position} of {count}`
|
|
3053
|
+
*/
|
|
3054
|
+
positionLabel: Message
|
|
3055
|
+
/**
|
|
3056
|
+
* The `summary` part's sentence. `{count}` is the number of points, written
|
|
3057
|
+
* in the locale, and `{x}`, `{y}`, and `{z}` are the three measures' names.
|
|
3058
|
+
*
|
|
3059
|
+
* English: `{count, plural, one {# point} other {# points}}: {x} across, {y} up, and {z} in depth.`
|
|
3060
|
+
*/
|
|
3061
|
+
summaryLabel: Message
|
|
3062
|
+
}
|
|
3063
|
+
'helix-spatial-surface-chart': {
|
|
3064
|
+
/**
|
|
3065
|
+
* The words shown in place of the drawing when the table has no readings,
|
|
3066
|
+
* and the fallback of the `empty` slot.
|
|
3067
|
+
*
|
|
3068
|
+
* English: `No readings`
|
|
3069
|
+
*/
|
|
3070
|
+
emptyText: Message
|
|
3071
|
+
/**
|
|
3072
|
+
* The words shown in place of the drawing while `loading` is set and
|
|
3073
|
+
* there are no readings yet, and the fallback of the `loading` slot.
|
|
3074
|
+
*
|
|
3075
|
+
* English: `Loading readings`
|
|
3076
|
+
*/
|
|
3077
|
+
loadingText: Message
|
|
3078
|
+
/**
|
|
3079
|
+
* What the readout says for a place with no reading. `{x}` and `{z}` are
|
|
3080
|
+
* the place's numbers across and in depth, and `{across}` and `{depth}`
|
|
3081
|
+
* the two measures' names.
|
|
3082
|
+
*
|
|
3083
|
+
* English: `{across} {x}, {depth} {z}: no reading`
|
|
3084
|
+
*/
|
|
3085
|
+
openLabel: Message
|
|
3086
|
+
/**
|
|
3087
|
+
* The plot's name where the chart has none: no `aria-label`, `label`, or table caption.
|
|
3088
|
+
*
|
|
3089
|
+
* English: `3D surface chart`
|
|
3090
|
+
*/
|
|
3091
|
+
plotLabel: Message
|
|
3092
|
+
/**
|
|
3093
|
+
* Where a reading the keys moved to stands among the readings, said after
|
|
3094
|
+
* it. `{position}` and `{count}` are replaced with the numbers, written in
|
|
3095
|
+
* `locale`.
|
|
3096
|
+
*
|
|
3097
|
+
* English: `{position} of {count}`
|
|
3098
|
+
*/
|
|
3099
|
+
positionLabel: Message
|
|
3100
|
+
/**
|
|
3101
|
+
* The `summary` part's sentence. `{count}` is the number of readings,
|
|
3102
|
+
* written in the locale, `{x}`, `{z}`, and `{y}` are the measures across,
|
|
3103
|
+
* in depth, and up, and `{low}` and `{high}` the lowest and the highest
|
|
3104
|
+
* reading.
|
|
3105
|
+
*
|
|
3106
|
+
* English: `{count, plural, one {# reading} other {# readings}} of {y} over {x} and {z}, from {low} to {high}.`
|
|
3107
|
+
*/
|
|
3108
|
+
summaryLabel: Message
|
|
3109
|
+
}
|
|
3026
3110
|
'helix-speed-dial': {
|
|
3027
3111
|
/**
|
|
3028
3112
|
* Accessible name for the trigger and the set of actions it opens.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { HelixHeadlessIsometricHeatmap } from './root/isometric-heatmap-root.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { HelixHeadlessIsometricHeatmap } from './root/isometric-heatmap-root.js';
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { nothing, type TemplateResult } from 'lit';
|
|
2
|
-
import '../../tooltip/index.js';
|
|
3
|
-
import { HelixHeadlessHeatmap } from '../../heatmap/root/heatmap-root.js';
|
|
4
|
-
/**
|
|
5
|
-
* @summary A heatmap drawn as a relief, where each reading stands as tall as its value.
|
|
6
|
-
*
|
|
7
|
-
* @description
|
|
8
|
-
* The same strip as `Heatmap`, seen from above at an angle. Each reading is a
|
|
9
|
-
* prism: its top face takes the cell's tone, and its height repeats the value,
|
|
10
|
-
* measured from zero against the highest reading in the table. `rows="7"`
|
|
11
|
-
* makes a contribution graph, with each week a column running down to the
|
|
12
|
-
* right.
|
|
13
|
-
*
|
|
14
|
-
* **The height says what the tone says.** Read the exact value from the tooltip
|
|
15
|
-
* or the table, and compare readings by tone. A tall reading at the front can
|
|
16
|
-
* hide a short one behind it, so the newest column stands at the front, where
|
|
17
|
-
* nothing covers it.
|
|
18
|
-
*
|
|
19
|
-
* **Everything else is `Heatmap`.** The table named by `for`, the tones and
|
|
20
|
-
* thresholds, the keys, the tooltip, the overview, `selection-mode`, and the
|
|
21
|
-
* events all work as they do there. The class extends the headless heatmap,
|
|
22
|
-
* and its own entry point carries the drawing, so a page using only `Heatmap`
|
|
23
|
-
* loads none of it.
|
|
24
|
-
*
|
|
25
|
-
* **`flat` lays every prism down** at no height, which leaves the tones on a
|
|
26
|
-
* plane at the same angle.
|
|
27
|
-
*
|
|
28
|
-
* **`gap` and `min-cell` set the smallest cell.** The drawing scales as a
|
|
29
|
-
* whole, so a wider box draws larger cells and the gap grows with them. A box
|
|
30
|
-
* too narrow for every column at `min-cell` draws the newest that fit.
|
|
31
|
-
*
|
|
32
|
-
* **The drawing is SVG and holds still.** It scales with its box through its
|
|
33
|
-
* `viewBox`, needs no WebGL, and has no motion to pause.
|
|
34
|
-
*
|
|
35
|
-
* **Keyboard.** The keys are `Heatmap`'s. Down moves to the next reading in a
|
|
36
|
-
* column, drawn down to the left, and Right to the same reading in the next
|
|
37
|
-
* column, drawn down to the right.
|
|
38
|
-
*
|
|
39
|
-
* | Key | What it does |
|
|
40
|
-
* |---|---|
|
|
41
|
-
* | Tab | Moves focus to the strip and shows the first cell. |
|
|
42
|
-
* | Down, Up | Moves to the next or the previous cell. |
|
|
43
|
-
* | Right, Left | Moves a column on or back, a week with `rows="7"`. On a right-to-left page, Left moves on. |
|
|
44
|
-
* | Home, End | Moves to the first or the last cell. |
|
|
45
|
-
* | Page Down, Page Up | Moves a month on or back where the rows carry dates, and four columns otherwise. |
|
|
46
|
-
* | Enter, Space | Presses the cell, which sends `helix-reading-press`, and selects it or lets it go under `selection-mode`. |
|
|
47
|
-
* | Shift with an arrow, Home, End, Page Up or Page Down | Selects every cell from the last one pressed to where the key went, under `selection-mode="multiple"`. |
|
|
48
|
-
* | Escape | Puts the cell's tooltip away. |
|
|
49
|
-
*
|
|
50
|
-
* @since 0.185.0
|
|
51
|
-
* @status experimental
|
|
52
|
-
* @category charts
|
|
53
|
-
* @aliases Isometric chart, 3D heatmap, Relief chart, Isometric contribution graph
|
|
54
|
-
* @documentation https://fusion.dev/helix/components/isometric-heatmap
|
|
55
|
-
*
|
|
56
|
-
* @csspart cell - One reading: a group holding its three faces.
|
|
57
|
-
* @csspart drawing - The SVG every prism is drawn in. It is mirrored on a right-to-left page.
|
|
58
|
-
* @csspart left-face - The face of a prism toward the next row, drawn at its lower left.
|
|
59
|
-
* @csspart right-face - The face of a prism toward the next column, drawn at its lower right.
|
|
60
|
-
* @csspart row - A column of prisms, which a grid reads as a row, under `selection-mode`.
|
|
61
|
-
* @csspart strip - The box the drawing fills, which takes focus to be read by key. It is named by the host's `aria-labelledby` or `aria-label`, then by `label`, then by the caption of the table.
|
|
62
|
-
* @csspart top-face - The top of a prism, which carries the reading's tone.
|
|
63
|
-
*
|
|
64
|
-
* @cssproperty --isometric-heatmap-span - How many cells the drawing spans across: its columns and its rows together. The component writes it on the strip, and a stylesheet that caps the cell size reads it.
|
|
65
|
-
*/
|
|
66
|
-
export declare class HelixHeadlessIsometricHeatmap extends HelixHeadlessHeatmap {
|
|
67
|
-
/**
|
|
68
|
-
* The key this family's words are registered under, its styled tag:
|
|
69
|
-
* `registerWords('de', { 'helix-isometric-heatmap': { emptyText: 'Keine Werte' } })`.
|
|
70
|
-
*/
|
|
71
|
-
static words: string;
|
|
72
|
-
protected static markRules: string[];
|
|
73
|
-
/**
|
|
74
|
-
* Draws every prism at no height, so the tones lie on a plane.
|
|
75
|
-
*/
|
|
76
|
-
flat: boolean;
|
|
77
|
-
/**
|
|
78
|
-
* How tall the highest reading stands, in cells. Every other reading stands
|
|
79
|
-
* at its share of it.
|
|
80
|
-
*/
|
|
81
|
-
relief: number;
|
|
82
|
-
/** The prisms drawn on the last render, which the tooltip is placed against. */
|
|
83
|
-
private shown;
|
|
84
|
-
/**
|
|
85
|
-
* How many readings fit, as whole columns, newest kept.
|
|
86
|
-
*
|
|
87
|
-
* The drawing runs at 30 degrees, so a cell takes `ACROSS` of its width, and
|
|
88
|
-
* the rows run across too: a strip `rows` deep starts that many cells to the
|
|
89
|
-
* left of its first column.
|
|
90
|
-
*/
|
|
91
|
-
protected get room(): number;
|
|
92
|
-
/** The drawn readings as prisms, standing against the highest reading in the table. */
|
|
93
|
-
private drawnRelief;
|
|
94
|
-
protected render(): TemplateResult;
|
|
95
|
-
/**
|
|
96
|
-
* One reading as a prism. The sides come first, so the top face is painted
|
|
97
|
-
* over the edge they share with it.
|
|
98
|
-
*
|
|
99
|
-
* Under `selection-mode` the prism is a `gridcell` named by its row in the
|
|
100
|
-
* table and saying whether it is selected, as the flat strip's cell is.
|
|
101
|
-
*/
|
|
102
|
-
private renderPrism;
|
|
103
|
-
/**
|
|
104
|
-
* The prisms as a grid's rows, one for each column of the strip, which is
|
|
105
|
-
* also the order they are painted in.
|
|
106
|
-
*/
|
|
107
|
-
private renderPrismRows;
|
|
108
|
-
/**
|
|
109
|
-
* The bubble over the top face of the reading the pointer or the keys rest
|
|
110
|
-
* on, placed as a share of the drawing, which the strip's box matches.
|
|
111
|
-
*/
|
|
112
|
-
protected renderTooltip(grid?: boolean): TemplateResult | typeof nothing;
|
|
113
|
-
}
|
|
114
|
-
declare global {
|
|
115
|
-
interface HTMLElementTagNameMap {
|
|
116
|
-
'helix-headless-isometric-heatmap': HelixHeadlessIsometricHeatmap;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { CHART_PLOT, commaList, customElement, drawTooltip, MIRROR_RULE, spokenReading, writtenList, writtenNumbers, } from '@fusion.dev/helix-core';
|
|
3
|
-
import { html, nothing, svg } from 'lit';
|
|
4
|
-
import { property } from 'lit/decorators.js';
|
|
5
|
-
import '../../tooltip/index.js';
|
|
6
|
-
import { fits, toneOf } from '../../heatmap/root/buckets.js';
|
|
7
|
-
import { HelixHeadlessHeatmap } from '../../heatmap/root/heatmap-root.js';
|
|
8
|
-
import { ACROSS, heightsOf, highestOf, reliefOf } from '../projection.js';
|
|
9
|
-
let HelixHeadlessIsometricHeatmap = class HelixHeadlessIsometricHeatmap extends HelixHeadlessHeatmap {
|
|
10
|
-
constructor() {
|
|
11
|
-
super(...arguments);
|
|
12
|
-
this.flat = false;
|
|
13
|
-
this.relief = 2;
|
|
14
|
-
this.shown = undefined;
|
|
15
|
-
}
|
|
16
|
-
static { this.words = 'helix-isometric-heatmap'; }
|
|
17
|
-
static { this.markRules = [MIRROR_RULE]; }
|
|
18
|
-
get room() {
|
|
19
|
-
const width = this.width;
|
|
20
|
-
if (width === undefined) {
|
|
21
|
-
return this.points.length;
|
|
22
|
-
}
|
|
23
|
-
const pitch = this.cellPx + this.gapPx;
|
|
24
|
-
const across = width / ACROSS - this.rowCount * pitch - this.gapPx;
|
|
25
|
-
return fits(this.points.length, Math.max(across, Number.MIN_VALUE), this.cellPx, this.gapPx, this.rowCount);
|
|
26
|
-
}
|
|
27
|
-
drawnRelief() {
|
|
28
|
-
const tallest = this.flat ? 0 : Math.max(0, this.relief || 0);
|
|
29
|
-
const highest = highestOf(this.points.map((point) => point.value));
|
|
30
|
-
const heights = heightsOf(this.drawn.map((point) => point.value), highest, tallest);
|
|
31
|
-
return reliefOf(heights, this.rowCount, this.cellPx / (this.cellPx + this.gapPx));
|
|
32
|
-
}
|
|
33
|
-
render() {
|
|
34
|
-
const bounds = writtenNumbers(this.thresholds);
|
|
35
|
-
const palette = writtenList(this.tones);
|
|
36
|
-
const cells = this.drawn;
|
|
37
|
-
const readable = cells.length > 0;
|
|
38
|
-
const grid = readable && this.selectionMode !== undefined;
|
|
39
|
-
const keys = this.selectionMode ? this.keysOf(cells) : [];
|
|
40
|
-
const chosen = new Set(this.selectionMode ? commaList(this.value) : []);
|
|
41
|
-
const relief = this.drawnRelief();
|
|
42
|
-
this.shown = relief;
|
|
43
|
-
const at = this.pointer.at;
|
|
44
|
-
const prisms = relief.prisms.map((prism) => this.renderPrism(prism.index, prism.top, prism.left, prism.right, at === prism.index, chosen.has(keys[prism.index] ?? ''), grid, toneOf(cells[prism.index] ?? { value: undefined }, bounds, palette)));
|
|
45
|
-
const { box } = relief;
|
|
46
|
-
const drawing = readable
|
|
47
|
-
? html `<svg
|
|
48
|
-
aria-hidden=${grid ? nothing : 'true'}
|
|
49
|
-
data-mirror
|
|
50
|
-
part="drawing"
|
|
51
|
-
role=${grid ? 'none' : nothing}
|
|
52
|
-
viewBox="${box.x} ${box.y} ${box.width} ${box.height}"
|
|
53
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
54
|
-
>${grid ? this.renderPrismRows(prisms) : prisms}</svg>`
|
|
55
|
-
: nothing;
|
|
56
|
-
return html `<div
|
|
57
|
-
aria-activedescendant=${grid && at >= 0 ? `cell-${at}` : nothing}
|
|
58
|
-
aria-describedby=${readable ? 'helix-chart-summary' : nothing}
|
|
59
|
-
aria-label=${this.named || this.stripLabel}
|
|
60
|
-
aria-multiselectable=${grid && this.selectionMode === 'multiple' ? 'true' : nothing}
|
|
61
|
-
part="strip plot"
|
|
62
|
-
id=${CHART_PLOT}
|
|
63
|
-
role=${grid ? 'grid' : readable ? 'application' : 'img'}
|
|
64
|
-
style="--isometric-heatmap-span: ${Math.ceil(cells.length / this.rowCount) + Math.min(this.rowCount, cells.length)}"
|
|
65
|
-
tabindex=${readable ? '0' : nothing}
|
|
66
|
-
@click=${this.onClick}
|
|
67
|
-
@keydown=${this.onStripKeydown}
|
|
68
|
-
@pointerover=${this.onPointerOver}
|
|
69
|
-
@pointerleave=${this.onPointerLeave}
|
|
70
|
-
@pointerup=${this.onPointerUp}
|
|
71
|
-
>${drawing}${this.renderTooltip(grid)}</div>
|
|
72
|
-
${cells.length === 0 ? this.renderStatus() : nothing}
|
|
73
|
-
<div part="footer">
|
|
74
|
-
<span part="start"><slot name="start"></slot></span>
|
|
75
|
-
<span part="summary"><slot name="summary"></slot></span>
|
|
76
|
-
<span part="end"><slot name="end"></slot></span>
|
|
77
|
-
</div>${readable ? this.renderOverview(cells) : nothing}${this.status.spoken
|
|
78
|
-
? html `<span part="selection" role="status">${this.status.said}</span>`
|
|
79
|
-
: nothing}${this.renderTable()}`;
|
|
80
|
-
}
|
|
81
|
-
renderPrism(index, top, left, right, active, picked, grid, tone) {
|
|
82
|
-
const row = grid ? this.sourceRows[this.points.length - this.drawn.length + index] : undefined;
|
|
83
|
-
const name = row ? spokenReading(row) : '';
|
|
84
|
-
return svg `<g
|
|
85
|
-
aria-label=${grid && name ? name : nothing}
|
|
86
|
-
aria-selected=${grid ? (picked ? 'true' : 'false') : nothing}
|
|
87
|
-
data-index=${index}
|
|
88
|
-
data-tone=${tone ?? nothing}
|
|
89
|
-
id=${grid ? `cell-${index}` : nothing}
|
|
90
|
-
part="cell${active ? ' cell-active' : ''}${picked ? ' cell-selected' : ''}"
|
|
91
|
-
role=${grid ? 'gridcell' : nothing}
|
|
92
|
-
style=${tone === undefined ? nothing : `--heatmap-tone: var(--heatmap-tone-${tone})`}
|
|
93
|
-
><path d=${left} part="left-face"></path><path d=${right} part="right-face"></path><path d=${top} part="top-face"></path></g>`;
|
|
94
|
-
}
|
|
95
|
-
renderPrismRows(prisms) {
|
|
96
|
-
const size = this.rowCount === 1 ? prisms.length : this.rowCount;
|
|
97
|
-
const rows = [];
|
|
98
|
-
for (let start = 0; start < prisms.length; start += size) {
|
|
99
|
-
rows.push(svg `<g part="row" role="row">${prisms.slice(start, start + size)}</g>`);
|
|
100
|
-
}
|
|
101
|
-
return rows;
|
|
102
|
-
}
|
|
103
|
-
renderTooltip(grid = false) {
|
|
104
|
-
const at = this.pointer.at;
|
|
105
|
-
const prism = this.shown?.prisms[at];
|
|
106
|
-
const box = this.shown?.box;
|
|
107
|
-
const reading = grid ? undefined : this.pointer;
|
|
108
|
-
if (at < 0 || !prism || !box || box.width <= 0 || box.height <= 0) {
|
|
109
|
-
return drawTooltip(this.sourceRows, -1, this.tag('tooltip'), undefined, undefined, reading);
|
|
110
|
-
}
|
|
111
|
-
return drawTooltip(this.sourceRows, this.points.length - this.drawn.length + at, this.tag('tooltip'), {
|
|
112
|
-
placement: 'top',
|
|
113
|
-
x: `${((prism.peak.x - box.x) / box.width) * 100}%`,
|
|
114
|
-
y: `${((prism.peak.y - box.y) / box.height) * 100}%`,
|
|
115
|
-
}, undefined, reading);
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
__decorate([
|
|
119
|
-
property({ type: Boolean })
|
|
120
|
-
], HelixHeadlessIsometricHeatmap.prototype, "flat", void 0);
|
|
121
|
-
__decorate([
|
|
122
|
-
property({ type: Number })
|
|
123
|
-
], HelixHeadlessIsometricHeatmap.prototype, "relief", void 0);
|
|
124
|
-
HelixHeadlessIsometricHeatmap = __decorate([
|
|
125
|
-
customElement('helix-headless-isometric-heatmap')
|
|
126
|
-
], HelixHeadlessIsometricHeatmap);
|
|
127
|
-
export { HelixHeadlessIsometricHeatmap };
|