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:
- LineUp component: LineUp dynamic ranking by the Harvard University Visual Computing Group and the Caleydo project.
- UpSet component: UpSet set visualization by the Harvard University Visual Computing Group and the Caleydo project.
- OnSet component: OnSet set visualization by the Georgia Institute of Technology Information Interfaces Group.
- Vega visualizations by the University of Washington Interactive Data Lab. Example component: ScatterPlot.
- GeoJS geospatial visualizations by Kitware’s Resonant platform. Example component: GeoDots.
Getting started¶
Quick start - JavaScript¶
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/dist/candela.min.js"></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>
Open
index.html
in your browser to display the resulting visualization.
Quick start - Python¶
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).
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
.)Issue this command to start Jupyter notebook server in your browser:
jupyter-notebook
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¶
Download and install RStudio.
Run the following commands to install Candela:
install.packages('devtools') devtools::install_github('Kitware/candela', subdir='R/candela')
Issue these commands to display a scatter plot of the
mtcars
dataset:library(candela) candela('ScatterPlot', data=mtcars, x='mpg', y='wt', color='disp')