@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.
Files changed (52) hide show
  1. package/dist/artifact-card.d.ts +20 -26
  2. package/dist/artifact-card.js +20 -26
  3. package/dist/base.d.ts +21 -29
  4. package/dist/base.js +18 -26
  5. package/dist/basemap.d.ts +2 -2
  6. package/dist/cluster-filter.d.ts +19 -25
  7. package/dist/cluster-filter.js +19 -25
  8. package/dist/colour-editor.d.ts +16 -36
  9. package/dist/colour-editor.js +16 -36
  10. package/dist/context.d.ts +4 -4
  11. package/dist/context.js +4 -4
  12. package/dist/count.d.ts +16 -15
  13. package/dist/count.js +16 -15
  14. package/dist/events.d.ts +63 -68
  15. package/dist/explorer.d.ts +76 -119
  16. package/dist/explorer.js +76 -121
  17. package/dist/field-card.d.ts +24 -56
  18. package/dist/field-card.js +24 -56
  19. package/dist/filter-panel.d.ts +31 -45
  20. package/dist/filter-panel.js +31 -45
  21. package/dist/filter.d.ts +20 -28
  22. package/dist/filter.js +20 -28
  23. package/dist/hierarchy.d.ts +35 -36
  24. package/dist/hierarchy.js +35 -36
  25. package/dist/index.d.ts +5 -4
  26. package/dist/index.js +5 -4
  27. package/dist/item-card.d.ts +34 -55
  28. package/dist/item-card.js +34 -55
  29. package/dist/key-picker.d.ts +5 -5
  30. package/dist/key-picker.js +5 -5
  31. package/dist/layer-picker.d.ts +11 -9
  32. package/dist/layer-picker.js +11 -9
  33. package/dist/map.d.ts +134 -172
  34. package/dist/map.js +136 -188
  35. package/dist/mosaica-components.js +5599 -1594
  36. package/dist/mosaica-components.js.LICENSE.txt +80 -16
  37. package/dist/mosaica-components.js.sri +1 -1
  38. package/dist/mosaica-components.json +2 -2
  39. package/dist/parts.d.ts +3 -4
  40. package/dist/parts.js +3 -4
  41. package/dist/selection.d.ts +21 -27
  42. package/dist/selection.js +21 -27
  43. package/dist/states.d.ts +15 -20
  44. package/dist/status.d.ts +26 -38
  45. package/dist/status.js +26 -38
  46. package/dist/store-element.d.ts +8 -7
  47. package/dist/store-element.js +8 -7
  48. package/dist/tokens.d.ts +12 -13
  49. package/dist/tokens.js +12 -13
  50. package/dist/view-picker.d.ts +10 -6
  51. package/dist/view-picker.js +10 -6
  52. package/package.json +6 -6
@@ -1,23 +1,25 @@
1
1
  import { nothing, type TemplateResult } from 'lit';
2
2
  import { MosaicaElement } from './base.js';
3
3
  /**
4
- * A checkbox per annotation layer in `meta.layers`, choosing which layers the map draws. A layer
5
- * that others depend on (a clustering and its labels) is one entry that turns on the whole group;
6
- * the entry's tooltip names the layers in it. A filter layer has nothing to draw and gets no
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
- * @summary Which annotation layers the map draws.
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, with the layers now drawn.
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, on a line under "View refused".
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 where it declares none.
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
  */
