@mosaicajs/components 0.1.0-rc.4 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/artifact-card.d.ts +20 -26
- package/dist/artifact-card.js +20 -26
- package/dist/base.d.ts +21 -29
- package/dist/base.js +18 -26
- package/dist/basemap.d.ts +2 -2
- package/dist/cluster-filter.d.ts +19 -25
- package/dist/cluster-filter.js +19 -25
- package/dist/colour-editor.d.ts +16 -36
- package/dist/colour-editor.js +16 -36
- package/dist/context.d.ts +4 -4
- package/dist/context.js +4 -4
- package/dist/count.d.ts +16 -15
- package/dist/count.js +16 -15
- package/dist/events.d.ts +63 -68
- package/dist/explorer.d.ts +76 -119
- package/dist/explorer.js +76 -121
- package/dist/field-card.d.ts +24 -56
- package/dist/field-card.js +24 -56
- package/dist/filter-panel.d.ts +31 -45
- package/dist/filter-panel.js +31 -45
- package/dist/filter.d.ts +20 -28
- package/dist/filter.js +20 -28
- package/dist/hierarchy.d.ts +35 -36
- package/dist/hierarchy.js +35 -36
- package/dist/index.d.ts +5 -4
- package/dist/index.js +5 -4
- package/dist/item-card.d.ts +34 -55
- package/dist/item-card.js +34 -55
- package/dist/key-picker.d.ts +5 -5
- package/dist/key-picker.js +5 -5
- package/dist/layer-picker.d.ts +11 -9
- package/dist/layer-picker.js +11 -9
- package/dist/map.d.ts +134 -172
- package/dist/map.js +136 -188
- package/dist/mosaica-components.js +5599 -1594
- package/dist/mosaica-components.js.LICENSE.txt +80 -16
- package/dist/mosaica-components.js.sri +1 -1
- package/dist/mosaica-components.json +2 -2
- package/dist/parts.d.ts +3 -4
- package/dist/parts.js +3 -4
- package/dist/selection.d.ts +21 -27
- package/dist/selection.js +21 -27
- package/dist/states.d.ts +15 -20
- package/dist/status.d.ts +26 -38
- package/dist/status.js +26 -38
- package/dist/store-element.d.ts +8 -7
- package/dist/store-element.js +8 -7
- package/dist/tokens.d.ts +12 -13
- package/dist/tokens.js +12 -13
- package/dist/view-picker.d.ts +10 -6
- package/dist/view-picker.js +10 -6
- package/package.json +6 -6
package/dist/colour-editor.d.ts
CHANGED
|
@@ -11,40 +11,20 @@ type Found = {
|
|
|
11
11
|
rung: number;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* rendered category
|
|
17
|
-
* it as a modal dialog, and Close, Done or Escape closes it and gives focus back to what had it.
|
|
14
|
+
* Use the colour editor when viewers should choose their own colours while the map is coloured by a
|
|
15
|
+
* category or a layer. The explorer's Edit colours button opens it. In your own layout, set `field`
|
|
16
|
+
* to a rendered category column or to `cluster:<layer>`, then call `show()` to open the dialog.
|
|
18
17
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* nearest parents in grey under it) and its count over everything the viewer may see, with no
|
|
24
|
-
* filter and no area, so the rows hold their order, largest first, through a pan or a change of
|
|
25
|
-
* filter. The counts come from one aggregate (`Store.setAggregate`, `subject: 'visible'`) of up to
|
|
26
|
-
* `meta.selection.max_aggregate_top` rows, registered while the dialog is open. A category value
|
|
27
|
-
* the map has not drawn yet has no palette colour, and its swatch is an outline until it has one.
|
|
28
|
-
* Changing `field` or `cluster-level` while the dialog is open lists the new field's rows, and
|
|
29
|
-
* closes the dialog where the field is neither a category nor a layer that colours.
|
|
18
|
+
* Each row counts the items the viewer may see with that value, ignoring the filters and the
|
|
19
|
+
* camera, so the rows keep their order as the viewer pans or filters. For a `nested` or `dag`
|
|
20
|
+
* layer, the rows are the clusters the map currently draws, and the search box reaches the rest. To
|
|
21
|
+
* recolour several rows at once, viewers tick them and press Set colour.
|
|
30
22
|
*
|
|
31
|
-
* The
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* its count, until the dialog closes.
|
|
23
|
+
* The colours are kept in the store, so every element that uses the store shows a change at once.
|
|
24
|
+
* Each change also fires one `mosaica-valuecolour` or `mosaica-clustercolour` event naming every
|
|
25
|
+
* value or cluster it changed.
|
|
35
26
|
*
|
|
36
|
-
* A
|
|
37
|
-
* how many are ticked, Set colour, which opens the picker and gives the colour chosen to every row
|
|
38
|
-
* ticked, and Deselect. Reset to palette gives every value of the field, or every cluster of the
|
|
39
|
-
* layer, its palette colour back. Under the list is how many colours are chosen for the field or
|
|
40
|
-
* the layer.
|
|
41
|
-
*
|
|
42
|
-
* Each action fires one event: `mosaica-valuecolour` for a category, or `mosaica-clustercolour`
|
|
43
|
-
* for a layer, naming every value or cluster it changed. A category's colours are written to the
|
|
44
|
-
* colour choices every element over the store shares, and a layer's are set on the store with the
|
|
45
|
-
* colours chosen for every layer (`Store.setArtifactColours`); the dialog keeps no colour itself.
|
|
46
|
-
*
|
|
47
|
-
* @summary Every value or cluster's colour, to search, choose and reset.
|
|
27
|
+
* @summary A dialog for choosing the colour of each category value or cluster.
|
|
48
28
|
* @tagname mosaica-colour-editor
|
|
49
29
|
* @category Elements
|
|
50
30
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-valuecolour']>} mosaica-valuecolour - Colours
|
|
@@ -57,11 +37,11 @@ type Found = {
|
|
|
57
37
|
* @csspart close - The close button.
|
|
58
38
|
* @csspart columns - The headings over the rows.
|
|
59
39
|
* @csspart rows - The list of rows.
|
|
60
|
-
* @csspart row - One row, with `data-key`, `data-found`
|
|
40
|
+
* @csspart row - One row, with `data-key`, `data-found` if the search box found it, and
|
|
61
41
|
* `data-ticked` while it is ticked.
|
|
62
42
|
* @csspart check - A row's checkbox.
|
|
63
|
-
* @csspart swatch - A row's colour
|
|
64
|
-
* drawn as an outline for a
|
|
43
|
+
* @csspart swatch - A row's colour button, which opens the colour picker. It carries `data-unmet`,
|
|
44
|
+
* and is drawn as an outline, for a value the map has not given a colour yet.
|
|
65
45
|
* @csspart name - A row's name, with `data-unnamed` for a cluster that has none.
|
|
66
46
|
* @csspart path - A cluster row's parents.
|
|
67
47
|
* @csspart count - A row's count over everything the viewer may see.
|
|
@@ -84,7 +64,7 @@ export declare class MosaicaColourEditor extends MosaicaElement {
|
|
|
84
64
|
static styles: import("lit").CSSResult[];
|
|
85
65
|
/** What the dialog colours: a rendered category column, or `cluster:<layer>`. */
|
|
86
66
|
accessor field: string;
|
|
87
|
-
/** The level of a `stacked` or `tiered` layer whose clusters are listed
|
|
67
|
+
/** The level of a `stacked` or `tiered` layer whose clusters are listed. `null` is the coarsest level. */
|
|
88
68
|
accessor level: number | null;
|
|
89
69
|
/** Whether the dialog is open. @internal */
|
|
90
70
|
accessor isOpen: boolean;
|
|
@@ -103,7 +83,7 @@ export declare class MosaicaColourEditor extends MosaicaElement {
|
|
|
103
83
|
private pathFrame;
|
|
104
84
|
/** Open the dialog. */
|
|
105
85
|
show(): Promise<void>;
|
|
106
|
-
/** Close the dialog
|
|
86
|
+
/** Close the dialog and return focus to the element that had it before. */
|
|
107
87
|
close(): void;
|
|
108
88
|
protected onStoreAdopted(store: Store | null): void;
|
|
109
89
|
protected resetServerData(): void;
|
package/dist/colour-editor.js
CHANGED
|
@@ -54,40 +54,20 @@ const ROW_HEIGHT = 40;
|
|
|
54
54
|
/** The rows whose paths are asked for before the list has been measured. */
|
|
55
55
|
const FIRST_ROWS = 8;
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* rendered category
|
|
60
|
-
* it as a modal dialog, and Close, Done or Escape closes it and gives focus back to what had it.
|
|
57
|
+
* Use the colour editor when viewers should choose their own colours while the map is coloured by a
|
|
58
|
+
* category or a layer. The explorer's Edit colours button opens it. In your own layout, set `field`
|
|
59
|
+
* to a rendered category column or to `cluster:<layer>`, then call `show()` to open the dialog.
|
|
61
60
|
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* nearest parents in grey under it) and its count over everything the viewer may see, with no
|
|
67
|
-
* filter and no area, so the rows hold their order, largest first, through a pan or a change of
|
|
68
|
-
* filter. The counts come from one aggregate (`Store.setAggregate`, `subject: 'visible'`) of up to
|
|
69
|
-
* `meta.selection.max_aggregate_top` rows, registered while the dialog is open. A category value
|
|
70
|
-
* the map has not drawn yet has no palette colour, and its swatch is an outline until it has one.
|
|
71
|
-
* Changing `field` or `cluster-level` while the dialog is open lists the new field's rows, and
|
|
72
|
-
* closes the dialog where the field is neither a category nor a layer that colours.
|
|
61
|
+
* Each row counts the items the viewer may see with that value, ignoring the filters and the
|
|
62
|
+
* camera, so the rows keep their order as the viewer pans or filters. For a `nested` or `dag`
|
|
63
|
+
* layer, the rows are the clusters the map currently draws, and the search box reaches the rest. To
|
|
64
|
+
* recolour several rows at once, viewers tick them and press Set colour.
|
|
73
65
|
*
|
|
74
|
-
* The
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* its count, until the dialog closes.
|
|
66
|
+
* The colours are kept in the store, so every element that uses the store shows a change at once.
|
|
67
|
+
* Each change also fires one `mosaica-valuecolour` or `mosaica-clustercolour` event naming every
|
|
68
|
+
* value or cluster it changed.
|
|
78
69
|
*
|
|
79
|
-
* A
|
|
80
|
-
* how many are ticked, Set colour, which opens the picker and gives the colour chosen to every row
|
|
81
|
-
* ticked, and Deselect. Reset to palette gives every value of the field, or every cluster of the
|
|
82
|
-
* layer, its palette colour back. Under the list is how many colours are chosen for the field or
|
|
83
|
-
* the layer.
|
|
84
|
-
*
|
|
85
|
-
* Each action fires one event: `mosaica-valuecolour` for a category, or `mosaica-clustercolour`
|
|
86
|
-
* for a layer, naming every value or cluster it changed. A category's colours are written to the
|
|
87
|
-
* colour choices every element over the store shares, and a layer's are set on the store with the
|
|
88
|
-
* colours chosen for every layer (`Store.setArtifactColours`); the dialog keeps no colour itself.
|
|
89
|
-
*
|
|
90
|
-
* @summary Every value or cluster's colour, to search, choose and reset.
|
|
70
|
+
* @summary A dialog for choosing the colour of each category value or cluster.
|
|
91
71
|
* @tagname mosaica-colour-editor
|
|
92
72
|
* @category Elements
|
|
93
73
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-valuecolour']>} mosaica-valuecolour - Colours
|
|
@@ -100,11 +80,11 @@ const FIRST_ROWS = 8;
|
|
|
100
80
|
* @csspart close - The close button.
|
|
101
81
|
* @csspart columns - The headings over the rows.
|
|
102
82
|
* @csspart rows - The list of rows.
|
|
103
|
-
* @csspart row - One row, with `data-key`, `data-found`
|
|
83
|
+
* @csspart row - One row, with `data-key`, `data-found` if the search box found it, and
|
|
104
84
|
* `data-ticked` while it is ticked.
|
|
105
85
|
* @csspart check - A row's checkbox.
|
|
106
|
-
* @csspart swatch - A row's colour
|
|
107
|
-
* drawn as an outline for a
|
|
86
|
+
* @csspart swatch - A row's colour button, which opens the colour picker. It carries `data-unmet`,
|
|
87
|
+
* and is drawn as an outline, for a value the map has not given a colour yet.
|
|
108
88
|
* @csspart name - A row's name, with `data-unnamed` for a cluster that has none.
|
|
109
89
|
* @csspart path - A cluster row's parents.
|
|
110
90
|
* @csspart count - A row's count over everything the viewer may see.
|
|
@@ -364,7 +344,7 @@ let MosaicaColourEditor = (() => {
|
|
|
364
344
|
get field() { return this.#field_accessor_storage; }
|
|
365
345
|
set field(value) { this.#field_accessor_storage = value; }
|
|
366
346
|
#level_accessor_storage = (__runInitializers(this, _field_extraInitializers), __runInitializers(this, _level_initializers, null));
|
|
367
|
-
/** The level of a `stacked` or `tiered` layer whose clusters are listed
|
|
347
|
+
/** The level of a `stacked` or `tiered` layer whose clusters are listed. `null` is the coarsest level. */
|
|
368
348
|
get level() { return this.#level_accessor_storage; }
|
|
369
349
|
set level(value) { this.#level_accessor_storage = value; }
|
|
370
350
|
#isOpen_accessor_storage = (__runInitializers(this, _level_extraInitializers), __runInitializers(this, _isOpen_initializers, false));
|
|
@@ -407,7 +387,7 @@ let MosaicaColourEditor = (() => {
|
|
|
407
387
|
}
|
|
408
388
|
dialog.focus();
|
|
409
389
|
}
|
|
410
|
-
/** Close the dialog
|
|
390
|
+
/** Close the dialog and return focus to the element that had it before. */
|
|
411
391
|
close() {
|
|
412
392
|
if (!this.isOpen)
|
|
413
393
|
return;
|
package/dist/context.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Store } from '@mosaicajs/client';
|
|
2
2
|
/**
|
|
3
|
-
* The Lit context
|
|
4
|
-
* provide it
|
|
5
|
-
*
|
|
6
|
-
* on one page share it.
|
|
3
|
+
* The Lit context through which elements find their store. `<mosaica-store>` and
|
|
4
|
+
* `<mosaica-explorer>` provide it. To supply a store from your own element, provide it under this
|
|
5
|
+
* context with a `ContextProvider` from `@lit/context`. The key is `Symbol.for('mosaica.store')`,
|
|
6
|
+
* so two copies of the package on one page share it.
|
|
7
7
|
*/
|
|
8
8
|
export declare const storeContext: {
|
|
9
9
|
__context__: Store | null;
|
package/dist/context.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createContext } from '@lit/context';
|
|
2
2
|
/**
|
|
3
|
-
* The Lit context
|
|
4
|
-
* provide it
|
|
5
|
-
*
|
|
6
|
-
* on one page share it.
|
|
3
|
+
* The Lit context through which elements find their store. `<mosaica-store>` and
|
|
4
|
+
* `<mosaica-explorer>` provide it. To supply a store from your own element, provide it under this
|
|
5
|
+
* context with a `ContextProvider` from `@lit/context`. The key is `Symbol.for('mosaica.store')`,
|
|
6
|
+
* so two copies of the package on one page share it.
|
|
7
7
|
*/
|
|
8
8
|
export const storeContext = createContext(Symbol.for('mosaica.store'));
|
package/dist/count.d.ts
CHANGED
|
@@ -1,37 +1,38 @@
|
|
|
1
1
|
import { LitElement, nothing, type TemplateResult } from 'lit';
|
|
2
2
|
import { type Count, type Masked } from '@mosaicajs/client';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* is rendered while `stale` is set. With both properties set, `count` is rendered.
|
|
4
|
+
* Use `<mosaica-count>` when you build your own panel from the store's projections and want its
|
|
5
|
+
* counts to look like those of the other elements. It has no store, so you set its properties
|
|
6
|
+
* yourself.
|
|
8
7
|
*
|
|
9
|
-
*
|
|
8
|
+
* A sample `Count` set in `count` shows as `4,812 of 12,465`, the marks shown out of those served.
|
|
9
|
+
* A `Masked` count set in `masked` shows as one figure, marked `≈` when it is an estimate. When
|
|
10
|
+
* both are set, the element shows `count`. It shows nothing for an inexact sample, or for any count
|
|
11
|
+
* while `stale` is set.
|
|
10
12
|
*
|
|
11
|
-
* @summary A
|
|
13
|
+
* @summary A single formatted count.
|
|
12
14
|
* @tagname mosaica-count
|
|
13
15
|
* @category Elements
|
|
14
|
-
* @csspart count - The figure
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* @csspart label - The `label` text after the figure, rendered only when the figure is.
|
|
16
|
+
* @csspart count - The figure, with `data-kind` (`sample`, `scalar` or `none`), `data-exact` (`true`
|
|
17
|
+
* or `false`), `data-empty` (`true` if nothing is shown) and, with `figure="shown"`, `data-total`.
|
|
18
|
+
* @csspart label - The `label` text after the figure, shown only with the figure.
|
|
18
19
|
*/
|
|
19
20
|
export declare class MosaicaCount extends LitElement {
|
|
20
21
|
static styles: import("lit").CSSResult[];
|
|
21
22
|
/** A sample count: how many marks are shown of how many are served. */
|
|
22
23
|
accessor count: Count | null;
|
|
23
|
-
/** A masked count over the viewer
|
|
24
|
+
/** A masked count over the items the viewer may see. Shown if `count` is not set. */
|
|
24
25
|
accessor masked: Masked | null;
|
|
25
|
-
/**
|
|
26
|
+
/** Shows nothing, for a count that is out of date because the data changed. */
|
|
26
27
|
accessor stale: boolean;
|
|
27
28
|
/** Text rendered after the figure, such as `matched`. */
|
|
28
29
|
accessor label: string;
|
|
29
30
|
/**
|
|
30
|
-
* `both`
|
|
31
|
-
*
|
|
31
|
+
* `both` shows a sample as `shown of total`. `shown` shows the shown figure alone and puts the
|
|
32
|
+
* total in the `count` part's `data-total`.
|
|
32
33
|
*/
|
|
33
34
|
accessor figure: 'both' | 'shown';
|
|
34
|
-
/** Shortens figures of a thousand or more to one decimal, as `16.8M
|
|
35
|
+
/** Shortens figures of a thousand or more to one decimal, as `16.8M`. */
|
|
35
36
|
accessor compact: boolean;
|
|
36
37
|
render(): TemplateResult | typeof nothing;
|
|
37
38
|
}
|
package/dist/count.js
CHANGED
|
@@ -38,20 +38,21 @@ import { formatCount, formatMasked } from '@mosaicajs/client';
|
|
|
38
38
|
import { attachContextRoot, defineOnce } from './define.js';
|
|
39
39
|
import { tokens } from './tokens.js';
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* is rendered while `stale` is set. With both properties set, `count` is rendered.
|
|
41
|
+
* Use `<mosaica-count>` when you build your own panel from the store's projections and want its
|
|
42
|
+
* counts to look like those of the other elements. It has no store, so you set its properties
|
|
43
|
+
* yourself.
|
|
45
44
|
*
|
|
46
|
-
*
|
|
45
|
+
* A sample `Count` set in `count` shows as `4,812 of 12,465`, the marks shown out of those served.
|
|
46
|
+
* A `Masked` count set in `masked` shows as one figure, marked `≈` when it is an estimate. When
|
|
47
|
+
* both are set, the element shows `count`. It shows nothing for an inexact sample, or for any count
|
|
48
|
+
* while `stale` is set.
|
|
47
49
|
*
|
|
48
|
-
* @summary A
|
|
50
|
+
* @summary A single formatted count.
|
|
49
51
|
* @tagname mosaica-count
|
|
50
52
|
* @category Elements
|
|
51
|
-
* @csspart count - The figure
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* @csspart label - The `label` text after the figure, rendered only when the figure is.
|
|
53
|
+
* @csspart count - The figure, with `data-kind` (`sample`, `scalar` or `none`), `data-exact` (`true`
|
|
54
|
+
* or `false`), `data-empty` (`true` if nothing is shown) and, with `figure="shown"`, `data-total`.
|
|
55
|
+
* @csspart label - The `label` text after the figure, shown only with the figure.
|
|
55
56
|
*/
|
|
56
57
|
let MosaicaCount = (() => {
|
|
57
58
|
let _classSuper = LitElement;
|
|
@@ -112,11 +113,11 @@ let MosaicaCount = (() => {
|
|
|
112
113
|
get count() { return this.#count_accessor_storage; }
|
|
113
114
|
set count(value) { this.#count_accessor_storage = value; }
|
|
114
115
|
#masked_accessor_storage = (__runInitializers(this, _count_extraInitializers), __runInitializers(this, _masked_initializers, null));
|
|
115
|
-
/** A masked count over the viewer
|
|
116
|
+
/** A masked count over the items the viewer may see. Shown if `count` is not set. */
|
|
116
117
|
get masked() { return this.#masked_accessor_storage; }
|
|
117
118
|
set masked(value) { this.#masked_accessor_storage = value; }
|
|
118
119
|
#stale_accessor_storage = (__runInitializers(this, _masked_extraInitializers), __runInitializers(this, _stale_initializers, false));
|
|
119
|
-
/**
|
|
120
|
+
/** Shows nothing, for a count that is out of date because the data changed. */
|
|
120
121
|
get stale() { return this.#stale_accessor_storage; }
|
|
121
122
|
set stale(value) { this.#stale_accessor_storage = value; }
|
|
122
123
|
#label_accessor_storage = (__runInitializers(this, _stale_extraInitializers), __runInitializers(this, _label_initializers, ''));
|
|
@@ -125,13 +126,13 @@ let MosaicaCount = (() => {
|
|
|
125
126
|
set label(value) { this.#label_accessor_storage = value; }
|
|
126
127
|
#figure_accessor_storage = (__runInitializers(this, _label_extraInitializers), __runInitializers(this, _figure_initializers, 'both'));
|
|
127
128
|
/**
|
|
128
|
-
* `both`
|
|
129
|
-
*
|
|
129
|
+
* `both` shows a sample as `shown of total`. `shown` shows the shown figure alone and puts the
|
|
130
|
+
* total in the `count` part's `data-total`.
|
|
130
131
|
*/
|
|
131
132
|
get figure() { return this.#figure_accessor_storage; }
|
|
132
133
|
set figure(value) { this.#figure_accessor_storage = value; }
|
|
133
134
|
#compact_accessor_storage = (__runInitializers(this, _figure_extraInitializers), __runInitializers(this, _compact_initializers, false));
|
|
134
|
-
/** Shortens figures of a thousand or more to one decimal, as `16.8M
|
|
135
|
+
/** Shortens figures of a thousand or more to one decimal, as `16.8M`. */
|
|
135
136
|
get compact() { return this.#compact_accessor_storage; }
|
|
136
137
|
set compact(value) { this.#compact_accessor_storage = value; }
|
|
137
138
|
render() {
|
package/dist/events.d.ts
CHANGED
|
@@ -10,29 +10,29 @@ export type SelectionShapeDetail = Exclude<SelectionShape, {
|
|
|
10
10
|
outside?: boolean;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
|
-
* Every event the elements fire, by name, with its `detail`. Each bubbles and is
|
|
14
|
-
*
|
|
15
|
-
* as a decimal string, since it is a 64-bit integer.
|
|
13
|
+
* Every event the elements fire, by name, with the type of its `detail`. Each event bubbles and is
|
|
14
|
+
* composed, so you can listen on any ancestor, including one outside `<mosaica-explorer>`. A
|
|
15
|
+
* `mosaica_id` is sent as a decimal string, since it is a 64-bit integer.
|
|
16
16
|
*/
|
|
17
17
|
export type MosaicaEventDetails = {
|
|
18
18
|
/**
|
|
19
|
-
* The panel state
|
|
20
|
-
*
|
|
21
|
-
*
|
|
19
|
+
* The panel state changed from `from` to `to`; `from` is null on the first render. If `to` is
|
|
20
|
+
* `refused`, `unanswered`, `busy` or `expired`, `refusal` says what went wrong; otherwise it is
|
|
21
|
+
* null.
|
|
22
22
|
*/
|
|
23
23
|
'mosaica-statechange': {
|
|
24
24
|
from: PanelState | null;
|
|
25
25
|
to: PanelState;
|
|
26
26
|
refusal: Refusal | null;
|
|
27
27
|
};
|
|
28
|
-
/** The session expired
|
|
28
|
+
/** The session expired. `refusal` is the server's refusal that ended it, if there was one. */
|
|
29
29
|
'mosaica-expired': {
|
|
30
30
|
refusal: Refusal | null;
|
|
31
31
|
};
|
|
32
32
|
/**
|
|
33
|
-
* The camera moved. `bbox` is `[x0, y0, x1, y1]` in the view's data coordinates
|
|
34
|
-
*
|
|
35
|
-
* `height` the canvas in CSS pixels.
|
|
33
|
+
* The camera moved. `bbox` is the area shown, `[x0, y0, x1, y1]` in the view's data coordinates.
|
|
34
|
+
* `zoom` is 0 when the 512-unit world is 512 pixels wide, and 1 more per doubling. `width` and
|
|
35
|
+
* `height` are the canvas size in CSS pixels.
|
|
36
36
|
*/
|
|
37
37
|
'mosaica-viewchange': {
|
|
38
38
|
bbox: [number, number, number, number];
|
|
@@ -40,14 +40,14 @@ export type MosaicaEventDetails = {
|
|
|
40
40
|
width: number;
|
|
41
41
|
height: number;
|
|
42
42
|
};
|
|
43
|
-
/** A point was clicked
|
|
43
|
+
/** A point was clicked. `id` is its `mosaica_id`. Its record follows in `mosaica-itemopen`. */
|
|
44
44
|
'mosaica-pick': {
|
|
45
45
|
id: string;
|
|
46
46
|
};
|
|
47
47
|
/**
|
|
48
|
-
* The
|
|
49
|
-
*
|
|
50
|
-
*
|
|
48
|
+
* The record of the selected item `id` arrived, whether it was selected by a click or by
|
|
49
|
+
* `Store.pick`. If the server refuses the record, this does not fire, and the refusal is in the
|
|
50
|
+
* store's `selection.itemRefusal`.
|
|
51
51
|
*/
|
|
52
52
|
'mosaica-itemopen': {
|
|
53
53
|
id: string;
|
|
@@ -62,7 +62,7 @@ export type MosaicaEventDetails = {
|
|
|
62
62
|
y: number;
|
|
63
63
|
};
|
|
64
64
|
/**
|
|
65
|
-
* The artifact `id` was opened and its
|
|
65
|
+
* The artifact `id` was opened and its details arrived in `detail`, with `maskedCount` as a
|
|
66
66
|
* decimal string.
|
|
67
67
|
*/
|
|
68
68
|
'mosaica-artifactopen': {
|
|
@@ -71,16 +71,15 @@ export type MosaicaEventDetails = {
|
|
|
71
71
|
maskedCount: string;
|
|
72
72
|
};
|
|
73
73
|
};
|
|
74
|
-
/** Fit was
|
|
74
|
+
/** Fit was pressed for the artifact `id`. `<mosaica-explorer>` fits its map to it. */
|
|
75
75
|
'mosaica-artifactfit': {
|
|
76
76
|
id: string;
|
|
77
77
|
};
|
|
78
78
|
/**
|
|
79
|
-
* The
|
|
80
|
-
* selection was cleared. `status`
|
|
81
|
-
*
|
|
82
|
-
* `
|
|
83
|
-
* shape.
|
|
79
|
+
* The selected region changed. `shape` is the new shape in data coordinates, or null if the
|
|
80
|
+
* selection was cleared. It fires with `status` `loading` when a shape is selected or `cleared`
|
|
81
|
+
* when it is cleared, then again with `shown` or `refused` when the server answers. Then `visible`, `matched` and
|
|
82
|
+
* `served` carry the region's counts, and `verdict` says whether they are exact for the shape.
|
|
84
83
|
*/
|
|
85
84
|
'mosaica-selectchange': {
|
|
86
85
|
shape: SelectionShapeDetail | null;
|
|
@@ -90,19 +89,19 @@ export type MosaicaEventDetails = {
|
|
|
90
89
|
served?: Count;
|
|
91
90
|
verdict?: RegionProjection['verdict'];
|
|
92
91
|
};
|
|
93
|
-
/** The layers
|
|
92
|
+
/** The chosen layers are now `layers`. The map also draws the layers each depends on, which the list leaves out. */
|
|
94
93
|
'mosaica-layerchange': {
|
|
95
94
|
layers: string[];
|
|
96
95
|
};
|
|
97
|
-
/** The points are now coloured by `colourBy`: a column, `cluster:<layer>`, or null for
|
|
96
|
+
/** The points are now coloured by `colourBy`: a column, `cluster:<layer>`, or null for a single colour. */
|
|
98
97
|
'mosaica-colourchange': {
|
|
99
98
|
colourBy: string | null;
|
|
100
99
|
};
|
|
101
100
|
/**
|
|
102
|
-
*
|
|
103
|
-
* stand
|
|
104
|
-
* `max` are the radii in pixels of its smallest and largest value, and `scale` how values
|
|
105
|
-
* placed between them.
|
|
101
|
+
* A size setting changed in the explorer's Layers popover. The detail holds all four as they now
|
|
102
|
+
* stand: `sizeBy` is the number column that sizes the points, or null for a single size, `min`
|
|
103
|
+
* and `max` are the radii in pixels of its smallest and largest value, and `scale` is how values
|
|
104
|
+
* are placed between them.
|
|
106
105
|
*/
|
|
107
106
|
'mosaica-sizechange': {
|
|
108
107
|
sizeBy: string | null;
|
|
@@ -115,24 +114,23 @@ export type MosaicaEventDetails = {
|
|
|
115
114
|
field: string;
|
|
116
115
|
folded: boolean;
|
|
117
116
|
};
|
|
118
|
-
/** Most points was
|
|
117
|
+
/** The Most points slider was released. The store now aims to draw `budget` marks on screen. */
|
|
119
118
|
'mosaica-budgetchange': {
|
|
120
119
|
budget: number;
|
|
121
120
|
};
|
|
122
|
-
/** Most clusters was
|
|
121
|
+
/** The Most clusters slider was released. A `nested` or `dag` layer is now cut to at most `budget` clusters. */
|
|
123
122
|
'mosaica-clusterbudgetchange': {
|
|
124
123
|
budget: number;
|
|
125
124
|
};
|
|
126
|
-
/** The level
|
|
125
|
+
/** The level that clusters are coloured and labelled at is now `level`. Null is the default level. */
|
|
127
126
|
'mosaica-levelchange': {
|
|
128
127
|
level: number | null;
|
|
129
128
|
};
|
|
130
129
|
/**
|
|
131
|
-
*
|
|
132
|
-
* picker
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
* keeps the choices sets them back through the map's or the explorer's `valueColours`.
|
|
130
|
+
* The viewer chose or reset colours for values of the category column `column`, in a colour
|
|
131
|
+
* picker or in Edit colours. Each change names a category key and its new colour as `#rrggbb`, or
|
|
132
|
+
* `null` if it was reset to its palette colour. The map already draws the new colours. To restore
|
|
133
|
+
* them in a later session, save them and set the map's or explorer's `valueColours`.
|
|
136
134
|
*/
|
|
137
135
|
'mosaica-valuecolour': {
|
|
138
136
|
column: string;
|
|
@@ -142,11 +140,10 @@ export type MosaicaEventDetails = {
|
|
|
142
140
|
}[];
|
|
143
141
|
};
|
|
144
142
|
/**
|
|
145
|
-
*
|
|
146
|
-
* `
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
* the explorer's `clusterColours`.
|
|
143
|
+
* The viewer chose or reset colours for clusters of the layer `layer`. Each change names a cluster
|
|
144
|
+
* by its `mosaica_id` and its new colour as `#rrggbb`, or `null` if it was reset to its palette
|
|
145
|
+
* colour. The map already draws the new colours. To restore them in a later session, save them
|
|
146
|
+
* and set the map's or explorer's `clusterColours`.
|
|
150
147
|
*/
|
|
151
148
|
'mosaica-clustercolour': {
|
|
152
149
|
layer: string;
|
|
@@ -155,26 +152,22 @@ export type MosaicaEventDetails = {
|
|
|
155
152
|
colour: string | null;
|
|
156
153
|
}[];
|
|
157
154
|
};
|
|
158
|
-
/** The palette,
|
|
155
|
+
/** The palette, ramp, ramp scale or ramp direction was changed in the explorer's Colour section. The detail holds all four as they now stand. */
|
|
159
156
|
'mosaica-palettechange': {
|
|
160
157
|
palette: CategoryPaletteName;
|
|
161
158
|
ramp: RampName;
|
|
162
159
|
scale: RampScale;
|
|
163
160
|
reverse: boolean;
|
|
164
161
|
};
|
|
165
|
-
/**
|
|
166
|
-
* A palette was chosen for a layer's clusters in the explorer's Colour section, and set on the
|
|
167
|
-
* store (`Store.setPalette`).
|
|
168
|
-
*/
|
|
162
|
+
/** A palette was chosen for a layer's clusters in the explorer's Colour section and set on the store (`Store.setPalette`). */
|
|
169
163
|
'mosaica-clusterpalettechange': {
|
|
170
164
|
palette: PaletteName;
|
|
171
165
|
};
|
|
172
166
|
/**
|
|
173
|
-
* A display setting
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
* density's colours follow, `linear` or `log`.
|
|
167
|
+
* A display setting changed in the explorer's Layers popover. The detail holds every setting as it
|
|
168
|
+
* now stands. `points` is the opposite of the map's `noPoints`; the other fields match the map's
|
|
169
|
+
* properties of the same name. `radius`, `pointOpacity` and `densityColours` are null while the
|
|
170
|
+
* map chooses them itself.
|
|
178
171
|
*/
|
|
179
172
|
'mosaica-displaychange': {
|
|
180
173
|
points: boolean;
|
|
@@ -187,33 +180,33 @@ export type MosaicaEventDetails = {
|
|
|
187
180
|
densityScale: DensityScale;
|
|
188
181
|
};
|
|
189
182
|
/**
|
|
190
|
-
* A filter changed. `column` is the column whose control changed, or null for Clear
|
|
191
|
-
* clearing the highlight.
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
183
|
+
* A filter or highlight changed. `column` is the column whose control changed, or null for Clear
|
|
184
|
+
* all and for clearing the highlight. `verb` is `filter` or `highlight` (`filter` if absent).
|
|
185
|
+
* After an edit, `expr` is the combined expression of every control's clause for that `verb`, or
|
|
186
|
+
* null if there are none. When a chip is removed, or Clear all is pressed, `expr` is null.
|
|
187
|
+
* `member_of` clauses are reported by `mosaica-clausechange`.
|
|
195
188
|
*/
|
|
196
189
|
'mosaica-filterchange': {
|
|
197
190
|
column: string | null;
|
|
198
191
|
expr?: FilterExpr | null;
|
|
199
192
|
verb?: ClauseVerb;
|
|
200
193
|
};
|
|
201
|
-
/** A column's chip was pressed
|
|
194
|
+
/** A column's chip was pressed in a filter panel with `chips-only`, so you can show its card. `verb` is `filter` or `highlight`. */
|
|
202
195
|
'mosaica-chipopen': {
|
|
203
196
|
column: string;
|
|
204
197
|
verb: ClauseVerb;
|
|
205
198
|
};
|
|
206
199
|
/**
|
|
207
|
-
* Open was pressed on the item `id
|
|
208
|
-
* the card's `open`
|
|
200
|
+
* Open was pressed on the item `id`, whose record's fields are `fields`. It fires both when Open
|
|
201
|
+
* calls the card's `open` and when it follows `open-url`.
|
|
209
202
|
*/
|
|
210
203
|
'mosaica-open': {
|
|
211
204
|
id: string;
|
|
212
205
|
fields: Record<string, unknown>;
|
|
213
206
|
};
|
|
214
207
|
/**
|
|
215
|
-
* The view changed from `from` to `to`. `sameFrame` is true
|
|
216
|
-
*
|
|
208
|
+
* The view changed from `from` to `to`. `sameFrame` is true if both views share one extent, in
|
|
209
|
+
* which case the camera stays where it is; otherwise the map refits.
|
|
217
210
|
*/
|
|
218
211
|
'mosaica-viewswitch': {
|
|
219
212
|
from: string;
|
|
@@ -221,8 +214,9 @@ export type MosaicaEventDetails = {
|
|
|
221
214
|
sameFrame: boolean;
|
|
222
215
|
};
|
|
223
216
|
/**
|
|
224
|
-
*
|
|
225
|
-
* `<mosaica-explorer>` switches to the view and centres the
|
|
217
|
+
* A view chip on the item card asked to show the item in the view `view`, where it sits at `x`,
|
|
218
|
+
* `y` in that view's data coordinates. `<mosaica-explorer>` switches to the view and centres the
|
|
219
|
+
* map there.
|
|
226
220
|
*/
|
|
227
221
|
'mosaica-viewfollow': {
|
|
228
222
|
view: string;
|
|
@@ -230,21 +224,22 @@ export type MosaicaEventDetails = {
|
|
|
230
224
|
y: number;
|
|
231
225
|
};
|
|
232
226
|
/**
|
|
233
|
-
*
|
|
234
|
-
* under
|
|
235
|
-
* view, shown in
|
|
227
|
+
* The map's message about its basemap changed. `refusal` says why the `basemap` value cannot be
|
|
228
|
+
* drawn under its view, and is shown over the map. `note` says why nothing is drawn under the
|
|
229
|
+
* current view, and is shown in a corner. Each is null if there is none.
|
|
236
230
|
*/
|
|
237
231
|
'mosaica-basemapchange': {
|
|
238
232
|
refusal: string | null;
|
|
239
233
|
note: string | null;
|
|
240
234
|
};
|
|
241
|
-
/** A card's close button was pressed
|
|
235
|
+
/** A card's close button was pressed. `what` says which card. */
|
|
242
236
|
'mosaica-close': {
|
|
243
237
|
what: 'item' | 'artifact';
|
|
244
238
|
};
|
|
245
239
|
/**
|
|
246
|
-
* A `member_of` clause
|
|
247
|
-
*
|
|
240
|
+
* A `member_of` clause, which keeps the map to the members of the artifact `id` in layer `layer`,
|
|
241
|
+
* was added (`on` true) or removed. `verb` is `filter` or `highlight`, and `outside` is true if the
|
|
242
|
+
* clause keeps everything outside the artifact instead.
|
|
248
243
|
*/
|
|
249
244
|
'mosaica-clausechange': {
|
|
250
245
|
id: string;
|