{"id":15525924,"url":"https://github.com/mmarcon/pretty-data","last_synced_at":"2026-04-29T17:40:37.732Z","repository":{"id":57330200,"uuid":"85351596","full_name":"mmarcon/pretty-data","owner":"mmarcon","description":"Intuitive way of creating d3 visualization headlessly.","archived":false,"fork":false,"pushed_at":"2017-04-07T13:42:18.000Z","size":2873,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-19T13:33:50.579Z","etag":null,"topics":["charts","d3","d3js","data-visualization","data-viz","headless"],"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/mmarcon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-17T20:21:42.000Z","updated_at":"2023-06-29T04:59:55.000Z","dependencies_parsed_at":"2022-09-21T03:13:15.152Z","dependency_job_id":null,"html_url":"https://github.com/mmarcon/pretty-data","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mmarcon/pretty-data","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmarcon%2Fpretty-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmarcon%2Fpretty-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmarcon%2Fpretty-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmarcon%2Fpretty-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mmarcon","download_url":"https://codeload.github.com/mmarcon/pretty-data/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmarcon%2Fpretty-data/sbom","scorecard":{"id":654040,"data":{"date":"2025-08-11","repo":{"name":"github.com/mmarcon/pretty-data","commit":"ffac8f5d2e30a38a8a858beeb73416a1dcb448ab"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/17 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"24 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-g74r-ffvr-5q9f","Warn: Project is vulnerable to: GHSA-36jr-mh4h-2g58","Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq","Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-4hpf-3wq7-5rpr","Warn: Project is vulnerable to: GHSA-f522-ffg8-j8r6","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-282f-qqgm-c34q","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-6394-6h9h-cfjg","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-2m39-62fm-q8r3","Warn: Project is vulnerable to: GHSA-mf6x-7mm4-x2g7","Warn: Project is vulnerable to: GHSA-g7q5-pjjr-gqvp","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-xc7v-wxcw-j472"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T14:12:36.325Z","repository_id":57330200,"created_at":"2025-08-21T14:12:36.326Z","updated_at":"2025-08-21T14:12:36.326Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32437109,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T17:34:55.123Z","status":"ssl_error","status_checked_at":"2026-04-29T17:34:45.749Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["charts","d3","d3js","data-visualization","data-viz","headless"],"created_at":"2024-10-02T11:00:36.024Z","updated_at":"2026-04-29T17:40:37.712Z","avatar_url":"https://github.com/mmarcon.png","language":"JavaScript","readme":"# Pretty Data\n\nThis module allows the generation of [D3](https://d3js.org) visualizations on the server.\n\nVisualizations can be exported in HTML, SVG or PNG (via [PhantomJS](http://phantomjs.org/)).\n\n## Installation\n\nAs simple as:\n\n`npm install prettydata`\n\nIf you are more the [Yarn](https://yarnpkg.com) kind of guy then go for:\n\n`yarn add prettydata`\n\n## Usage\n\nUsing Pretty Data is very simple. If you know d3, you know how to use Pretty Data.\n\n```javascript\nconst PrettyData = require('prettydata');\n\nconst WIDTH = 1280\nconst HEIGHT = 800;\n\nconst prettyData = new PrettyData(WIDTH, HEIGHT);\n\n//This is the root SVG object where the entire chart will be rendered\nconst svg = prettyData.$;\n\n//This is the same d3 object you'd use in a browser\nconst d3 = PrettyData.d3;\n\n//Optionally, set some style rules\nprettyData.css = {\n    'rect.bordered': {\n        stroke: '#E6E6E6',\n        strokeWidth: '2px'\n    },\n    'text.mono': {\n        fontSize: '9pt',\n        fontFamily: 'Consolas, courier',\n        fill: '#aaa'\n    },\n    'text.axis-workweek, text.axis-worktime': {\n        fill: '#000'\n    }\n};\n\n//\n//Do your d3 stuff here...\n//\n\n//Generate HTML file output\nprettyData.html()\n    .then(PrettyData.to('myfile.html')))\n    .catch(console.error);\n\n//Generate SVG file output\nprettyData.svg()\n    .then(PrettyData.to('myfile.svg')))\n    .catch(console.error);\n\n//Generate PNG file output\nprettyData.png()\n    .then(PrettyData.to('myfile.png')))\n    .catch(console.error);\n```\n\n### Transitions\n\nIf you want to render a d3 visualization on the server using exactly the same code you use on the client, [transitions](https://github.com/d3/d3-transition) may get in the way.\n\nWhen Pretty Data generates the snapshot of the SVG generated by d3 the transition isn't complete (or it's not going to happen at all, this I still have to figure out).\n\nTo overcome this problem, you can either make sure that the chart is generated on the server you get rid of all the transitions, or you can disable all the transitions with\n\n```javascript\nPrettyData.disableD3Transitions();\n```\n\nAn example of this is in [transition.js](https://github.com/mmarcon/pretty-data/blob/master/examples/transition.js):\n\n```javascript\n//Disable d3 transitions\nPrettyData.disableD3Transitions();\n\nconst prettyData = new PrettyData(960, 500);\nconst svg = prettyData.$;\nconst d3 = PrettyData.d3;\n\nsvg.append(\"circle\")       // append a cicle to the svg\n    .attr(\"fill\", \"blue\")   // fill the circle with 'blue'\n    .attr(\"r\", 20)          // set the radius to 10 pixels\n    .attr('cx', 40)         // position the circle at 40 on the x axis\n    .attr('cy', 250)        // position the circle at 250 on the y axis\n    .transition()           // apply a transition\n    .duration(4000)         // apply it over 4000 milliseconds\n    .attr('cx', 920);       // new horizontal position at 920 on x axis\n```\n\nWhen the PNG, SVG and HTML files are generated, the visualization will be in its completed status, as if the transition already happened.\n\n**This method is still very experimental and currently only covers the `delay`, `duration` and  `ease` methods of the [Transition](https://github.com/d3/d3-transition/blob/master/src/transition/index.js) object.**\n\n## Examples\n\n### US TopoJSON\n\nSource: [https://bl.ocks.org/mbostock/4136647](https://bl.ocks.org/mbostock/4136647).\n\n![us topojson example](https://raw.githubusercontent.com/mmarcon/pretty-data/master/examples/out/map-us.png)\n\n### Voronoi\n\nAdapted from: [http://mbostock.github.io/d3/talk/20111116/airports-all.html](http://mbostock.github.io/d3/talk/20111116/airports-all.html).\n\n![voronoi example](https://raw.githubusercontent.com/mmarcon/pretty-data/master/examples/out/voronoi.png)\n\n### Flare\n\nMinimally adapted from: [https://bl.ocks.org/maybelinot/5552606564ef37b5de7e47ed2b7dc099](https://bl.ocks.org/maybelinot/5552606564ef37b5de7e47ed2b7dc099).\n\nIn this example the data is pulled on the fly as JSON using [node-fetch](https://github.com/bitinn/node-fetch).\n\n![flare example with data fetched on the fly](https://raw.githubusercontent.com/mmarcon/pretty-data/master/examples/out/flare.png)\n\n### Heatmap (with styles)\n\nSource: [http://bl.ocks.org/ganezasan/dfe585847d65d0742ca7d0d1913d50e1](http://bl.ocks.org/ganezasan/dfe585847d65d0742ca7d0d1913d50e1).\n\nIn this example the chart is styled using the css API exposed by Pretty Data:\n\n```javascript\nprettyData.css = {\n    'rect.bordered': {\n        stroke: '#E6E6E6',\n        strokeWidth: '2px'\n    },\n    'text.mono': {\n        fontSize: '9pt',\n        fontFamily: 'Consolas, courier',\n        fill: '#aaa'\n    },\n    'text.axis-workweek, text.axis-worktime': {\n        fill: '#000'\n    }\n};\n```\n\n![heatmap example with css](https://raw.githubusercontent.com/mmarcon/pretty-data/master/examples/out/heatmap.png)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmarcon%2Fpretty-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmmarcon%2Fpretty-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmarcon%2Fpretty-data/lists"}