Candela

Candela is an open-source suite of interoperable web visualization components for Kitware‘s Resonant platform. Candela focuses on making scalable, rich visualizations available with a normalized API for use in real-world data science applications. Integrated components include:

Getting started

Quick start - JavaScript

  1. Enter the following in a text file named index.html:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    <body>
    <div id="vis"></div>
    <script src="//unpkg.com/candela"></script>
    <script>
    
      var data = [
        {x: 1, y: 3},
        {x: 2, y: 4},
        {x: 2, y: 3},
        {x: 0, y: 1}
      ];
    
      var el = document.getElementById('vis');
      var vis = new candela.components.ScatterPlot(el, {
        data: data,
        x: 'x',
        y: 'y'
      });
      vis.render();
    
    </script>
    </body>
    
  2. Open index.html in your browser to display the resulting visualization.

Quick start - Python

  1. Make sure you have Python 2.7 and pip installed (on Linux and OS X systems, your local package manager should do the trick; for Windows, see here).

  2. Open a shell (e.g. Terminal on OS X; Bash on Linux; or Command Prompt on Windows) and issue this command to install the Candela package and the Requests library for obtaining sample data from the web:

    pip install pycandela requests
    

    (On UNIX systems you may need to do this as root, or with sudo.)

  3. Issue this command to start Jupyter notebook server in your browser:

    jupyter-notebook
    
  4. Create a notebook from the New menu and enter the following in a cell, followed by Shift-Enter to execute the cell and display the visualization:

    import requests
    data = requests.get(
        'https://raw.githubusercontent.com/vega/vega-datasets/gh-pages/data/iris.json'
    ).json()
    
    import pycandela
    pycandela.components.ScatterPlot(
        data=data, color='species', x='sepalLength', y='sepalWidth')
    

Quick start - R

  1. Download and install RStudio.

  2. Run the following commands to install Candela:

    install.packages('devtools')
    devtools::install_github('Kitware/candela', subdir='R/candela')
    
  3. Issue these commands to display a scatter plot of the mtcars dataset:

    library(candela)
    candela('ScatterPlot', data=mtcars, x='mpg', y='wt', color='disp')