d3 Example from Beaker

node v4.8.5
version: 1.0.0
endpointsharetweet
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…

12 comments

  • posted a year ago by xgqfrms
    cool!
  • posted a year ago by 58058eb1010c990013bf8ae5
    its lit
  • posted a year ago by meganmcgeee
    Awesome.
  • posted a year ago by apollotang
    can someone point me to how I can use d3Graph() ? how is that different from d3.js ? Thanks!
  • posted a year ago by 586a6a90cd36d3001301fb29
  • posted a year ago by 586a6a90cd36d3001301fb29
    _
  • posted a year ago by 586a6a90cd36d3001301fb29
    __.
  • posted a year ago by 586a6a90cd36d3001301fb29
    Awesome.
  • posted 10 months ago by bonashen
    nice!
  • posted 6 months ago by alshamiri2
    Very nice
  • posted 3 months ago by everaldo
    d3.node.codes
  • posted 25 days ago by joseluisq
    Really cool!

sign in to comment