Closed mbostock closed 8 years ago
This seemed to work:
var Xhr = typeof XMLHttpRequest === "function"
? XMLHttpRequest
: require("xmlhttprequest").XMLHttpRequest;
Though, d3.html doesn’t work, since it would also require a jsdom dependency and a global document
.
Related mbostock/d3#2736, we could use xmlhttprequest to add support for Node. Though, I’m not sure yet exactly how we express that dependency for Rollup so that it doesn’t affect non-CommonJS environments and Browserify.