This package is used by WebTorrent. You can see thispackage in action on the webtorrent.io homepage orplay with it on theesnextb.in demo.
npm install p2p-graph
This package works in the browser with browserify. If you do not use a bundler, you can use the standalone script directly in a <script>
tag.
var Graph = require('p2p-graph')
var graph = new Graph('.root')
graph.on('select', function (id) {
console.log(id + ' selected!')
})
// Add two peers
graph.add({
id: 'peer1',
me: true,
name: 'You'
})
graph.add({
id: 'peer2',
name: 'Another Peer'
})
// Connect them
graph.connect('peer1', 'peer2')
Heads Up! : Represented Graphs are directed!
In graph theory, a directed graph (or digraph) is a graph that is a set of vertices connected by edges, where the edges have a direction associated with them.
Create a new P2P graph at the root DOM element rootElem
. In addition to anElement
, a query selector string (like '.my-cool-element'
) can also be passedin.
Add a peer to the graph. The peer
object should contain:
{
id: 'unique-identifier', // should be unique across all peers
me: true, // is this the current user?
name: 'display name' // name to show in the graph UI
}
Connect to two nodes, identified by id1
and id2
, to each other.
Disconnect two nodes, identified by id1
and id2
, from each other.
Check whether two nodes identified by id1
and id2
are somehow connected (id1 --> id2
or id2 --> id1
).
If exists return the link between id1
and id2
, otherwise null
.
Return true
if all the given Nodes exists, otherwise false
.
Return true
the given Link exists, otherwise false
(direction matters!).
Remove a node, identified by id
, from the graph.
Change a node's status identified by id
, isSeeding
must be true or false.
Update the transfer rate between two nodes identified by id1
and id2
. speed
must be expressed in bytes.
Return an array of Nodes.
Destroys the graph and all the listeners related to it.
Event is fired when a node is selected (clicked on) by the user. The id
argument is either the idof the selected peer, false
to indicate that the peer has been deselected. Only one peer can beselected at any given time.
MIT. Copyright (c) Feross Aboukhadijeh.
graph-tool is a Python module for manipulation and statistical analysis of graphs[disambiguation needed] (a.k.a. networks). graph-tool是一个操作和统计分析图表的Python模块。 The core data structures and algorithms of
Given an array of strings strs, group the anagrams together. You can return the answer in any order. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typ
P2P Cloud P2P Cloud project allows users to build their private networks. Building p2p is shipped with a Makefile, so building it a pretty easy task. You just run make command to buld a single binary
Here we describe configuration options around the Peer Exchange. These can be set using flags or via the $TMHOME/config/config.toml file. Seed Mode --p2p.seed_mode The node operates in seed mode. In s
很多朋友关心SRS是否有计划支持RTMFP,是否计划支持P2P,这篇文章详细介绍了SRS和P2P的关系。 Summary 我们所指的P2P,并非传统客户端P2P的方式,譬如ed2k那种协议。我们特指三种P2P: Flash P2P:Adobe开发的P2P,Flash播放器之间可以互相P2P,分享视频。 Android P2P:特指Android的App的P2P方式,Android上HTML5不可能
To see a better formatted, more frequently updated version of this, please visit docs.p2p.today, or for the develop branch, dev-docs.p2p.today. Current build status: Goal We are trying to make peer-to
Alliance P2P是一个P2P分享软件。它支持BitTorrent下载和直接下载,采用了分散的安全网络技术,只有你邀请的人或者朋友才能分享文件和进行交流,这就很好的保护了个人隐私。它可以行动于Windows, Linux和Mac OSX系统上。
ANts P2P 实现了第三代的P2P网络。它保护您的隐私,当您连接,使你没有跟踪的,隐藏您的身份(IP)和crypting一切您发送/接收别人。支持云集多源下载