SVG-2-IMAGE
Let's improve it in a future.
How to implement it in AngularJS
Here you have some help to implement it in AngularJS.
- In
bower.json
, add:"svg-2-image": "^1.0.0",
. - In your
index.html
add<script src="[path]/svg-2-image/lib/svg-2-image-ngProvider.min.js"></script>
. - Add ngSvg2Image as dependency in your App, doing:
angular
- Then, for example, add a button that will call a
save
function to use your directive (that it use svg-2-image), doing:
Export SVG to PNG
- To implement it, you can create a Directive that expose a
save
function that will be called when click on the button, like this:
angular;
- Now, wrap your SVG with your new directive, doing:
<my-directive data-save="save"> <svg...></svg> <!-- Here you can have D3, NVD3, or whatever. --></my-directive>