git ssb

2+

dinoworm 🐛 / ssb-graphviz



Commit 981ed08561e580c3f6f34242a8388c7614bdcb69

physics tweak + edge color

mix irving committed on 12/5/2016, 11:26:30 AM
Parent: 89e66634f75031b1d9c5ffa2bdc49231d2a629b7

Files changed

index.jschanged
index.jsView
@@ -3,13 +3,29 @@
33 const fromJson = require('ngraph.fromjson')
44 const Renderer = require('ngraph.pixel')
55 const Graph = require('./graph')
66
7 +const config = {
8 + physics: {
9 + springLength : 80,
10 + springCoeff : 0.00005,
11 + gravity: -0.4,
12 + theta : 0.4,
13 + dragCoeff : 0.04
14 + },
15 + link: () => {
16 + return {
17 + fromColor: 0x000066,
18 + toColor: 0x000066
19 + }
20 + }
21 +}
22 +
723 module.exports = function (sbot, cb) {
824 Graph(sbot, (err, data) => {
925 if (err) return cb(err)
1026 const str = JSON.stringify(data)
1127 const graph = fromJson(str)
12- const display = Renderer(graph)
28 + const display = Renderer(graph, config)
1329 cb(null, display)
1430 })
1531 }

Built with git-ssb-web