A notebook server for storing and sharing custom data visualizations
Python
dependencies
- node.js
- gulp build system
- to install run
npm install --global gulp
once node.js is installed (may need sudo)
- to install run
- postgres
- Create the database by running
npm run createdb
- Create the database by running
Install libraries by running npm install
.
Compile client side libraries by running gulp
. This can will continue to watch for changes of client side files.
Run server with npm start
. Open your browser to http://localhost:3000
If a change has been made to the database, you can update using the sequelize cli migration tool.
Simply run npm run migrate
from the root of the project and sequelize should automatically
run any pending migrations.
With companion code from the python client
x = [randrange(100) for _ in xrange(50)]
y = [randrange(100) for _ in xrange(50)]
lightning.scatter(x, y)
lightning.plot(type="line", data=[randrange(100) for x in xrange(50)])
Simple visualizations can be linked together to create new interactions
points = [{ 'x': randrange(100), 'y': randrange(100), 'i': i} for i in xrange(50)]
timeseries = [[uniform(-1, 1) for _ in xrange(1000)] for _ in xrange(50)]
data = {
'points': points,
'timeseries': timeseries
}
lightning.plot(data=data, type='roi')
import numpy as np
mat = np.array([[random.uniform(0, 15) if random.random() > 0.8 else 0 for _ in xrange(15)] for _ in xrange(15)])
viz = lightning.network(mat)
US and World Maps
countries = ["USA", "MEX", "CAN", "GER", "AUS", "BRA", "ARG", "PER", "SPA", "POR", "FRA", "ITA", "RUS", "CHN", "IND"]
mapDict = dict((country, random.random()) for country in countries)
viz = lightning.plot('map', data=mapDict)
mat = np.array([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]])
viz = lightning.matrix(mat)
img1 = random.rand(256, 256)
img2 = random.rand(256, 256)
viz = lightning.image([img1, img2], type='gallery')