Pitchaya Boonsarngsuk 7bb1cd755b Add comments
2018-01-31 16:02:37 +00:00
2017-11-07 21:33:16 +00:00
2018-01-31 16:02:37 +00:00
2017-11-07 21:33:16 +00:00
2017-11-07 21:33:16 +00:00
2018-01-31 08:40:01 +00:00
2017-11-07 21:33:16 +00:00
2017-11-07 22:14:21 +00:00
2017-11-07 21:33:16 +00:00

d3-neighbour-sampling

This module implements Chalmers' 1996 Neighbour and Sampling algorithm for drawing the force-directed layouts. It is a linear time algorithm that uses stochastic sampling to find the best neighbours for high-dimensional data and creates the layout in 2 dimensions.

Neighbour and Sampling algorithm is useful for producing visualizations that show relationships between the data. For instance:

fsmvis data setPoker Hands data set

Authors

Remigijus Bartasius and Matthew Chalmers

Reference

Installing

Download the latest release.

API Reference

NeighbourSampling

The Neighbour and Sampling algorithm tries to group the nodes based on the distance between them. If the nodes have a low distance, then the force attracts them to each other. If the nodes have a high distance, then the repulsive force pushes them further apart from each other.

In order for it to work properly, a distance function should be specified.

# d3.forceNeighbourSampling() <>

Initializes the Neighbour and Sampling algorithm with default parameters.

# neighbourSampling.id([id]) <>

If id is specified, sets the node id accessor to the specified function and returns this force. If id is not specified, returns the current node id accessor, which defaults to the numeric node.index:

function id(d) {
  return d.index;
}

The id accessor is invoked for each node whenever the force is initialized, as when the nodes change, being passed the node and its zero-based index.

# neighbourSampling.distance([distance]) <>

If distance is specified, sets the distance accessor to the specified number or function, re-evaluates the distance accessor for each link, and returns this force. If distance is not specified, returns the current distance accessor, which defaults to:

function distance() {
  return 300;
}

# neighbourSampling.neighbourSize([neighbourSize]) <>

If neighbourSize is specified, sets the neighbour set size to the specified number and returns this force. If neighbourSize is not specified, returns the current value, which defaults to 6.

# neighbourSampling.sampleSize([sampleSize]) <>

If sampleSize is specified, sets the sample set size to the specified number and returns this force. If sampleSize is not specified, returns the current value, which defaults to 3.

# neighbourSampling.stress() <>

Returns the stress of the layout.

# neighbourSampling.velocity() <>

Returns the average velocity of the iteration.

Description
No description provided
Readme 12 MiB
2018-03-23 01:01:51 +07:00