@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
package/dist/explorer.js CHANGED
@@ -131,70 +131,31 @@ const TABS = [
131
131
  { sheet: 'detail', icon: 'info', label: 'Item', panel: 'detail' }
132
132
  ];
133
133
  /**
134
- * The map with its status strip, toolbar, field cards, display settings, layers, selection and item
135
- * card, laid out together. It builds its own store from `token` or an `authorise` property and
136
- * `viewer-url`, the page's own origin where unset, or from `viewer-url` alone for an open server,
137
- * or takes a `store` property, and provides it by
138
- * context to everything inside it, including elements a host puts in its slots.
134
+ * Use the explorer when you want a working map page without arranging the elements yourself. It
135
+ * gives the viewer a map with the filter panel, the status strip and a Layers popover, and it opens
136
+ * a card when they pick an item or a cluster or select a region.
139
137
  *
140
- * The heading names what is shown: `dataset-title` where the host sets one, with the view's name
141
- * under it, else the view's name alone. A view's name that is only its id is left out. With
142
- * several views the view's name is the view choice.
138
+ * Most of these parts have a slot, so you can put your own element in place of one of them. For a
139
+ * different arrangement, lay out the separate elements yourself.
143
140
  *
144
- * The left holds the heading and the filter panel (`<mosaica-filter-panel>`): what the cards count,
145
- * In view or Highlighted beside All matching, the clauses applied as chips with Clear all, one
146
- * `<mosaica-field-card>` per field, and Add field. `layout="docked"` puts them in a sidebar left of
147
- * the map; `layout="overlay"` puts them in a card over the map's top-left, which scrolls inside
148
- * itself when tall. The map's tools sit at the top-left of the map, right of the card in the
149
- * overlay layout, with a Layers button beneath them. The status strip sits in the map's
150
- * bottom-right.
141
+ * The explorer builds its store from `viewer-url` and `token` or `authorise`, unless you give it
142
+ * one in its `store` property. Every element inside it uses that store, including the ones you put
143
+ * in its slots.
151
144
  *
152
- * Picking a point opens its item card beside the point, joined to it by a short leader: on the side
153
- * with most room, clear of the cards over the map, the map's tools and the Layers button, following
154
- * the point as the map pans and zooms, hidden while the point is off the map, and clear of the
155
- * other cards beside points. Where no side beside the point is clear, the card goes to the clear
156
- * place nearest it. The card shows the headline, the `subtitle-field` field, the `card-fields`
157
- * fields (else the first three), "Show all N fields", and Open where `open-url` or `open` says what
158
- * it does. Show all grows the card as far as the map's height and the same things allow; past that
159
- * the card scrolls. Picking another point replaces it unless Pin was pressed, which keeps it open;
160
- * Close or Escape closes it and drops the selection, and a click on the map that finds nothing does
161
- * the same for the card that is not pinned. Tab from the map goes to the card, which is named by
162
- * its item's title and gives focus back to the map as it closes. A picked cluster's card behaves
163
- * the same way. While a region is selected its card stands in the map's top-right corner, and where
164
- * the map holds no position for the selection, as after following an item into another view, the
165
- * item's card goes there too.
145
+ * `layout="docked"` puts the heading and the filter panel in a sidebar beside the map, and
146
+ * `layout="overlay"` puts them in a card over it. When the bundle offers more than one view or
147
+ * group of views, the heading holds the view picker so that viewers can switch between them.
166
148
  *
167
- * The Layers button opens a popover in four sections. Points: whether the points are drawn; Most
168
- * points, a slider from `budget-min` to `budget-max` on a log scale that sets the store's budget
169
- * when it is let go (`Store.setBudget`); while a `nested` or `dag` layer is drawn, Most clusters,
170
- * a slider from `cluster-budget-min` to `cluster-budget-max` on a log scale that sets the most
171
- * clusters such a layer is cut to when it is let go (`Store.setClusterBudget`); what sizes the
172
- * points; and their opacity. Size by lists
173
- * None and the number columns the points arrive with. Under None one Size slider sets every
174
- * point's radius, which `hide-size` leaves out; under a column two sliders set the radii of its
175
- * smallest and largest value, and a Linear, Log or Rank choice places values between them. Colour:
176
- * Colour by, which lists None, every layer that can colour (a levelled layer once per level) and
177
- * the rendered category and number columns; then for a layer or a category the palette, and for a
178
- * number the ramp, Linear or Log and Reverse, unless `hide-palettes` is set. A layer's palette is
179
- * the store's (`Store.setPalette`), whose size the clusters' slots are served for. While the
180
- * points are coloured by a category or a layer, Edit colours opens `<mosaica-colour-editor>` over
181
- * the page, listing the values or the clusters drawn (at the level coloured, on a levelled layer)
182
- * with their colours to choose and reset, in an order that holds through a pan or a filter. A field card's paint button chooses Colour by too. Density: how density is drawn, at what resolution, in which
183
- * colours and how strongly. Layers: the layer picker. The display settings are the explorer's properties of
184
- * the same names, passed to its map. `pinned-filters` names the columns whose cards are listed
185
- * before they hold a clause.
149
+ * A picked item's card opens beside its point and follows the point as the map moves. Picking
150
+ * another point replaces the card unless the viewer has pinned it.
186
151
  *
187
- * In a container narrower than 1000 px, either layout takes the overlay's form with a narrower card
188
- * of 264 px, every field card folded to one line until one is opened, and opening one folds the
189
- * one open before; the tools move to the bottom-left and the strip shortens its figures. In a
190
- * container 720 px wide or narrower, the heading sits in a bar above the map, the status strip
191
- * runs full width above a tab bar (Fields, Layers, Item), and each tab opens its panel as a sheet:
192
- * the filter panel, folded as in the compact form; the Layers popover's sections; and the item
193
- * card. The cards over the map are not drawn there.
152
+ * Each setting in the Layers popover is also an attribute of the explorer, so you can set it from
153
+ * HTML.
194
154
  *
195
- * Every event its elements fire bubbles out of it, since each is composed.
155
+ * Below 1000 px the explorer uses the overlay layout whatever `layout` says. At 720 px or less it
156
+ * opens its panels as sheets from a tab bar.
196
157
  *
197
- * @summary The map and every panel, in a default layout.
158
+ * @summary A complete map application in a single element.
198
159
  * @tagname mosaica-explorer
199
160
  * @category Elements
200
161
  * @slot toolbar - Replaces the view picker and the key picker.
@@ -209,9 +170,9 @@ const TABS = [
209
170
  * @fires {CustomEvent<MosaicaEventDetails['mosaica-pick']>} mosaica-pick - A point was clicked.
210
171
  * @fires {CustomEvent<MosaicaEventDetails['mosaica-itemopen']>} mosaica-itemopen - The selected item's record arrived.
211
172
  * @fires {CustomEvent<MosaicaEventDetails['mosaica-basemapchange']>} mosaica-basemapchange - The map's basemap refusal or note changed.
212
- * @fires {CustomEvent<MosaicaEventDetails['mosaica-miss']>} mosaica-miss - A click on the map found nothing; the explorer closes the card that is not pinned and drops the selection.
173
+ * @fires {CustomEvent<MosaicaEventDetails['mosaica-miss']>} mosaica-miss - A click on the map found nothing. The explorer closes the unpinned card.
213
174
  * @fires {CustomEvent<MosaicaEventDetails['mosaica-hover']>} mosaica-hover - The pointer moved over a point.
214
- * @fires {CustomEvent<MosaicaEventDetails['mosaica-artifactopen']>} mosaica-artifactopen - An artifact was opened and its drill-down arrived.
175
+ * @fires {CustomEvent<MosaicaEventDetails['mosaica-artifactopen']>} mosaica-artifactopen - An artifact was opened and its details arrived.
215
176
  * @fires {CustomEvent<MosaicaEventDetails['mosaica-selectchange']>} mosaica-selectchange - A selection was drawn, changed or cleared, or its counts arrived.
216
177
  * @fires {CustomEvent<MosaicaEventDetails['mosaica-layerchange']>} mosaica-layerchange - The layers chosen changed.
217
178
  * @fires {CustomEvent<MosaicaEventDetails['mosaica-colourchange']>} mosaica-colourchange - Colour by changed, in the Layers popover or by a card's paint button.
@@ -231,7 +192,7 @@ const TABS = [
231
192
  * @fires {CustomEvent<MosaicaEventDetails['mosaica-clausechange']>} mosaica-clausechange - A `member_of` clause was put on or taken off.
232
193
  * @fires {CustomEvent<MosaicaEventDetails['mosaica-artifactfit']>} mosaica-artifactfit - Fit was pressed on the artifact card; the explorer fits its map to the artifact.
233
194
  * @fires {CustomEvent<MosaicaEventDetails['mosaica-open']>} mosaica-open - Open was pressed on the item card.
234
- * @fires {CustomEvent<MosaicaEventDetails['mosaica-close']>} mosaica-close - A card's close button was pressed; the explorer closes the card and drops the selection it shows.
195
+ * @fires {CustomEvent<MosaicaEventDetails['mosaica-close']>} mosaica-close - A card's close button was pressed. The explorer closes the card and clears its selection.
235
196
  * @fires {CustomEvent<MosaicaEventDetails['mosaica-viewswitch']>} mosaica-viewswitch - The view changed through the view or key picker.
236
197
  * @fires {CustomEvent<MosaicaEventDetails['mosaica-viewfollow']>} mosaica-viewfollow - A view chip on the item card was pressed; the explorer switches to that view and centres on the item.
237
198
  * @csspart frame - The explorer's grid.
@@ -276,8 +237,7 @@ const TABS = [
276
237
  * @csspart colour-option - An entry in the Colour by menu, with `data-value` (empty for None,
277
238
  * `cluster:<layer>@<level>` for one level of a levelled layer) and `aria-checked`.
278
239
  * @csspart palette - The Palette button, while the points are coloured by a layer or a category.
279
- * @csspart palette-menu - The Palette menu, while it is open: a row per palette, each a strip of its
280
- * colours, its name and a line saying how many it has.
240
+ * @csspart palette-menu - The Palette menu, while it is open.
281
241
  * @csspart palette-option - A palette in that menu, with `data-value` and `aria-checked`.
282
242
  * @csspart edit-colours - The Edit colours button, enabled while the points are coloured by a
283
243
  * category or a layer.
@@ -289,16 +249,16 @@ const TABS = [
289
249
  * @csspart ramp-reverse - The Reverse button, with `aria-pressed`.
290
250
  * @csspart density-mode - The Density choice: None, Smooth, Hex, Grid and Lines, each with
291
251
  * `data-mode` and `aria-checked`.
292
- * @csspart density-resolution - The Resolution slider, while density is drawn: the cell size on
293
- * screen, coarse to fine. Its stops past the finest the server will count for the view are shown
294
- * struck through, and the slider stops at the last one it can count.
252
+ * @csspart density-resolution - The Resolution slider for density's cell size, while density is
253
+ * drawn. Sizes finer than the server allows for the view are struck through.
295
254
  * @csspart density-scale - The Linear and Log choice of density's colour scale, while density is
296
255
  * drawn, each with `data-scale` and `aria-checked`.
297
256
  * @csspart density-colours - The button that opens the list of density colours, while density is
298
257
  * drawn in colours.
299
258
  * @csspart density-strength - The Strength slider, while density is drawn.
300
- * @csspart detail - The item or artifact card in the map's top-right corner, where the map holds no
301
- * position for the selection.
259
+ * @csspart detail - The item or artifact card in the map's top-right corner, used when the picked
260
+ * item or artifact has no position on the map, such as after following an item into another
261
+ * view.
302
262
  * @csspart sheet - The open sheet, in the narrow layout.
303
263
  * @csspart strip-row - The full-width status strip, in the narrow layout.
304
264
  * @csspart tabs - The tab bar, in the narrow layout.
@@ -1041,188 +1001,185 @@ let MosaicaExplorer = (() => {
1041
1001
  canBuildOwn = true;
1042
1002
  #layout_accessor_storage = __runInitializers(this, _layout_initializers, 'docked');
1043
1003
  /**
1044
- * `docked`, the map beside a sidebar, or `overlay`, the map full-bleed under a card holding the
1045
- * same panels.
1004
+ * `docked` puts the panels in a sidebar beside the map. `overlay` makes the map fill the element
1005
+ * and puts the panels in a card over it.
1046
1006
  */
