Closed 100-km closed 7 years ago
Would you kindly provide sample code for using color scales with your biPartite layout.
For example, changing from:
var color = {Elite:"#3366CC", Grand:"#DC3912", Lite:"#FF9900", Medium:"#109618", Plus:"#990099", Small:"#0099C6"};
to:
var color = d3.scaleOrdinal(d3.schemeCategory20);
Does not work. What's the trick? Thanks and Great Work!!!
It will work, you will have to make sure that you supply the fill function correctly.
viz.bP().data(data).fill(d=>color(d.primary));
instead of
viz.bP().data(data).fill(d=>color[d.primary]);
Would you kindly provide sample code for using color scales with your biPartite layout.
For example, changing from:
var color = {Elite:"#3366CC", Grand:"#DC3912", Lite:"#FF9900", Medium:"#109618", Plus:"#990099", Small:"#0099C6"};
to:
var color = d3.scaleOrdinal(d3.schemeCategory20);
Does not work. What's the trick? Thanks and Great Work!!!