{"id":22724802,"url":"https://github.com/mridang/serverless-highcharts","last_synced_at":"2025-03-29T23:21:35.841Z","repository":{"id":41801066,"uuid":"163147869","full_name":"mridang/serverless-highcharts","owner":"mridang","description":"A serverless application built atop the Serverless framework to render Highcharts","archived":false,"fork":false,"pushed_at":"2023-01-04T20:16:48.000Z","size":26276,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-05T00:43:33.902Z","etag":null,"topics":["aws-lambda","highcharts","serverless","serverless-framework"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mridang.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":"2018-12-26T07:01:55.000Z","updated_at":"2021-05-27T12:54:27.000Z","dependencies_parsed_at":"2023-02-02T20:31:54.775Z","dependency_job_id":null,"html_url":"https://github.com/mridang/serverless-highcharts","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/mridang%2Fserverless-highcharts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mridang%2Fserverless-highcharts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mridang%2Fserverless-highcharts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mridang%2Fserverless-highcharts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mridang","download_url":"https://codeload.github.com/mridang/serverless-highcharts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246255756,"owners_count":20748122,"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":["aws-lambda","highcharts","serverless","serverless-framework"],"created_at":"2024-12-10T15:07:59.208Z","updated_at":"2025-03-29T23:21:35.802Z","avatar_url":"https://github.com/mridang.png","language":"JavaScript","readme":"# serverless-highcharts\n\nGenerates charts using and embedded highcharts server.\n\n##### Caching\n\nAll the responses are cached for a day and varied by the `Accept-Encoding` and the `Origin`.\n\n##### CORS\n\nCORS is enabled by default for all endpoints and allows any origin i.e. `*`\n\n## Getting started\n\nEnsure you have `node` and either `npm` or `yarn` installed globally. Serverless requires Node 8.10.0.\n\n------\n\n##### NVM\n\nIf you are using a different version of Node, we recommend using `nvm` to run different versions. Set up the correct Node environment bar running `nvm use`. This will automatically read the contained `.nvmrc` file and set the appropriate version.\n\n------\n\nRun `yarn install`to fetch all  the dependencies and once done, run `yarn serve` to start a local server at `http://localhost:3000`. \n\n## Deployment\n\nHighcharts allows deployment to AWS Lambda with a single command. Run `sls deploy --stage [STAGE]` to deploy the function. \n\n**Note:** If the `--stage` parameter is not specified, Serverless will default to `dev`.\n\n**Note:** The `NODE_ENV` variable is always forced to be `production` irrespective of whether the service is running offline or in the cloud. This is so that the Highcharts service will run in production mode. \n\nThis will trigger output that looks something like:\n\n```\nServerless: Packaging service...\nServerless: Excluding development dependencies...\nServerless: Uploading CloudFormation file to S3...\nServerless: Uploading artifacts...\nServerless: Uploading service .zip file to S3 (57.17 MB)...\nServerless: Validating template...\nServerless: Updating Stack...\nServerless: Checking Stack update progress...\n..............\nServerless: Stack update finished...\nService Information\nservice: highcharts\nstage: production\nregion: us-west-2\nstack: highcharts-production\napi keys:\n  None\nendpoints:\n  GET - https://xxxxxxxxxx.execute-api.us-west-2.amazonaws.com/production/polyfill\nfunctions:\n  graph: highcharts-production-graph\n```\n\n## Usage\n\nThe service requires a POST request with a entire JSON payload as the body. If the JSON is malformed, a 400 Bad Request will be returned. If the JSON is well formed but incompatible with the Highcharts params, a 500 Server Error will be returned.\n\n##### HTML\n\nView the source of the included `debug.html` file to see how to make requests against the Highcarts server and embed the resultant image on a page.\n\n##### cURL\n\n```shell\ncurl -o m1.png -v -X POST http://localhost:3000/ \\\n    -d @- \u003c\u003c EOF\n{\n  \"type\":\"png\",\n  \"callback\":\"function(chart) {chart.yAxis[0].update({ labels: { enabled: true, formatter: function() { return this.value + '%' } }}); }\",\n  \"options\":{\n    \"chart\":{\n      \"type\":\"area\",\n      \"spacingRight\":0,\n      \"spacingLeft\":0,\n      \"plotShadow\":false,\n      \"renderTo\":\"visitsChartContainer\"\n    },\n    \"credits\":{\n      \"enabled\":false\n    },\n    \"title\":{\n      \"text\":\"\",\n      \"x\":-20\n    },\n    \"xAxis\":{\n      \"type\":\"datetime\",\n      \"dateTimeLabelFormats\":{\n        \"month\":\"%e. %b\",\n        \"year\":\"%b\"\n      },\n      \"labels\":{\n        \"overflow\":\"justify\"\n      }\n    },\n    \"yAxis\":{\n      \"showFirstLabel\":false,\n      \"gridLineColor\":\"#f5f5f5\",\n      \"gridLineDashStyle\":\"Dash\",\n      \"title\":\"\",\n      \"min\":0,\n      \"plotLines\":[\n        {\n          \"value\":0,\n          \"width\":1,\n          \"color\":\"#f5f5f5\",\n          \"dashStyle\":\"Dash\"\n        }\n      ],\n      \"labels\":{\n        \"align\":\"left\",\n        \"y\":13,\n        \"x\":1\n      }\n    },\n    \"plotOptions\":{\n      \"area\":{\n        \"fillColor\":\"#E6F3FB\",\n        \"size\":\"100%\"\n      },\n      \"series\":{\n        \"threshold\":0,\n        \"negativeColor\":\"#1b94ad\",\n        \"color\":\"#dc4276\",\n        \"lineWidth\":2,\n        \"shadow\":false,\n        \"marker\":{\n          \"lineWidth\":0,\n          \"lineColor\":\"#dc4276\",\n          \"enabled\":true,\n          \"fillColor\":\"#dc4276\"\n        },\n        \"events\":{\n\n        }\n      }\n    },\n    \"tooltip\":{\n      \"shared\":true,\n      \"crosshairs\":true,\n      \"borderColor\":\"#dc4276\",\n      \"valueDecimals\":0\n    },\n    \"legend\":{\n      \"onclick\":null,\n      \"layout\":\"vertical\",\n      \"align\":\"top\",\n      \"verticalAlign\":\"top\",\n      \"x\":0,\n      \"y\":0,\n      \"itemStyle\":{\n        \"font\":\"18px/1.4 700 \\\"Gotham Rounded A\\\", \\\"Gotham Rounded B\\\", \\\"Helvetica Neue\\\", Helvetica, Arial, sans-serif\",\n        \"color\":\"#000\",\n        \"fontWeight\":\"700\",\n        \"width\":350\n      },\n      \"borderWidth\":0\n    },\n    \"series\":[\n      {\n        \"name\":\"Woogasfaa\",\n        \"data\":[\n          [\n            1542585600000,\n            14866\n          ],\n          [\n            1542672000000,\n            10593\n          ],\n          [\n            1542758400000,\n            12957\n          ],\n          [\n            1542844800000,\n            10026\n          ],\n          [\n            1542931200000,\n            18351\n          ],\n          [\n            1543017600000,\n            13230\n          ],\n          [\n            1543104000000,\n            14350\n          ],\n          [\n            1543190400000,\n            13720\n          ],\n          [\n            1543276800000,\n            12631\n          ],\n          [\n            1543363200000,\n            9426\n          ],\n          [\n            1543449600000,\n            7399\n          ],\n          [\n            1543536000000,\n            11346\n          ],\n          [\n            1543622400000,\n            7579\n          ],\n          [\n            1543708800000,\n            14691\n          ],\n          [\n            1543795200000,\n            9133\n          ],\n          [\n            1543881600000,\n            11180\n          ],\n          [\n            1543968000000,\n            8622\n          ],\n          [\n            1544054400000,\n            6953\n          ],\n          [\n            1544140800000,\n            11621\n          ],\n          [\n            1544227200000,\n            7900\n          ],\n          [\n            1544313600000,\n            10967\n          ],\n          [\n            1544400000000,\n            8809\n          ],\n          [\n            1544486400000,\n            11385\n          ],\n          [\n            1544572800000,\n            8127\n          ],\n          [\n            1544659200000,\n            7186\n          ]\n        ]\n      }\n    ]\n  }\n}\nEOF\n```\n\n## Linting\n\nThis service uses Prettier to format and lint it's sources. Run `yarn build` to prettify all the sources.\n\n## Testing\n\nServerless uses Jest for testing. Run the entire test suite by executing `yarn test`. ","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmridang%2Fserverless-highcharts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmridang%2Fserverless-highcharts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmridang%2Fserverless-highcharts/lists"}