Skip to content

@graphty/graphty-element / index / CameraState

Interface: CameraState ​

Defined in: graphty-element/src/camera/types.ts:56

Where the camera is now, and where a view asks it to go.

Every member is optional because the element draws with three different cameras and a state describes whichever one is current: an orbit camera reads alpha, beta and radius, a free camera reads position and target, and the 2D camera reads zoom and pan. A view fills in the members its type calls for and leaves the rest alone.

Properties ​

alpha? ​

optional alpha?: number

Defined in: graphty-element/src/camera/types.ts:68

Orbit angles in Babylon's ArcRotate convention: alpha turns around the +y axis starting from +x, beta is measured down from +y (0 looks straight down, PI/2 is level). With radius they place the viewer at target + radius * (cos(alpha) sin(beta), cos(beta), sin(alpha) sin(beta)). Ignored when the state also gives position or pivotRotation.


beta? ​

optional beta?: number

Defined in: graphty-element/src/camera/types.ts:69


cameraDistance? ​

optional cameraDistance?: number

Defined in: graphty-element/src/camera/types.ts:87


fov? ​

optional fov?: number

Defined in: graphty-element/src/camera/types.ts:72


orthoBottom? ​

optional orthoBottom?: number

Defined in: graphty-element/src/camera/types.ts:83


orthoLeft? ​

optional orthoLeft?: number

Defined in: graphty-element/src/camera/types.ts:80


orthoRight? ​

optional orthoRight?: number

Defined in: graphty-element/src/camera/types.ts:81


orthoTop? ​

optional orthoTop?: number

Defined in: graphty-element/src/camera/types.ts:82


pan? ​

optional pan?: object

Defined in: graphty-element/src/camera/types.ts:76

x ​

x: number

y ​

y: number


pivotRotation? ​

optional pivotRotation?: object

Defined in: graphty-element/src/camera/types.ts:86

x ​

x: number

y ​

y: number

z ​

z: number


position? ​

optional position?: object

Defined in: graphty-element/src/camera/types.ts:60

x ​

x: number

y ​

y: number

z ​

z: number


radius? ​

optional radius?: number

Defined in: graphty-element/src/camera/types.ts:71

Distance from target for an orbit state given as alpha and beta.


rotation? ​

optional rotation?: number

Defined in: graphty-element/src/camera/types.ts:77


target? ​

optional target?: object

Defined in: graphty-element/src/camera/types.ts:61

x ​

x: number

y ​

y: number

z ​

z: number


type? ​

optional type?: "arcRotate" | "free" | "universal" | "orthographic"

Defined in: graphty-element/src/camera/types.ts:57


zoom? ​

optional zoom?: number

Defined in: graphty-element/src/camera/types.ts:75