Skip to content

@graphty/graphty-element / extend / CameraViewInput

Interface: CameraViewInput ​

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

Everything a view is told before it decides where the viewer stands.

Properties ​

aspect ​

readonly aspect: number

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

The viewport's width divided by its height.


bounds ​

readonly bounds: GraphBounds

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

The box to frame.

An INPUT rather than something the view measures, which is what lets a view frame a subset: applyCameraView(id, { scope }) measures over the scope and hands the smaller box in. A view that always framed everything could not be asked to do anything else.


current ​

readonly current: CameraState

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

Where the camera is right now, so a view can be relative to it.


fov? ​

readonly optional fov?: number

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

The vertical field of view in radians. Absent in 2D, which has no perspective.


mode ​

readonly mode: DrawingMode

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


options ​

readonly options: Readonly<Record<string, unknown>>

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

The view's own options, resolved against the defaults its descriptor declares.


viewport ​

readonly viewport: object

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

How big the drawing surface is, in device pixels.

A flat view needs the pixel width and not only the aspect ratio, because an orthographic zoom is a ratio of pixels to world units: the element's own fitToGraph computes its 2D zoom as the render width divided by the padded extent of the box. Withholding this would leave a plugin unable to compute what a built-in computes, which is the defect this extension point exists to prevent.

height ​

readonly height: number

width ​

readonly width: number