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

Add ability to specify limits manually - and deal with null data values better #30

Open
wants to merge 3 commits into
base: gh-pages
Choose a base branch
from

Conversation

robintw
Copy link

@robintw robintw commented Jun 12, 2019

This is a small change adding the ability to specify the limits to use in the options, rather than having them calculated directly from the data.

I've simply added an if statement to choose whether to do the limits calculation (if the limits weren't passed), and changed a few other bits to refer to the right limits values.

I've also done a small change to the styling logic. Previously it used if(!isNaN(featureValue)) but I had problems with this as data loaded from a GeoJSON doesn't tend to have NaN values in it, but instead has null values. It turns out that just if(featureValue) will exclude NaN, null, and undefined - which is probably the best option.

I should note here that I'm not an experienced Javascript programmer - so please let me know if things need improving or changing.

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.

None yet

1 participant