PrivatedimsPrivatedimensionMin/max bounds for each dimension derived from metadata
PrivatelistenersObserver callbacks that react to dimension changes (can be async)
PrivatependingPromise tracking pending listener completion (for animation synchronization)
Private StaticdefaultThe default position policy — shared by initFromScene and resetPositions so the two can never diverge:
min + k·step navigation grid.Initializes the scene-level dimension state from metadata embedded in the scene.
This method searches through the THREE.js scene hierarchy to find nD objects with embedded dimension metadata, then establishes the shared dimensional coordinate system for the entire scene.
Search strategy:
Initialization logic:
THREE.js scene containing nD objects with metadata
True if dimensions were successfully initialized, false if no metadata found
Provides read-only access to the current dimension state.
This is the primary interface for components that need to access the current slice positions, displayed dimensions, and metadata.
Current dimension state or null if not initialized
Gets the navigable bounds for each dimension.
These ranges define the valid navigation space and are used by UI components (sliders, keyboard handlers) to constrain user input and calculate appropriate step sizes.
Array of [min, max] bounds for each dimension, or null if not initialized
Updates the position in a specific dimension and triggers re-slicing.
This is the central method for dimension navigation, handling both user input validation and observer notification. It ensures all dimension changes are properly constrained and communicated.
Value processing:
Index of dimension to update
New position value in dimension units
Reset every dimension back to its initial default position (same policy as initFromScene) and notify listeners — sliders, slicing, and status displays all refresh reactively. Used by the rail Home popover's "Reset dimensions" action. No-op before initialization.
Registers a callback to be invoked whenever dimension state changes.
This implements the observer pattern, allowing UI components and visualization objects to react automatically to navigation events. Typical subscribers include sliders, points, and status displays.
Callbacks can be async — their completion can be awaited via waitForUpdate().
Function to call when dimensions change (can return Promise)
Unregisters a dimension change callback.
Important for preventing memory leaks when components are destroyed.
Previously registered callback function
PrivatenotifyPrivate
Triggers all registered observer callbacks.
This is called internally whenever dimension state changes, propagating updates throughout the reactive system. Async callbacks are collected and their completion is tracked via currentUpdatePromise.
Returns a promise that resolves when all pending listener updates complete.
Used by animation systems to wait for data loading before advancing frames. Returns immediately resolved promise if no update is in progress.
Promise that resolves when pending updates complete
Provides access to the complete dimension metadata array.
Used by UI components that need detailed information about dimension properties like names, units, discreteness, etc.
Array of dimension metadata, empty if not initialized
Reset the dimension manager to initial state
Extracts human-readable names for all dimensions.
Provides fallback names when metadata doesn't specify custom names. Used by UI components for labeling sliders and status displays.
Array of dimension names (e.g., ["Time", "X", "Y", "Z"])
Extracts physical units for all dimensions.
Used by UI components to display appropriate unit labels next to numeric values (e.g., "μm", "s", "nm").
Array of dimension units, empty strings for dimensionless quantities
Determines if the dataset has navigable dimensions beyond the displayed 3D view.
This is used by UI components to decide whether to show dimension navigation controls (sliders, keyboard hints). If all dimensions are displayed in 3D, no additional navigation UI is needed.
True if there are dimensions not currently displayed in 3D space
The shared dimension state for the entire scene