MCPcopy Create free account
hub / github.com/BloombergGraphics/whatiscode / appendIframe

Function appendIframe

modules/tree/tree.js:265–285  ·  view source on GitHub ↗
(d)

Source from the content-addressed store, hash-verified

263 }
264
265 function appendIframe(d) {
266 d.iframe = sel.select(".svg-container")
267 .append("div.iframe-container")
268 .datum(d)
269 .classed("expandable", function(d) { return d._children && d._children.length; })
270 .style("left", function(d) { return d.parent ? d.parent.y0 + margin.left + 'px' : d.x0; })
271 .style("top", function(d) { return d.parent ? d.parent.x0 + margin.top + 'px' : d.y0; });
272
273 d.iframe.append("div.title").text(function(d) { return d.description ? d.description : d.name; });
274
275 // could also append label for class list, like so...
276 // d.iframe.append("div.class-list").text(function(d) { return d.ref ? d.ref.classList : ''; });
277
278 var inlineStyle = "<style>img{max-width:100%;}</style>";
279
280 var iframeEl = d.iframe.append("iframe");
281 var iframeDocument = iframeEl.node().contentWindow.document;
282 iframeDocument.open();
283 iframeDocument.write(inlineStyle + d.ref.outerHTML);
284 iframeDocument.close();
285 }
286
287 function getDomTree(node) {
288 // from here http://www.w3.org/TR/html4/index/elements.html

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected