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

Function createCanvas

docs/app/js/sanddance-app.js:8361–8375  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

8359};
8360// Create canvas elements for map and deck
8361function createCanvas(props) {
8362 let { container =document.body } = props;
8363 if (typeof container === "string") container = document.getElementById(container);
8364 if (!container) throw Error("Deck: container not found");
8365 // Add DOM elements
8366 const containerStyle = window.getComputedStyle(container);
8367 if (containerStyle.position === "static") container.style.position = "relative";
8368 const deckCanvas = document.createElement("canvas");
8369 container.appendChild(deckCanvas);
8370 Object.assign(deckCanvas.style, CANVAS_STYLE);
8371 return {
8372 container,
8373 deckCanvas
8374 };
8375}
8376function createDeckGLClassesForPresenter(factoryOptions) {
8377 const OrbitControllerClass = (0, _orbitController.createOrbitControllerClass)(factoryOptions);
8378 //dynamic superclass lets us create a subclass at execution phase instead of declaration phase.

Callers 1

constructorMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected