{"id":16433809,"url":"https://github.com/brodanoel/d3-to-image","last_synced_at":"2026-05-02T20:32:25.331Z","repository":{"id":58240225,"uuid":"96586015","full_name":"BrodaNoel/d3-to-image","owner":"BrodaNoel","description":"D3 to Image","archived":false,"fork":false,"pushed_at":"2017-07-13T04:00:43.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-17T04:29:50.919Z","etag":null,"topics":["angular","angularjs","chartjs","d3","export","image","nvd3"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BrodaNoel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-08T00:37:21.000Z","updated_at":"2017-07-09T06:33:56.000Z","dependencies_parsed_at":"2022-08-31T00:02:24.162Z","dependency_job_id":null,"html_url":"https://github.com/BrodaNoel/d3-to-image","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrodaNoel%2Fd3-to-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrodaNoel%2Fd3-to-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrodaNoel%2Fd3-to-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrodaNoel%2Fd3-to-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BrodaNoel","download_url":"https://codeload.github.com/BrodaNoel/d3-to-image/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240730056,"owners_count":19848269,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","angularjs","chartjs","d3","export","image","nvd3"],"created_at":"2024-10-11T08:47:17.671Z","updated_at":"2026-05-02T20:32:20.297Z","avatar_url":"https://github.com/BrodaNoel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# D3-TO-IMAGE\nThis library is exclusive dedicated to D3 implemented in AngularJS. So, it will be useful to `D3` manually added over AngularJS, `NVD3` and `angularjs-nvd3`\n\nIf you want more information about how to implement your own svg-image-exporter-converter-whatever, please chck this library: https://github.com/BrodaNoel/svg-2-image/blob/master/README.md\n\n## How to implement it in AngularJS\nHere you have some help to implement it in AngularJS.\n\n* In `bower.json`, add: `\"d3-to-image\": \"^1.0.0\",`.\n* In your `index.html` add `\u003cscript src=\"[path]/d3-to-image/lib/d3-to-image-ngDirective.min.js\"\u003e\u003c/script\u003e`.\n* Add ngD3ToImage as dependency in your App, doing:\n```js\nangular\n  .module('yourAwesomeApp', [\n      'ngRoute',\n      // ...\n      'ngD3ToImage' // \u003c\u003c\u003c Add this!\n  ])\n```\n* Then, for example, add a button that will call a `exportPNG` function to \"run the export process\", doing:\n```html\n  \u003ca ng-click=\"exportPNG()\"\u003eExport SVG to PNG\u003c/a\u003e\n```\n* Then, define your callback function that will be called when the image finished to be created:\n```js\n$scope.d3ToImageCallback = function(imageFormats) {\n    // Let's use FileSave library to download the image\n    saveAs(imageFormats.blob, 'myChart.png');\n};\n```\n* Now, wrap your SVG with your new directive, doing:\n```hmtl\n\u003cd3-to-image data-try-to-fix=\"true\"\n             callback=\"d3ToImageCallback\"\n             export=\"exportPNG\"\u003e\n    \u003csvg...\u003e\u003c/svg\u003e \u003c!-- Here you can have D3, NVD3, or whatever. --\u003e\n\u003c/d3-to-image\u003e\n```\n\n\u003e The `try-to-fix` is passed to the `svg-2-iamge` library to force to improve cross browser compatibility\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrodanoel%2Fd3-to-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrodanoel%2Fd3-to-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrodanoel%2Fd3-to-image/lists"}