robinkraft / lightning

Data Visualization Server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lightning

A notebook server for storing and sharing custom data visualizations

Deploy

session

client libraries

Python

installation

dependencies

  • node.js
  • gulp build system
    • to install run npm install --global gulp once node.js is installed (may need sudo)
  • PostgreSQL (Install instructions)
    • Create the database by running npm run createdb

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

database migrations

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.

viz types

With companion code from the python client

scatter

scatter

x = [randrange(100) for _ in xrange(50)]
y = [randrange(100) for _ in xrange(50)]

lightning.scatter(x, y)

line

line

lightning.plot(type="line", data=[randrange(100) for x in xrange(50)])

mix+match and server backed

Simple visualizations can be linked together to create new interactions

gif

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')

force directed network

network

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)

maps

US and World Maps

us map world map

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)

matrices

matrices

mat = np.array([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]])
viz = lightning.matrix(mat)

bitmaps

bmp

img1 = random.rand(256, 256)
img2 = random.rand(256, 256)

viz = lightning.image([img1, img2], type='gallery')

About

Data Visualization Server

License:MIT License


Languages

Language:JavaScript 91.8%Language:CSS 8.1%Language:Makefile 0.0%