Skip to content

<mosaica-artifact-card>

A card showing an artifact's details, parents and children.

Use the artifact card to show an artifact the viewer has opened on the map, such as a cluster. An artifact is a named group of items in an annotation layer. The card's count covers every member the viewer may see, so it does not change as the map moves. Pressing one of the artifact's parents or children opens that one instead.

The card reads the store's opened artifact, or the artifact you set.

The card's buttons filter or highlight the map by the artifact's members wherever they are, or filter to everything outside it. Fit to cluster fires mosaica-artifactfit, and <mosaica-explorer> responds by fitting its map to the artifact. A filter layer draws nothing, so its artifacts have no Fit button.

import '@mosaicajs/components/artifact-card';

Attributes

Attribute Property Type Default Description
viewer-url viewerUrl string '' The base URL of the Mosaica viewer server, for the store the element builds: a full URL such as https://maps.example.org, or a path such as /mosaica. Unset, the page's own origin. Read only by the map, the explorer and <mosaica-store>. Changing it builds a new store.
token token string '' A viewer token for the store the element builds. Without token or authorise, only an open server (serve.open) answers. Read only by the map, the explorer and <mosaica-store>. Changing it builds a new store.
artifacts-per-tile artifactsPerTile number | null null The most artifacts one level of a layer shows per map tile, for the store the element builds. Unset, 50, or the server's selection.max_artifacts_per_tile if lower. A value above that maximum is refused. Read only by the map, the explorer and <mosaica-store>. Changing it builds a new store.

Properties

Set as JavaScript properties; they have no attribute.

Property Type Default Description
artifact {id: bigint; detail: ArtifactDetail} | null null The artifact to show, if you fetch its details yourself. It replaces the store's opened artifact.
refusal Refusal | null null A refusal to show instead of an artifact, if you fetch its details yourself.
store Store | null null The store to use, ahead of one from context or one the element would build. The element never disposes it.
authorise TokenSupplier | null null A function that returns a viewer token, used instead of token and called again before the token expires. A different function builds a new store, so keep it stable across renders. Set it together with viewer-url: a store built from viewer-url alone first sends a request with no token, and is replaced when authorise arrives.
activeStore Store | null read-only The store this element is using, or null if it has none.
source StoreSource read-only Where activeStore came from.

Methods

Method Returns Description
dispose() void Dispose of the store this element built. Removing the element from the page does not, so call this when you are done with the element. A store you passed in is left to you.

Events

Each bubbles and is composed. Events gives each detail.

Event Fired when
mosaica-artifactfit Fit to cluster was pressed. <mosaica-explorer> fits its map to the artifact.
mosaica-clausechange A filter or highlight button added or removed a member_of clause.
mosaica-close The close button was pressed, with what set to artifact.

Slots

Slot Description
actions Buttons beside the close button, such as the explorer's Pin.

Parts

Styled from outside the element with ::part().

Part Description
title The heading, with the level's or layer's title and the close button.
close The close button.
state The state line, with data-state.
refusal The words "Not available", with data-code set to the refusal's code.
reason The server's reason for the refusal, under "Not available".
headline The artifact's name, with data-unnamed if it has none.
count The count of items the viewer may see.
content The artifact's description, or its attached topic.
value The layer and the key.
shape How the layer's shapes are made, with data-kind (derived, predicate or authored).
label The headings above the parents and the children.
parents The list of parents.
parent One parent, with data-id.
children The list of children in this view.
child One child, with data-id.
name A parent's or child's name, with data-unnamed if it has none.
fit The Fit to cluster button.
verbs The clause buttons.
filter The Filter to this button, with aria-pressed while its clause is on.
highlight The Highlight this button, with aria-pressed while its clause is on.
outside The Outside this button, with aria-pressed while its clause is on.

CSS custom properties

The theme tokens apply to this element.