@@ -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
- * A checkbox per annotation layer in `meta.layers`, choosing which layers the map draws. A layer
9
- * that others depend on (a clustering and its labels) is one entry that turns on the whole group;
10
- * the entry's tooltip names the layers in it. A filter layer has nothing to draw and gets no
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
- * @summary Which annotation layers the map draws.
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, with the layers now drawn.
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, on a line under "View refused".
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 where it declares none.
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
- * The map: the points, the density wash, the artifacts' outlines and labels, hover, pick and the
104
- * selection, drawn with deck.gl in an orthographic view. The refused, expired and empty states, and
105
- * a server that cannot be reached, did not answer or is too busy, are drawn over the canvas, so
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 owns the camera and tells the store where it is looking on every move. When it is given
113
- * a store, and when the store switches to a view with another extent, it opens framed on the items
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
- * The host element is `display: block`; its height comes from `--mosaica-map-height`. A map that
131
- * is disconnected and not reconnected releases its GPU resources a quarter of a second later.
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
- * @summary The map canvas.
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 selection, as {@link MosaicaMap.clearPick} does.
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 drill-down arrived.
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 state drawn over the canvas when refused, expired or empty, when the
161
- * server cannot be reached, when it did not answer, and when it is too busy. Where the
162
- * viewer can see no item in the view at all, it says so in place of Nothing in view.
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
- * where the viewer can see no item in the view.
165
- * @csspart retry - The Retry button in the overlay, when the view was refused or the server did
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 drawn region's tag on its top-left corner: how many items match inside
173
- * it, or outside it for its complement, and a button that clears the selection.
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, items per cell from 0 to the largest count
176
- * drawn with the count at the scale's midpoint, in the bottom-left corner while density is drawn
177
- * in a ramp or without the points.
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 between the top-left corner's content and the
184
- * map's left edge, for a panel floated over the map's left side. Defaults to 0.
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 are coloured by: a declared column that is rendered, `cluster:<layer>` for a
191
- * layer that can colour, or `none` for one colour. Unset, the store's choice stands.
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, space- or comma-separated; each is drawn with the layers it
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` leaves the store's budget, which starts at 250000. */
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` at first
207
- * leaves the store's; `0` after a budget was set clears it, to the finest cut.
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
- * Columns shown beneath a hovered point's title, space- or comma-separated. The map asks the
212
- * store for them with `setPointColumns`. Only a rendered column's value is in the marks; another
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 hovered point is titled by, read from the marks where they carry it (the map asks
218
- * the store for a rendered one with `setPointColumns`), else from the item's record once the
219
- * pointer has rested on it for 140 ms. Unset, the title is the point's
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 under colour by cluster: `okabe-ito`, `tableau10`,
227
- * `tableau20` or `kelly`, set on the store (`Store.setPalette`). Each cluster's colour is the
228
- * palette's colour at the slot the server gives it. Unset, the store's palette stands, which is
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 to colour, name and outline clusters at. Unset, the
234
- * layer's top (coarsest) level. A `nested` or `dag` layer draws the cut served.
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: `world` (the server's world outline: land, coastlines and
239
- * country borders), `none`, `{tiles, attribution}` (a tile server's URL template, with `{z}`,
240
- * `{x}` and `{y}`, and its credit, shown in the bottom-right corner), `{image, bounds}` (one
241
- * image over `[x0, y0, x1, y1]` in the view's coordinates, degrees on a geographic view, or over
242
- * the whole frame), a mapping from view id to one of those, or a deck.gl layer the host built in
243
- * the map's 512-unit world. The attribute takes `world` and `none`. Unset, or for a view a
244
- * mapping leaves out, `world` on a view with a map projection and nothing on one without.
245
- *
246
- * An object with a `tiles` or `image` key is one value, and takes only the keys its form names;
247
- * any other object is a mapping. A mapping's keys are view ids as `meta.views` lists them, so a
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
- * The ground the map draws on, `light` or `dark`, where it differs from the page's, such as a
260
- * light basemap under a dark page. The labels and the density colours follow it, and the
261
- * toolbar and panels follow the page. Unset, the scheme the elements render in: the one the
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 alpha from 0.1 to 1. Unset, points are more transparent the more of them are
270
- * drawn, so a dense region reads as a density.
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, from exact counts by cell (`POST /v1/aggregate`) and
275
- * never from the points, which are a sample: `none`, `smooth` (a soft wash), `hex` (hexagons),
276
- * `grid` (square cells) or `contours` (lines of equal density). It counts the highlighted items
277
- * under a highlight, the matched items under a filter or selection, else the visible items.
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
- * How large density's cells are on screen, in CSS pixels: 32, 24, 16, 12, 8, 6 or 4, and any
282
- * other size is taken as the nearest of them. The cells asked for are those of the depth nearest
283
- * that size at the current zoom. Where that depth's cells over the area asked for are more than
284
- * the server's `selection.maxAggregateCells`, the finest size that fits is drawn instead;
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
- * the smooth wash under the points is warm grey and every other density is Viridis. While density
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 is placed between no items and the largest count drawn, which picks its
298
- * colour: `linear`, in proportion to the count, or `log`, in proportion to `log(1 + count)`,
299
- * which spreads counts that span several orders of magnitude. Log is the default because counts
300
- * are skewed on most maps, and under linear only the densest few cells stand out from the rest.
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's values are coloured from: `tableau10`, `okabe-ito`, `set2` or
308
- * `dark2`. Unset, the choice made in the explorer's Colour section stands, Tableau 10 until one
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's values are coloured on: `viridis`, `cividis`, `magma`, `greys` or
314
- * `red-blue`. Unset, the choice made in the explorer's Colour section stands, Viridis until one
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 Colour section's choice stands. */
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 single category values, per column, per category key, as `#rrggbb`, such as
324
- * `{field: {'cs.CV': '#f28e2b'}}`. Setting it replaces every value colour chosen before,
325
- * including those chosen on a field card; a host restores a viewer's saved choices this way,
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 single clusters, per layer, per `mosaica_id` as a decimal string, as `#rrggbb`, such
331
- * as `{topics: {'4021': '#f28e2b'}}`, set on the store in place of their palette colours
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; a host restores a viewer's saved choices this
334
- * way, having kept them from `mosaica-clustercolour`. An entry that is not a `mosaica_id` and a
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, points are sized by how many are drawn and by the zoom.
348
- * Under `size-by`, the size column sizes the points in its place.
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
- * What the points are sized by: a declared number column that is rendered, or `none` for one
353
- * size. Each point's value is placed between `size-min` and `size-max` on `size-scale`, against
354
- * the range of the values drawn, or under rank a sample of them; a point with no value, NaN or an
355
- * infinity draws as a ring, at `size-min` or 3 px, whichever is larger. The column arrives with
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 a finite number
361
- * above zero is ignored. Unset, the choice made in the explorer stands, 2 until one is made.
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 a finite number
366
- * above zero is ignored. Unset, the choice made in the explorer stands, 9 until one is made.
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 made in the explorer stands, linear until one is made.
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
- * Which corner the toolbar sits in: `top-left`, `top-right`, `bottom-left` or `bottom-right`. In
378
- * a top corner the corner's slotted content is below the toolbar; in a bottom corner, above it.
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 where it found no item: `{kind: 'miss'}`, or a broken pick, a fault
397
- * in the layer, with its details. `null` after a hit. `<mosaica-item-card>`'s `pick` takes it.
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 and where: an item or an artifact, by `mosaicaId`, and the world
402
- * position the card for it points at, the picked point's own or, for an artifact, where the click
403
- * landed. `null` before a pick, after a miss and after a switch of view. `<mosaica-explorer>`
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 stops at the camera as it stands: each cell size, the depth it asks for, and
489
- * whether that depth's cells over the area asked for fit the server's
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, as on every element, and release its GPU resources now. */
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 selection: forget the last pick and the ring drawn round the picked point, and clear
569
- * the store's selection, which closes the card it opened. A click on empty map and Escape call
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
- /** The ground the map draws on now: `ground` where it is set, else the page's colour scheme. */
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
- * A world position in the map's pixels, from its top-left corner, under the camera as it stands.
605
- * A position off the map falls outside `[0, width] × [0, height]`.
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 fills 512 px, +1 per doubling. */
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
- * Frame the items the store's filters and selected region match: the box {@link frameMatches}
616
- * gives, which holds every one of them, fitted to 92% of the map along the side that limits it.
617
- * Where nothing matches, or the server refuses the count, the whole extent is fitted instead.
618
- * The camera moves once the count lands, unless it is moved before then. A map off the page
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
- * Centre the camera on a data coordinate at the current zoom. Returns false before `meta`, when
625
- * there is no frame to convert against.
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, the space `mosaica-viewchange` reports, into
632
- * the map. The camera keeps the canvas's aspect, so the box shown contains the one asked for,
633
- * and the next `mosaica-viewchange` reports the box shown. `fill` is the share of the map the
634
- * box takes along the side that limits it, 2^-0.3 (about 81%) unless given; at 1 a box
635
- * `mosaica-viewchange` reported is fitted back to the same camera. Returns false before `meta`.
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;