Skip to content
Samuel Gratzl edited this page Sep 1, 2014 · 3 revisions

Introduction

LineUp.js uses a simple JSON description file for loading and interpreting tabular data.

example: data_small.json

{
  "file": "wur2013.txt",
  "separator" : "\t",
  "primaryKey": "schoolname",
  "columns": [
    {
      "column": "schoolname",
      "type": "string"
    },
    {
      "column": "academic",
      "type": "number",
      "domain": [0, 100]
    },
    {
      "column": "internationalstudents",
      "label": "international students",
      "type": "number",
      "domain": [0, 100]
    }
  ],
  "layout": {
    "primary": [
      {
        "column": "schoolname",
        "width": 200
      },
      {
        "column": "academic",
        "width": 100
      },
      {
        "type": "stacked",
        "label": "Combined",
        "children": [
          {
            "column": "academic",
            "width": 100
          },
          {
            "column": "internationalstudents",
            "width": 150
          }
        ]
      },
    ]
  }
}

entries:

  • file, url, data: data reference
  • file: name of the file, which is a given relative to the current descriptor file
  • url: url of the data file to load
  • data : in case the data are part of this description as array of objects
  • separator: the separator to use for parsing the comma separated file, default \t
  • primaryKey: name of the column, which provides unique row ids for this dataset
  • columns: list of columns in the data along with meta data about them
  • layout: collection of layouts, how the described columns are combined and layouted in LineUp. In the current version only the primary layout is supported.

Column Types

A column description consists of the column name as well as the type of the column. Optionally, a label can be provided. By default, the column name is used.

LineUp.js currently supports following column types:

  • string
  • number: Besides the type, the description requires:
  • domain: the domain of this number column, the value is used to initialize a D3 Linear Scale
  • range (optional, default: [0,1]): similar to the domain` the range of the linear scale can be defined
Clone this wiki locally