UNPKG

d3-templating

Version:
1 lines 739 B
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).d3=e.d3||{})}(this,function(e){"use strict";var t,n;"undefined"==typeof DOMParser&&(t=global,n=new(require("jsdom").JSDOM)(""),t.DOMParser=n.window.DOMParser),e.template=function(r){return function(e){var i=new DOMParser;i.async=!1,e.each(function(e){for(var t=r(e),n=t.match(/xmlns="http:\/\/www\.w3\.org\/\d+\/svg"/gi)?"text/xml":"text/html",o=i.parseFromString(t,n).documentElement,o="text/xml"==n?o.firstChild:o;o;)this.appendChild(this.ownerDocument.importNode(o,!0)),o=o.nextSibling})}},Object.defineProperty(e,"__esModule",{value:!0})});