d3plus/d3plus-viz

changing .colorScale() breaks viz

Closed this issue · 1 comments

When I have a switch for to toggle the colorScale, I can't to disable the colorScale in the second instance.

Expected Behavior

I should be able to change the data provided to colorScale()

Current Behavior

The color scale rendered in the first instance is maintained.

Steps to Reproduce (for bugs)

  1. https://jsfiddle.net/2ut5gyd7/2/

Your Environment

  • Browser Name: Google Chrome
  • Operating System and Version: MacOS Mojave

@cnavarreteliz hmmm, this one should be simple to fix. Take a look at these lines, which manage the visibility of the colorScale: https://github.com/d3plus/d3plus-viz/blob/master/src/_drawColorScale.js#L22-L30