Events¶
Every event the elements fire, with its detail. Each is a CustomEvent that bubbles and is composed, so a host listens on the element or on any ancestor. A mosaica_id crosses as a decimal string. MosaicaEventDetails in @mosaicajs/components types every detail.
mosaica-statechange¶
The panel state changed from from to to; from is null on the first render. If to is refused, unanswered, busy or expired, refusal says what went wrong; otherwise it is null.
Detail: {from: PanelState | null; to: PanelState; refusal: Refusal | null}
Fired by: <mosaica-explorer>, <mosaica-status>.
mosaica-expired¶
The session expired. refusal is the server's refusal that ended it, if there was one.
Detail: {refusal: Refusal | null}
Fired by: <mosaica-explorer>, <mosaica-status>.
mosaica-viewchange¶
The camera moved. bbox is the area shown, [x0, y0, x1, y1] in the view's data coordinates. zoom is 0 when the 512-unit world is 512 pixels wide, and 1 more per doubling. width and height are the canvas size in CSS pixels.
Detail: {bbox: [number, number, number, number]; zoom: number; width: number; height: number}
Fired by: <mosaica-explorer>, <mosaica-map>.
mosaica-pick¶
A point was clicked. id is its mosaica_id. Its record follows in mosaica-itemopen.
Detail: {id: string}
Fired by: <mosaica-explorer>, <mosaica-map>.
mosaica-itemopen¶
The record of the selected item id arrived, whether it was selected by a click or by Store.pick. If the server refuses the record, this does not fire, and the refusal is in the store's selection.itemRefusal.
Detail: {id: string; record: ItemDetail}
Fired by: <mosaica-explorer>, <mosaica-map>.
mosaica-miss¶
A click on the map found no point and no artifact.
Detail: Record<string, never>
Fired by: <mosaica-explorer>, <mosaica-map>.
mosaica-hover¶
The pointer is over the point id, at x, y in canvas pixels.
Detail: {id: string; x: number; y: number}
Fired by: <mosaica-explorer>, <mosaica-map>.
mosaica-artifactopen¶
The artifact id was opened and its details arrived in detail, with maskedCount as a decimal string.
Detail: {id: string; detail: Omit<ArtifactDetail, 'maskedCount'> & {maskedCount: string}}
Fired by: <mosaica-explorer>, <mosaica-map>.
mosaica-artifactfit¶
Fit was pressed for the artifact id. <mosaica-explorer> fits its map to it.
Detail: {id: string}
Fired by: <mosaica-artifact-card>, <mosaica-explorer>, <mosaica-hierarchy>.
mosaica-selectchange¶
The selected region changed. shape is the new shape in data coordinates, or null if the selection was cleared. It fires with status loading when a shape is selected or cleared when it is cleared, then again with shown or refused when the server answers. Then visible, matched and served carry the region's counts, and verdict says whether they are exact for the shape.
Detail: { shape: SelectionShapeDetail | null; status?: RegionProjection['status'] | 'cleared'; visible?: Masked | null; matched?: Masked; served?: Count; verdict?: RegionProjection['verdict']; }
Fired by: <mosaica-explorer>, <mosaica-map>, <mosaica-selection>.
mosaica-layerchange¶
The chosen layers are now layers. The map also draws the layers each depends on, which the list leaves out.
Detail: {layers: string[]}
Fired by: <mosaica-explorer>, <mosaica-layer-picker>, <mosaica-map>.
mosaica-colourchange¶
The points are now coloured by colourBy: a column, cluster:<layer>, or null for a single colour.
Detail: {colourBy: string | null}
Fired by: <mosaica-explorer>, <mosaica-field-card>.
mosaica-sizechange¶
A size setting changed in the explorer's Layers popover. The detail holds all four as they now stand: sizeBy is the number column that sizes the points, or null for a single size, min and max are the radii in pixels of its smallest and largest value, and scale is how values are placed between them.
Detail: {sizeBy: string | null; min: number; max: number; scale: SizeScale}
Fired by: <mosaica-explorer>.
mosaica-fold¶
A field card's fold button folded it to one line (folded true) or opened it.
Detail: {field: string; folded: boolean}
Fired by: <mosaica-explorer>, <mosaica-field-card>.
mosaica-budgetchange¶
The Most points slider was released. The store now aims to draw budget marks on screen.
Detail: {budget: number}
Fired by: <mosaica-explorer>.
mosaica-clusterbudgetchange¶
The Most clusters slider was released. A nested or dag layer is now cut to at most budget clusters.
Detail: {budget: number}
Fired by: <mosaica-explorer>.
mosaica-levelchange¶
The level that clusters are coloured and labelled at is now level. Null is the default level.
Detail: {level: number | null}
Fired by: <mosaica-explorer>, <mosaica-field-card>.
mosaica-valuecolour¶
The viewer chose or reset colours for values of the category column column, in a colour picker or in Edit colours. Each change names a category key and its new colour as #rrggbb, or null if it was reset to its palette colour. The map already draws the new colours. To restore them in a later session, save them and set the map's or explorer's valueColours.
Detail: {column: string; changes: {value: string; colour: string | null}[]}
Fired by: <mosaica-colour-editor>, <mosaica-explorer>, <mosaica-field-card>.
mosaica-clustercolour¶
The viewer chose or reset colours for clusters of the layer layer. Each change names a cluster by its mosaica_id and its new colour as #rrggbb, or null if it was reset to its palette colour. The map already draws the new colours. To restore them in a later session, save them and set the map's or explorer's clusterColours.
Detail: {layer: string; changes: {mosaicaId: string; colour: string | null}[]}
Fired by: <mosaica-colour-editor>, <mosaica-explorer>, <mosaica-field-card>.
mosaica-palettechange¶
The palette, ramp, ramp scale or ramp direction was changed in the explorer's Colour section. The detail holds all four as they now stand.
Detail: {palette: CategoryPaletteName; ramp: RampName; scale: RampScale; reverse: boolean}
Fired by: <mosaica-explorer>.
mosaica-clusterpalettechange¶
A palette was chosen for a layer's clusters in the explorer's Colour section and set on the store (Store.setPalette).
Detail: {palette: PaletteName}
Fired by: <mosaica-explorer>.
mosaica-displaychange¶
A display setting changed in the explorer's Layers popover. The detail holds every setting as it now stands. points is the opposite of the map's noPoints; the other fields match the map's properties of the same name. radius, pointOpacity and densityColours are null while the map chooses them itself.
Detail: { points: boolean; radius: number | null; pointOpacity: number | null; density: DensityMode; densityColours: DensityColours | null; densityStrength: number; densityResolution: number; densityScale: DensityScale; }
Fired by: <mosaica-explorer>.
mosaica-filterchange¶
A filter or highlight changed. column is the column whose control changed, or null for Clear all and for clearing the highlight. verb is filter or highlight (filter if absent). After an edit, expr is the combined expression of every control's clause for that verb, or null if there are none. When a chip is removed, or Clear all is pressed, expr is null. member_of clauses are reported by mosaica-clausechange.
Detail: {column: string | null; expr?: FilterExpr | null; verb?: ClauseVerb}
Fired by: <mosaica-explorer>, <mosaica-field-card>, <mosaica-filter>, <mosaica-filter-panel>.
mosaica-chipopen¶
A column's chip was pressed in a filter panel with chips-only, so you can show its card. verb is filter or highlight.
Detail: {column: string; verb: ClauseVerb}
Fired by: <mosaica-filter-panel>.
mosaica-open¶
Open was pressed on the item id, whose record's fields are fields. It fires both when Open calls the card's open and when it follows open-url.
Detail: {id: string; fields: Record<string, unknown>}
Fired by: <mosaica-explorer>, <mosaica-item-card>.
mosaica-viewswitch¶
The view changed from from to to. sameFrame is true if both views share one extent, in which case the camera stays where it is; otherwise the map refits.
Detail: {from: string; to: string; sameFrame: boolean}
Fired by: <mosaica-explorer>, <mosaica-key-picker>, <mosaica-view-picker>.
mosaica-viewfollow¶
A view chip on the item card asked to show the item in the view view, where it sits at x, y in that view's data coordinates. <mosaica-explorer> switches to the view and centres the map there.
Detail: {view: string; x: number; y: number}
Fired by: <mosaica-explorer>, <mosaica-item-card>.
mosaica-basemapchange¶
The map's message about its basemap changed. refusal says why the basemap value cannot be drawn under its view, and is shown over the map. note says why nothing is drawn under the current view, and is shown in a corner. Each is null if there is none.
Detail: {refusal: string | null; note: string | null}
Fired by: <mosaica-explorer>, <mosaica-map>.
mosaica-close¶
A card's close button was pressed. what says which card.
Detail: {what: 'item' | 'artifact'}
Fired by: <mosaica-artifact-card>, <mosaica-explorer>, <mosaica-item-card>.
mosaica-clausechange¶
A member_of clause, which keeps the map to the members of the artifact id in layer layer, was added (on true) or removed. verb is filter or highlight, and outside is true if the clause keeps everything outside the artifact instead.
Detail: {id: string; layer: string; outside: boolean; verb: ClauseVerb; on: boolean}
Fired by: <mosaica-artifact-card>, <mosaica-cluster-filter>, <mosaica-explorer>, <mosaica-field-card>, <mosaica-hierarchy>.