mbostock/d3 — Issue #414: Dynamic color switcher
Author: jbeasley6651
Created: 2011-12-23 05:49:51+00:00
State: open

Love the library, thanks alot!

If anyone has a chance could you please show me an example of how to make a dynamic color switcher

i'm currently using
color = d3.scale.category20c();

https://github.com/mbostock/d3/wiki/Ordinal-Scales#wiki-category20c

then

.style("fill", function(d) { return color((d.children ? d : d.parent).name); })

To make sure the colors match the parent

What i would like to see is how i can
1 - Construct my own colors (that match)
2 - Apply / switch the colors dynamically

Thanks in advance if anyone can help me :)

jbeasley6651