MCPcopy Create free account
hub / github.com/DFin/Neural-Network-Visualisation / applyNeuronPanelLayout

Function applyNeuronPanelLayout

assets/main.js:226–234  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

224 const bottomMargin = 24;
225
226 const applyNeuronPanelLayout = () => {
227 if (!rootStyle) return;
228 const gridRect = gridContainerElement.getBoundingClientRect();
229 const rawTop = Math.round(gridRect.bottom + spacingBelowSketchPad);
230 const viewportHeight = window.innerHeight || document.documentElement.clientHeight || 0;
231 const availableHeight = Math.max(viewportHeight - rawTop - bottomMargin, 200);
232 rootStyle.setProperty("--neuron-panel-top", `${rawTop}px`);
233 rootStyle.setProperty("--neuron-panel-max-height", `${availableHeight}px`);
234 };
235
236 const scheduleNeuronPanelLayout = () => window.requestAnimationFrame(applyNeuronPanelLayout);
237 scheduleNeuronPanelLayout();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected