2019 Ændrew Rininsland (@aendrew)
This is all the code from my November 2019 talk at Trending.JS.
Here's what you should look at if you want to recreate something like this:
- serverless.yaml: All the AWS Lambda config is in this. You'll need to tweak this to deploy
- data.js: This is the GraphQL data handler for Serverless. It consumes mock data from data.json; normally you'd make requests to an API instead.
- chart.js: This is the chart handler. It takes one path parameter,
config
, to fork between thebasic
and theadvanced
chart examples (both in/charts
). - /charts: The actual chart generation code.
basic.js
returns a simple SVG string.advanced.js
uses JSDOM + D3 to create a more realistic example.
- schemas.js: GraphQL schemas. I've made these really trivial by design.