git ssb

2+

dinoworm 🐛 / ssb-graphviz



Commit a7018ed04f2f3649a770fa168f32d48b5ffdf057

publish

Michael Williams committed on 12/5/2016, 5:18:07 AM
Parent: 0882250828f8b296fbb0440e8f4e54238db0c88c

Files changed

README.mdchanged
package.jsonchanged
profile.jschanged
out/index.jsdeleted
output.jsadded
README.mdView
@@ -1,25 +1,24 @@
1-# ssb-viz
1 +# ssb-graphviz
22
33 visualize the ssb network graph
44
5-```shell
6-npm install ssb-viz -g
7-```
5 +(**unfinished**)
86
9-## scripts
7 +## get started
108
11-### build
12-
139 ```sh
14-npm run build
10 +git clone 'ssb://%hNm67sfnZFtWkD/+1qxH3UfzhXykfpKtOL1C/XbLANA=.sha256' ssb-graphviz
11 +cd ssb-graphviz
12 +npm install
13 +npm start
1514 ```
1615
17-### start
16 +## design
1817
19-```sh
20-npm start
21-```
18 +- `/graph` show graph
19 +- `/nodes/:id` show node
20 +- `/edges/:from/:to` show edge
2221
2322 ## license
2423
2524 The Apache License
package.jsonView
@@ -1,53 +1,32 @@
11 {
2- "name": "ssb-viz",
2 + "name": "ssb-graphviz",
33 "version": "0.0.0",
44 "description": "visualize the ssb network graph",
55 "main": "index.js",
66 "scripts": {
77 "test": "tape test.js",
8- "start": "electro out/bundle.js",
9- "bundle": "browselectrify out/index.js",
10- "build": "npm run --silent bundle -- > out/bundle.js",
11- "disc": "npm run --silent bundle -- --full-paths | discify --open",
12- "push": "gh-pages -d out",
13- "deploy": "npm-run-all -s build push"
8 + "start": "electro output.js"
149 },
15- "browserify": {
16- "transform": [
17- "brfs",
18- "es2040"
19- ]
20- },
2110 "repository": {
2211 "type": "git",
23- "url": "git+https://github.com/ahdinosaur/ssb-viz.git"
12 + "url": " ssb://%hNm67sfnZFtWkD/+1qxH3UfzhXykfpKtOL1C/XbLANA=.sha256"
2413 },
2514 "keywords": [],
2615 "author": "Mikey <michael.williams@enspiral.com> (http://dinosaur.is)",
2716 "license": "Apache-2.0",
2817 "bugs": {
29- "url": "https://github.com/ahdinosaur/ssb-viz/issues"
18 + "url": "https://git.scuttlebot.io/%25hNm67sfnZFtWkD%2F%2B1qxH3UfzhXykfpKtOL1C%2FXbLANA%3D.sha256/issues"
3019 },
31- "homepage": "https://github.com/ahdinosaur/ssb-viz#readme",
20 + "homepage": "https://git.scuttlebot.io/%25hNm67sfnZFtWkD%2F%2B1qxH3UfzhXykfpKtOL1C%2FXbLANA%3D.sha256#readme",
3221 "devDependencies": {
33- "browserify": "^13.0.0",
34- "budo": "^8.1.0",
35- "disc": "^1.3.2",
36- "envify": "^3.4.0",
37- "gh-pages": "^0.11.0",
38- "npm-run-all": "^1.6.0",
39- "tape": "^4.5.1",
40- "uglifyify": "^3.0.1",
41- "watchify": "^3.7.0"
22 + "tape": "^4.5.1"
4223 },
4324 "dependencies": {
44- "brfs": "^1.4.3",
45- "browselectrify": "^1.0.1",
4625 "electro": "^2.0.2",
4726 "electron": "^1.4.4",
48- "es2040": "^1.2.4",
4927 "insert-css": "^1.0.0",
28 + "inu": "^3.1.3",
5029 "ngraph.fromjson": "^0.1.8",
5130 "ngraph.pixel": "^2.2.0",
5231 "pull-stream": "^3.4.5",
5332 "run-waterfall": "^1.1.3",
profile.jsView
@@ -1,3 +1,16 @@
11 module.exports = profile
22
3-function profile () {}
3 +module.exports = function (sbot, id, cb) {
4 + pull(
5 + sbot.(id, (err, profile) => {
6 + if (err) return cb(err)
7 + console.log('profile', profile)
8 + }),
9 + pull.reduce(latest, {})
10 + )
11 +}
12 +
13 +function latest (sofar, next) {
14 + console.log('sofar', sofar, next)
15 + return sofar
16 +}
out/index.jsView
@@ -1,21 +1,0 @@
1-const insertCss = require('insert-css')
2-const Sbot = require('ssb-client')
3-const Viz = require('../')
4-
5-insertCss(`
6- html, body {
7- width: 100%;
8- height: 100%;
9- position: absolute;
10- overflow: hidden;
11- padding: 0;
12- margin: 0;
13- }
14-`)
15-
16-Sbot((err, sbot) => {
17- Viz(sbot, (err, viz) => {
18- if (err) throw err
19- sbot.close()
20- })
21-})
output.jsView
@@ -1,0 +1,21 @@
1 +const insertCss = require('insert-css')
2 +const Sbot = require('ssb-client')
3 +const Viz = require('./')
4 +
5 +insertCss(`
6 + html, body {
7 + width: 100%;
8 + height: 100%;
9 + position: absolute;
10 + overflow: hidden;
11 + padding: 0;
12 + margin: 0;
13 + }
14 +`)
15 +
16 +Sbot((err, sbot) => {
17 + Viz(sbot, (err, viz) => {
18 + if (err) throw err
19 + sbot.close()
20 + })
21 +})

Built with git-ssb-web