API Documentation
Dataset

Dataset

In grafiki, a Dataset is a fundamental object that stores all your data. Currently, Datasets have a tabular structure, consisting of columns as attributes and rows as data points. However, we're excited to announce that future updates will introduce support for nested structures, giving you even more flexibility and power to organize your data.

Structure of a Dataset

To create a Dataset in grafiki, you'll need to provide the following attributes. Please refer to the table below for a detailed breakdown:

AttributeTypeRequiredDescription
uuidstringOptionalA universally unique identifier for the Dataset
dataany[]RequiredAn array of data points that make up the Dataset
tagsstring[]OptionalAn array of strings used to categorize or filter the Dataset
namestringRequiredA human-readable name for the Dataset
infoDatasetInfoOptionalAdditional metadata about the Dataset (this will be generated automtically)

DatasetInfo Attributes

If you choose to provide a info attribute, it should contain the following:

AttributeTypeRequiredDescription
attributesstringRequiredAn object with keys as attribute names and values as AttributeInfo objects
sizenumberOptionalThe number of data points in the Dataset

AttributeInfo Attributes

Each AttributeInfo object should contain the following:

AttributeTypeRequiredDescription
typestring | number | booleanRequiredThe data type of the attribute
minnumberOptionalThe minimum value for the attribute
maxnumberOptionalThe maximum value for the attribute
optionsstring[]RequiredAn array of possible values for the attribute
excludebooleanOptionalA boolean indicating whether to exclude this attribute from aggregations
textstringOptionalA human-readable description of the attribute

Example Dataset

Here's a simple example of a Dataset in JSON format:

{
  "name": "My First Dataset",
  "data": [
    { "Age": 25, "Name": "John", "City": "NYC" },
    { "Age": 30, "Name": "Jane", "City": "LA" }
  ],
  "tags": ["example", "demo"],
  "info": {
    "attributes": {
      "Age": { "type": "number", "min": 25, "max": 30 },
      "Name": { "type": "string", "options": ["John", "Jane"] },
      "City": { "type": "string", "options": ["NYC", "LA"] }
    }
  }
}

This example Dataset has a name and an array of data points with three attributes: Age, Name, and City. The info object provides additional metadata about the attributes, including their data types and possible values.