Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import sylvester, closes #51 #56

Merged

Conversation

joshhjacobson
Copy link
Contributor

No description provided.

@@ -32,7 +35,8 @@ const computeCentroids = (config, position, row) => {
let centroid = 0.5 * (leftCentroid + rightCentroid);
cy = centroid + (1 - config.bundlingStrength) * (cy - centroid);
}
centroids.push($V([cx, cy]));
v = new Vector([cx, cy]);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
v = new Vector([cx, cy]);

@@ -32,7 +35,8 @@ const computeCentroids = (config, position, row) => {
let centroid = 0.5 * (leftCentroid + rightCentroid);
cy = centroid + (1 - config.bundlingStrength) * (cy - centroid);
}
centroids.push($V([cx, cy]));
v = new Vector([cx, cy]);
centroids.push(v);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
centroids.push(v);
centroids.push(new Vector([cx, cy]));

@@ -8,7 +10,8 @@ const computeCentroids = (config, position, row) => {
// centroids on 'real' axes
const x = position(p[i]);
const y = config.dimensions[p[i]].yscale(row[p[i]]);
centroids.push($V([x, y]));
let v = new Vector([x, y]);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let v = new Vector([x, y]);

@@ -8,7 +10,8 @@ const computeCentroids = (config, position, row) => {
// centroids on 'real' axes
const x = position(p[i]);
const y = config.dimensions[p[i]].yscale(row[p[i]]);
centroids.push($V([x, y]));
let v = new Vector([x, y]);
centroids.push(v);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
centroids.push(v);
centroids.push(new Vector([cx, cy]));

centroids[0].e(2),
])
);
cps.push(v);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

variable v is not used afterwards, we may consider adding it directly:

cps.push(new Vector(...))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realize it's possible to instantiate a class inside a function call, thanks for catching that! I've made the changes and pushed them in a new commit. Please let me know if there's anything else.

@BigFatDog
Copy link
Owner

Thank you for this PR! 🎄 🎄 🎄

I've gone through your code and left my comments.

@BigFatDog BigFatDog merged commit 92d237c into BigFatDog:develop Dec 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants