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)
Number of registered dimension observers.
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 (or a single Luxar root group, which carries the metadata itself — what a LuxarLayer passes so a host scene holding several layers cannot hand one layer another's dimensions)
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
Optionalforce?: booleanRe-notify listeners at the current value to refine a pinned slice
whether the position changed (a forced re-notify at the same value is not a change)
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. A reset still notifies when every dimension is already at its default, with changed=false. 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 on a change or forced refresh (can return Promise). Receives false for a refresh that leaves the slice position unchanged.
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 scene state while retaining listeners owned by longer-lived components.
Release subscribers when the owning app is torn down.
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