MCPcopy Create free account
hub / github.com/microsoft/SandDance / createCanvas

Function createCanvas

packages/vega-deck.gl/src/deck.gl-classes/deckgl.ts:29–51  ·  view source on GitHub ↗
(props: DeckGLInternalProps)

Source from the content-addressed store, hash-verified

27
28// Create canvas elements for map and deck
29function createCanvas(props: DeckGLInternalProps) {
30 let { container = document.body } = props;
31
32 if (typeof container === 'string') {
33 container = document.getElementById(container);
34 }
35
36 if (!container) {
37 throw Error('Deck: container not found');
38 }
39
40 // Add DOM elements
41 const containerStyle = window.getComputedStyle(container);
42 if (containerStyle.position === 'static') {
43 container.style.position = 'relative';
44 }
45
46 const deckCanvas = document.createElement('canvas');
47 container.appendChild(deckCanvas);
48 Object.assign(deckCanvas.style, CANVAS_STYLE);
49
50 return { container, deckCanvas };
51}
52
53export interface DeckGLClassesForPresenter {
54 OrbitControllerClass: typeof OrbitController_Class;

Callers 1

constructorMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected