React error boundary component that catches JavaScript errors in the component tree.
Visual summary of daily and sub-daily synthesis values allowing target date selection.
Central toolbar controls for forecast date navigation, manual date selection and restoration.
Main application toolbar providing access to distribution and analog details modals and central navigation controls.
Wrapper around MUI Snackbar with configurable origin and auto-hide.
Global snackbar manager component rendering queued snackbars and workspace validity alerts.
Dropdown selector for choosing active workspace region.
Application sidebar containing workspace selector and forecast-related panels.
Barrel file re-exporting panel components for convenient imports.
Panel rendering normalized synthesis values per method across daily and sub-daily lead times. Allows selecting target date and method; supports sub-daily segmentation when available.
Standardized status text renderer inside a Panel for loading/error/empty states.
Panel for selecting a forecast station/entity from the available entities list.
Panel for selecting forecast method and configuration using a tree view.
Panel for adjusting display parameters (percentile & normalization reference).
Panel displaying ranked analog dates with criteria values for the selected method/config and lead time.
Collapsible panel component for sidebar sections.
Barrel file re-exporting modal components for convenient imports.
Modal displaying time series percentiles, best analogs, reference return periods and previous forecast histories. Supports exporting charts (SVG/PNG/PDF) and dynamic configuration resolution for selected entity.
Modal displaying precipitation and criteria distributions for a selected method/config/entity/lead. Provides percentile markers, reference return periods, best analog overlays and export options.
Modal presenting a detailed list of analogs for a selected method/config/entity/lead with criteria and precipitation values.
Shared constants and color palettes used by modal charts (time series & distributions).
Utility helpers for exporting charts: safe filename generation, SVG style inlining, dimension extraction and temporary DOM mounting.
Shared modal selection component to pick method, configuration, entity and lead time. Handles chained data fetching, validity maintenance and relevance highlighting.
Small dropdown menu component offering export options (PNG, SVG, PDF).
D3-based time series chart rendering percentile envelopes, best analog markers, return periods and forecast history overlays.
D3-based empirical cumulative distribution chart for precipitation analog values with optional overlays.
D3-based ordered criteria distribution chart with optional analog criteria fallback.
Centralized map-related constants for OpenLayers configuration. Avoids magic numbers scattered throughout map components.
Main map viewer component using OpenLayers for forecast visualization. Displays forecast points, supports entity selection, and manages map layers.
Floating tooltip overlay displaying entity name and raw value at pointer position.
Legend component rendering a horizontal gradient scale for normalized forecast values.
Utilities for OpenLayers style creation and color parsing. Supports hex, rgb, rgba, QGIS-style colors, and style configuration objects.
Centralized projection utilities for OpenLayers with proj4 integration.
Utilities for loading WMTS (Web Map Tile Service) capabilities and creating tile layers. Handles fetching capabilities XML, parsing layer options, and caching for reuse.
Generates legend gradient stops for map visualization.
React hook for registering custom map projections with OpenLayers.
Hook for loading and managing global (non-workspace-specific) overlay layers. Supports WMTS and GeoJSON sources with optional periodic refresh.
Hook for loading and managing workspace-specific overlay layers (shapefiles). Dynamically adds/removes overlay layers based on workspace configuration.
Hook for handling map click and pointer interactions with forecast points. Manages entity selection on click and tooltip display on hover.
React hook for initializing OpenLayers map with configured layers and controls.
Hook for rendering forecast points on the map with color-coded values. Handles entity visualization, relevance highlighting, legend updates, and map extent fitting.
React hook for detecting system dark mode preference.
React error boundary component that catches JavaScript errors in the component tree.
React.ComponentObjectReact.ComponentError boundary component that catches and handles React component errors. Displays fallback UI and provides retry functionality.
Kind: static class of components/ErrorBoundary
Extends: React.Component
React.ComponentObject| Param | Type | Description |
|---|---|---|
| props | Object |
Component props |
| props.children | React.ReactNode |
Child components to protect |
| [props.onError] | function |
Optional error handler callback |
| [props.fallback] | React.ReactNode |
Optional custom fallback UI |
Example
<ErrorBoundary>
<MyComponent />
</ErrorBoundary>
Lifecycle method called after an error is caught. Logs the error and calls the optional onError callback.
Kind: instance method of ErrorBoundary
| Param | Type | Description |
|---|---|---|
| error | Error |
The error that was thrown |
| info | Object |
Error info with componentStack |
ObjectUpdates state when an error is caught.
Kind: static method of ErrorBoundary
Returns: Object - New state object
| Param | Type | Description |
|---|---|---|
| error | Error |
The error that was thrown |
Visual summary of daily and sub-daily synthesis values allowing target date selection.
Central toolbar controls for forecast date navigation, manual date selection and restoration.
Main application toolbar providing access to distribution and analog details modals and central navigation controls.
Wrapper around MUI Snackbar with configurable origin and auto-hide.
Global snackbar manager component rendering queued snackbars and workspace validity alerts.
Dropdown selector for choosing active workspace region.
Application sidebar containing workspace selector and forecast-related panels.
Barrel file re-exporting panel components for convenient imports.
Panel rendering normalized synthesis values per method across daily and sub-daily lead times. Allows selecting target date and method; supports sub-daily segmentation when available.
Standardized status text renderer inside a Panel for loading/error/empty states.
React.ReactElement | null ⏏Renders a small status line based on loading/error/empty flags. Priority order: loading > error > empty. Returns null if none are true.
Kind: Exported function
Returns: React.ReactElement | null - Span element or null if no status
| Param | Type | Description |
|---|---|---|
| props | Object |
|
| [props.loading] | boolean |
Whether the panel content is loading |
| [props.error] | boolean |
Whether an error occurred |
| [props.empty] | boolean |
Whether there is no data to show |
| [props.messages] | Object |
Optional custom messages |
| [props.messages.loading] | string |
Loading message override |
| [props.messages.error] | string |
Error message override |
| [props.messages.empty] | string |
Empty message override |
Panel for selecting a forecast station/entity from the available entities list.
React.ReactElement ⏏PanelStations component rendering a dropdown of entities with loading/error/empty states.
Kind: Exported function
| Param | Type | Description |
|---|---|---|
| props | Object |
|
| [props.defaultOpen] | boolean |
Initial open state of panel |
Panel for selecting forecast method and configuration using a tree view.
React.ReactElement ⏏PanelForecasts component wrapping the method/config tree inside a collapsible panel.
Kind: Exported function
| Param | Type | Description |
|---|---|---|
| props | Object |
|
| [props.defaultOpen] | boolean |
Initial open state for panel |
Panel for adjusting display parameters (percentile & normalization reference).
React.ReactElement ⏏PanelDisplay component rendering controls for percentile and normalization reference selection.
Kind: Exported function
| Param | Type | Description |
|---|---|---|
| props | Object |
|
| [props.defaultOpen] | boolean |
Initial open state |
Panel displaying ranked analog dates with criteria values for the selected method/config and lead time.
Collapsible panel component for sidebar sections.
React.ReactElement ⏏Collapsible panel with toggle header.
Kind: Exported function
| Param | Type | Default | Description |
|---|---|---|---|
| props | Object |
||
| props.title | string |
Panel title | |
| props.children | React.ReactNode |
Panel content | |
| [props.defaultOpen] | boolean |
false |
Initial open state |
Barrel file re-exporting modal components for convenient imports.
Modal displaying time series percentiles, best analogs, reference return periods and previous forecast histories. Supports exporting charts (SVG/PNG/PDF) and dynamic configuration resolution for selected entity.
Modal displaying precipitation and criteria distributions for a selected method/config/entity/lead. Provides percentile markers, reference return periods, best analog overlays and export options.
Modal presenting a detailed list of analogs for a selected method/config/entity/lead with criteria and precipitation values.
Shared constants and color palettes used by modal charts (time series & distributions).
Default percentile set (main quantiles).
Kind: static constant of components/modals/common/plotConstants
Full percentile set for detailed view.
Kind: static constant of components/modals/common/plotConstants
Selected return periods displayed when overlays enabled.
Kind: static constant of components/modals/common/plotConstants
Quantile line colors mapping.
Kind: static constant of components/modals/common/plotConstants
Stroke color for ten-year return period overlay.
Kind: static constant of components/modals/common/plotConstants
Marker stroke color for best analog points.
Kind: static constant of components/modals/common/plotConstants
Utility helpers for exporting charts: safe filename generation, SVG style inlining, dimension extraction and temporary DOM mounting.
stringvoidvoidObject*stringSanitize a string for safe use as a filename (drops/normalizes problematic characters)
Kind: static method of components/modals/common/exportUtils
Returns: string - Sanitized filename-friendly string
| Param | Type | Description |
|---|---|---|
| s | string |
Input string |
voidTrigger a download of a Blob with the given filename
Kind: static method of components/modals/common/exportUtils
| Param | Type | Description |
|---|---|---|
| blob | Blob |
Data blob |
| filename | string |
Filename to save |
voidInline computed style properties into all nodes of a given SVG element. Helpful to preserve appearance when exporting SVG/PNG/PDF without external CSS.
Kind: static method of components/modals/common/exportUtils
| Param | Type | Description |
|---|---|---|
| svg | SVGElement |
Root SVG element to inline styles into |
ObjectDetermine pixel size of an SVG element using width/height or viewBox fallback.
Kind: static method of components/modals/common/exportUtils
Returns: Object - Dimensions object
| Param | Type | Description |
|---|---|---|
| svg | SVGElement |
SVG element |
*Temporarily mount a node (e.g., cloned SVG) in a hidden container in the DOM to allow layout/style computations, then run a callback and cleanup.
Kind: static method of components/modals/common/exportUtils
Returns: * - Return value of callback
| Param | Type | Description |
|---|---|---|
| node | Node |
DOM node to mount temporarily |
| cb | function |
Callback executed while node is mounted |
Shared modal selection component to pick method, configuration, entity and lead time. Handles chained data fetching, validity maintenance and relevance highlighting.
React.ReactElement ⏏
React.ReactElement ⏏MethodConfigSelector component.
Kind: Exported function
| Param | Type | Default | Description |
|---|---|---|---|
| props | Object |
||
| [props.cachePrefix] | string |
"'modal_'" |
Prefix for cache keys to avoid collisions across modals |
| props.open | boolean |
Whether the parent modal is open (controls fetching enablement) | |
| props.value | Object |
Current selection state { methodId, configId, entityId, lead } | |
| props.onChange | function |
Callback receiving updated selection object | |
| [props.children] | React.ReactNode |
Optional extra controls rendered beneath standard selectors |
ObjectHook returning resolved selection data (with fallback config if none explicitly chosen).
Kind: static method of module.exports
Returns: Object - Object with resolvedMethodId, resolvedConfigId, resolvedEntityId
| Param | Type | Description |
|---|---|---|
| cachePrefix | string |
Cache key namespace prefix |
| open | boolean |
Whether owning modal is open |
| selection | Object |
Raw selection { methodId, configId, entityId } |
Example
const { resolvedMethodId, resolvedConfigId } = useModalSelectionData('dist_', open, selection);
Small dropdown menu component offering export options (PNG, SVG, PDF).
D3-based time series chart rendering percentile envelopes, best analog markers, return periods and forecast history overlays.
D3-based empirical cumulative distribution chart for precipitation analog values with optional overlays.
D3-based ordered criteria distribution chart with optional analog criteria fallback.
Centralized map-related constants for OpenLayers configuration. Avoids magic numbers scattered throughout map components.
Default map projection (Web Mercator). @constant {string}
Kind: static constant of components/map/mapConstants
Default WMTS matrix set identifier. @constant {string}
Kind: static constant of components/map/mapConstants
Padding for map extent fitting [top, right, bottom, left] in pixels. @constant {Array
Kind: static constant of components/map/mapConstants
Number of color gradient samples for legend generation. @constant {number}
Kind: static constant of components/map/mapConstants
Radius for relevant/highlighted forecast points (pixels). @constant {number}
Kind: static constant of components/map/mapConstants
Radius for normal forecast points (pixels). @constant {number}
Kind: static constant of components/map/mapConstants
Stroke width for forecast point borders (pixels). @constant {number}
Kind: static constant of components/map/mapConstants
Stroke color for relevant forecast points. @constant {string}
Kind: static constant of components/map/mapConstants
Stroke color for dimmed forecast points. @constant {string}
Kind: static constant of components/map/mapConstants
Opacity for relevant forecast points. @constant {number}
Kind: static constant of components/map/mapConstants
Opacity for dimmed forecast points. @constant {number}
Kind: static constant of components/map/mapConstants
Default line color for overlay layers. @constant {string}
Kind: static constant of components/map/mapConstants
Default stroke width for overlay features (pixels). @constant {number}
Kind: static constant of components/map/mapConstants
Default fill color for overlay polygons. @constant {string}
Kind: static constant of components/map/mapConstants
Default radius for overlay points (pixels). @constant {number}
Kind: static constant of components/map/mapConstants
Default stroke color for overlay points. @constant {string}
Kind: static constant of components/map/mapConstants
Default stroke width for overlay points (pixels). @constant {number}
Kind: static constant of components/map/mapConstants
Default fill color for overlay points. @constant {string}
Kind: static constant of components/map/mapConstants
Main map viewer component using OpenLayers for forecast visualization. Displays forecast points, supports entity selection, and manages map layers.
Floating tooltip overlay displaying entity name and raw value at pointer position.
Legend component rendering a horizontal gradient scale for normalized forecast values.
Utilities for OpenLayers style creation and color parsing. Supports hex, rgb, rgba, QGIS-style colors, and style configuration objects.
stringfunctionstringConverts various color formats to CSS rgba() string. Supports hex, rgb/rgba strings, QGIS-style comma-separated values, and arrays.
Kind: static method of components/map/utils/olStyleUtils
Returns: string - CSS rgba() color string
| Param | Type | Default | Description |
|---|---|---|---|
| input | string | Array |
Color in various formats | |
| [alphaFallback] | number |
1 |
Default alpha value if not specified |
Example
toRGBA('#ff0000') // Returns: "rgba(255,0,0,1)"
toRGBA('255,0,0,128') // Returns: "rgba(255,0,0,0.5)"
functionCreates an OpenLayers style function from a configuration object. Supports different styles for lines, polygons, and points.
Kind: static method of components/map/utils/olStyleUtils
Returns: function - OpenLayers style function
| Param | Type | Default | Description |
|---|---|---|---|
| [obj] | Object |
{} |
Style configuration object |
| [obj.line] | Object |
Line style configuration | |
| [obj.polygon] | Object |
Polygon style configuration | |
| [obj.point] | Object |
Point/circle style configuration | |
| [obj.strokeColor] | string |
Fallback stroke color | |
| [obj.strokeWidth] | number |
Fallback stroke width | |
| [obj.fillColor] | string |
Fallback fill color |
Example
const style = styleFromConfigObj({
line: { stroke: { color: '#ff0000', width: 3 } },
polygon: { fill: { color: 'rgba(255,0,0,0.2)' } }
});
Centralized projection utilities for OpenLayers with proj4 integration.
ObjectEnsures a projection is defined in proj4 and registered with OpenLayers. Uses predefined definitions for known EPSG codes. Handles registration errors silently.
Kind: static method of components/map/utils/olProjectionUtils
| Param | Type | Description |
|---|---|---|
| epsg | string |
EPSG code (e.g., "EPSG:2154") |
Example
ensureProjDefined('EPSG:2154'); // Registers Lambert-93 for France
ObjectPredefined proj4 projection definitions for common EPSG codes.
Kind: inner constant of components/map/utils/olProjectionUtils
Utilities for loading WMTS (Web Map Tile Service) capabilities and creating tile layers. Handles fetching capabilities XML, parsing layer options, and caching for reuse.
Promise.<Object>WMTS | nullPromise.<Object>Fetches WMTS capabilities from configured providers and builds options cache. Processes base layers and overlay layers from runtime config, attempts to load capabilities with preferred styles, and returns a cache of layer options.
Kind: static method of components/map/utils/loadWmtsCapabilities
Returns: Promise.<Object> - Cache object mapping wmtsLayer name to OpenLayers WMTS options
| Param | Type | Description |
|---|---|---|
| runtimeConfig | Object |
Runtime configuration with providers and layers |
| [enqueueWarning] | function |
Optional callback to display warning messages |
| [preferStyleForItem] | function |
Optional function to determine preferred style for an item |
Example
const cache = await loadWmtsCapabilities(config, (msg) => console.warn(msg));
// Returns: { 'layerName': { ...wmtsOptions } }
WMTS | nullCreates an OpenLayers WMTS source from cached layer options.
Kind: static method of components/map/utils/loadWmtsCapabilities
Returns: WMTS | null - OpenLayers WMTS source instance, or null if not found in cache
| Param | Type | Description |
|---|---|---|
| item | Object |
Layer configuration item with wmtsLayer property |
| wmtsOptionsCache | Object |
Cache of WMTS options from loadWmtsCapabilities |
Example
const source = createWmtsTileLayer({ wmtsLayer: 'myLayer' }, cache);
if (source) {
const layer = new TileLayer({ source });
}
Generates legend gradient stops for map visualization.
Array.<Object>Builds an array of color stops for a continuous legend gradient. Each stop represents a point in the gradient from 0 to maxVal.
Kind: static method of components/map/utils/buildLegendStops
Returns: Array.<Object> - Array of legend stops with {color: string, pct: number}
| Param | Type | Default | Description |
|---|---|---|---|
| [maxVal] | number |
1 |
Maximum value for the legend scale |
| [samples] | number |
LEGEND_SAMPLES |
Number of gradient samples to generate |
Example
const stops = buildLegendStops(100, 10);
// Returns: [
// {color: 'rgb(255,255,255)', pct: 0},
// {color: 'rgb(200,255,200)', pct: 10},
// ...
// {color: 'rgb(255,0,0)', pct: 100}
// ]
React hook for registering custom map projections with OpenLayers.
React.RefObject ⏏ObjectReact.RefObject ⏏Hook that registers a projection with OpenLayers if not already registered. Uses predefined proj4 definitions for known EPSG codes.
Kind: Exported function
Returns: React.RefObject - Ref containing the last registered projection
| Param | Type | Description |
|---|---|---|
| epsg | string |
EPSG code (e.g., "EPSG:2154") |
Example
useProjectionRegistration('EPSG:2154'); // Registers Lambert-93 for France
ObjectPredefined projection definitions for common EPSG codes.
Kind: inner constant of module.exports
Hook for loading and managing global (non-workspace-specific) overlay layers. Supports WMTS and GeoJSON sources with optional periodic refresh.
Hook that loads global overlay layers defined in runtime configuration. Handles WMTS capabilities adoption, dynamic GeoJSON fetching, refresh timers, abort controllers, and layer switcher panel updates.
Kind: Exported function
| Param | Type | Description |
|---|---|---|
| params | Object |
Hook parameters |
| params.mapReady | boolean |
Whether map is initialized |
| params.runtimeConfig | Object |
Runtime configuration object |
| params.overlayGroupRef | React.RefObject |
Ref to overlay layer group |
| params.layerSwitcherRef | React.RefObject |
Ref to layer switcher control |
| [params.enqueueSnackbar] | function |
Optional notification callback |
Example
useOverlayGlobalLayers({
mapReady: true,
runtimeConfig,
overlayGroupRef,
layerSwitcherRef,
enqueueSnackbar: (msg) => console.warn(msg)
});
Hook for loading and managing workspace-specific overlay layers (shapefiles). Dynamically adds/removes overlay layers based on workspace configuration.
Hook that manages workspace-specific overlay layers on the map. Loads shapefiles defined in workspace configuration and adds them as vector layers. Automatically cleans up layers when workspace changes.
Kind: Exported function
| Param | Type | Description |
|---|---|---|
| params | Object |
Hook parameters |
| params.mapReady | boolean |
Whether map is initialized |
| params.runtimeConfig | Object |
Runtime configuration with workspace definitions |
| params.workspace | string |
Current workspace key |
| params.overlayGroupRef | React.RefObject |
Ref to overlay layer group |
| params.layerSwitcherRef | React.RefObject |
Ref to layer switcher control |
Example
useOverlayConfigLayers({
mapReady: true,
runtimeConfig: config,
workspace: 'demo',
overlayGroupRef,
layerSwitcherRef
});
Hook for handling map click and pointer interactions with forecast points. Manages entity selection on click and tooltip display on hover.
Hook that sets up map interaction handlers for forecast point selection and tooltips. Handles single click for entity selection and pointer move/out for tooltip display.
Kind: Exported function
| Param | Type | Description |
|---|---|---|
| params | Object |
Hook parameters |
| params.mapRef | React.RefObject |
Ref to OpenLayers map instance |
| params.forecastLayerRef | React.RefObject |
Ref to forecast vector layer |
| params.setSelectedEntityId | function |
Function to set selected entity ID |
| params.setTooltip | function |
Function to set tooltip state (x, y, name, valueRaw) |
| params.mapReady | boolean |
Whether map is initialized |
Example
useMapInteractions({
mapRef,
forecastLayerRef,
setSelectedEntityId: (id) => console.log('Selected:', id),
setTooltip: (tooltip) => console.log('Tooltip:', tooltip),
mapReady: true
});
React hook for initializing OpenLayers map with configured layers and controls.
Object ⏏Hook that initializes an OpenLayers map with base layers, overlays, and controls.
Kind: Exported function
Returns: Object - Map refs and ready state
| Param | Type | Description |
|---|---|---|
| params | Object |
Hook parameters |
| params.t | function |
Translation function |
| params.runtimeConfig | Object |
Runtime config with layer definitions |
| params.enqueueSnackbar | function |
Notification function |
Example
const { containerRef, mapRef, mapReady } = useMapInit({ t, runtimeConfig, enqueueSnackbar });
Hook for rendering forecast points on the map with color-coded values. Handles entity visualization, relevance highlighting, legend updates, and map extent fitting.
Hook that renders forecast entities as colored points on the OpenLayers map. Updates point colors based on forecast values, highlights relevant entities, manages legend stops, and fits map extent to data.
Kind: Exported function
| Param | Type | Description |
|---|---|---|
| params | Object |
Hook parameters |
| params.ENTITIES_SOURCE_EPSG | string |
EPSG code for entity coordinates |
| params.mapReady | boolean |
Whether map is initialized |
| params.entities | Array |
Array of entity objects with coordinates |
| params.entitiesWorkspace | string |
Workspace key for entities |
| params.entitiesKey | string |
Cache key for current entities |
| params.relevantEntities | Set |
Set of relevant entity IDs |
| params.workspace | string |
Current workspace |
| params.forecastValuesNorm | Object |
Normalized forecast values by entity ID |
| params.forecastValues | Object |
Raw forecast values by entity ID |
| params.forecastUnavailable | boolean |
Whether forecast data is unavailable |
| params.forecastLayerRef | React.RefObject |
Ref to forecast vector layer |
| params.mapRef | React.RefObject |
Ref to OpenLayers map instance |
| params.setLegendStops | function |
Setter for legend gradient stops |
| params.setLegendMax | function |
Setter for legend maximum value |
Example
useForecastPoints({
ENTITIES_SOURCE_EPSG: 'EPSG:4326',
mapReady: true,
entities: [...],
forecastValuesNorm: { 1: 0.5, 2: 0.8 },
forecastLayerRef,
mapRef,
setLegendStops,
setLegendMax
});
React hook for detecting system dark mode preference.
boolean ⏏Hook that detects and tracks the user's dark mode preference. Listens to system preference changes via prefers-color-scheme media query.
Kind: Exported function
Returns: boolean - True if dark mode is preferred, false otherwise
Example
const isDarkMode = useDarkMode();
const tileLayer = isDarkMode ? 'dark-tiles' : 'light-tiles';