{"id":18678143,"url":"https://github.com/zingchart/export-server","last_synced_at":"2025-10-17T13:45:00.963Z","repository":{"id":44022559,"uuid":"187072530","full_name":"zingchart/export-server","owner":"zingchart","description":"A headless chrome puppeteer export server to generate chart images.","archived":false,"fork":false,"pushed_at":"2024-03-25T23:37:03.000Z","size":550,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-12-27T21:14:32.614Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zingchart.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-16T17:27:12.000Z","updated_at":"2023-12-22T19:27:34.000Z","dependencies_parsed_at":"2024-11-07T09:38:26.400Z","dependency_job_id":"1e970102-2ae6-4c6b-ad52-810dfc69228a","html_url":"https://github.com/zingchart/export-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zingchart%2Fexport-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zingchart%2Fexport-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zingchart%2Fexport-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zingchart%2Fexport-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zingchart","download_url":"https://codeload.github.com/zingchart/export-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239525498,"owners_count":19653337,"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":[],"created_at":"2024-11-07T09:36:10.214Z","updated_at":"2025-10-17T13:44:55.921Z","avatar_url":"https://github.com/zingchart.png","language":"JavaScript","readme":"# Headless Chrome Export Server \n \nLive version running on glitch [https://glitch.com/~zingchart-export-server](https://glitch.com/~zingchart-export-server) with a reachable endpoint of `https://zingchart-export-server.glitch.me` \u0026 `https://zingchart-export-server.glitch.me/json`\n\n### Deploying\n\n`gcloud app deploy --project export-server`\n\n### Installation\n\n- run `npm install`\n- run `npm run start` to instantiate the local server\n\n### Dependencies\n\nThis has a strong dependency on the headless chrome API library **Puppeteer**. Documentation\ncan be found [here](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#event-console)\n\n### Routes\n\n1) We have our default route `/` which functions **EXACTLY** as our current export server at [https://export.zingchart.com](https://export.zingchart.com). Documentation on this can be on the ZingChart site [here](https://www.zingchart.com/docs/api/export-chart/) and gitlab repo containing the code for that server [here](https://gitlab.zingchart.com/zingchart/export-server.\n\n  - This takes svg and renders it to the page. From there it takes a screenshot\n  - You can change the ZingChart `EXPORTURL` like the following\n  - `zingchart.EXPORTURL = 'https://my.server.com/';` but since we have client side rendering for canvas and svg (convert svg to image blob) we don't really need this.\n \n#### Params for this route are as follows\n\nImportant to note the port takes form data that is x-ww-form-urlencoded.\n\n```\n/*\n * retrieve a chart image and return it\n * takes form-data, x-ww-form-urlencoded, and JSON\n * @ parameters\n * h =\u003e height (String or Number)\n * w =\u003e width(String or Number)\n * svg =\u003e raw svg string data (NOT JSON stringified)\n * t =\u003e type (png, jpeg, pdf, svg)\n * fn =\u003e filename (String)\n */\napp.post('/', async (req, res) =\u003e {\n```\n![](http://capture.zingsoft.com/b09dfbf6b383/download/Image%2525202019-12-09%252520at%2525206.08.13%252520PM.png)\n\n2) We have secondary route `/json` which functions by taking a chart JSON and outputting a png, jpeg or pdf.\n \n#### Params for this route are as follows\n\n```\n/*\n * retrieve a chart image and return it\n * takes form-data, x-ww-form-urlencoded, and JSON\n * @ parameters\n * h =\u003e height (String or Number)\n * w =\u003e width(String or Number)\n * chartJSON =\u003e JSON for chart to render\n * t =\u003e type (png, jpeg, pdf),\n * wait =\u003e milliseconds delay for taking screenshot (for animations)\n */\napp.post('/json', async (req, res) =\u003e {\n```\n\n#### Curl Request\n\n```\ncurl -X POST \\\n  http://localhost:9085/json \\\n  -H 'cache-control: no-cache' \\\n  -H 'content-type: application/json' \\\n  -H 'postman-token: 8692d4b2-6d11-9314-bcf2-2d46b7d182ad' \\\n  -d '{\n\t\"chartJSON\": {\n\t\"graphset\":[\n\t    {\n\t        \"type\":\"bar\",\n\t        \"background-color\":\"white\",\n\t        \"title\":{\n\t            \"text\":\"Tech Giant Quarterly Revenue\",\n\t            \"font-color\":\"#7E7E7E\",\n\t            \"backgroundColor\":\"none\",\n\t            \"font-size\":\"22px\",\n\t            \"alpha\":1,\n\t            \"adjust-layout\":true\n\t        },\n\t        \"plotarea\":{\n\t            \"margin\":\"dynamic\"\n\t        },\n\t        \"series\":[\n\t            {\n\t                \"values\":[37.47,57.59,45.65,37.43],\n\t                \"alpha\":0.95,\n\t                \"borderRadiusTopLeft\":7,\n\t                \"background-color\":\"#8993c7\",\n\t                \"text\":\"Apple\"\n\t            }\n\t        ]\n\t    }\n\t]\n\t},\n\t\"t\": \"png\",\n\t\"height\": 500,\n\t\"width\": 500\n}'\n```\n\n### Other Stuff\n\n`tmp` folder holds ALL the screenshots, JSON's and SVG's sent to the server. If we are taking images for people we might as well save them!","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzingchart%2Fexport-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzingchart%2Fexport-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzingchart%2Fexport-server/lists"}