test.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
var svg = d3.select('#example-1') | |
.append('svg') | |
.attr('width', 202) | |
.attr('height', 202); | |
var data = d3.range(10).map(function (d, i) { | |
return i; | |
}); |
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 svg = d3.select('#example-2') | |
.append('svg') | |
.attr('width', '100%') | |
.attr('viewBox', '0 0 202 202'); | |
var data = d3.range(10).map(function (d, i) { | |
return i; | |
}); |
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 svg = d3.select('#example-3') | |
.append('svg') | |
.attr('width', '100%') | |
.attr('viewBox', '0 0 202 202'); | |
var data = d3.range(10).map(function (d, i) { | |
return i; | |
}); |
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
// This can be generalized to arbitrary | |
// aspect ratios. See last example for | |
// more on that. | |
// See calculation for total size in | |
// example above | |
var size = 202; | |
// 1st example - set an explicit |
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
// Assume a variable called `svg` | |
// has already been created, | |
// corresponding to a d3 selection | |
// of an SVG element. | |
// | |
// For this example take the | |
// 'size' of the svg to be 202x202 pixels | |
var marginSize = 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
var aspectRatio= '16:9' | |
var svg = d3.select('#example-4') | |
.append('svg') | |
.attr('width', '100%') | |
.attr('viewBox', '0 0 ' + aspectRatio.split(':').join(' ')); | |
// draw a rect to act as an outline | |
svg.append('rect') |
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 aspectRatio= '16:9'; | |
var viewBox = '0 0 ' + aspectRatio.split(':').join(' '); | |
var svg = d3.select('#example-4') | |
.append('svg') | |
.attr('width', '100%') | |
.attr('viewBox', viewBox); | |
// draw the background |
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; |
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 |