1047
1007
  get layout() { return this.#layout_accessor_storage; }
1048
1008
  set layout(value) { this.#layout_accessor_storage = value; }
1049
1009
  #panels_accessor_storage = (__runInitializers(this, _layout_extraInitializers), __runInitializers(this, _panels_initializers, ALL_PANELS.join(' ')));
1050
1010
  /**
1051
- * Which regions appear, space- or comma-separated, from `toolbar` (the heading), `legend` (the
1052
- * Layers button and its popover), `filters` (the filter panel), `selection` and `detail` (the
1053
- * item and artifact cards). Defaults to all five. Any other name, such as `hierarchy`, shows
1054
- * nothing.
1011
+ * The regions to show, separated by spaces or commas: `toolbar` (the heading), `legend` (the
1012
+ * Layers button and popover), `filters` (the filter panel), `selection` (the selected region's
1013
+ * card) and `detail` (the item and artifact cards). Defaults to all five. Other names are ignored.
1055
1014
  */
1056
1015
  get panels() { return this.#panels_accessor_storage; }
1057
1016
  set panels(value) { this.#panels_accessor_storage = value; }
1058
1017
  #colourBy_accessor_storage = (__runInitializers(this, _panels_extraInitializers), __runInitializers(this, _colourBy_initializers, ''));
1059
- /** Passed to the map's `colour-by`. */
1018
+ /** What colours the points, as for `<mosaica-map>`'s `colour-by`. */
1060
1019
  get colourBy() { return this.#colourBy_accessor_storage; }
1061
1020
  set colourBy(value) { this.#colourBy_accessor_storage = value; }
1062
1021
  #layers_accessor_storage = (__runInitializers(this, _colourBy_extraInitializers), __runInitializers(this, _layers_initializers, ''));
1063
- /** Passed to the map's `layers`. */
1022
+ /** The annotation layers to draw, as for `<mosaica-map>`'s `layers`. */
1064
1023
  get layers() { return this.#layers_accessor_storage; }
1065
1024
  set layers(value) { this.#layers_accessor_storage = value; }
1066
1025
  #tooltipFields_accessor_storage = (__runInitializers(this, _layers_extraInitializers), __runInitializers(this, _tooltipFields_initializers, ''));
1067
- /** Passed to the map's `tooltip-fields`. */
1026
+ /** The columns the hover tooltip shows, as for `<mosaica-map>`'s `tooltip-fields`. */
1068
1027
  get tooltipFields() { return this.#tooltipFields_accessor_storage; }
1069
1028
  set tooltipFields(value) { this.#tooltipFields_accessor_storage = value; }
1070
1029
  #titleField_accessor_storage = (__runInitializers(this, _tooltipFields_extraInitializers), __runInitializers(this, _titleField_initializers, ''));
1071
- /** The field that titles a point, in the map's tooltip and the item card's headline. Unset, the title is the `mosaica_id`. */
1030
+ /** The field that titles a point in the hover tooltip and the item card. Unset, the title is the `mosaica_id`. */
1072
1031
  get titleField() { return this.#titleField_accessor_storage; }
1073
1032
  set titleField(value) { this.#titleField_accessor_storage = value; }
1074
1033
  #subtitleField_accessor_storage = (__runInitializers(this, _titleField_extraInitializers), __runInitializers(this, _subtitleField_initializers, ''));
1075
- /** The field the item card shows under its headline. Unset, it shows none. */
1034
+ /** The field the item card shows under its title. Unset, there is no subtitle. */
1076
1035
  get subtitleField() { return this.#subtitleField_accessor_storage; }
1077
1036
  set subtitleField(value) { this.#subtitleField_accessor_storage = value; }
1078
1037
  #cardFields_accessor_storage = (__runInitializers(this, _subtitleField_extraInitializers), __runInitializers(this, _cardFields_initializers, ''));
1079
- /** Passed to the item card's `card-fields`: the fields it shows before "Show all", in this order. Unset, the first three. */
1038
+ /** The fields the item card shows before "Show all", in order, as for `<mosaica-item-card>`. Unset, the first three. */
1080
1039
  get cardFields() { return this.#cardFields_accessor_storage; }
1081
1040
  set cardFields(value) { this.#cardFields_accessor_storage = value; }
1082
1041
  #openUrl_accessor_storage = (__runInitializers(this, _cardFields_extraInitializers), __runInitializers(this, _openUrl_initializers, ''));
1083
- /** Passed to the item card's `open-url`: the address Open goes to, filled from the item's fields. Unset, and without `open`, there is no Open. */
1042
+ /** The link template for the item card's Open button, as for `<mosaica-item-card>`. Without it or `open`, there is no Open button. */
1084
1043
  get openUrl() { return this.#openUrl_accessor_storage; }
1085
1044
  set openUrl(value) { this.#openUrl_accessor_storage = value; }
1086
1045
  #open_accessor_storage = (__runInitializers(this, _openUrl_extraInitializers), __runInitializers(this, _open_initializers, null));
1087
- /** Passed to the item card's `open`: called when Open is pressed. Set, it wins over `open-url`. */
1046
+ /** A function the item card calls when Open is pressed, as for `<mosaica-item-card>`. Takes precedence over `open-url`. */
1088
1047
  get open() { return this.#open_accessor_storage; }
1089
1048
  set open(value) { this.#open_accessor_storage = value; }
1090
1049
  #budget_accessor_storage = (__runInitializers(this, _open_extraInitializers), __runInitializers(this, _budget_initializers, 0));
1091
1050
  /**
1092
- * How many marks to aim for on screen, passed to the map's `budget`. `0`, the default, leaves the
1093
- * store's own, which starts at 250000. Most points in the Layers popover sets the store's budget
1094
- * itself.
1051
+ * How many marks to aim for on screen. `0` keeps the store's budget, which starts at 250000. Most
1052
+ * points in the Layers popover changes the store's budget directly.
1095
1053
  */
1096
1054
  get budget() { return this.#budget_accessor_storage; }
1097
1055
  set budget(value) { this.#budget_accessor_storage = value; }
1098
1056
  #budgetMin_accessor_storage = (__runInitializers(this, _budget_extraInitializers), __runInitializers(this, _budgetMin_initializers, 1_000));
1099
- /** The fewest marks Most points offers, passed to the map's `budget-min`. */
1057
+ /** The lowest value of the Most points slider. */
1100
1058
  get budgetMin() { return this.#budgetMin_accessor_storage; }
1101
1059
  set budgetMin(value) { this.#budgetMin_accessor_storage = value; }
1102
1060
  #budgetMax_accessor_storage = (__runInitializers(this, _budgetMin_extraInitializers), __runInitializers(this, _budgetMax_initializers, 2_000_000));
1103
- /** The most marks Most points offers, passed to the map's `budget-max`. */
1061
+ /** The highest value of the Most points slider. */
1104
1062
  get budgetMax() { return this.#budgetMax_accessor_storage; }
1105
1063
  set budgetMax(value) { this.#budgetMax_accessor_storage = value; }
1106
1064
  #clusterBudget_accessor_storage = (__runInitializers(this, _budgetMax_extraInitializers), __runInitializers(this, _clusterBudget_initializers, 1_000));
1107
1065
  /**
1108
- * The most clusters a `nested` or `dag` layer is cut to, passed to the map's `cluster-budget`;
1109
- * `0` is the finest cut. Most clusters in the Layers popover sets the store's itself.
1066
+ * The most clusters a `nested` or `dag` layer is cut to; `0` removes the limit. Most clusters in
1067
+ * the Layers popover changes it.
1110
1068
  */
1111
1069
  get clusterBudget() { return this.#clusterBudget_accessor_storage; }
1112
1070
  set clusterBudget(value) { this.#clusterBudget_accessor_storage = value; }
1113
1071
  #clusterBudgetMin_accessor_storage = (__runInitializers(this, _clusterBudget_extraInitializers), __runInitializers(this, _clusterBudgetMin_initializers, 10));
1114
- /** The fewest clusters Most clusters offers. */
1072
+ /** The lowest value of the Most clusters slider. */
1115
1073
  get clusterBudgetMin() { return this.#clusterBudgetMin_accessor_storage; }
1116
1074
  set clusterBudgetMin(value) { this.#clusterBudgetMin_accessor_storage = value; }
1117
1075
  #clusterBudgetMax_accessor_storage = (__runInitializers(this, _clusterBudgetMin_extraInitializers), __runInitializers(this, _clusterBudgetMax_initializers, 10_000));
1118
- /** The most clusters Most clusters offers. */
1076
+ /** The highest value of the Most clusters slider. */
1119
1077
  get clusterBudgetMax() { return this.#clusterBudgetMax_accessor_storage; }
1120
1078
  set clusterBudgetMax(value) { this.#clusterBudgetMax_accessor_storage = value; }
1121
1079
  #basemap_accessor_storage = (__runInitializers(this, _clusterBudgetMax_extraInitializers), __runInitializers(this, _basemap_initializers, null));
1122
1080
  /**
1123
- * Passed to the map's `basemap`: `world`, `none`, `{tiles, attribution}`, `{image, bounds}`, a
1124
- * mapping from view id (as `meta.views` lists it, and not `tiles` or `image`) to one of those, or
1125
- * a deck.gl layer. The attribute takes `world` and `none`. Unset, the world outline under a view
1126
- * with a map projection and nothing under one without.
1081
+ * What is drawn under the points, as for `<mosaica-map>`'s `basemap`. The attribute takes `world`
1082
+ * and `none`. Unset, a view with a map projection gets the world outline and any other view gets
1083
+ * nothing.
1127
1084
  */
1128
1085
  get basemap() { return this.#basemap_accessor_storage; }
1129
1086
  set basemap(value) { this.#basemap_accessor_storage = value; }
1130
1087
  #noPoints_accessor_storage = (__runInitializers(this, _basemap_extraInitializers), __runInitializers(this, _noPoints_initializers, false));
1131
- /** Passed to the map's `no-points`; the Points switch in the Layers popover changes it. */
1088
+ /** Hides the points. The Points switch in the Layers popover changes it. */
1132
1089
  get noPoints() { return this.#noPoints_accessor_storage; }
1133
1090
  set noPoints(value) { this.#noPoints_accessor_storage = value; }
1134
1091
  #radius_accessor_storage = (__runInitializers(this, _noPoints_extraInitializers), __runInitializers(this, _radius_initializers, null));
1135
- /** Passed to the map's `radius`; the Size slider in the Layers popover changes it. */
1092
+ /** A fixed point radius in pixels, as for `<mosaica-map>`. The Size slider in the Layers popover changes it. */
1136
1093
  get radius() { return this.#radius_accessor_storage; }
1137
1094
  set radius(value) { this.#radius_accessor_storage = value; }
1138
1095
  #sizeBy_accessor_storage = (__runInitializers(this, _radius_extraInitializers), __runInitializers(this, _sizeBy_initializers, ''));
1139
- /** Passed to the map's `size-by`; the Size by choice in the Layers popover changes it. */
1096
+ /** The number column that sizes the points, as for `<mosaica-map>`. Size by in the Layers popover changes it. */
1140
1097
  get sizeBy() { return this.#sizeBy_accessor_storage; }
1141
1098
  set sizeBy(value) { this.#sizeBy_accessor_storage = value; }
1142
1099
  #sizeMin_accessor_storage = (__runInitializers(this, _sizeBy_extraInitializers), __runInitializers(this, _sizeMin_initializers, null));
1143
- /** Passed to the map's `size-min`; the smallest-size slider in the Layers popover changes it. */
1100
+ /** The radius of the smallest value under `size-by`. A slider in the Layers popover changes it. */
1144
1101
  get sizeMin() { return this.#sizeMin_accessor_storage; }
1145
1102
  set sizeMin(value) { this.#sizeMin_accessor_storage = value; }
1146
1103
  #sizeMax_accessor_storage = (__runInitializers(this, _sizeMin_extraInitializers), __runInitializers(this, _sizeMax_initializers, null));
1147
- /** Passed to the map's `size-max`; the largest-size slider in the Layers popover changes it. */
1104
+ /** The radius of the largest value under `size-by`. A slider in the Layers popover changes it. */
1148
1105
  get sizeMax() { return this.#sizeMax_accessor_storage; }
1149
1106
  set sizeMax(value) { this.#sizeMax_accessor_storage = value; }
1150
1107
  #sizeScale_accessor_storage = (__runInitializers(this, _sizeMax_extraInitializers), __runInitializers(this, _sizeScale_initializers, ''));
1151
- /** Passed to the map's `size-scale`; the Scale choice in the Layers popover changes it. */
1108
+ /** How values are placed between the two sizes, as for `<mosaica-map>`. The Scale choice in the Layers popover changes it. */
1152
1109
  get sizeScale() { return this.#sizeScale_accessor_storage; }
1153
1110
  set sizeScale(value) { this.#sizeScale_accessor_storage = value; }
1154
1111
  #hideSize_accessor_storage = (__runInitializers(this, _sizeScale_extraInitializers), __runInitializers(this, _hideSize_initializers, false));
1155
- /** Leaves the Size slider out of the Layers popover, for a host that sets `radius` itself. */
1112
+ /** Leaves the Size slider out of the Layers popover, for when you set `radius` yourself. */
1156
1113
  get hideSize() { return this.#hideSize_accessor_storage; }
1157
1114
  set hideSize(value) { this.#hideSize_accessor_storage = value; }
1158
1115
  #pointOpacity_accessor_storage = (__runInitializers(this, _hideSize_extraInitializers), __runInitializers(this, _pointOpacity_initializers, null));
1159
- /** Passed to the map's `point-opacity`; the Opacity slider in the Layers popover changes it. */
1116
+ /** A fixed point opacity from 0.1 to 1. The Opacity slider in the Layers popover changes it. */
1160
1117
  get pointOpacity() { return this.#pointOpacity_accessor_storage; }
1161
1118
  set pointOpacity(value) { this.#pointOpacity_accessor_storage = value; }
1162
1119
  #density_accessor_storage = (__runInitializers(this, _pointOpacity_extraInitializers), __runInitializers(this, _density_initializers, 'none'));
1163
- /** Passed to the map's `density`; the Density choice in the Layers popover changes it. */
1120
+ /** How density is drawn, as for `<mosaica-map>`. The Density choice in the Layers popover changes it. */
1164
1121
  get density() { return this.#density_accessor_storage; }
1165
1122
  set density(value) { this.#density_accessor_storage = value; }
1166
1123
  #densityColours_accessor_storage = (__runInitializers(this, _density_extraInitializers), __runInitializers(this, _densityColours_initializers, ''));
1167
- /** Passed to the map's `density-colours`; the Colours choice in the Layers popover changes it. */
1124
+ /** The colours density is drawn in, as for `<mosaica-map>`. The Colours choice in the Layers popover changes it. */
1168
1125
  get densityColours() { return this.#densityColours_accessor_storage; }
1169
1126
  set densityColours(value) { this.#densityColours_accessor_storage = value; }
1170
1127
  #densityStrength_accessor_storage = (__runInitializers(this, _densityColours_extraInitializers), __runInitializers(this, _densityStrength_initializers, 1));
1171
- /** Passed to the map's `density-strength`; the Strength slider in the Layers popover changes it. */
1128
+ /** How strongly density is drawn, from 0.1 to 1. The Strength slider in the Layers popover changes it. */
1172
1129
  get densityStrength() { return this.#densityStrength_accessor_storage; }
1173
1130
  set densityStrength(value) { this.#densityStrength_accessor_storage = value; }
1174
1131
  #densityResolution_accessor_storage = (__runInitializers(this, _densityStrength_extraInitializers), __runInitializers(this, _densityResolution_initializers, DEFAULT_DENSITY_CELL_PX));
1175
1132
  /**
1176
- * Passed to the map's `density-resolution`, the cell size on screen in CSS pixels; the Resolution
1133
+ * The size of density's cells on screen, in CSS pixels, as for `<mosaica-map>`. The Resolution
1177
1134
  * slider in the Layers popover changes it.
1178
1135
  */
1179
1136
  get densityResolution() { return this.#densityResolution_accessor_storage; }
1180
1137
  set densityResolution(value) { this.#densityResolution_accessor_storage = value; }
1181
1138
  #densityScale_accessor_storage = (__runInitializers(this, _densityResolution_extraInitializers), __runInitializers(this, _densityScale_initializers, DEFAULT_DENSITY_SCALE));
1182
- /** Passed to the map's `density-scale`; the Scale choice under Resolution in the Layers popover changes it. */
1139
+ /** `linear` or `log` colouring of density counts. The Scale choice under Resolution in the Layers popover changes it. */
1183
1140
  get densityScale() { return this.#densityScale_accessor_storage; }
1184
1141
  set densityScale(value) { this.#densityScale_accessor_storage = value; }
1185
1142
  #palette_accessor_storage = (__runInitializers(this, _densityScale_extraInitializers), __runInitializers(this, _palette_initializers, ''));
1186
1143
  /**
1187
- * Passed to the map's `palette`, the palette a layer's clusters are coloured from; the Palette
1188
- * choice in the Colour section changes it while the points are coloured by a layer.
1144
+ * The palette clusters are coloured from, as for `<mosaica-map>`. The Palette choice in the Colour
1145
+ * section changes it while the points are coloured by a layer.
1189
1146
  */
1190
1147
  get palette() { return this.#palette_accessor_storage; }
1191
1148
  set palette(value) { this.#palette_accessor_storage = value; }
1192
1149
  #categoryPalette_accessor_storage = (__runInitializers(this, _palette_extraInitializers), __runInitializers(this, _categoryPalette_initializers, ''));
1193
- /** Passed to the map's `category-palette`. */
1150
+ /** The palette for colouring by a category column, as for `<mosaica-map>`. */
1194
1151
  get categoryPalette() { return this.#categoryPalette_accessor_storage; }
1195
1152
  set categoryPalette(value) { this.#categoryPalette_accessor_storage = value; }
1196
1153
  #ramp_accessor_storage = (__runInitializers(this, _categoryPalette_extraInitializers), __runInitializers(this, _ramp_initializers, ''));
1197
- /** Passed to the map's `ramp`. */
1154
+ /** The colour ramp for colouring by a number column, as for `<mosaica-map>`. */
1198
1155
  get ramp() { return this.#ramp_accessor_storage; }
1199
1156
  set ramp(value) { this.#ramp_accessor_storage = value; }
1200
1157
  #rampScale_accessor_storage = (__runInitializers(this, _ramp_extraInitializers), __runInitializers(this, _rampScale_initializers, ''));
1201
- /** Passed to the map's `ramp-scale`. */
1158
+ /** How numbers are placed on the ramp, `linear` or `log`. */
1202
1159
  get rampScale() { return this.#rampScale_accessor_storage; }
1203
1160
  set rampScale(value) { this.#rampScale_accessor_storage = value; }
1204
1161
  #rampReverse_accessor_storage = (__runInitializers(this, _rampScale_extraInitializers), __runInitializers(this, _rampReverse_initializers, false));
1205
- /** Passed to the map's `ramp-reverse`. */
1162
+ /** Runs the ramp from its high end to its low end. */
1206
1163
  get rampReverse() { return this.#rampReverse_accessor_storage; }
1207
1164
  set rampReverse(value) { this.#rampReverse_accessor_storage = value; }
1208
1165
  #valueColours_accessor_storage = (__runInitializers(this, _rampReverse_extraInitializers), __runInitializers(this, _valueColours_initializers, null));
1209
- /** Passed to the map's `valueColours`. */
1166
+ /** Colours for individual category values, as for `<mosaica-map>`'s `valueColours`. */
1210
1167
  get valueColours() { return this.#valueColours_accessor_storage; }
1211
1168
  set valueColours(value) { this.#valueColours_accessor_storage = value; }
1212
1169
  #clusterColours_accessor_storage = (__runInitializers(this, _valueColours_extraInitializers), __runInitializers(this, _clusterColours_initializers, null));
1213
- /** Passed to the map's `clusterColours`. */
1170
+ /** Colours for individual clusters, as for `<mosaica-map>`'s `clusterColours`. */
1214
1171
  get clusterColours() { return this.#clusterColours_accessor_storage; }
1215
1172
  set clusterColours(value) { this.#clusterColours_accessor_storage = value; }
1216
1173
  #datasetTitle_accessor_storage = (__runInitializers(this, _clusterColours_extraInitializers), __runInitializers(this, _datasetTitle_initializers, ''));
1217
- /** The dataset's title, which heads the explorer above the view's name. Unset, the view's name is the heading. */
1174
+ /** The dataset's title, shown as the heading above the view's name. Unset, the view's name is the heading. */
1218
1175
  get datasetTitle() { return this.#datasetTitle_accessor_storage; }
1219
1176
  set datasetTitle(value) { this.#datasetTitle_accessor_storage = value; }
1220
1177
  #pinnedFilters_accessor_storage = (__runInitializers(this, _datasetTitle_extraInitializers), __runInitializers(this, _pinnedFilters_initializers, ''));
1221
- /** Passed to the filter panel's `pinned`: the columns whose cards are listed before they hold a clause. */
1178
+ /** Columns whose field cards always show, even when they hold no filter, as for `<mosaica-filter-panel>`'s `pinned`. */
1222
1179
  get pinnedFilters() { return this.#pinnedFilters_accessor_storage; }
1223
1180
  set pinnedFilters(value) { this.#pinnedFilters_accessor_storage = value; }
1224
1181
  #hidePalettes_accessor_storage = (__runInitializers(this, _pinnedFilters_extraInitializers), __runInitializers(this, _hidePalettes_initializers, false));
1225
- /** Leaves the palette and ramp choices out of the Colour section, for a host that sets them. */
1182
+ /** Leaves the palette and ramp choices out of the Colour section, for when you set them yourself. */
1226
1183
  get hidePalettes() { return this.#hidePalettes_accessor_storage; }
1227
1184
  set hidePalettes(value) { this.#hidePalettes_accessor_storage = value; }
1228
1185
  #menu_accessor_storage = (__runInitializers(this, _hidePalettes_extraInitializers), __runInitializers(this, _menu_initializers, null));
@@ -1369,7 +1326,7 @@ let MosaicaExplorer = (() => {
1369
1326
  this.map?.dispose();
1370
1327
  super.dispose();
1371
1328
  }
1372
- /** The `<mosaica-map>` the explorer renders, for a host that calls `fit`, `fitTo` or `select`. */
1329
+ /** The explorer's `<mosaica-map>`, for calling its methods such as `fit`, `fitTo` or `select`. */
1373
1330
  get map() {
1374
1331
  return this.renderRoot?.querySelector('mosaica-map') ?? null;
1375
1332
  }
@@ -1500,8 +1457,6 @@ let MosaicaExplorer = (() => {
1500
1457
  tooltip-fields=${this.tooltipFields}
1501
1458
  title-field=${this.titleField || nothing}
1502
1459
  budget=${this.budget || nothing}
1503
- .budgetMin=${this.budgetMin}
1504
- .budgetMax=${this.budgetMax}
1505
1460
  .clusterBudget=${this.clusterBudget}
1506
1461
  controls-corner=${compact ? 'bottom-left' : 'top-left'}
1507
1462
  .clusterLevel=${level}
@@ -10,59 +10,27 @@ type Brush = {
10
10
  open: boolean;
11
11
  };
12
12
  /**
13
- * One field as a card in the filter panel: a category's commonest values, a layer's largest
14
- * clusters, a number's or a date's histogram, or a text field's search box, under the field's name.
15
- * `field` is a column `meta.filterOperands` lists, or `cluster:<layer>` for a layer whose clusters
16
- * can be filtered by.
13
+ * Use a field card on its own when you want one field's chart in a place of your choosing.
14
+ * `<mosaica-filter-panel>` shows one for each field. Set `field` to a column `meta.filterOperands`
15
+ * lists, or to `cluster:<layer>` for a layer's clusters.
17
16
  *
18
- * The counts are taken over two sets. The subject is what is in view: the items in the camera's box
19
- * that the filters admit, or the highlighted ones while a highlight is set. The whole match is every
20
- * item the filters admit. Both leave out the card's own clause in the filter position, so a value
21
- * its clause excludes keeps its count. The card keeps three aggregates registered with the store
22
- * while it is drawn (`Store.setAggregate`): the subject's counts (`subject: 'view'` with
23
- * `highlighted`), the whole match's, and for a number or a date its figures over everything the
24
- * viewer may see (`subject: 'visible'`). A folded card asks for the subject's alone.
17
+ * The solid bars count the items in view that the filters match, or the highlighted items while
18
+ * there is a highlight. The pale bars count every item the filters match. Neither count applies the
19
+ * card's own filter, so a value the viewer has filtered out keeps its count.
25
20
  *
26
- * A category or cluster card lists five values, those with most items in the subject first and any
27
- * its own clauses name, with "N more" opening it to twenty. Each row has its name (a cluster's
28
- * parents in grey after it), a solid bar for its share of the subject and a pale bar for its share
29
- * of the whole match, each a share of its own total, and the two counts. Under a filter on the
30
- * field, the values it leaves out are greyed and show only how many items they would add, and the
31
- * shares are of what the filter keeps. Hovering or focusing a row shows Highlight and Filter, which
32
- * put the value in or out of the field's clause in that position. A click or tap on the row does
33
- * what its Filter button does and shows its buttons; the row takes no focus, and the keyboard
34
- * reaches the buttons. Over the rows is the field's search box, the typeahead of
35
- * `<mosaica-filter>` or `<mosaica-cluster-filter>`, whose choice joins the filter. A levelled
36
- * layer's card has a Level choice in its heading, the top (coarsest) level by default, which fires
37
- * `mosaica-levelchange`. A cluster card ranks a `nested` or `dag` layer's clusters at the cut the
38
- * map draws (`cut: 'drawn'`), and a flat or levelled layer's at its level.
39
- * A cluster is named as the aggregate's table names it, which is the name the layer's browse pages
40
- * give the same viewer. On a `nested` or `dag` layer its path is named from a browse page of its
41
- * parents and one of its first parent's.
21
+ * What the card shows depends on the kind of field:
42
22
  *
43
- * A number or date card draws about twenty bins over the values the viewer may see, the pale bar
44
- * the whole match and the solid one the subject, each bin's height its share of its own set, scaled
45
- * so the tallest share fills the plot. The counts are taken from a sample of about 100,000 items
46
- * where a set is larger, and an estimate is marked "≈". Dragging across the bins, or the arrow keys
47
- * with Shift on the focused plot and then Enter, opens a box naming the range and how many items
48
- * match in it, with Filter and Highlight, which set the field's range in that position. A range set
49
- * on the field is outlined on the plot. The heading gives the field's figures: how many items hold
50
- * a value and their mean, or their range while folded.
23
+ * - A category or cluster card lists the values with most items in view, each with Highlight and
24
+ * Filter buttons.
25
+ * - A number or date card draws a histogram, and the viewer drags across it to pick a range to
26
+ * filter or highlight by. From the keyboard, they press Shift and the arrow keys on the focused
27
+ * plot, then Enter. Counts over about 100,000 items come from a sample, so they are marked "≈".
28
+ * - A text or keyword field's card is a search box, `<mosaica-filter>`.
51
29
  *
52
- * A text or keyword field is its `<mosaica-filter>` search box.
30
+ * While the paint button colours the map by the field, clicking a value's colour opens a picker
31
+ * that changes the colour on the map.
53
32
  *
54
- * The paint button colours the map by the field, or by nothing where it already does
55
- * (`Store.setColourBy`), and is pressed while it does. Then a category or cluster card shows each
56
- * value's colour beside it, and a number or date card the ramp under its plot. Each colour is a
57
- * button that opens a colour picker: the palette's colours and a lighter row, a custom area with a
58
- * hue bar and a hex field, and Reset, which gives the value or the cluster its palette colour back.
59
- * A choice applies at once and fires `mosaica-valuecolour` for a category value, written to the
60
- * colour choices every element over the store shares, or `mosaica-clustercolour` for a cluster,
61
- * set on the store with its other chosen colours (`Store.setArtifactColours`).
62
- *
63
- * `folded` draws the heading alone, with a small chart of the subject's counts.
64
- *
65
- * @summary One field's counts in view and overall, with its filter and highlight.
33
+ * @summary A card that charts one field's values and filters or highlights by them.
66
34
  * @tagname mosaica-field-card
67
35
  * @category Elements
68
36
  * @fires {CustomEvent<MosaicaEventDetails['mosaica-filterchange']>} mosaica-filterchange - A row's
@@ -87,11 +55,11 @@ type Brush = {
87
55
  * @csspart paint - The paint button, with `aria-pressed`.
88
56
  * @csspart fold - The fold button, with `aria-expanded`.
89
57
  * @csspart rows - A category or cluster card's rows.
90
- * @csspart row - One row, with `data-key` and `data-state`: `in` for a value the field's filter
91
- * keeps, `out` for one it leaves out, `lit` for one its highlight lights, else empty.
92
- * @csspart swatch - A row's colour, while the map is coloured by the field, a button that opens the
93
- * colour picker, with `data-unmet` and drawn as an outline for a category value the map has not
94
- * drawn yet and so has given no colour.
58
+ * @csspart row - One row, with `data-key` and `data-state`: `in` if the field's filter keeps the
59
+ * value, `out` if it leaves it out, `lit` if it is highlighted, otherwise empty.
60
+ * @csspart swatch - A row's colour button, while the map is coloured by the field. It opens the
61
+ * colour picker. It carries `data-unmet`, and is drawn as an outline, for a value the map has not
62
+ * drawn yet and so has not given a colour.
95
63
  * @csspart name - A row's name, with `data-unnamed` for a cluster that has none.
96
64
  * @csspart path - A cluster row's parents.
97
65
  * @csspart bar-match - A row's or a bin's pale bar, its share of the whole match.
@@ -123,11 +91,11 @@ export declare class MosaicaFieldCard extends MosaicaElement {
123
91
  static styles: import("lit").CSSResult[];
124
92
  /** The field: a column `meta.filterOperands` lists, or `cluster:<layer>` for a layer's clusters. */
125
93
  accessor field: string;
126
- /** Draws the heading alone, with a small chart of the subject's counts. */
94
+ /** Shows the heading alone, with a small chart of the counts in view. */
127
95
  accessor folded: boolean;
128
- /** Draws the small chart for the compact layout. */
96
+ /** Draws a folded card in the compact style the explorer uses in narrow containers. */
129
97
  accessor compact: boolean;
130
- /** The level a levelled layer's card counts at; `null` is its top level. */
98
+ /** The level a card for a layer with levels counts at. `null` is the coarsest level. */
131
99
  accessor level: number | null;
132
100
  /** Whether "N more" was pressed. @internal */
133
101
  accessor expanded: boolean;