MCPcopy
hub / github.com/nilbuild/driver.js / renderOverlay

Function renderOverlay

src/overlay.ts:92–108  ·  view source on GitHub ↗
(stagePosition: StageDefinition)

Source from the content-addressed store, hash-verified

90}
91
92function renderOverlay(stagePosition: StageDefinition) {
93 const overlaySvg = getState("__overlaySvg");
94
95 // TODO: cancel rendering if element is not visible
96 if (!overlaySvg) {
97 mountOverlay(stagePosition);
98
99 return;
100 }
101
102 const pathElement = overlaySvg.firstElementChild as SVGPathElement | null;
103 if (pathElement?.tagName !== "path") {
104 throw new Error("no path element found in stage svg");
105 }
106
107 pathElement.setAttribute("d", generateStageSvgPathString(stagePosition));
108}
109
110function createOverlaySvg(stage: StageDefinition): SVGSVGElement {
111 const windowX = window.innerWidth;

Callers 2

transitionStageFunction · 0.85
trackActiveElementFunction · 0.85

Calls 3

getStateFunction · 0.90
mountOverlayFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…