Add ability to specify limits manually - and deal with null data values better #30
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 haveNaN
values in it, but instead hasnull
values. It turns out that justif(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.