MCPcopy Create free account
hub / github.com/OpenIntroStat/ims / sizingPolicy

Function sizingPolicy

libs/htmlwidgets-1.5.3/htmlwidgets.js:205–215  ·  view source on GitHub ↗
(el)

Source from the content-addressed store, hash-verified

203 // The return value is either null, or an object with fill, padding,
204 // defaultWidth, defaultHeight fields.
205 function sizingPolicy(el) {
206 var sizingEl = document.querySelector("script[data-for='" + el.id + "'][type='application/htmlwidget-sizing']");
207 if (!sizingEl)
208 return null;
209 var sp = JSON.parse(sizingEl.textContent || sizingEl.text || "{}");
210 if (viewerMode) {
211 return sp.viewer;
212 } else {
213 return sp.browser;
214 }
215 }
216
217 // @param tasks Array of strings (or falsy value, in which case no-op).
218 // Each element must be a valid JavaScript expression that yields a

Callers 1

initSizingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected