Skip to content

Eodash Store ​

eodash fetches the SpatioTemporal Asset Catalog (STAC) endpoint assigned in the client configuration, navigates through its links, and assigns the result to its store. The store is then exposed to users, giving them the ability to read or modify the state of the dashboard at runtime.

The store is divided into three areas:

  • states - reactive values that drive the dashboard. They use the Vue reactivity system, so reading or writing a state updates the interface accordingly.
  • actions - functions that operate on the states, either by fetching new data or by triggering changes to existing states.
  • stac - a Pinia store that holds the STAC catalog navigation: the root catalog links, the selected STAC object, and the actions to load them.

States - store.states ​

PropertyTypeDescription
currentUrlRef<string>Currently selected STAC endpoint
currentCompareUrlRef<string>Currently selected compare STAC endpoint
datetimeRef<string>Currently selected datetime
indicatorRef<string>Currently selected indicator
compareIndicatorRef<string>Currently selected compare indicator
mapPositionRef<(number | undefined)[]>Current map position
registeredProjectionsstring[]
availableMapProjectionRef<string>available projection to be rendered by EodashMap
mapElRef<EOxMap & { mapUpdateId?: number } | null>
mapCompareElRef<EOxMap | null>
activeTemplateRef<string>
poiRef<string>Selected point of interest, used for location collections
comparePoiRef<string>Selected point of interest for comparison, used for location collections
isGlobeRef<boolean>Whether the map is in globe mode
areChartsSeparateLayoutRef<boolean>Whether the charts are in fullscreen mode
chartDataRef<Record<string,any>|null>Holds main chart data
compareChartDataRef<Record<string,any>|null>Holds compare chart data
chartSpecRef<VisualizationSpec | null>Holds main chart spec
compareChartSpecRef<VisualizationSpec | null>Holds compare chart spec
errorStateRef<{message: string, details: string, severity: "error" | "warning" | "info"}>Global error state
loadingGlobal loading state. - loading.activeLoads — increment/decrement to track concurrent loads - loading.value — derived boolean, true when activeLoads > 0
tooltipAdapterRef<((param: {key: string, value: any}, map?: string) => {key: string, value: any} | undefined) | null>Adapter allows external widgets to hook into tooltip property transformation

Actions - store.actions ​

ActionSignatureDescription
getLayers()Returns the current layers of mapEl.
getCompareLayers()Returns the current layers of mapCompareEl.
assignLayers(map, layers, event) => PromiseAssigns layers to an EOxMap instance and emits an update event when provided.
registerProjection(projection) => PromiseRegisters a spatial projection definition globally in proj4 and OpenLayers.
changeMapProjection(projection) => PromiseChanges eox-map projection to an EPSG projection.
setDatetime(value) => PromiseSets the datetime the dashboard shows and rebuilds the data layers to match. An open compare pane follows the same datetime.
setActiveTemplate(template)
includesProcess(collection, compare?)Checks whether the collection requires an EodashProcess widget.
shouldShowChartWidget(compare?)Checks whether the main or compare chart has data to display.

STAC store - store.stac.useSTAcStore() ​

The STAC catalog navigation pinia store. Call store.stac.useSTAcStore() to access these properties.

PropertyTypeDescription
stacEndpointRef<string| null>STAC catalog endpoint URL
rasterEndpointRef<string | null>Raster endpoint URL
configRendersRecord<string, Record<string, Render>>TiTiler render presets from the eodash configuration, keyed by collection id then render name. Take precedence over a collection's own renders.
isApiRef<boolean>
stacRef<STACLink[] | null>Links of the root STAC catalog
init(endpoint, renders)Initializes the store by assigning the STAC endpoint.
loadSTAC(url) => PromiseFetches root stac catalog and assign it to stac
loadSelectedSTAC(relativePath?, isPoi?, stacItem) => PromiseFetches the selected STAC object and assigns it to selectedStac.
loadSelectedCompareSTAC(relativePath?, isPOI?, stacItem) => PromiseFetches the selected STAC object and assigns it to selectedCompareStac.
resetSelectedCompareSTAC() => PromiseReset selected compare stac object
selectedStacRef<STACCollection | null>Selected STAC object.
selectedCompareStacRef<STACCollection | null>Selected compare STAC object.
selectedItemRef<STACItem | null | undefined>Currently selected item
selectedCompareItemRef<STACItem | null | undefined>Currently selected compare item
supportedUpscalingEndpointsRef<Array<string | { url: string; titilerVersion?: 1 | 2, scaleFactor?: number; }>>List of supported endpoints for upscaling. scaleFactor for v1 corresponds to @nx suffix (max 4). scaleFactor for v2 multiplies base tile size of 256px. Default scaleFactor is 2.
colormapRegistryRef<Record<string, string[]> | null>Registry of colormap ranges
loadColormapRegistry(registry) => PromiseLoads the colormap registry from a URL or object
tileMatrixSetRegistryRef<Record<string, any> | null>Custom registry of TileMatrixSets that replaces the default eodash registry
loadTileMatrixSetRegistry(registry) => PromiseLoads the tileMatrixSet registry from a URL or object

URL Query Parameters ​

A subset of the states is mirrored to the URL query string, so a dashboard can be deep-linked and restored to a specific view. On load these parameters are read into the store; while the user navigates they are written back, keeping the URL shareable.

ParameterStateDescription
templateactiveTemplateThe active template id.
indicatorindicatorThe selected dataset (sub-code id of a STAC link).
poipoiPoint of interest passed to the dataset's process service.
x, y, zmapPositionMap center longitude, latitude, and zoom.
datetimedatetimeSelected date (YYYY-MM-DD).

Importing the store ​

The same store API is exported from several entry points; pick the one that matches how the dashboard is configured.

ConfigurationImport
Build-time (SPA)import { store } from "@eodash/eodash"
Web component inside a bundled appimport { store } from "@eodash/eodash/webcomponent"
Runtime (config.js)const store = window.eodashStore
Runtime (web component build)import { store } from "/.eodash/dist/eo-dash.js"