URL fetch not working
merrittholmes opened this issue · 1 comments
I tried the quickstart url example but I get
Uncaught TypeError: Cannot read property '0' of null miso.ds.deps.0.4.1.js:8627
_.extend.parse miso.ds.deps.0.4.1.js:8627
_.extend._apply miso.ds.deps.0.4.1.js:7074
importer.fetch.success miso.ds.deps.0.4.1.js:6972
bound miso.ds.deps.0.4.1.js:1772
(anonymous function) miso.ds.deps.0.4.1.js:8171
bound miso.ds.deps.0.4.1.js:1772
handleResponse
I am doing the basics of the basics so what is going wrong?
This is my html:
<title>Your Application Title</title> <script src='./js/dataset/dist/miso.ds.deps.0.4.1.js'></script>
This is my javascript
var ds = new Miso.Dataset({
url : "./crudeoil.csv",
delimeter : ",",
columns : [
{ name : "Year", type : "time", format : "YYYY" },
{ name : "Crude oil production (1000 barrels per day)", type : "number"}
]
});
ds.fetch({
success : function() {
console.log("Here");
console.log("Available Columns:" + this.columnNames());
console.log("There are " + this.length + " rows");
}
});
OK, Delimiter was spelt wrong, so problem solved. I would add though that it might be good to handle this type of problem a little better by explicitly asking for the type rather than assuming json if the delimiter keyword is not there.