0.1.2 • Published 6 years ago

peer-star-network-vis v0.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

peer-star-network-vis

Peer-* collaboration network visualization.

made by Protocol Labs

Example

Example

const PeerStar = require('peer-star-app')
const NetworkVis = require('peer-star-network-vis')

dApp = PeerStar('my app')
await dApp.start()
collaboration = await dApp.collaborate('collaboration name', ...)

// inside my render function
const svg = document.getElementById('my-svg')

const vis = NetworkVis(collaboration, svg)

// later...

vis.stop()

API

A NetworkVis instance emits the following events:

emit('selected peer', peerId)

When a peer is selected by the user.

emit('peer stats updated', { peerId, stats })

When the stats for a given peer is updated.

The stats object schema is defined in peer-star-app.

License

MIT