re: Binding Data to Charts using Vue Components and D3 VIEW POST

re: I make charts with d3 in Vue almost every day and here is some of my best practices: Avoid to import whole d3 - it has a very heavy geo module an...

Definitely agree on the recommendation to pull in only those dependent modules.

Regarding JSX I assume that is easier / harder based on your familiarity with the syntax.


Oh and of course some features are simpler with d3 selections - animations and transition for example


You haven't to use JSX, you can use vue templates, but JSX is a little more flexible. The idea is to use


<!-- or d={this.lineShape(} in jsx -->

Instead of$el).append('path')
  .attr('d', this.lineShape(
  .attr('stroke', 'red')

I think html/svg is more readable

code of conduct - report abuse