React context for managing workspace (region) selection and associated forecast data. Handles workspace selection, URL synchronization, and workspace-specific data loading.
Provides lead time arrays (daily & sub-daily), target date selection and per-method synthesis data. Parses total synthesis responses to derive lead resolution structure.
React context for managing application-wide notification snackbars. Provides a queue-based system for displaying temporary messages to users.
React context for managing the currently selected forecast entity (station/point). Automatically resets selection when workspace changes.
React context for managing forecast methods and configurations. Fetches available methods, manages selection, and provides normalized method tree.
Composite provider combining all forecast-related contexts. Re-exports convenient hooks for accessing forecast functionality.
Fetches and exposes forecast values (normalized + raw) for entities based on current selection. Handles lead time resolution, availability detection, and percentile/normalization parameters.
Manages the active forecast date, base date, percentile/normalization parameters and shifting logic. Provides helper functions to restore last available forecast and shift base date by hour increments.
Manages fetching and caching of forecast entities (stations/points) and relevant subsets. Handles automatic clearing on workspace or configuration changes and derives cache keys.
React context for managing runtime configuration.
This context fetches /config.json at startup and makes configuration
values available throughout the application via the useConfig hook.
React context for managing workspace (region) selection and associated forecast data. Handles workspace selection, URL synchronization, and workspace-specific data loading.
React.ReactElementObject | string | function | Object | boolean | Error | stringReact.ReactElementProvider component for workspace management. Manages workspace selection, URL synchronization, and workspace-specific data loading.
Kind: static method of contexts/WorkspaceContext
| Param | Type | Description |
|---|---|---|
| props | Object |
Component props |
| props.children | React.ReactNode |
Child components |
Object | string | function | Object | boolean | Error | stringHook to access workspace context.
Kind: static method of contexts/WorkspaceContext
Returns: Object - Workspace context valuestring - returns.workspace - Current workspace keyfunction - returns.setWorkspace - Function to change workspaceObject - returns.workspaceData - Workspace data including last forecast dateboolean - returns.loading - Loading stateError - returns.error - Error if loading failedstring - returns.invalidWorkspaceKey - Invalid workspace key from URL (if any)
Example
const { workspace, setWorkspace, workspaceData } = useWorkspace();
console.log('Current workspace:', workspace);
setWorkspace('newWorkspace');
Provides lead time arrays (daily & sub-daily), target date selection and per-method synthesis data. Parses total synthesis responses to derive lead resolution structure.
Object | Array | Array | string | number | Date | null | function | Array | boolean | Error | nullHook to access synthesis context.
Kind: static constant of contexts/SynthesisContext
Returns: Object - Synthesis state and helpersArray - returns.dailyLeads - Array of daily lead recordsArray - returns.subDailyLeads - Array of sub-daily lead recordsstring - returns.leadResolution - 'daily' or 'sub'number - returns.selectedLead - Selected lead indexDate | null - returns.selectedTargetDate - Selected target date objectfunction - returns.selectTargetDate - Helper to select target date with preferenceArray - returns.perMethodSynthesis - Baseline per-method normalized synthesis valuesboolean - returns.perMethodSynthesisLoading - Loading state for per-method dataError | null - returns.perMethodSynthesisError - Error for per-method data
React context for managing application-wide notification snackbars. Provides a queue-based system for displaying temporary messages to users.
Object | function | function | function | ArrayReact.ReactElementObject | function | function | function | ArrayHook to access snackbar functionality. Must be used within a SnackbarProvider.
Kind: static constant of contexts/SnackbarContext
Returns: Object - Snackbar context valuefunction - returns.enqueueSnackbar - Add a new snackbarfunction - returns.closeSnackbar - Close a snackbarfunction - returns.removeSnackbar - Remove a snackbarArray - returns.snackbars - Array of active snackbars
Throws:
Error If used outside SnackbarProviderExample
const { enqueueSnackbar } = useSnackbar();
enqueueSnackbar('Success!', { variant: 'success' });
React.ReactElementProvider component for snackbar notifications. Manages a queue of snackbar messages and provides methods to add, close, and remove them.
Kind: static constant of contexts/SnackbarContext
| Param | Type | Description |
|---|---|---|
| props | Object |
Component props |
| props.children | React.ReactNode |
Child components |
Example
<SnackbarProvider>
<App />
</SnackbarProvider>
React context for managing the currently selected forecast entity (station/point). Automatically resets selection when workspace changes.
Object | string | number | null | functionReact.ReactElementObject | string | number | null | functionHook to access the selected entity context.
Kind: static constant of contexts/SelectedEntityContext
Returns: Object - Selected entity context valuestring | number | null - returns.selectedEntityId - Currently selected entity ID, or nullfunction - returns.setSelectedEntityId - Function to set the selected entity ID
Example
const { selectedEntityId, setSelectedEntityId } = useSelectedEntity();
setSelectedEntityId(123); // Select entity with ID 123
console.log(selectedEntityId); // Logs: 123
React.ReactElementProvider component for selected entity state management. Tracks which forecast entity is currently selected and resets on workspace change.
Kind: static method of contexts/SelectedEntityContext
| Param | Type | Description |
|---|---|---|
| props | Object |
Component props |
| props.children | React.ReactNode |
Child components |
React context for managing forecast methods and configurations. Fetches available methods, manages selection, and provides normalized method tree.
Object | Array | boolean | Error | Object | functionReact.ReactElementObject | Array | boolean | Error | Object | functionHook to access methods context.
Kind: static constant of contexts/MethodsContext
Returns: Object - Methods context valueArray - returns.methodConfigTree - Normalized tree of methods with nested configsboolean - returns.methodsLoading - Loading state for methods fetchError - returns.methodsError - Error if methods fetch failedObject - returns.selectedMethodConfig - Currently selected method and configfunction - returns.setSelectedMethodConfig - Function to set method/config selection
Example
const { methodConfigTree, selectedMethodConfig, setSelectedMethodConfig } = useMethods();
// Select first method
setSelectedMethodConfig({ method: methodConfigTree[0], config: null });
React.ReactElementProvider component for forecast methods and configurations. Manages method selection with workspace scoping and auto-selection.
Kind: static method of contexts/MethodsContext
| Param | Type | Description |
|---|---|---|
| props | Object |
Component props |
| props.children | React.ReactNode |
Child components |
Composite provider combining all forecast-related contexts. Re-exports convenient hooks for accessing forecast functionality.
ObjectObjectObjectObjectObject | number | function | string | functionObjectReact.ReactElementObjectHook to access methods context. Re-export from MethodsContext.
Kind: static constant of contexts/ForecastsContext
Returns: Object - Methods context value
ObjectHook to access entities context. Re-export from EntitiesContext.
Kind: static constant of contexts/ForecastsContext
Returns: Object - Entities context value
ObjectHook to access synthesis context. Re-export from SynthesisContext.
Kind: static constant of contexts/ForecastsContext
Returns: Object - Synthesis context value
ObjectHook to access forecast values context. Re-export from ForecastValuesContext.
Kind: static constant of contexts/ForecastsContext
Returns: Object - Forecast values context value
Object | number | function | string | functionHook to access forecast parameters (percentile and normalization).
Kind: static constant of contexts/ForecastsContext
Returns: Object - Forecast parametersnumber - returns.percentile - Current percentile valuefunction - returns.setPercentile - Set percentilestring - returns.normalizationRef - Normalization referencefunction - returns.setNormalizationRef - Set normalization reference
ObjectHook to access selected entity context. Re-export from SelectedEntityContext.
Kind: static constant of contexts/ForecastsContext
Returns: Object - Selected entity context value
React.ReactElementComposite provider wrapping all forecast-related contexts.
Kind: static method of contexts/ForecastsContext
| Param | Type |
|---|---|
| props | Object |
| props.children | React.ReactNode |
Fetches and exposes forecast values (normalized + raw) for entities based on current selection. Handles lead time resolution, availability detection, and percentile/normalization parameters.
Object | Object | Object | boolean | Error | null | booleanReact.ReactElementObject | Object | Object | boolean | Error | null | booleanHook to access forecast values context.
Kind: static constant of contexts/ForecastValuesContext
Returns: Object - Forecast values stateObject - returns.forecastValues - Map entityId -> raw forecast valueObject - returns.forecastValuesNorm - Map entityId -> normalized forecast valueboolean - returns.forecastLoading - Loading stateError | null - returns.forecastError - Error during fetchboolean - returns.forecastUnavailable - Flag when data deemed unavailable (e.g., no leads)
React.ReactElementForecastValuesProvider component.
Kind: static method of contexts/ForecastValuesContext
| Param | Type |
|---|---|
| props | Object |
| props.children | React.ReactNode |
Manages the active forecast date, base date, percentile/normalization parameters and shifting logic. Provides helper functions to restore last available forecast and shift base date by hour increments.
Object | string | null | Date | null | number | function | number | string | function | function | function | boolean | boolean | numberReact.ReactElementObject | string | null | Date | null | number | function | number | string | function | function | function | boolean | boolean | numberHook to access forecast session context.
Kind: static constant of contexts/ForecastSessionContext
Returns: Object - Forecast session state and helpersstring | null - returns.activeForecastDate - Raw active forecast date stringDate | null - returns.forecastBaseDate - Parsed base date objectnumber - returns.percentile - Selected percentile (e.g., 90)function - returns.setPercentile - Setter for percentilenumber | string - returns.normalizationRef - Normalization reference valuefunction - returns.setNormalizationRef - Setter for normalization referencefunction - returns.shiftForecastBaseDate - Shift search function for base datefunction - returns.restoreLastAvailableForecast - Restore last workspace forecastboolean - returns.baseDateSearchFailed - Flag when shift search failsboolean - returns.baseDateSearching - Whether shift search is in progressnumber - returns.resetVersion - Incrementing version to trigger dependent resets
React.ReactElementForecastSessionProvider component. Initializes forecast session state from workspace data and exposes shifting & restore helpers.
Kind: static method of contexts/ForecastSessionContext
| Param | Type |
|---|---|
| props | Object |
| props.children | React.ReactNode |
Manages fetching and caching of forecast entities (stations/points) and relevant subsets. Handles automatic clearing on workspace or configuration changes and derives cache keys.
Object | Array | boolean | Error | null | Set.<(string|number)> | null | string | string | nullReact.ReactElementObject | Array | boolean | Error | null | Set.<(string|number)> | null | string | string | nullHook to access entities context.
Kind: static constant of contexts/EntitiesContext
Returns: Object - Entities context valueArray - returns.entities - Array of entity objectsboolean - returns.entitiesLoading - Loading stateError | null - returns.entitiesError - Error during entity fetchSet.<(string|number)> | null - returns.relevantEntities - Set of relevant entity IDs or nullstring - returns.entitiesWorkspace - Workspace key used for entitiesstring | null - returns.entitiesKey - Cache key used for the request
React.ReactElementEntitiesProvider component. Fetches entity list and relevant entity IDs for the selected method/config.
Kind: static method of contexts/EntitiesContext
| Param | Type |
|---|---|
| props | Object |
| props.children | React.ReactNode |
React context for managing runtime configuration.
This context fetches /config.json at startup and makes configuration
values available throughout the application via the useConfig hook.
React.ReactElementObjectReact.ReactElementProvider component that fetches and manages runtime configuration.
Fetches /config.json on mount with cache: no-store to ensure fresh config.
Merges normalized config into the shared config object and provides it via context.
Kind: static method of contexts/ConfigContext
| Param | Type | Description |
|---|---|---|
| props | Object |
|
| props.children | React.ReactNode |
Child components |
ObjectHook to access runtime configuration.
Kind: static method of contexts/ConfigContext
Returns: Object - Configuration object with __workspacesLoaded flag
Example
const config = useConfig();
if (config.__workspacesLoaded) {
console.log('Workspaces:', config.workspaces);
}