0.0.7 • Published 2 years ago

netclustering v0.0.7

Weekly downloads
178
License
GPL
Repository
github
Last release
2 years ago

netClustering.js

netClustering allows you to detect clusters in networks using the Clauset, Newman and Moore community detection algorithm directly from the browser, as simple as:

netClustering.cluster(nodes, edges);

and the clusters will be stored in the .cluster attribute of the nodes.

The code is based on an implementation created by Robin W. Spencer for his site scaledinnovation.com, I wrapped it up on a container so it could be reused as a library

Install

npm install netclustering

Usage

On node

import netClustering from "netclustering";

var nodes = [{name:"a"},{name:"b"}, {name:"c"}];
var links = [{source:0, target:1, count:1}];
var groups = netClustering.cluster(nodes, links );

For the web

<html>
<script src="https://unpkg.com/netclustering/dist/netClustering.min.js"></script>
<script>
var nodes = ["a", "b", "c"];
var links = [{source:0, target:1, count:1}];
var groups = netClustering.cluster(nodes, links );
</script>
</html>
0.0.5

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago