You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that d3.xhr and its convenient methods (like d3.json) do not work in Node.js due to a lack of an implemented XMLHttpRequest there. Wouldn't it be easy enough to add a dependency to the xmlhttprequest npm package? This way the Node version would work as well as the browser version by adding:
var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;
The text was updated successfully, but these errors were encountered:
I’ve opened d3/d3-request#8 as a request for the d3-request module in 4.0. I’m all for this, although I don’t yet know how to express this optional dependency in conjunction with Rollup so that the require only happens in a Node environment (and not, for example, in Browserify consuming the CommonJS / UMD bundle). One possibility is a wrapper script as the main entry in the package.json, and then a separate Browserify entry, but then the wrapper has to expose the XMLHttpRequest symbol globally… so, blech.
I noticed that d3.xhr and its convenient methods (like d3.json) do not work in Node.js due to a lack of an implemented XMLHttpRequest there. Wouldn't it be easy enough to add a dependency to the xmlhttprequest npm package? This way the Node version would work as well as the browser version by adding:
var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;
The text was updated successfully, but these errors were encountered: