There are two ways to use Dataset:
In the Browser
To get dataset into your web development environment, follow the following steps:
Download the right build for your environment:
Include the appropriate script tags:
Start using Miso.Dataset in your code!
You should now have access to the
Miso.Dataset object in your code.
Install appropriate package:
npm install miso.dataset
Use the library in code:
var Miso = require("miso.dataset"); var ds = new Miso.Dataset...
If you chose to include the production version without built in dependencies, you may need to include them yourself. Dataset requires the following libraries:
- LoDash 0.9.0
- Underscore.math.js (unknown version)
- Underscore.deferred.js 0.2.0
- moment.js 1.7.2 (for 'time' data type)
If you are using IE, you will want to include json2.js:
Creating Your First Dataset
There are many ways to import your data into Dataset, but here are a few common examples that should get you going. For full instructions see the Creating a Dataset tutorial.
Creating a Basic Dataset
In this example we are going to create a dataset that is based on a collection of objects, each representing a row. Let's assume you have a local var that contains the following array of objects:
You can then create your dataset like so:
Creating a Dataset from a Remote Source
In this example, we are going to retrieve a set of data that is located at the following url: http://misoproject.com/data/crudeoil.csv
Note that the data above is comma, delimited. You can create a dataset against this url like so.