d3plus / d3plus-legend

An easy to use javascript chart legend.
MIT License
4 stars 0 forks source link

uniform color scale legend not matching data? #78

Open jspeis opened 5 years ago

jspeis commented 5 years ago

(not sure if this belongs elsewhere but figured I would start here)

Current Behavior

Screen Shot 2019-05-30 at 12 09 26 PM

In reviewing some vizs for CNY I noticed an issue where certain vizs seems to have black/very dark areas that don't seem to match up with the legend colors?

Steps to Reproduce (for bugs)

  1. https://jsfiddle.net/jonathan_dw/adrwsz3f/

Your Environment

davelandry commented 5 years ago

@jspeis oooo this is actually an interesting one! Ok so, the logic for determining the range of the color is based on the entire array of flat data, but when drawing the visualization it will group data points (and sum values) based on the specified group by. In this case, you have multiple years of data that are getting aggregated in the map! If you add time: "Year" to your config, it all looks right: https://jsfiddle.net/ebfvs78h/

My feeling is that... this may be user error and not a bug? Not sure how to catch for this internally.