misoproject / dataset

JavaScript library that makes managing the data behind client-side visualisations easy
http://misoproject.com
GNU General Public License v2.0
1.18k stars 99 forks source link

URL fetch not working #194

Closed merrittholmes closed 11 years ago

merrittholmes commented 11 years ago

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:

<!DOCTYPE HTML>

Your Application Title
``` ```

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");
        }
    });
merrittholmes commented 11 years ago

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.