Clean up old codes 2
This commit is contained in:
@@ -109,9 +109,9 @@ function processData(data, error) {
|
||||
console.log("n =", nodes.length);
|
||||
// Calculate normalization arguments and get the list of
|
||||
// properties of the nodes.
|
||||
norm = calculateNormalization(nodes);
|
||||
props = Object.keys(nodes[0]);
|
||||
COLOR_ATTRIBUTE = props[0];
|
||||
norm = calculateNormalization(nodes); // Used with distance fn
|
||||
props = Object.keys(nodes[0]); // Properties to consider by distance fn
|
||||
COLOR_ATTRIBUTE = props[props.length-1];
|
||||
|
||||
var opts = document.getElementById('color_attr').options;
|
||||
|
||||
@@ -172,7 +172,7 @@ function processData(data, error) {
|
||||
function ticked() {
|
||||
// If rendering is selected, then draw at every iteration.
|
||||
if (rendering === true) {
|
||||
node
|
||||
node // Each sub-circle in the SVG, update cx and cy
|
||||
.attr("cx", function (d) {
|
||||
return d.x;
|
||||
})
|
||||
@@ -187,7 +187,7 @@ function processData(data, error) {
|
||||
}
|
||||
|
||||
function ended() {
|
||||
if (rendering !== true) {
|
||||
if (rendering !== true) { // Never drawn anything before? Now it's time.
|
||||
node
|
||||
.attr("cx", function (d) {
|
||||
return d.x;
|
||||
@@ -485,6 +485,7 @@ function startLinkSimulation() {
|
||||
springForce = false;
|
||||
simulation.stop();
|
||||
p1 = performance.now();
|
||||
let links = [];
|
||||
|
||||
// Initialize link array.
|
||||
nodes = simulation.nodes();
|
||||
|
||||
Reference in New Issue
Block a user