From 5db242dd0f0d0e0d6ee107e590141eb78f2521dc Mon Sep 17 00:00:00 2001
From: Pitchaya Boonsarngsuk <2285135b@student.gla.ac.uk>
Date: Fri, 2 Feb 2018 10:11:07 +0000
Subject: [PATCH] Update readme2
---
README.md | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 5c21f28..4540bd6 100644
--- a/README.md
+++ b/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.
-# d3.forceNeighbourSampling() [<>](src/neighbourSampling.js "Source")
+# 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.
-# neighbourSampling.distance([distance]) [<>](https://github.com/sReeper/d3-neighbour-sampling/blob/master/src/neighbourSampling.js#L230 "Source")
+# *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.
# neighbourSampling.velocity() [<>](https://github.com/sReeper/d3-neighbour-sampling/blob/master/src/neighbourSampling.js#L238 "Source")
Returns the average velocity of the iteration.
+
+#### Hybrid Layout