Data

Erie supports two methods for providing the data: values and url.

Property type Description
values Array[Object] A tidy data.
url UrlString A URL to a dataset. It is retrieved using Fetch API.
name String The name of a dataset, which is defined in the datasets object.

Specifying data using values

JSON

{
  ...
  "data" : {
    "values": [
      {
        "category": "A",
        "sparsity": 0.5
      },
      {
        "category": "B",
        "sparsity": 0.1
      },
      {
        "category": "C",
        "sparsity": 0.9
      },
      {
        "category": "D",
        "sparsity": 1
      },
      {
        "category": "E",
        "sparsity": 0.75
      }
    ]
  }
  ...
}

JavaScript

let data = [
  {
    "category": "A",
    "sparsity": 0.5
  },
  {
    "category": "B",
    "sparsity": 0.1
  },
  {
    "category": "C",
    "sparsity": 0.9
  },
  {
    "category": "D",
    "sparsity": 1
  },
  {
    "category": "E",
    "sparsity": 0.75
  }
];
let stream = new Erie.Stream();
...
stream.data.set("values", data);
...

Specifying data using url

JSON

{
  ...
  "data" : {
    "url": "data/penguins.json"
  }
  ...
}

JavaScript

let stream = new Erie.Stream();
...
stream.data.set("url", "data/penguins.json");
...
© Hyeok Kim