Closed thfield closed 8 years ago
Makes sense. I'll take a stab at it.
lmk if you have questions, I didn't mean to sound brusk and just pass this off but it seemed like a good use of d3
Best way to learn -- found and squashed a bug in the process. Thanks, Tyler.
@geoffnet, since you want to get more familiar with D3 this is a good place to implement a common D3 pattern and clean up the code a little.
In main.js there is a switch statement to decide the background color of the switchbox element, but we should be able to use the
color
variable, which is a d3 quantize scale.I believe it would be a matter of changing the switch to something like
scorebox.style.backgroundColor = color(escore)
with anif
to set the text color accordingly