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

refactor code #37

Merged
merged 2 commits into from
Feb 8, 2017
Merged

refactor code #37

merged 2 commits into from
Feb 8, 2017

Conversation

jingsam
Copy link
Contributor

@jingsam jingsam commented Feb 8, 2017

I repeated the code that share same logic, maybe better for readability.

Copy link
Member

@mourner mourner left a comment

Choose a reason for hiding this comment

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

Looks good, with minor comment remarks.

index.js Outdated
if (this.options.reduce) {
this._accumulate(clusterProperties, b);
}
// filter out neighbors that already processed
Copy link
Member

Choose a reason for hiding this comment

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

"that are already processed"

index.js Outdated
this.trees[z + 1] = kdbush(clusters, getX, getY, this.options.nodeSize, Float32Array);

clusters = this._cluster(clusters, z); // create a new set of clusters for the zoom
// create a new set of clusters for the zoom and index input points into a KD-tree
Copy link
Member

Choose a reason for hiding this comment

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

Since we index new clusters and not input points at this stage, we could say:

create a new set of clusters for the zoom and index them with a KD-tree

@jingsam
Copy link
Contributor Author

jingsam commented Feb 8, 2017

OK, updated the mentioned comments

@mourner mourner merged commit 93253f3 into mapbox:master Feb 8, 2017
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