bubblechart-decolor.js 399 B

1234567891011121314151617
  1. import * as d3 from 'd3';
  2. // d3js module for module05: unify circle color
  3. export default () => {
  4. // start
  5. const bubbleChart = selection => {
  6. selection.selectAll('.circle--colored')
  7. .transition()
  8. .delay(d => ((d.x + d.y) * Math.random()))
  9. .ease(d3.easeSin)
  10. .duration(1000)
  11. .attr('fill', '#D8D8D8')
  12. .attr('class', 'circle');
  13. };
  14. return bubbleChart;
  15. };