Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 45 additions & 1 deletion typescript/packages/subsurface-viewer/src/components/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,57 @@ export interface ViewsType {
* Camera view state.
*/
export interface ViewStateType {
/**
* Camera target position.
*/
target: Point2D | Point3D | undefined;
zoom: number | Point2D | BoundingBox3D | undefined;
/**
* Zoom level or bounding box to fit in the view.
* - When a number: Represents the zoom level of the camera.
* - When a tuple [number, number]: Represents independent zoom levels along the horizontal and vertical axes.
* - When a BoundingBox3D: Represents the camera position computed to fit (zoom in) the entire box.
*/
zoom: number | [number, number] | BoundingBox3D | undefined;
/**
* Rotation around the X axis in degrees. Only for 3D view.
*/
rotationX: number;
/**
* Rotation around the orbit in degrees. Only for 3D view.
*/
rotationOrbit: number;
/**
* Minimum zoom level.
* Constrains how far out the user can zoom. Lower values allow viewing a larger area.
*/
minZoom?: number;
/**
* Maximum zoom level.
* Constrains how far in the user can zoom. Higher values allow closer inspection.
*/
maxZoom?: number;
/**
* Animation transition duration in milliseconds.
*/
transitionDuration?: number;
/**
* Viewport width in pixels.
*/
width?: number;
/**
* Viewport height in pixels.
*/
height?: number;
/**
* Minimum rotation around the X axis in degrees. Only for 3D view.
* Constrains the minimum tilt angle of the camera (e.g., 0° = horizontal view).
*/
minRotationX?: number;
/**
* Maximum rotation around the X axis in degrees. Only for 3D view.
* Constrains the maximum tilt angle of the camera (e.g., 90° = top-down view).
*/
maxRotationX?: number;
}

interface MarginsType {
Expand Down