@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/explorer.js
CHANGED
|
@@ -131,70 +131,31 @@ const TABS = [
|
|
|
131
131
|
{ sheet: 'detail', icon: 'info', label: 'Item', panel: 'detail' }
|
|
132
132
|
];
|
|
133
133
|
/**
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
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
|
-
*
|
|
141
|
-
*
|
|
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
|
|
145
|
-
*
|
|
146
|
-
*
|
|
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
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
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
|
-
*
|
|
168
|
-
*
|
|
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
|
-
*
|
|
188
|
-
*
|
|
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
|
-
*
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
293
|
-
*
|
|
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,
|
|
301
|
-
* position
|
|
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
|
|
1045
|
-
*
|
|
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
|
-
*
|
|
1052
|
-
* Layers button and
|
|
1053
|
-
* item and artifact cards). Defaults to all five.
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
|
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
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
|
1093
|
-
*
|
|
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
|
|
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
|
|
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
|
|
1109
|
-
*
|
|
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
|
|
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
|
|
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
|
-
*
|
|
1124
|
-
*
|
|
1125
|
-
*
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
*
|
|
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
|
-
/**
|
|
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
|
-
*
|
|
1188
|
-
*
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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,
|
|
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
|
-
/**
|
|
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
|
|
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
|
|
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}
|
package/dist/field-card.d.ts
CHANGED
|
@@ -10,59 +10,27 @@ type Brush = {
|
|
|
10
10
|
open: boolean;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
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
|
|
19
|
-
*
|
|
20
|
-
*
|
|
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
|
-
*
|
|
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
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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`
|
|
91
|
-
*
|
|
92
|
-
* @csspart swatch - A row's colour, while the map is coloured by the field
|
|
93
|
-
* colour picker
|
|
94
|
-
* drawn yet and so has given
|
|
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
|
-
/**
|
|
94
|
+
/** Shows the heading alone, with a small chart of the counts in view. */
|
|
127
95
|
accessor folded: boolean;
|
|
128
|
-
/** Draws
|
|
96
|
+
/** Draws a folded card in the compact style the explorer uses in narrow containers. */
|
|
129
97
|
accessor compact: boolean;
|
|
130
|
-
/** The level a
|
|
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;
|