MCPcopy
hub / github.com/microsoft/SandDance / targetViewState

Function targetViewState

packages/vega-deck.gl/src/viewState.ts:9–27  ·  view source on GitHub ↗
(height: number, width: number, view: View)

Source from the content-addressed store, hash-verified

7export const viewStateProps = ['target', 'rotationOrbit', 'rotationX', 'zoom'];
8
9export function targetViewState(height: number, width: number, view: View): OrbitViewState {
10 const target = [width / 2, - height / 2, 0] as Position;
11
12 if (view === '2d') {
13 return {
14 target,
15 rotationOrbit: 0,
16 rotationX: 90,
17 zoom: -0.2,
18 };
19 } else {
20 return {
21 target,
22 rotationOrbit: 25,
23 rotationX: 30,
24 zoom: -0.4,
25 };
26 }
27}

Callers 3

presentMethod · 0.90
setDeckPropsMethod · 0.90
homeCameraMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected