Update readme2
This commit is contained in:
12
README.md
12
README.md
@@ -6,7 +6,7 @@ This module implements three force-directed layout algorithms to visualize high-
|
||||
1. Hybrid layout algorithm. It performs Neighbour and Sampling algorithm on a subset of data before interpolating the rest onto the 2D space. Neighbour and Sampling algorithm may also be run over the full dataset at the end to refine placement.
|
||||
During the interpolation, each node have to find a parent, a closest node that has already been plotted on the 2D space. Two methods of of finding the parents have been implemented.
|
||||
1. Bruteforce searching. This method takes more time but guaranteed that the parent found is the best one.
|
||||
1. Pivot-based searching. This method introduce a one-off pre-processing time but will make parent finding of each node faster. The parent found may not be the best one but should still be near enough.
|
||||
1. Pivot-based searching. This method introduce a one-off pre-processing time but will make parent finding of each node faster. The parent found may not be the best one but should still be near enough to provide good results.
|
||||
|
||||
These algorithms are useful for producing visualizations that show relationships between the data. For instance:
|
||||
|
||||
@@ -40,13 +40,15 @@ var simulation = d3.forceSimulation(nodes);
|
||||
|
||||
## API Reference
|
||||
|
||||
#### NeighbourSampling
|
||||
#### Spring Model
|
||||
|
||||
#### Neighbour and Sampling - TO REWRITE
|
||||
|
||||
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.
|
||||
|
||||
<a name="forceNeighbourSampling" href="#forceNeighbourSampling">#</a> d3.<b>forceNeighbourSampling</b>() [<>](src/neighbourSampling.js "Source")
|
||||
<a name="forceNeighbourSampling" href="#forceNeighbourSampling">#</a> d3.**forceNeighbourSampling**() [<>](src/neighbourSampling.js "Source")
|
||||
|
||||
Initializes the Neighbour and Sampling algorithm with default parameters.
|
||||
|
||||
@@ -62,7 +64,7 @@ function id(d) {
|
||||
|
||||
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.
|
||||
|
||||
<a name="neighbourSampling_distance" href="#neighbourSampling_distance">#</a> <i>neighbourSampling</i>.<b>distance</b>([<i>distance</i>]) [<>](https://github.com/sReeper/d3-neighbour-sampling/blob/master/src/neighbourSampling.js#L230 "Source")
|
||||
<a name="neighbourSampling_distance" href="#neighbourSampling_distance">#</a> *neighbourSampling*.**distance**([*distance*]) [<>](https://github.com/sReeper/d3-neighbour-sampling/blob/master/src/neighbourSampling.js#L230 "Source")
|
||||
|
||||
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:
|
||||
|
||||
@@ -87,3 +89,5 @@ Returns the stress of the layout.
|
||||
<a name="neighbourSampling_velocity" href="#neighbourSampling_velocity">#</a> <i>neighbourSampling</i>.<b>velocity</b>() [<>](https://github.com/sReeper/d3-neighbour-sampling/blob/master/src/neighbourSampling.js#L238 "Source")
|
||||
|
||||
Returns the average velocity of the iteration.
|
||||
|
||||
#### Hybrid Layout
|
||||
|
||||
Reference in New Issue
Block a user