@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/layer-picker.d.ts
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import { nothing, type TemplateResult } from 'lit';
|
|
2
2
|
import { MosaicaElement } from './base.js';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* that others depend on
|
|
6
|
-
*
|
|
7
|
-
* checkbox: a quiet note beneath the list names the filter layers, which are applied as clauses
|
|
8
|
-
* through `<mosaica-hierarchy>`.
|
|
4
|
+
* Put the layer picker beside a map when the bundle has annotation layers that viewers should be
|
|
5
|
+
* able to turn on and off. A layer that others depend on, such as a clustering and its labels, has
|
|
6
|
+
* one checkbox, so that the whole group is turned on together.
|
|
9
7
|
*
|
|
10
|
-
*
|
|
8
|
+
* Filter layers draw nothing, so the picker names them in a note instead of giving them checkboxes.
|
|
9
|
+
* Viewers filter by a filter layer from its card in `<mosaica-filter-panel>`, or browse it in
|
|
10
|
+
* `<mosaica-hierarchy>` when its artifacts form a hierarchy.
|
|
11
|
+
*
|
|
12
|
+
* @summary A list of checkboxes for choosing which annotation layers the map draws.
|
|
11
13
|
* @tagname mosaica-layer-picker
|
|
12
14
|
* @category Elements
|
|
13
15
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-layerchange']>} mosaica-layerchange - A checkbox
|
|
14
|
-
* changed
|
|
16
|
+
* changed which layers are drawn.
|
|
15
17
|
* @csspart title - The heading.
|
|
16
18
|
* @csspart state - The state line, with `data-state`.
|
|
17
19
|
* @csspart refusal - The words "View refused", with `data-code`, in the refused state.
|
|
18
|
-
* @csspart reason - The server's reason for a refusal,
|
|
20
|
+
* @csspart reason - The server's reason for a refusal, under "View refused".
|
|
19
21
|
* @csspart entry - One layer that draws, with `data-layer`.
|
|
20
|
-
* @csspart name - A layer's title, or its name
|
|
22
|
+
* @csspart name - A layer's title, or its name if it has no title.
|
|
21
23
|
* @csspart note - The note naming the filter layers, such as "Venues can be used as a filter
|
|
22
24
|
* only.", with `data-layers` listing their names.
|
|
23
25
|
*/
|
package/dist/layer-picker.js
CHANGED
|
@@ -5,23 +5,25 @@ import { attachContextRoot, defineOnce } from './define.js';
|
|
|
5
5
|
import { renderState, stateOf } from './states.js';
|
|
6
6
|
import { chrome, tokens } from './tokens.js';
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* that others depend on
|
|
10
|
-
*
|
|
11
|
-
* checkbox: a quiet note beneath the list names the filter layers, which are applied as clauses
|
|
12
|
-
* through `<mosaica-hierarchy>`.
|
|
8
|
+
* Put the layer picker beside a map when the bundle has annotation layers that viewers should be
|
|
9
|
+
* able to turn on and off. A layer that others depend on, such as a clustering and its labels, has
|
|
10
|
+
* one checkbox, so that the whole group is turned on together.
|
|
13
11
|
*
|
|
14
|
-
*
|
|
12
|
+
* Filter layers draw nothing, so the picker names them in a note instead of giving them checkboxes.
|
|
13
|
+
* Viewers filter by a filter layer from its card in `<mosaica-filter-panel>`, or browse it in
|
|
14
|
+
* `<mosaica-hierarchy>` when its artifacts form a hierarchy.
|
|
15
|
+
*
|
|
16
|
+
* @summary A list of checkboxes for choosing which annotation layers the map draws.
|
|
15
17
|
* @tagname mosaica-layer-picker
|
|
16
18
|
* @category Elements
|
|
17
19
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-layerchange']>} mosaica-layerchange - A checkbox
|
|
18
|
-
* changed
|
|
20
|
+
* changed which layers are drawn.
|
|
19
21
|
* @csspart title - The heading.
|
|
20
22
|
* @csspart state - The state line, with `data-state`.
|
|
21
23
|
* @csspart refusal - The words "View refused", with `data-code`, in the refused state.
|
|
22
|
-
* @csspart reason - The server's reason for a refusal,
|
|
24
|
+
* @csspart reason - The server's reason for a refusal, under "View refused".
|
|
23
25
|
* @csspart entry - One layer that draws, with `data-layer`.
|
|
24
|
-
* @csspart name - A layer's title, or its name
|
|
26
|
+
* @csspart name - A layer's title, or its name if it has no title.
|
|
25
27
|
* @csspart note - The note naming the filter layers, such as "Venues can be used as a filter
|
|
26
28
|
* only.", with `data-layers` listing their names.
|
|
27
29
|
*/
|
package/dist/map.d.ts
CHANGED
|
@@ -100,37 +100,29 @@ export type MapProbe = {
|
|
|
100
100
|
[extra: string]: unknown;
|
|
101
101
|
};
|
|
102
102
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* none of them reads as an empty corpus. A refusal shows the server's reason under its words. The
|
|
107
|
-
* toolbar switches between pan, box select and lasso select, and fits the camera to the items the
|
|
108
|
-
* filters match; shift-drag in pan mode draws a box. A settled box or lasso becomes the store's
|
|
109
|
-
* selection, a filter every count narrows to; a tag on its top-left corner gives the count matched
|
|
110
|
-
* inside it and a button that clears it.
|
|
103
|
+
* Use the map on its own when you lay out your own panels around it. It draws one view's points,
|
|
104
|
+
* density and annotation layers. When the viewer picks a point or draws a region, the map records
|
|
105
|
+
* it in the store, so the other elements on the page follow.
|
|
111
106
|
*
|
|
112
|
-
* The map
|
|
113
|
-
*
|
|
114
|
-
* the store's filters match, as the Fit button frames them ({@link MosaicaMap.fit}). It sends the
|
|
115
|
-
* store no camera until then, so no points are fetched for a camera it is about to leave. A camera
|
|
116
|
-
* the user or the host moves first is kept, and a later change of filter leaves the camera where
|
|
117
|
-
* it is. Density is asked for once the camera has rested for 200 ms, as counts by cell over the
|
|
118
|
-
* view and a margin round it, with coarser counts reaching further for a zoom out, and the last
|
|
119
|
-
* counts are drawn at their own positions until the next land. Keys, with the map focused: the
|
|
120
|
-
* arrow keys pan, `+` and `-` zoom, and Escape cancels a shape being drawn, else
|
|
121
|
-
* clears the selected region, else drops the picked point or artifact and its ring. A click on
|
|
122
|
-
* empty map drops them too; a selected region stays. A press hides
|
|
123
|
-
* the hover tooltip until the pointer is released, and the point whose record is selected, which
|
|
124
|
-
* its item card shows, has no tooltip. The canvas is one tab stop, after the toolbar
|
|
125
|
-
* and before the content of the other corners: it carries `role="application"`, the `tabindex`
|
|
126
|
-
* the host set on the map, else 0, and the host's `aria-label` where the host set one, else one
|
|
127
|
-
* naming the keys. A `tabindex` the host sets moves to the canvas, leaving -1 on the map, so the
|
|
128
|
-
* map is never a second stop. `focus()` focuses the canvas.
|
|
107
|
+
* The map takes its store from its `store` property or from an enclosing `<mosaica-store>`. It can
|
|
108
|
+
* also build its own from `viewer-url` and `token` or `authorise`.
|
|
129
109
|
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
110
|
+
* When the map first gets a store, it frames the items the filters match unless the camera has
|
|
111
|
+
* already been moved. It frames them again when the view switches to one with a different extent,
|
|
112
|
+
* but a change of filter leaves the camera where it is.
|
|
132
113
|
*
|
|
133
|
-
*
|
|
114
|
+
* A box or lasso drawn with the toolbar becomes the store's selected region, which narrows the map
|
|
115
|
+
* and every count to the items inside it. Shift-drag draws a box without changing tool. With the
|
|
116
|
+
* map focused, the arrow keys pan and `+` and `-` zoom. Escape cancels a shape being drawn, or
|
|
117
|
+
* clears the region when there is no shape, or drops the picked item when there is neither.
|
|
118
|
+
*
|
|
119
|
+
* When the map cannot draw the view, it says why over the canvas.
|
|
120
|
+
*
|
|
121
|
+
* The canvas is a single tab stop, and it takes any `tabindex` or `aria-label` you set on the map.
|
|
122
|
+
* Without an `aria-label`, the canvas is labelled with its keys, "map: arrow keys pan, + and -
|
|
123
|
+
* zoom", so that someone using a screen reader knows how to move it.
|
|
124
|
+
*
|
|
125
|
+
* @summary An interactive map with no panels around it.
|
|
134
126
|
* @tagname mosaica-map
|
|
135
127
|
* @category Elements
|
|
136
128
|
* @slot top-left - Content in the top-left corner, below the toolbar when it is there.
|
|
@@ -146,193 +138,164 @@ export type MapProbe = {
|
|
|
146
138
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-itemopen']>} mosaica-itemopen - The selected
|
|
147
139
|
* item's record arrived, however the item was selected.
|
|
148
140
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-miss']>} mosaica-miss - A click found no point
|
|
149
|
-
* and no artifact. The map has dropped the
|
|
141
|
+
* and no artifact. The map has already dropped the picked item.
|
|
150
142
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-hover']>} mosaica-hover - The pointer moved onto
|
|
151
143
|
* or over a point.
|
|
152
144
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-artifactopen']>} mosaica-artifactopen - An
|
|
153
|
-
* artifact was opened and its
|
|
145
|
+
* artifact was opened and its details arrived.
|
|
154
146
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-selectchange']>} mosaica-selectchange - A
|
|
155
147
|
* selection was drawn or cleared (`status` `loading` or `cleared`), and again when its counts
|
|
156
148
|
* arrive.
|
|
157
149
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-layerchange']>} mosaica-layerchange - The
|
|
158
150
|
* `layers` attribute changed.
|
|
159
151
|
* @csspart canvas - The deck.gl canvas's container.
|
|
160
|
-
* @csspart overlay - The
|
|
161
|
-
* server cannot be reached,
|
|
162
|
-
*
|
|
152
|
+
* @csspart overlay - The message over the canvas when the view is refused, expired or empty, or the
|
|
153
|
+
* server cannot be reached, did not answer or is too busy. If the viewer may see no item in the
|
|
154
|
+
* view at all, it says so instead of "Nothing in view".
|
|
163
155
|
* @csspart state - The state line inside the overlay, with `data-state`, and `data-visible="none"`
|
|
164
|
-
*
|
|
165
|
-
* @csspart retry - The Retry button in the overlay,
|
|
166
|
-
* not answer or is too busy.
|
|
156
|
+
* if the viewer may see no item in the view.
|
|
157
|
+
* @csspart retry - The Retry button in the overlay, after a refusal, no answer or a busy server.
|
|
167
158
|
* @csspart refusal - The words "View refused", or "Server busy", inside the overlay, with
|
|
168
159
|
* `data-code` set to the refusal's code.
|
|
169
160
|
* @csspart reason - The server's reason for a refusal, as it sent it, on a line under "View
|
|
170
161
|
* refused".
|
|
171
162
|
* @csspart controls - The toolbar.
|
|
172
|
-
* @csspart region-tag - The
|
|
173
|
-
* it
|
|
163
|
+
* @csspart region-tag - The tag on the selected region's top-left corner, with how many items
|
|
164
|
+
* match inside it (or outside it, for its complement) and a button that clears it.
|
|
174
165
|
* @csspart tooltip - The hover tooltip.
|
|
175
|
-
* @csspart density-key - The key to density's colours
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
* @csspart note - Why no basemap is drawn under this view, in the bottom-right corner: the value
|
|
179
|
-
* given does not fit it, or the basemap did not load.
|
|
166
|
+
* @csspart density-key - The key to density's colours in items per cell, in the bottom-left corner.
|
|
167
|
+
* Shown while density is drawn in a colour ramp or without the points.
|
|
168
|
+
* @csspart note - Why no basemap is drawn under this view, in the bottom-right corner.
|
|
180
169
|
* @csspart attribution - The tile server's credit, in the bottom-right corner while tiles are drawn.
|
|
181
170
|
* @cssprop --mosaica-map-height - The map's height.
|
|
182
171
|
* @cssprop --mosaica-map-bg - The canvas's background, behind the points and any basemap.
|
|
183
|
-
* @cssprop --mosaica-map-inset-left - Extra space
|
|
184
|
-
*
|
|
172
|
+
* @cssprop --mosaica-map-inset-left - Extra space to the left of the top-left corner's content, to
|
|
173
|
+
* clear a panel you float over the map's left side. Defaults to 0.
|
|
185
174
|
*/
|
|
186
175
|
export declare class MosaicaMap extends MosaicaElement {
|
|
187
176
|
static styles: import("lit").CSSResult[];
|
|
188
177
|
protected canBuildOwn: boolean;
|
|
189
178
|
/**
|
|
190
|
-
* What the points
|
|
191
|
-
* layer that can colour, or `none` for
|
|
179
|
+
* What colours the points: a rendered column (one sent with the points), `cluster:<layer>` for a
|
|
180
|
+
* layer that can colour, or `none` for a single colour. Unset, the store's choice stands.
|
|
192
181
|
*/
|
|
193
182
|
accessor colourBy: string;
|
|
194
183
|
/**
|
|
195
|
-
* The annotation layers to draw,
|
|
184
|
+
* The annotation layers to draw, separated by spaces or commas. Each also draws the layers it
|
|
196
185
|
* depends on. Unset, the store's choice stands.
|
|
197
186
|
*/
|
|
198
187
|
accessor layers: string[] | null;
|
|
199
|
-
/** How many marks to aim for on screen. `0`
|
|
188
|
+
/** How many marks to aim for on screen. `0` keeps the store's budget, which starts at 250000. */
|
|
200
189
|
accessor budget: number;
|
|
201
|
-
/** The fewest marks a control for `budget` offers. The map sets no budget from it. */
|
|
202
|
-
accessor budgetMin: number;
|
|
203
|
-
/** The most marks a control for `budget` offers. The map sets no budget from it. */
|
|
204
|
-
accessor budgetMax: number;
|
|
205
190
|
/**
|
|
206
|
-
* The most clusters a `nested` or `dag` layer is cut to (`Store.setClusterBudget`). `0`
|
|
207
|
-
*
|
|
191
|
+
* The most clusters a `nested` or `dag` layer is cut to (`Store.setClusterBudget`). `0` keeps the
|
|
192
|
+
* store's setting; setting `0` after another value removes the limit, giving the finest cut.
|
|
208
193
|
*/
|
|
209
194
|
accessor clusterBudget: number;
|
|
210
195
|
/**
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
* shows nothing.
|
|
196
|
+
* The columns the hover tooltip shows under the point's title, separated by spaces or commas.
|
|
197
|
+
* Only rendered columns arrive with the points, so another column shows nothing.
|
|
214
198
|
*/
|
|
215
199
|
accessor tooltipFields: string;
|
|
216
200
|
/**
|
|
217
|
-
* The field a
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
* `mosaica_id`.
|
|
201
|
+
* The field that titles a point in the hover tooltip. A rendered column shows at once; any other
|
|
202
|
+
* field is read from the item's record once the pointer rests on the point. Unset, the title is
|
|
203
|
+
* the point's `mosaica_id`.
|
|
221
204
|
*/
|
|
222
205
|
accessor titleField: string;
|
|
223
206
|
/** What a drag does: `pan` moves the camera, `box` draws a box selection and `lasso` a freehand one. */
|
|
224
207
|
accessor mode: 'pan' | 'box' | 'lasso';
|
|
225
208
|
/**
|
|
226
|
-
* The palette clusters are coloured from
|
|
227
|
-
* `tableau20` or `kelly
|
|
228
|
-
*
|
|
229
|
-
* Tableau 10 until one is chosen.
|
|
209
|
+
* The palette clusters are coloured from when the points are coloured by a layer: `okabe-ito`,
|
|
210
|
+
* `tableau10`, `tableau20` or `kelly`. It is set on the store (`Store.setPalette`). Unset, the
|
|
211
|
+
* store's palette stands, which starts as `tableau10`.
|
|
230
212
|
*/
|
|
231
213
|
accessor palette: PaletteName | '';
|
|
232
214
|
/**
|
|
233
|
-
* The level of a `stacked` or `tiered` layer
|
|
234
|
-
*
|
|
215
|
+
* The level of a `stacked` or `tiered` layer at which clusters are coloured, labelled and
|
|
216
|
+
* outlined. Unset, the coarsest level. A `nested` or `dag` layer ignores it.
|
|
235
217
|
*/
|
|
236
218
|
accessor clusterLevel: number | null;
|
|
237
219
|
/**
|
|
238
|
-
* What is drawn under the points
|
|
239
|
-
*
|
|
240
|
-
* `{x}` and `{y}
|
|
241
|
-
* image over `[x0, y0, x1, y1]` in the view's coordinates
|
|
242
|
-
*
|
|
243
|
-
* the map's 512-unit world
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
* view named `tiles` or `image` cannot be named in one; a key that names no view this viewer may
|
|
249
|
-
* reach is ignored, and every value must be one of the forms.
|
|
250
|
-
*
|
|
251
|
-
* The world outline needs a projection and tiles need the view's `tileScheme`. A value that does
|
|
252
|
-
* not fit the view it was given on, or that a mapping names for a view, is refused over the map
|
|
253
|
-
* with what to write instead; one value that does not fit a view switched to later draws nothing
|
|
254
|
-
* there, and a note in the bottom-right corner says why. The points are drawn either way. The
|
|
255
|
-
* code that draws a basemap is loaded the first time one is drawn.
|
|
220
|
+
* What is drawn under the points. `world` is the server's outline of land, coastlines and country
|
|
221
|
+
* borders, and needs a view with a map projection. `{tiles, attribution}` is a tile server's URL
|
|
222
|
+
* template with `{z}`, `{x}` and `{y}` and the credit to show, and needs a view with a
|
|
223
|
+
* `tileScheme`. `{image, bounds}` is one image over `[x0, y0, x1, y1]` in the view's coordinates
|
|
224
|
+
* (degrees on a geographic view), or over the whole frame without `bounds`. You can also pass
|
|
225
|
+
* `none`, a deck.gl layer you built in the map's 512-unit world, or an object mapping view ids to
|
|
226
|
+
* any of these for a different basemap per view. The attribute takes only `world` and `none`.
|
|
227
|
+
* Unset, a view with a map projection gets `world` and any other view gets nothing. A value that
|
|
228
|
+
* does not fit the view is shown as an error over the map; one that stops fitting after a switch
|
|
229
|
+
* of view draws nothing, and a note says why. The points are drawn either way.
|
|
256
230
|
*/
|
|
257
231
|
accessor basemap: BasemapChoice | null;
|
|
258
232
|
/**
|
|
259
|
-
*
|
|
260
|
-
* light basemap
|
|
261
|
-
*
|
|
262
|
-
* host's `color-scheme` names, the system preference where it names both, and light where it
|
|
263
|
-
* names neither.
|
|
233
|
+
* Whether the map's background is `light` or `dark`, for when it differs from the page's, such as
|
|
234
|
+
* a light basemap on a dark page. Labels and density colours follow it; the toolbar and panels
|
|
235
|
+
* follow the page. Unset, it follows the page's `color-scheme`.
|
|
264
236
|
*/
|
|
265
237
|
accessor ground: 'light' | 'dark' | '';
|
|
266
238
|
/** Hides the points. Density, outlines, labels and the selection are still drawn. */
|
|
267
239
|
accessor noPoints: boolean;
|
|
268
240
|
/**
|
|
269
|
-
* A fixed point
|
|
270
|
-
* drawn
|
|
241
|
+
* A fixed point opacity from 0.1 to 1. Unset, points get more transparent the more of them are
|
|
242
|
+
* drawn.
|
|
271
243
|
*/
|
|
272
244
|
accessor pointOpacity: number | null;
|
|
273
245
|
/**
|
|
274
|
-
* How density is drawn under the points
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
*
|
|
246
|
+
* How density is drawn under the points: `none`, `smooth` (a soft wash), `hex` (hexagons),
|
|
247
|
+
* `grid` (square cells) or `contours` (lines of equal density). Density is counted by the server
|
|
248
|
+
* over every matching item, so it covers more than the sampled points drawn. It counts the
|
|
249
|
+
* highlighted items if there is a highlight, otherwise the items the filters and selection match.
|
|
278
250
|
*/
|
|
279
251
|
accessor density: DensityMode;
|
|
280
252
|
/**
|
|
281
|
-
*
|
|
282
|
-
*
|
|
283
|
-
* that
|
|
284
|
-
*
|
|
285
|
-
* {@link MosaicaMap.densityStops} says which sizes fit.
|
|
253
|
+
* The size of density's cells on screen, in CSS pixels: 32, 24, 16, 12, 8, 6 or 4. Other values
|
|
254
|
+
* are rounded to the nearest of these. If the server's `selection.maxAggregateCells` does not
|
|
255
|
+
* allow that many cells, the finest size that fits is drawn; `densityStops()` says
|
|
256
|
+
* which sizes fit.
|
|
286
257
|
*/
|
|
287
258
|
accessor densityResolution: number;
|
|
288
259
|
/**
|
|
289
260
|
* The colours density is drawn in: `warm-grey`, `viridis`, `cividis`, `magma` or `greys`. Unset,
|
|
290
|
-
*
|
|
291
|
-
* is drawn in a ramp, or without the points, a key to the colours sits in the bottom-left corner.
|
|
261
|
+
* a `smooth` wash under the points is warm grey and anything else is `viridis`.
|
|
292
262
|
*/
|
|
293
263
|
accessor densityColours: DensityColours | '';
|
|
294
264
|
/** How strongly density is drawn, from 0.1 to 1. */
|
|
295
265
|
accessor densityStrength: number;
|
|
296
266
|
/**
|
|
297
|
-
* How a cell's count
|
|
298
|
-
*
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
-
* The largest count is that of the densest cell in the area counted, which is the view and a
|
|
302
|
-
* margin around it; the contours take it among the cells they merge to, and a hexagon is
|
|
303
|
-
* coloured by the densest cell under it. Any other value is taken as `log`.
|
|
267
|
+
* How a cell's count maps to a colour, from zero to the densest cell in and around the view:
|
|
268
|
+
* `linear`, or `log` on `log(1 + count)`. `log` is the default because counts are skewed on most
|
|
269
|
+
* maps, and on a linear scale only the densest few cells stand out. Any other value is taken as
|
|
270
|
+
* `log`.
|
|
304
271
|
*/
|
|
305
272
|
accessor densityScale: DensityScale;
|
|
306
273
|
/**
|
|
307
|
-
* The palette a category column
|
|
308
|
-
*
|
|
309
|
-
* is made.
|
|
274
|
+
* The palette for colouring by a category column: `tableau10`, `okabe-ito`, `set2` or `dark2`.
|
|
275
|
+
* Unset, the current choice stands, which starts as `tableau10`.
|
|
310
276
|
*/
|
|
311
277
|
accessor categoryPalette: CategoryPaletteName | '';
|
|
312
278
|
/**
|
|
313
|
-
* The ramp a number column
|
|
314
|
-
* `red-blue`. Unset, the choice
|
|
315
|
-
* is made.
|
|
279
|
+
* The colour ramp for colouring by a number column: `viridis`, `cividis`, `magma`, `greys` or
|
|
280
|
+
* `red-blue`. Unset, the current choice stands, which starts as `viridis`.
|
|
316
281
|
*/
|
|
317
282
|
accessor ramp: RampName | '';
|
|
318
|
-
/** How numbers are placed on the ramp, `linear` or `log`. Unset, the
|
|
283
|
+
/** How numbers are placed on the ramp, `linear` or `log`. Unset, the current choice stands. */
|
|
319
284
|
accessor rampScale: RampScale | '';
|
|
320
285
|
/** Runs the ramp from its high end to its low end. */
|
|
321
286
|
accessor rampReverse: boolean;
|
|
322
287
|
/**
|
|
323
|
-
* Colours for
|
|
324
|
-
* `{field: {'cs.CV': '#f28e2b'}}`. Setting it replaces every value colour chosen before,
|
|
325
|
-
*
|
|
326
|
-
* having kept them from `mosaica-valuecolour`. Unset, the choices made on the cards stand.
|
|
288
|
+
* Colours for individual category values, by column and category key, as `#rrggbb`, such as
|
|
289
|
+
* `{field: {'cs.CV': '#f28e2b'}}`. Setting it replaces every value colour chosen before, including
|
|
290
|
+
* those chosen on a field card. Use it to restore choices you saved from `mosaica-valuecolour`.
|
|
327
291
|
*/
|
|
328
292
|
accessor valueColours: Colouring['values'] | null;
|
|
329
293
|
/**
|
|
330
|
-
* Colours for
|
|
331
|
-
* as `{topics: {'4021': '#f28e2b'}}
|
|
294
|
+
* Colours for individual clusters, by layer and `mosaica_id` (as a decimal string), as `#rrggbb`,
|
|
295
|
+
* such as `{topics: {'4021': '#f28e2b'}}`. They replace the palette colours
|
|
332
296
|
* (`Store.setArtifactColours`). Setting it replaces every cluster colour chosen before, including
|
|
333
|
-
* those chosen on a field card or in Edit colours
|
|
334
|
-
*
|
|
335
|
-
* `#rrggbb` colour is skipped. Unset, the choices made on the cards stand.
|
|
297
|
+
* those chosen on a field card or in Edit colours. Use it to restore choices you saved from
|
|
298
|
+
* `mosaica-clustercolour`. Invalid entries are skipped.
|
|
336
299
|
*/
|
|
337
300
|
accessor clusterColours: Record<string, Record<string, string>> | null;
|
|
338
301
|
/**
|
|
@@ -344,38 +307,40 @@ export declare class MosaicaMap extends MosaicaElement {
|
|
|
344
307
|
*/
|
|
345
308
|
accessor measure: boolean;
|
|
346
309
|
/**
|
|
347
|
-
* A fixed point radius in pixels. Unset,
|
|
348
|
-
*
|
|
310
|
+
* A fixed point radius in pixels. Unset, the radius depends on how many points are drawn and on
|
|
311
|
+
* the zoom. Ignored while `size-by` names a column.
|
|
349
312
|
*/
|
|
350
313
|
accessor radius: number | null;
|
|
351
314
|
/**
|
|
352
|
-
*
|
|
353
|
-
*
|
|
354
|
-
*
|
|
355
|
-
*
|
|
356
|
-
* the points, so choosing one sends no request. Unset, the store's choice stands.
|
|
315
|
+
* The rendered number column that sizes the points, or `none` for a single size. Each value is
|
|
316
|
+
* placed between `size-min` and `size-max` on `size-scale`, against the range of the values
|
|
317
|
+
* drawn. A point with no value, NaN or an infinity is drawn as a ring. Unset, the store's choice
|
|
318
|
+
* stands.
|
|
357
319
|
*/
|
|
358
320
|
accessor sizeBy: string;
|
|
359
321
|
/**
|
|
360
|
-
* The radius in pixels of the smallest value under `size-by`. A value that is not
|
|
361
|
-
*
|
|
322
|
+
* The radius in pixels of the smallest value under `size-by`. A value that is not above zero is
|
|
323
|
+
* ignored. Unset, the
|
|
324
|
+
* current choice stands, which starts at 2.
|
|
362
325
|
*/
|
|
363
326
|
accessor sizeMin: number | null;
|
|
364
327
|
/**
|
|
365
|
-
* The radius in pixels of the largest value under `size-by`. A value that is not
|
|
366
|
-
*
|
|
328
|
+
* The radius in pixels of the largest value under `size-by`. A value that is not above zero is
|
|
329
|
+
* ignored. Unset, the
|
|
330
|
+
* current choice stands, which starts at 9.
|
|
367
331
|
*/
|
|
368
332
|
accessor sizeMax: number | null;
|
|
369
333
|
/**
|
|
370
334
|
* How values are placed between the two sizes: `linear`, `log`, or `rank` among a sample of the
|
|
371
|
-
* values drawn. Unset, the choice
|
|
335
|
+
* values drawn. Unset, the current choice stands, which starts as `linear`.
|
|
372
336
|
*/
|
|
373
337
|
accessor sizeScale: SizeScale | '';
|
|
374
338
|
/** Hides the toolbar. */
|
|
375
339
|
accessor noControls: boolean;
|
|
376
340
|
/**
|
|
377
|
-
*
|
|
378
|
-
*
|
|
341
|
+
* The corner the toolbar sits in: `top-left`, `top-right`, `bottom-left` or `bottom-right`.
|
|
342
|
+
* Content in the same corner's slot sits below the toolbar in a top corner, and above it in a
|
|
343
|
+
* bottom corner.
|
|
379
344
|
*/
|
|
380
345
|
accessor controlsCorner: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
381
346
|
/** @internal */
|
|
@@ -393,15 +358,15 @@ export declare class MosaicaMap extends MosaicaElement {
|
|
|
393
358
|
/** @internal */
|
|
394
359
|
accessor dragPolygon: [number, number][] | null;
|
|
395
360
|
/**
|
|
396
|
-
* What the last click found
|
|
397
|
-
* in the layer
|
|
361
|
+
* What the last click found if it found no item: `{kind: 'miss'}`, or `{kind: 'broken', ...}`
|
|
362
|
+
* with details of a fault in the layer. `null` after a hit. Pass it to `<mosaica-item-card>`'s
|
|
363
|
+
* `pick`.
|
|
398
364
|
*/
|
|
399
365
|
lastPick: PickOutcome;
|
|
400
366
|
/**
|
|
401
|
-
* What the last click picked
|
|
402
|
-
* position the
|
|
403
|
-
*
|
|
404
|
-
* places its callout from it through {@link MosaicaMap.screenOf}.
|
|
367
|
+
* What the last click picked, an item or an artifact, and where in world coordinates: the point's
|
|
368
|
+
* position, or where the click landed on an artifact. `null` before a pick, after a miss and after
|
|
369
|
+
* a switch of view. Pass `world` to `screenOf()` to place a card beside it.
|
|
405
370
|
*/
|
|
406
371
|
pickedAt: {
|
|
407
372
|
kind: 'item' | 'artifact';
|
|
@@ -485,9 +450,8 @@ export declare class MosaicaMap extends MosaicaElement {
|
|
|
485
450
|
/** Tell the density counter what to draw: whether, and at which cell size. */
|
|
486
451
|
private pushDensity;
|
|
487
452
|
/**
|
|
488
|
-
* The resolution
|
|
489
|
-
*
|
|
490
|
-
* `selection.maxAggregateCells`. Every stop is enabled before `meta` has arrived.
|
|
453
|
+
* The density cell sizes `density-resolution` offers at the current camera, each with whether the
|
|
454
|
+
* server's `selection.maxAggregateCells` allows it. Every size is allowed before `meta` has loaded.
|
|
491
455
|
*/
|
|
492
456
|
densityStops(): ResolutionStop[];
|
|
493
457
|
protected onStoreAdopted(store: Store | null): void;
|
|
@@ -513,7 +477,7 @@ export declare class MosaicaMap extends MosaicaElement {
|
|
|
513
477
|
private measureStore;
|
|
514
478
|
/** A sample of carried ordinals, each resolved through the table; see {@link MapProbe.cluster}. */
|
|
515
479
|
private clusterProbe;
|
|
516
|
-
/** Dispose of the store this map built
|
|
480
|
+
/** Dispose of the store this map built and release its GPU resources now. */
|
|
517
481
|
dispose(): void;
|
|
518
482
|
private ensureDeck;
|
|
519
483
|
private get size();
|
|
@@ -565,9 +529,8 @@ export declare class MosaicaMap extends MosaicaElement {
|
|
|
565
529
|
/** Focus the canvas, which takes the map's keys. */
|
|
566
530
|
focus(options?: FocusOptions): void;
|
|
567
531
|
/**
|
|
568
|
-
* Drop the
|
|
569
|
-
*
|
|
570
|
-
* it. A selected region stays.
|
|
532
|
+
* Drop the picked item or artifact and the ring around it, and clear the store's selection, which
|
|
533
|
+
* closes its card. A click on an empty part of the map does the same. A selected region stays.
|
|
571
534
|
*/
|
|
572
535
|
clearPick(): void;
|
|
573
536
|
private onClick;
|
|
@@ -598,41 +561,40 @@ export declare class MosaicaMap extends MosaicaElement {
|
|
|
598
561
|
private regionTag;
|
|
599
562
|
/** The level clusters are drawn at: `cluster-level` where set, else the top level of a levelled layer. */
|
|
600
563
|
private drawnLevel;
|
|
601
|
-
/**
|
|
564
|
+
/** Whether the map is drawn on a light or dark background now: `ground` if set, else the page's scheme. */
|
|
602
565
|
get drawnGround(): 'light' | 'dark';
|
|
603
566
|
/**
|
|
604
|
-
*
|
|
605
|
-
*
|
|
567
|
+
* Convert a world position to pixels from the map's top-left corner, under the current camera. A
|
|
568
|
+
* position off the map falls outside `[0, width] × [0, height]`.
|
|
606
569
|
*/
|
|
607
570
|
screenOf(world: readonly [number, number]): [number, number];
|
|
608
|
-
/** The camera's zoom: 0 when the 512-unit world
|
|
571
|
+
/** The camera's zoom: 0 when the 512-unit world is 512 pixels wide, and 1 more per doubling. */
|
|
609
572
|
get zoom(): number;
|
|
610
573
|
/** The framing asked for and not yet applied; a camera move cancels it. */
|
|
611
574
|
private framing;
|
|
612
575
|
/** Whether the map frames the matches when it is next connected: it left the page with a framing pending. */
|
|
613
576
|
private frameOnConnect;
|
|
614
577
|
/**
|
|
615
|
-
*
|
|
616
|
-
*
|
|
617
|
-
*
|
|
618
|
-
*
|
|
619
|
-
* frames once it is back on it. Resolves when the camera has moved or the framing was cancelled.
|
|
578
|
+
* Move the camera to frame every item the filters and selected region match, filling 92% of the
|
|
579
|
+
* map. If nothing matches, or the server refuses, it frames the whole extent. The camera moves
|
|
580
|
+
* when the server answers, unless it is moved first. Resolves when the camera has moved or
|
|
581
|
+
* the move was cancelled.
|
|
620
582
|
*/
|
|
621
583
|
fit(): Promise<void>;
|
|
622
584
|
private cancelFraming;
|
|
585
|
+
/** Centre the camera on a point in data coordinates, keeping the zoom. Returns false before `meta` has loaded. */
|
|
586
|
+
lookAt(x: number, y: number): boolean;
|
|
623
587
|
/**
|
|
624
|
-
*
|
|
625
|
-
*
|
|
588
|
+
* Fit the camera to an artifact's bounding box. Returns false if the artifact is not among those
|
|
589
|
+
* currently drawn (`artifacts.served`) or has no box.
|
|
626
590
|
*/
|
|
627
|
-
lookAt(x: number, y: number): boolean;
|
|
628
|
-
/** Fit a served artifact's box into the map. Returns false where the store holds no box for it. */
|
|
629
591
|
fitTo(artifactId: bigint): boolean;
|
|
630
592
|
/**
|
|
631
|
-
* Fit a box `[x0, y0, x1, y1]` in data coordinates,
|
|
632
|
-
*
|
|
633
|
-
*
|
|
634
|
-
*
|
|
635
|
-
*
|
|
593
|
+
* Fit the camera to a box `[x0, y0, x1, y1]` in data coordinates, as `mosaica-viewchange`
|
|
594
|
+
* reports them. The canvas keeps its aspect ratio, so the area shown contains the box. `fill` is
|
|
595
|
+
* the share of the map the box fills along its tighter side, about 81% by default; pass `1` to
|
|
596
|
+
* restore a camera from a box `mosaica-viewchange` reported. Returns false before `meta` has
|
|
597
|
+
* loaded.
|
|
636
598
|
*/
|
|
637
599
|
fitBbox(extent: [number, number, number, number], fill?: number): boolean;
|
|
638
600
|
private onKey;
|