This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.body.style.margin = 0; | |
document.body.style.padding = 0; | |
const width = window.innerWidth; | |
const height = window.innerHeight; | |
const canvas = document.body.appendChild(document.createElement('canvas')) | |
const fit = require('canvas-fit'); | |
const bezier = require('bezier'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.body.style.margin = 0; | |
document.body.style.padding = 0; | |
const width = window.innerWidth; | |
const height = window.innerHeight; | |
const canvas = document.body.appendChild(document.createElement('canvas')) | |
const fit = require('canvas-fit'); | |
const bezier = require('bezier'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Logs | |
logs | |
*.log | |
# Runtime data | |
pids | |
*.pid | |
*.seed | |
# Directory for instrumented libs generated by jscoverage/JSCover |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Lightning = require('lightning.js'); | |
var lightning = new Lightning(); | |
lightning.lineStreaming([1,1,2,3,5,8,13,21]) | |
.then(function(viz) { | |
viz.open() | |
setInterval(function() { | |
viz.appendData([Math.random()]); // appends to existing data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// dependencies looks like | |
// { | |
// "react": "X.Y.Z", | |
// "victory": "X.Y.Z" | |
// } | |
// | |
exports.decorateTerm = (Term, { React, notify }) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.decorateTerm = (Term, { React, notify }) => { | |
// this library calls require('react') internally | |
const Spinner = require('react-spinner'); | |
return class extends React.Component { | |
render () { | |
const children = []; | |
children.push(React.createElement(Term, Object.assign({}, this.props, { key: 'key1' }))); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
precision lowp float; | |
varying vec3 fragColor; | |
void main() { | |
if (length(gl_PointCoord.xy - 0.5) > 0.5) { | |
discard; | |
} | |
gl_FragColor = vec4(fragColor, 1); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lightning import Lightning, Line | |
lgn_host = 'http://localhost:3000/' | |
#### This instantiates everything | |
lgn = Lightning(host=lgn_host) | |
lgn.create_session() | |
session_id = lgn.session.id | |
print session_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lightning import Lightning | |
import numpy as np | |
import time | |
from random import randint, random | |
lgn = Lightning() | |
session = lgn.create_session() | |
NUM_LINES = 2 | |
NUM_INITIAL_POINTS = 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _ = require('lodash'); | |
var d3 = require('d3'); | |
function randomVariable(rate) { | |
rate = rate || 1; | |
var U = Math.random(); | |
return -Math.log(U)/rate; | |
}; | |
var start = 0; |