As of 1.0.6, requesting a relative URL no longer seems to work correctly. At least this is the case when building with Browserify...
For example, if I'm hosting a dev site at: http://mydevsite:8888 and try something like d3.csv('/data.csv') a request will be made to http://localhost/data.csv instead of http://mydevsite:8888/data.csv'.
Steps to reproduce:
1) npm install -g browserify
2) In a clean folder, create an index.html file:
4) Create a sample test.csv file
5) npm install d3-request@1.0.5
6) browserify index.js -o generated.js
7) python -m SimpleHTTPServer 8888
8) Open up in a browser (use http://127.0.0.1:8888) and verify that the csv file is properly requested at http://127.0.0.1:8888/test.csv
9) Next: npm install d3-request@1.0.6 and repeat steps 6-8
10) See that the the requested path is: http://localhost/test.csv
As of 1.0.6, requesting a relative URL no longer seems to work correctly. At least this is the case when building with Browserify...
For example, if I'm hosting a dev site at:
http://mydevsite:8888
and try something liked3.csv('/data.csv')
a request will be made tohttp://localhost/data.csv
instead ofhttp://mydevsite:8888/data.csv'
.Steps to reproduce:
1)
npm install -g browserify
2) In a clean folder, create anindex.html
file:3) Create an
index.js
file:4) Create a sample
test.csv
file 5)npm install d3-request@1.0.5
6)browserify index.js -o generated.js
7)python -m SimpleHTTPServer 8888
8) Open up in a browser (usehttp://127.0.0.1:8888
) and verify that the csv file is properly requested athttp://127.0.0.1:8888/test.csv
9) Next:
npm install d3-request@1.0.6
and repeat steps 6-8 10) See that the the requested path is:http://localhost/test.csv