git ssb

2+

dinoworm ๐Ÿ› / ssb-graphviz



Tree: 981ed08561e580c3f6f34242a8388c7614bdcb69

Files: 981ed08561e580c3f6f34242a8388c7614bdcb69 / index.js

648 bytesRaw
1const fs = require('fs')
2const Path = require('path')
3const fromJson = require('ngraph.fromjson')
4const Renderer = require('ngraph.pixel')
5const Graph = require('./graph')
6
7const 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
23module.exports = function (sbot, cb) {
24 Graph(sbot, (err, data) => {
25 if (err) return cb(err)
26 const str = JSON.stringify(data)
27 const graph = fromJson(str)
28 const display = Renderer(graph, config)
29 cb(null, display)
30 })
31}
32

Built with git-ssb-web