@mosaicajs/components 0.3.0 → 0.4.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/README.md +2 -0
- package/dist/aggregate.d.ts +4 -10
- package/dist/aggregate.js +7 -13
- package/dist/artifact-card.d.ts +21 -7
- package/dist/artifact-card.js +136 -79
- package/dist/base.d.ts +44 -5
- package/dist/base.js +54 -5
- package/dist/cluster-filter.d.ts +29 -25
- package/dist/cluster-filter.js +123 -106
- package/dist/colour-editor.d.ts +15 -4
- package/dist/colour-editor.js +107 -34
- package/dist/colour-picker.d.ts +12 -5
- package/dist/colour-picker.js +119 -32
- package/dist/display.js +77 -9
- package/dist/events.d.ts +21 -7
- package/dist/explorer.d.ts +116 -37
- package/dist/explorer.js +476 -210
- package/dist/field-card.d.ts +304 -48
- package/dist/field-card.js +1364 -244
- package/dist/filter-panel.d.ts +54 -10
- package/dist/filter-panel.js +242 -42
- package/dist/filter.d.ts +22 -4
- package/dist/filter.js +113 -34
- package/dist/hierarchy.d.ts +68 -45
- package/dist/hierarchy.js +320 -243
- package/dist/item-card.d.ts +47 -16
- package/dist/item-card.js +241 -108
- package/dist/key-picker.d.ts +2 -1
- package/dist/key-picker.js +4 -3
- package/dist/layer-picker.d.ts +4 -2
- package/dist/layer-picker.js +16 -7
- package/dist/lineage.d.ts +132 -0
- package/dist/lineage.js +307 -0
- package/dist/map.d.ts +135 -24
- package/dist/map.js +387 -117
- package/dist/mosaica-components.js +1837 -833
- package/dist/mosaica-components.js.sri +1 -1
- package/dist/mosaica-components.json +2 -2
- package/dist/parts.d.ts +4 -4
- package/dist/parts.js +18 -4
- package/dist/paths.d.ts +34 -12
- package/dist/paths.js +84 -46
- package/dist/selection.d.ts +22 -3
- package/dist/selection.js +125 -59
- package/dist/states.d.ts +72 -0
- package/dist/states.js +135 -26
- package/dist/status.d.ts +63 -5
- package/dist/status.js +215 -36
- package/dist/tokens.d.ts +8 -4
- package/dist/tokens.js +144 -14
- package/dist/view-picker.js +5 -0
- package/package.json +4 -3
package/dist/field-card.d.ts
CHANGED
|
@@ -1,46 +1,114 @@
|
|
|
1
1
|
import { nothing, type PropertyValues, type TemplateResult } from 'lit';
|
|
2
2
|
import { type Store } from '@mosaicajs/client';
|
|
3
|
-
import { MosaicaElement } from './base.js';
|
|
3
|
+
import { MosaicaElement, type Called } from './base.js';
|
|
4
4
|
import './filter.js';
|
|
5
5
|
import './cluster-filter.js';
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* One step of a card's position: the cluster stepped into, what it is called and where that came
|
|
8
|
+
* from, its level, and how many children its row said it has.
|
|
9
|
+
*/
|
|
10
|
+
type Step = {
|
|
11
|
+
id: bigint;
|
|
12
|
+
name: string;
|
|
13
|
+
from: Called['from'];
|
|
14
|
+
rung: number;
|
|
15
|
+
children: number | null;
|
|
16
|
+
};
|
|
17
|
+
/** A range being dragged across the histogram, by bin, `from` where the drag began. */
|
|
7
18
|
type Brush = {
|
|
8
19
|
from: number;
|
|
9
20
|
to: number;
|
|
10
|
-
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* One end of the range box: what its field holds, the value that stands for (`null` leaves the end
|
|
24
|
+
* open, `undefined` is text that is no value), and whether a mistake in it is shown.
|
|
25
|
+
*/
|
|
26
|
+
type End = {
|
|
27
|
+
text: string;
|
|
28
|
+
value: number | null | undefined;
|
|
29
|
+
checked: boolean;
|
|
30
|
+
};
|
|
31
|
+
/** The range box's two ends. */
|
|
32
|
+
type RangeEntry = {
|
|
33
|
+
from: End;
|
|
34
|
+
to: End;
|
|
11
35
|
};
|
|
12
36
|
/**
|
|
13
37
|
* Use a field card on its own when you want one field's chart in a place of your choosing.
|
|
14
38
|
* `<mosaica-filter-panel>` shows one for each field. Set `field` to a column `meta.filterOperands`
|
|
15
39
|
* lists, or to `cluster:<layer>` for a layer's clusters.
|
|
16
40
|
*
|
|
17
|
-
*
|
|
18
|
-
* there is a highlight. The pale bars count every item the
|
|
19
|
-
* card's own filter, so a value the viewer has filtered
|
|
41
|
+
* On a column's card and a flat layer's, the solid bars count the items in view that the filters
|
|
42
|
+
* match, or the highlighted items while there is a highlight. The pale bars count every item the
|
|
43
|
+
* filters match. Neither count applies the card's own filter, so a value the viewer has filtered
|
|
44
|
+
* out keeps its count.
|
|
20
45
|
*
|
|
21
46
|
* What the card shows depends on the kind of field:
|
|
22
47
|
*
|
|
23
|
-
* - A category
|
|
24
|
-
* Filter buttons
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
48
|
+
* - A category card, and the card of a `flat` layer, lists the values with most items in view,
|
|
49
|
+
* each with its counts. A row's Highlight and Filter buttons take the counts' place while the
|
|
50
|
+
* pointer is over the row or the keyboard's focus is in it, and are always drawn on a screen with
|
|
51
|
+
* no pointer that hovers. A button is filled, and its icon solid, while its value is highlighted
|
|
52
|
+
* or filtered to, and before the counts a tick marks a value the filter keeps and a pen one that
|
|
53
|
+
* is highlighted. A screen reader is given each count with what it counts.
|
|
54
|
+
* - The card of a `tiered`, `nested` or `dag` layer walks the layer by its parent edges, and
|
|
55
|
+
* walking it leaves the map's filter as it is. A breadcrumb above the rows holds the card's
|
|
56
|
+
* position, from All, the layer's top level, down to the cluster whose children are listed. Each
|
|
57
|
+
* crumb is a button that steps back to it, and a tick marks a crumb whose cluster the filter is
|
|
58
|
+
* on. The rows are the served children of the position, in the server's order, a page at a time:
|
|
59
|
+
* More loads the next page. Each row counts the items that match every filter, this layer's
|
|
60
|
+
* clauses among them, beside every item of it the viewer may see, so a row whose count is 0 is
|
|
61
|
+
* still listed, and each count is what filtering to the row would leave. A row with children
|
|
62
|
+
* ends in a button with their number, which steps into the row. Filtering to a row adds a
|
|
63
|
+
* clause, and a layer's clauses combine with AND. The rows of a `tiered` layer stand under the
|
|
64
|
+
* titles of their levels, and a row of a `dag` layer names its other served parents. Once every
|
|
65
|
+
* child of the position has loaded, a last row counts the items of the position that match every
|
|
66
|
+
* filter and are in none of its children.
|
|
67
|
+
* - The card of a `stacked` layer lists the clusters with most items in view, under every filter,
|
|
68
|
+
* this layer's clauses among them, at the chosen level or at the level the map draws. A row at a
|
|
69
|
+
* level with a finer level after it ends in a button that steps into it, and the card then lists
|
|
70
|
+
* the clusters of that finer level by their items inside the row, under a heading that says so.
|
|
71
|
+
* - On the card of a `tiered`, `nested`, `dag` or `stacked` layer, the layer's filter and highlight
|
|
72
|
+
* clauses stand in a line of their own under the breadcrumb, each with a × that removes it, so a
|
|
73
|
+
* clause set by another control is shown wherever the card's position is. Set `hide-chips` to
|
|
74
|
+
* leave that line out where the clauses are shown already, as `<mosaica-filter-panel>` does on
|
|
75
|
+
* the cards it shows while it shows the clauses as chips of its own. The ticks on the crumbs and
|
|
76
|
+
* the rows stay.
|
|
77
|
+
* - A number or date card draws a histogram of up to 20 bins, and the viewer presses a bin or drags
|
|
78
|
+
* across several to pick a range to filter or highlight by. From the keyboard, they press Shift
|
|
79
|
+
* and the arrow keys on the focused plot, then Enter. Either opens a box under the range with its
|
|
80
|
+
* two ends in fields that take a typed number or date. A field left empty leaves that end open.
|
|
81
|
+
* The box closes on Escape, on a press outside it and as focus leaves it.
|
|
82
|
+
* A field that holds no number or date, or a lower end above the upper, is not applied, and the
|
|
83
|
+
* box says what to type. Set range, a button drawn only while the keyboard has it, opens the
|
|
84
|
+
* same box with nothing chosen. A screen reader is given the range each of the filter and the
|
|
85
|
+
* highlight holds, and the bins' counts in a table. Counts over about 100,000 items come from a
|
|
86
|
+
* sample, so they are marked "≈".
|
|
87
|
+
* - A bool card lists yes and no as a category card lists values. Its counts are taken as a
|
|
88
|
+
* histogram's, so those over about 100,000 items are marked "≈".
|
|
28
89
|
* - A text or keyword field's card is a search box, `<mosaica-filter>`.
|
|
29
90
|
*
|
|
30
91
|
* While the paint button colours the map by the field, clicking a value's colour opens a picker
|
|
31
92
|
* that changes the colour on the map.
|
|
32
93
|
*
|
|
94
|
+
* A cluster with no name is called by its key, drawn in the secondary ink and the identifiers'
|
|
95
|
+
* font, and a clause on it carries the key as its label. A cluster with neither is called Unnamed.
|
|
96
|
+
*
|
|
97
|
+
* A long name is one line, cut with an ellipsis. Where `--mosaica-long-text` is `normal`, as in the
|
|
98
|
+
* explorer's narrow form, the card's name, what it notes and its rows' names wrap.
|
|
99
|
+
*
|
|
33
100
|
* @summary A card that charts one field's values and filters or highlights by them.
|
|
34
101
|
* @tagname mosaica-field-card
|
|
35
102
|
* @category Elements
|
|
36
103
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-filterchange']>} mosaica-filterchange - A row's
|
|
37
104
|
* Highlight or Filter, or the range box, changed the field's clause.
|
|
38
105
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-clausechange']>} mosaica-clausechange - A cluster
|
|
39
|
-
* row, its Highlight or its Filter put a `member_of` clause on or took it off.
|
|
106
|
+
* row, its Highlight or its Filter, or a clause's × put a `member_of` clause on or took it off.
|
|
40
107
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-colourchange']>} mosaica-colourchange - The paint
|
|
41
108
|
* button changed what the map is coloured by.
|
|
42
109
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-levelchange']>} mosaica-levelchange - The Level
|
|
43
|
-
* choice of a levelled layer's card changed.
|
|
110
|
+
* choice of a levelled layer's card changed. The detail names the card's layer, and a `level` of
|
|
111
|
+
* `null` for Follow zoom.
|
|
44
112
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-valuecolour']>} mosaica-valuecolour - A category
|
|
45
113
|
* value's colour was chosen or reset in the colour picker.
|
|
46
114
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-clustercolour']>} mosaica-clustercolour - A
|
|
@@ -48,34 +116,71 @@ type Brush = {
|
|
|
48
116
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-fold']>} mosaica-fold - The fold button folded or
|
|
49
117
|
* opened the card.
|
|
50
118
|
* @csspart head - The heading: the name, what it notes, and the buttons.
|
|
51
|
-
* @csspart title - The field's name.
|
|
119
|
+
* @csspart title - The field's name, a heading that names the card.
|
|
52
120
|
* @csspart sub - What the heading notes: the field's figures, or the Level choice.
|
|
53
|
-
* @csspart level-select - The Level choice, on a levelled layer's card.
|
|
121
|
+
* @csspart level-select - The Level choice, on a levelled layer's card. Where no level declares a
|
|
122
|
+
* zoom range, its first option is Follow zoom.
|
|
54
123
|
* @csspart spark - The small chart of a folded card.
|
|
55
124
|
* @csspart paint - The paint button, with `aria-pressed`.
|
|
56
125
|
* @csspart fold - The fold button, with `aria-expanded`.
|
|
57
|
-
* @csspart
|
|
126
|
+
* @csspart crumbs - The breadcrumb of a layer's card that steps: a navigation landmark named by
|
|
127
|
+
* the layer, holding a list of the card's position from All down.
|
|
128
|
+
* @csspart crumb - One crumb, with `data-id`, which is empty for All, and `data-filtered` while the
|
|
129
|
+
* layer's filter is on its cluster.
|
|
130
|
+
* @csspart crumb-name - A crumb's button, which steps back to it, with `aria-current` on the
|
|
131
|
+
* deepest. A tick before the name marks a cluster the filter is on, and the name carries
|
|
132
|
+
* `data-key-name` where it is the cluster's key.
|
|
133
|
+
* @csspart chips - The layer's filter and highlight clauses on a card that steps, a list, while it
|
|
134
|
+
* has any and `hide-chips` is not set.
|
|
135
|
+
* @csspart chip - One clause, with `data-id` and `data-verb` (`filter` or `highlight`).
|
|
136
|
+
* @csspart chip-name - A clause's cluster, after a tick for a filter or a pen for a highlight. The
|
|
137
|
+
* name carries `data-key-name` where it is the cluster's key.
|
|
138
|
+
* @csspart chip-remove - The × that removes a clause.
|
|
139
|
+
* @csspart level - A heading over a list of rows: a level's title on a `tiered` layer's card, or
|
|
140
|
+
* what a `stacked` layer's card lists inside its position.
|
|
141
|
+
* @csspart rows - A category or cluster card's rows, one list for each level on a `tiered` layer's
|
|
142
|
+
* card.
|
|
58
143
|
* @csspart row - One row, with `data-key` and `data-state`: `in` if the field's filter keeps the
|
|
59
144
|
* value, `out` if it leaves it out, `lit` if it is highlighted, otherwise empty.
|
|
60
|
-
* @csspart swatch - A row's colour button, while the map is coloured by the field
|
|
61
|
-
* colour
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* @csspart
|
|
145
|
+
* @csspart swatch - A row's colour button, while the map is coloured by the field: a 24 px target
|
|
146
|
+
* with the colour, set as `--c`, in a 10 px square at its middle. It opens the colour picker. It
|
|
147
|
+
* carries `data-unmet`, and the square is drawn as an outline, for a value the map has not drawn
|
|
148
|
+
* yet and so has not given a colour.
|
|
149
|
+
* @csspart name - A row's name, with the whole name as its `title`. Where a cluster has none it is
|
|
150
|
+
* the cluster's key, with `data-key-name`, and where it has no key either it is the word Unnamed,
|
|
151
|
+
* with `data-unnamed`.
|
|
152
|
+
* @csspart step - A row's button that steps into it, with the number of its children on a layer
|
|
153
|
+
* with parent edges.
|
|
154
|
+
* @csspart also - The other served parents a `dag` row of a layer's card is under, each with
|
|
155
|
+
* `data-key-name` where it is called by its key.
|
|
156
|
+
* @csspart remainder - The last row of the last list, which counts the position's items in none of
|
|
157
|
+
* its children.
|
|
158
|
+
* @csspart refusal - The words "Clusters unavailable", with `data-code`, where the rows were
|
|
159
|
+
* refused.
|
|
65
160
|
* @csspart bar-match - A row's or a bin's pale bar, its share of the whole match.
|
|
66
161
|
* @csspart bar-subject - A row's or a bin's solid bar, its share of the subject.
|
|
67
|
-
* @csspart count - A row's counts
|
|
68
|
-
*
|
|
162
|
+
* @csspart count - A row's counts as they are drawn, after its tick and its pen, with what they
|
|
163
|
+
* count as its `title`. A screen reader is given them beside it, each with what it counts.
|
|
164
|
+
* @csspart verbs - A row's Highlight and Filter buttons, in its counts' place.
|
|
69
165
|
* @csspart highlight - A row's Highlight button, with `aria-pressed`.
|
|
70
166
|
* @csspart filter - A row's Filter button, with `aria-pressed`.
|
|
71
|
-
* @csspart more - The "N more" button.
|
|
167
|
+
* @csspart more - The "N more" button. On a layer's card walked by its parent edges it loads the
|
|
168
|
+
* next page and moves focus to the first row it added; elsewhere it shows more rows, or fewer. Its
|
|
169
|
+
* accessible name says what it shows.
|
|
72
170
|
* @csspart plot - The histogram, a focusable group.
|
|
73
171
|
* @csspart bin - One bin, with `data-index`.
|
|
74
172
|
* @csspart band - An outlined range on the histogram, with `data-verb` (`filter`, `highlight`, or
|
|
75
|
-
* `brush` while one is being chosen).
|
|
173
|
+
* `brush` while one is being chosen). The highlight's is hatched.
|
|
76
174
|
* @csspart axis - The values under the histogram.
|
|
77
175
|
* @csspart ramp - The colour ramp under the histogram, while the map is coloured by the field.
|
|
78
|
-
* @csspart
|
|
176
|
+
* @csspart range - The Set range button, with `aria-expanded`, drawn over the start of the axis
|
|
177
|
+
* while it has the keyboard's focus.
|
|
178
|
+
* @csspart brush - The range box, which a chosen range or Set range opens over what is under the
|
|
179
|
+
* histogram.
|
|
180
|
+
* @csspart brush-from - The field for its lower end, with `aria-invalid` while what it holds is not
|
|
181
|
+
* applied.
|
|
182
|
+
* @csspart brush-to - The field for its upper end, with `aria-invalid` while what it holds is not
|
|
183
|
+
* applied.
|
|
79
184
|
* @csspart brush-filter - Its Filter button.
|
|
80
185
|
* @csspart brush-highlight - Its Highlight button.
|
|
81
186
|
* @csspart colour-popover - The colour picker, while it is open.
|
|
@@ -95,29 +200,58 @@ export declare class MosaicaFieldCard extends MosaicaElement {
|
|
|
95
200
|
accessor folded: boolean;
|
|
96
201
|
/** Draws a folded card in the compact style the explorer uses in narrow containers. */
|
|
97
202
|
accessor compact: boolean;
|
|
98
|
-
/**
|
|
203
|
+
/** Leaves out the layer's clauses as chips, for a card placed where they are shown already. */
|
|
204
|
+
accessor hideChips: boolean;
|
|
205
|
+
/**
|
|
206
|
+
* The level a card for a layer with levels counts at. `null` is the level the map draws: where no
|
|
207
|
+
* level declares a zoom range, the finest that is not crowded in view, else the coarsest served.
|
|
208
|
+
*/
|
|
99
209
|
accessor level: number | null;
|
|
100
210
|
/** Whether "N more" was pressed. @internal */
|
|
101
211
|
accessor expanded: boolean;
|
|
102
|
-
/**
|
|
103
|
-
|
|
212
|
+
/**
|
|
213
|
+
* Where a cluster card that steps stands in its layer: the clusters stepped into, the deepest
|
|
214
|
+
* last, and none for the top level. @internal
|
|
215
|
+
*/
|
|
216
|
+
accessor position: readonly Step[];
|
|
217
|
+
/** What the card says loaded after the last step. @internal */
|
|
218
|
+
accessor said: string;
|
|
104
219
|
/** A range being chosen on the histogram. @internal */
|
|
105
220
|
accessor brush: Brush | null;
|
|
221
|
+
/** The range box's two fields, while it is open. @internal */
|
|
222
|
+
accessor entry: RangeEntry | null;
|
|
223
|
+
/** The part that opened the range box, which takes focus as it closes. */
|
|
224
|
+
private entryOpener;
|
|
225
|
+
/** The ends of the last range the box could apply, as shares of the plot's width, which place the box. */
|
|
226
|
+
private boxAt;
|
|
227
|
+
/** The control in the card that held focus as a render began, and the row it was in. */
|
|
228
|
+
private focusedBefore;
|
|
229
|
+
/**
|
|
230
|
+
* A step whose rows have not landed: the cluster stepped out of, whose row then takes focus, or
|
|
231
|
+
* `null` for a step in, after which the first row does. `fresh` until the render after the step.
|
|
232
|
+
*/
|
|
233
|
+
private landing;
|
|
106
234
|
private readonly subjectCounts;
|
|
107
235
|
private readonly matchCounts;
|
|
108
236
|
private readonly figures;
|
|
109
237
|
/** The whole match's counts of the values in view its commonest do not list. */
|
|
110
238
|
private readonly outsideCounts;
|
|
111
239
|
private unwatchChoices;
|
|
112
|
-
/**
|
|
113
|
-
private readonly
|
|
240
|
+
/** A linked layer's rows: the children of the position, or the roots, a page at a time. */
|
|
241
|
+
private readonly lineage;
|
|
242
|
+
/** The items of the position in none of its children, once every child has loaded. */
|
|
243
|
+
private readonly remainder;
|
|
244
|
+
private remainderAsked;
|
|
245
|
+
/** The counts in view asked last. */
|
|
246
|
+
private subjectAsked;
|
|
114
247
|
private readonly picker;
|
|
115
248
|
/** What the card last drew from, so a publish that changes none of it draws nothing. */
|
|
116
249
|
private drawnFrom;
|
|
117
250
|
/**
|
|
118
|
-
* Draw again only when what the card reads changed: its counts, the clauses, the
|
|
119
|
-
* view,
|
|
120
|
-
* frame arrives, which changes none of
|
|
251
|
+
* Draw again only when what the card reads changed: its counts, the clauses, the drawn region,
|
|
252
|
+
* the colouring, the view, the palette and chosen colours a layer's clusters take, or the level a
|
|
253
|
+
* levelled layer is drawn at. The store publishes as each frame arrives, which changes none of
|
|
254
|
+
* these.
|
|
121
255
|
*/
|
|
122
256
|
protected onStoreChange(): void;
|
|
123
257
|
protected onStoreAdopted(store: Store | null): void;
|
|
@@ -131,15 +265,44 @@ export declare class MosaicaFieldCard extends MosaicaElement {
|
|
|
131
265
|
private isTimestamp;
|
|
132
266
|
/** Whether the map can be coloured by this field. */
|
|
133
267
|
private colourable;
|
|
134
|
-
/** The level a levelled layer's card counts and browses at: the one chosen, else the
|
|
268
|
+
/** The level a levelled layer's card counts and browses at: the one chosen, else the one the map draws. */
|
|
135
269
|
private levelOf;
|
|
136
|
-
/**
|
|
270
|
+
/** How the card lists `layer`. */
|
|
271
|
+
private listing;
|
|
272
|
+
/** What the card calls a cluster no table names, from the label of its clause on this layer if it has one. */
|
|
273
|
+
private knownName;
|
|
274
|
+
/**
|
|
275
|
+
* What the card calls a cluster with a clause labelled `label`: the label, which is the cluster's
|
|
276
|
+
* key where a page served its row with a key and no name, else as a page served it, else Unnamed.
|
|
277
|
+
*/
|
|
278
|
+
private clauseCalled;
|
|
279
|
+
/**
|
|
280
|
+
* The level a ranked list counts at. The overlap list counts at the level after its position's,
|
|
281
|
+
* and at the chosen or drawn level at the top.
|
|
282
|
+
*/
|
|
283
|
+
private listLevel;
|
|
284
|
+
/**
|
|
285
|
+
* The rows a category or flat layer's card lists first, whatever their counts: those its clauses
|
|
286
|
+
* name. A card that steps shows its layer's clauses apart from its rows.
|
|
287
|
+
*/
|
|
288
|
+
private pinned;
|
|
289
|
+
/** Point the browse pages at the position, with slots while the map is coloured by the layer, and fetch them where that moved. */
|
|
290
|
+
private browseIfStale;
|
|
291
|
+
/**
|
|
292
|
+
* The count of the position's items in none of its children, under every filter: a filter of its
|
|
293
|
+
* own holds the position's `member_of` and one `none_of` over the children. Asked only once every
|
|
294
|
+
* child has loaded.
|
|
295
|
+
*/
|
|
296
|
+
private remainderSpec;
|
|
297
|
+
/** The filter that keeps an overlap list inside its position, where it has one. */
|
|
298
|
+
private within;
|
|
299
|
+
/** The keys of the field's clause in `verb`: a category's values, a bool's, or a layer's clusters by id. */
|
|
137
300
|
private clauseKeys;
|
|
138
301
|
/** The groupings a category or cluster card counts; the values its clauses name are always counted. */
|
|
139
302
|
private rowGroupings;
|
|
140
|
-
/** The grouping ranking a layer's `top` clusters at the cut the map draws or
|
|
303
|
+
/** The grouping ranking a layer's `top` clusters at the cut the map draws or at {@link listLevel}; each row's slot colours its swatch. */
|
|
141
304
|
private ranked;
|
|
142
|
-
/** The groupings counting `ids` of `layer
|
|
305
|
+
/** The groupings counting `ids` of `layer`, each at the level the list counts at, by name, leaving room for one more beside them. */
|
|
143
306
|
private namedGroupings;
|
|
144
307
|
/**
|
|
145
308
|
* The values in view that the whole match's commonest values do not list, which a registration of
|
|
@@ -148,36 +311,114 @@ export declare class MosaicaFieldCard extends MosaicaElement {
|
|
|
148
311
|
* answer is held for another store, as just after the card adopts a new one.
|
|
149
312
|
*/
|
|
150
313
|
private outsideSpec;
|
|
151
|
-
/**
|
|
314
|
+
/**
|
|
315
|
+
* The specs the card keeps registered: the subject's counts, the whole match's and a number's
|
|
316
|
+
* figures. They are read in a render as well, so the overlap list reads only the answers to what
|
|
317
|
+
* its position asks.
|
|
318
|
+
*/
|
|
152
319
|
private specs;
|
|
320
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
321
|
+
/** The deepest crumb's button. */
|
|
322
|
+
private deepestCrumb;
|
|
323
|
+
/**
|
|
324
|
+
* Give focus back where the render took it away. A row, crumb or chip that moved, as its value
|
|
325
|
+
* joined or left a clause, keeps it; for one that went, the same button of the row, crumb or chip
|
|
326
|
+
* now in its place takes it, else the one before's, else the search box, else the fold button of
|
|
327
|
+
* a card with none. Focus in the search box stays there. Just after a step, focus in the card
|
|
328
|
+
* goes to the deepest crumb until the rows land.
|
|
329
|
+
*/
|
|
330
|
+
private keepFocus;
|
|
331
|
+
/**
|
|
332
|
+
* The keys of the rows a card that steps lists for its position, once they have landed; `null`
|
|
333
|
+
* while they are on their way.
|
|
334
|
+
*/
|
|
335
|
+
private landed;
|
|
336
|
+
/**
|
|
337
|
+
* Once the rows of a step have landed, say what loaded, and once they are drawn move focus from
|
|
338
|
+
* the deepest crumb to the row stepped out of or, after a step in, to the first row. Focus that
|
|
339
|
+
* has gone elsewhere meanwhile stays there.
|
|
340
|
+
*/
|
|
341
|
+
private land;
|
|
342
|
+
/** What a card that steps says has loaded: how many rows, of what. */
|
|
343
|
+
private loadedText;
|
|
153
344
|
protected updated(changed: PropertyValues<this>): void;
|
|
154
|
-
/** A press outside an open range box closes it, as Escape does. */
|
|
345
|
+
/** A press outside an open range box closes it, as Escape does; Set range closes it itself. */
|
|
155
346
|
private onPressOutsideBrush;
|
|
156
347
|
/** Whether a highlight is set, in which case the subject is the highlighted items. */
|
|
157
348
|
private highlighting;
|
|
158
349
|
/** Put a category value in or out of the field's clause in `verb`. */
|
|
159
350
|
private toggleValue;
|
|
351
|
+
/** Put a bool's value in or out of the field's clause in `verb`. */
|
|
352
|
+
private toggleBool;
|
|
160
353
|
/** Replace the field's clause in `verb`, and report what that position composes. */
|
|
161
354
|
private setClause;
|
|
162
355
|
/** Put a cluster's `member_of` clause in `verb` on or off. */
|
|
163
356
|
private toggleCluster;
|
|
357
|
+
/** Take one of this layer's clauses off. */
|
|
358
|
+
private removeClause;
|
|
359
|
+
/** Step into a cluster, so the card lists what is inside it. The filter is left as it is. */
|
|
360
|
+
private stepIn;
|
|
361
|
+
/** Step back to the crumb at `depth`, where 0 is All. */
|
|
362
|
+
private stepTo;
|
|
363
|
+
private stepped;
|
|
164
364
|
/** Colour the map by this field, or by nothing where it already is. */
|
|
165
365
|
private paint;
|
|
166
366
|
private chooseLevel;
|
|
167
367
|
private fold;
|
|
168
368
|
render(): TemplateResult | typeof nothing;
|
|
169
|
-
/**
|
|
369
|
+
/**
|
|
370
|
+
* A folded card's small chart: the subject's counts, largest first for values, in order for bins.
|
|
371
|
+
* A children list charts its first rows as it lists them.
|
|
372
|
+
*/
|
|
170
373
|
private spark;
|
|
171
374
|
/**
|
|
172
|
-
* The rows of a category or cluster card: the values its
|
|
173
|
-
* count in the subject, then in the whole match.
|
|
375
|
+
* The rows of a bool card, yes then no; or of a category or cluster card: the values its
|
|
376
|
+
* clauses name, then the rest by their count in the subject, then in the whole match.
|
|
174
377
|
*/
|
|
175
378
|
private rows;
|
|
176
|
-
/**
|
|
177
|
-
private
|
|
379
|
+
/** Each row's count in `entry`: a bool's from its bins for false and true, else by each group's key. */
|
|
380
|
+
private counts;
|
|
178
381
|
private valueCard;
|
|
382
|
+
/** The body of a category, bool or `flat` layer's card: the search box, the rows and More. */
|
|
383
|
+
private valueBody;
|
|
384
|
+
/**
|
|
385
|
+
* The body of a card that steps: the search box, the breadcrumb, the layer's clauses, the one
|
|
386
|
+
* status region, and the rows of the position with what follows them.
|
|
387
|
+
*/
|
|
388
|
+
private clusterBody;
|
|
389
|
+
/** What an overlap list inside a position lists, which heads it; `null` at the top. */
|
|
390
|
+
private overlapTitle;
|
|
391
|
+
/**
|
|
392
|
+
* A list ranked by count: a category's or a bool's values, a flat layer's clusters, or the
|
|
393
|
+
* overlap; then what an empty answer says and the More that shows more rows. `values` is how
|
|
394
|
+
* many values or clusters the whole match has, where its answer says.
|
|
395
|
+
*/
|
|
396
|
+
private rankedList;
|
|
397
|
+
/** The search box over a layer's clusters, which names how many there are where a count says. */
|
|
398
|
+
private clusterSearch;
|
|
399
|
+
/**
|
|
400
|
+
* One row of a category, bool or cluster card. `sub` and `all` are its two counts as drawn, or
|
|
401
|
+
* `drawn` alone in their place, and `said` gives them to a screen reader with what each counts.
|
|
402
|
+
* `step` is the button that steps into the row, `null` on a row of a card that steps with nothing
|
|
403
|
+
* to step into. A press on the row filters to its value or cluster, as its Filter button does;
|
|
404
|
+
* the keyboard reaches the buttons.
|
|
405
|
+
*/
|
|
406
|
+
private rowTemplate;
|
|
407
|
+
/** The rows of a children list, in the server's order: each with its matched count over its masked one where a filter is set, else its masked count alone. */
|
|
408
|
+
private childRows;
|
|
409
|
+
/**
|
|
410
|
+
* The rows of a linked layer's position: its children, or the roots, grouped under their levels'
|
|
411
|
+
* headings on a `tiered` layer, with the remainder as the last list's last row; then More.
|
|
412
|
+
*/
|
|
413
|
+
private childList;
|
|
414
|
+
/** The breadcrumb: All and then each step of the position, each a button that steps back to it. */
|
|
415
|
+
private crumbsTemplate;
|
|
416
|
+
/** The layer's clauses, in the order they were added, each with a × that removes it. */
|
|
417
|
+
private chipsTemplate;
|
|
418
|
+
/** Load the next page of children, and move focus from More to the first row it added, unless focus has gone elsewhere meanwhile. */
|
|
419
|
+
private moreChildren;
|
|
179
420
|
private histogram;
|
|
180
|
-
/** Where the range
|
|
421
|
+
/** Where the range box stands: under its range, from the range's left end or, on the right half, its right, and never past the plot. */
|
|
181
422
|
private brushPlace;
|
|
182
423
|
/** The figures in the heading: how many hold a value and their mean, or while folded their range. */
|
|
183
424
|
private summaryText;
|
|
@@ -190,14 +431,29 @@ export declare class MosaicaFieldCard extends MosaicaElement {
|
|
|
190
431
|
* value the viewer may see, so a range reaching the first or the last bin leaves that end open.
|
|
191
432
|
*/
|
|
192
433
|
private brushRange;
|
|
193
|
-
|
|
434
|
+
/**
|
|
435
|
+
* Set the range box's range as the field's clause in `verb`. A field holding text that is no
|
|
436
|
+
* value, or a lower end above the upper, sets nothing: both fields show what is wrong with them,
|
|
437
|
+
* and the first that is wrong takes focus.
|
|
438
|
+
*/
|
|
439
|
+
private applyRange;
|
|
440
|
+
/** Give focus back to the plot or to Set range, whichever opened the range box, unless the box is open again by then. */
|
|
441
|
+
private focusOpener;
|
|
194
442
|
/** Which bin a pointer is over. */
|
|
195
443
|
private binAt;
|
|
196
444
|
private brushStart;
|
|
197
445
|
private brushMove;
|
|
198
446
|
private brushEnd;
|
|
199
|
-
/**
|
|
447
|
+
/**
|
|
448
|
+
* The arrow keys move a one-bin range, Shift widens it and Escape drops it. Enter opens the range
|
|
449
|
+
* box, on that range or, with none chosen, on the range the field holds.
|
|
450
|
+
*/
|
|
200
451
|
private brushKey;
|
|
452
|
+
/**
|
|
453
|
+
* The box lies over what is under the plot, so it closes as focus goes on to that. Focus that
|
|
454
|
+
* goes to nothing has not left, and a box already taken off the page has nothing to close.
|
|
455
|
+
*/
|
|
456
|
+
private onBrushLeft;
|
|
201
457
|
private onBrushKey;
|
|
202
458
|
/** Open the colour picker on a row's swatch: a category value's, or a cluster's. */
|
|
203
459
|
private openPicker;
|