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

Bug in createNumericScale.js #148

Open
bianchi-dy opened this issue May 10, 2019 · 0 comments
Open

Bug in createNumericScale.js #148

bianchi-dy opened this issue May 10, 2019 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@bianchi-dy
Copy link
Contributor

The createNumericScale.js has this repeating bit of code where the presence of range in the passed scale is checked. If none is given, then a default array is set as the range.

The way it is currently written, regardless of what you feed to the range prop in scale, it gets ignored because of this:

  if (prop === 'radius') {
    //console.log('5467', !scalingOptions.range)
    if (!scalingOptions.range) {
      console.warn(`No range specified for prop ${prop}. Defaulting to [0, 8]`)
    }

    range = [0, 8]
    parseRange(range, scalingOptions) // parseRange does not alter range at all
  }

So the solution would be

  if (prop === 'radius') {
    //console.log('5467', !scalingOptions.range)
    if (!scalingOptions.range) {
      console.warn(`No range specified for prop ${prop}. Defaulting to [0, 8]`)
    }

    range = [0, 8]
    range = parseRange(range, scalingOptions) // parseRange alters the resulting range after some checks
  }
@bianchi-dy bianchi-dy self-assigned this May 10, 2019
@bianchi-dy bianchi-dy added the bug Something isn't working label May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant