Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hclusterjs

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hclusterjs

Agglomerative Hierarchical Clustering in JavaScript.

  • 1.3.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

hcluster.js

Agglomerative Hierarchical Clustering in JavaScript. (that plays nice with d3.js).

Demo + Blog Post

by @ChrisPolis

Usage

var colorCluster = hcluster()
  .distance('euclidean') // support for 'euclidean' and 'angular'
  .linkage('avg')        // support for 'avg', 'max' and 'min'
  .verbose(true)         // false by default
  .posKey('rgbValue')    // 'position' by default

  // pass in an array of objects w/ array values for 'position' or specified posKey()
  .data(colors);         // as an array of objects w/ array values for 'position'

// integrate into d3 layout.cluster
var cluster = d3.layout.cluster().size([200, 200]),
    nodes = cluster.nodes(colorCluster.tree()),
    links = cluster.links(nodes);

// get the tree, cut incertain ways
colorCluster.orderedNodes();  // returns array of leaves, ordered by tree structure
colorCluster.getClusters(k); // return k(2 to n) clusters of leaves

License

MIT

FAQs

Package last updated on 13 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc