jasondavies / d3-cloud

Create word clouds in JavaScript.
https://www.jasondavies.com/wordcloud/
Other
3.82k stars 1.08k forks source link

Example not reproducible from bower install #146

Closed yanickrochon closed 6 years ago

yanickrochon commented 6 years ago

In the example, there's this line :

var fill = d3.scale.category20();

I'm looking all over the place, but this function category20 is nowhere to be found in the bower packages.

tfischer commented 6 years ago

I ran into this problem as well. From the d3 changelog, this feature has been removed. Instead, you can do something like this:

var fill = d3.scaleOrdinal(d3.schemeAccent);

See this for more options: https://github.com/d3/d3-scale-chromatic

jasondavies commented 6 years ago

Yes, the example was created in the days of D3 version 2. D3 version 4 onwards split everything into smaller modules. I removed the fill from the example to avoid any confusion.