Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
d3 Example from Beaker
node v4.9.1
version:
1.0.0
endpoint
share
tweet
Original example using Python here: http://sharing.beakernotebook.com/gist/anonymous/e21582541d7c1fe60eb4
var R = require("ramda"); var randrange = require("random-number-in-range"); var count = 100; var nodes = R.range(0, 100).map((_, x) => ({ "name": x, "group": Math.floor(x * 7 / count) })); var links = R.range(0, Math.floor(count * 1.15)).map(function(_, x) { var source = x % count; var target = Math.floor(Math.log(1 + randrange(0, count)) / Math.log(1.3)); var value = 10.0 / (1 + Math.abs(source - target)); return { "source": source, "target": target, "value": value }; }) var d3Graph = require("@runkit/runkit/d3-graph/1.0.0"); d3Graph(nodes, links)
Loading…
24 comments
posted
8 years ago
by
xgqfrms
cool!
posted
8 years ago
by
58058eb1010c990013bf8ae5
its lit
posted
8 years ago
by
meganmcgeee
Awesome.
posted
8 years ago
by
apollotang
can someone point me to how I can use d3Graph() ? how is that different from d3.js ? Thanks!
posted
8 years ago
by
586a6a90cd36d3001301fb29
posted
8 years ago
by
586a6a90cd36d3001301fb29
_
posted
8 years ago
by
586a6a90cd36d3001301fb29
__.
posted
8 years ago
by
586a6a90cd36d3001301fb29
Awesome.
posted
8 years ago
by
bonashen
nice!
posted
7 years ago
by
alshamiri2
Very nice
posted
7 years ago
by
everaldo
d3.node.codes
posted
7 years ago
by
joseluisq
Really cool!
posted
7 years ago
by
loot
for those looking for more info on this module https://npm.runkit.com/react-d3-graph
posted
6 years ago
by
genghaibo
Coo
posted
6 years ago
by
wangkailang
en
posted
6 years ago
by
stsl
ua
posted
4 years ago
by
suzanak
the link for the python example is dead, does anyone know where to find it?
posted
4 years ago
by
mountainash
Rebuilding the old URL would give: https://gist.github.com/anonymous/e21582541d7c1fe60eb4
posted
3 years ago
by
rofound
Beautiful!
posted
3 years ago
by
agatamaria
too cute. 😍
posted
2 years ago
by
sabastineshea
Sweet
posted
a year ago
by
jonyy
My nime is abba adamu HafaHafaigavv kb Iqgo V&$10000000
posted
7 months ago
by
bilaljuttb93
V&10000000
posted
7 months ago
by
bilaljuttb93
Good greatfuy
sign in
to comment