Commit a7018ed04f2f3649a770fa168f32d48b5ffdf057
publish
Michael Williams committed on 12/5/2016, 5:18:07 AMParent: 0882250828f8b296fbb0440e8f4e54238db0c88c
Files changed
README.md | changed |
package.json | changed |
profile.js | changed |
out/index.js | deleted |
output.js | added |
README.md | |||
---|---|---|---|
@@ -1,25 +1,24 @@ | |||
1 | -# ssb-viz | ||
1 … | +# ssb-graphviz | ||
2 | 2 … | ||
3 | 3 … | visualize the ssb network graph | |
4 | 4 … | ||
5 | -```shell | ||
6 | -npm install ssb-viz -g | ||
7 | -``` | ||
5 … | +(**unfinished**) | ||
8 | 6 … | ||
9 | -## scripts | ||
7 … | +## get started | ||
10 | 8 … | ||
11 | -### build | ||
12 | - | ||
13 | 9 … | ```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 | ||
15 | 14 … | ``` | |
16 | 15 … | ||
17 | -### start | ||
16 … | +## design | ||
18 | 17 … | ||
19 | -```sh | ||
20 | -npm start | ||
21 | -``` | ||
18 … | +- `/graph` show graph | ||
19 … | +- `/nodes/:id` show node | ||
20 … | +- `/edges/:from/:to` show edge | ||
22 | 21 … | ||
23 | 22 … | ## license | |
24 | 23 … | ||
25 | 24 … | The Apache License |
package.json | ||
---|---|---|
@@ -1,53 +1,32 @@ | ||
1 | 1 … | { |
2 | - "name": "ssb-viz", | |
2 … | + "name": "ssb-graphviz", | |
3 | 3 … | "version": "0.0.0", |
4 | 4 … | "description": "visualize the ssb network graph", |
5 | 5 … | "main": "index.js", |
6 | 6 … | "scripts": { |
7 | 7 … | "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" | |
14 | 9 … | }, |
15 | - "browserify": { | |
16 | - "transform": [ | |
17 | - "brfs", | |
18 | - "es2040" | |
19 | - ] | |
20 | - }, | |
21 | 10 … | "repository": { |
22 | 11 … | "type": "git", |
23 | - "url": "git+https://github.com/ahdinosaur/ssb-viz.git" | |
12 … | + "url": " ssb://%hNm67sfnZFtWkD/+1qxH3UfzhXykfpKtOL1C/XbLANA=.sha256" | |
24 | 13 … | }, |
25 | 14 … | "keywords": [], |
26 | 15 … | "author": "Mikey <michael.williams@enspiral.com> (http://dinosaur.is)", |
27 | 16 … | "license": "Apache-2.0", |
28 | 17 … | "bugs": { |
29 | - "url": "https://github.com/ahdinosaur/ssb-viz/issues" | |
18 … | + "url": "https://git.scuttlebot.io/%25hNm67sfnZFtWkD%2F%2B1qxH3UfzhXykfpKtOL1C%2FXbLANA%3D.sha256/issues" | |
30 | 19 … | }, |
31 | - "homepage": "https://github.com/ahdinosaur/ssb-viz#readme", | |
20 … | + "homepage": "https://git.scuttlebot.io/%25hNm67sfnZFtWkD%2F%2B1qxH3UfzhXykfpKtOL1C%2FXbLANA%3D.sha256#readme", | |
32 | 21 … | "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" | |
42 | 23 … | }, |
43 | 24 … | "dependencies": { |
44 | - "brfs": "^1.4.3", | |
45 | - "browselectrify": "^1.0.1", | |
46 | 25 … | "electro": "^2.0.2", |
47 | 26 … | "electron": "^1.4.4", |
48 | - "es2040": "^1.2.4", | |
49 | 27 … | "insert-css": "^1.0.0", |
28 … | + "inu": "^3.1.3", | |
50 | 29 … | "ngraph.fromjson": "^0.1.8", |
51 | 30 … | "ngraph.pixel": "^2.2.0", |
52 | 31 … | "pull-stream": "^3.4.5", |
53 | 32 … | "run-waterfall": "^1.1.3", |
profile.js | ||
---|---|---|
@@ -1,3 +1,16 @@ | ||
1 | 1 … | module.exports = profile |
2 | 2 … | |
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.js | ||
---|---|---|
@@ -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.js | ||
---|---|---|
@@ -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