[ Launch: test ] 189149dfe2edac2dfa68 by ljbrown238
[ Launch: test ] 4653053 by enjalot
[ Launch: test ] 4652017 by enjalot
[ Launch: test ] 4582399 by enjalot
-
-
Save ljbrown238/189149dfe2edac2dfa68 to your computer and use it in GitHub Desktop.
test
This file contains 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
{"description":"test","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"style.css":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"tab":"edit","display_percent":0.7,"thumbnail":"http://i.imgur.com/Z4ghHZY.png","fullscreen":false,"ajax-caching":true} |
This file contains 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 width = 144, | |
height = 326; | |
var nodes = [ | |
{ x: width/3, y: height/2 }, | |
{ x: 2*width/3, y: height/2 } | |
]; | |
var links = [ | |
{ source: 0, target: 1 } | |
]; | |
var svg = d3.select('body').append('svg') | |
.attr('width', width) | |
.attr('height', height); | |
var force = d3.layout.force() | |
.size([width, height]) | |
.nodes(nodes) | |
.links(links); | |
force.linkDistance(width/2); | |
var link = svg.selectAll('.link') | |
.data(links) | |
.enter().append('line') | |
.attr('class', 'link'); | |
var node = svg.selectAll('.node') | |
.data(nodes) | |
.enter().append('circle') | |
.attr('class', 'node'); | |
force.on('end', function() { | |
node.attr('r', width/25) | |
.attr('cx', function(d) { return d.x; }) | |
.attr('cy', function(d) { return d.y; }); | |
link.attr('x1', function(d) { return d.source.x; }) | |
.attr('y1', function(d) { return d.source.y; }) | |
.attr('x2', function(d) { return d.target.x; }) | |
.attr('y2', function(d) { return d.target.y; }); | |
}); | |
//force.start(); |
This file contains 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
.node { | |
fill: #ff0000; | |
stroke: #fff; | |
stroke-width: 2px; | |
} | |
.link { | |
stroke: #777; | |
stroke-width: 2px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment