WealthBar / angular-d3

AngularJS directives for declaratively using D3
http://wealthbar.github.io/angular-d3/
MIT License
156 stars 39 forks source link

Add d3-include directive to allow for arbitrary SVG to be inserted #19

Closed chrisnicola closed 10 years ago

chrisnicola commented 10 years ago

Something we ended up doing with WealthBar to support gradients was a directive that will inject arbitrary SVG elements from it's own element into the actual SVG. However I think an actual gradient directive might be better for that use case this will allow us to support more unforeseen use cases more easily.

Example

<d3-include>
  <defs>
    <lineargradient id="grad1">
      <stop offset="0%" style="stop-color:#00B298"></stop>
      <stop offset="100%" style="stop-color:#21bca5"></stop>
    </lineargradient>
  </defs>
</d3-include>