Sharing custom charts on the fly using Satori
Shoaib Ahmed
@pixeledcodeReactJS Bangalore, April 6, 2024
Hi, I’m Shoaib.
Senior Frontend Engineer @CivicDataLab
Shoaib Ahmed
@pixeledcodeReactJS Bangalore, April 6, 2024
Hi, I’m Shoaib.
Senior Frontend Engineer @CivicDataLab
I work with dashboards on a daily basis. A common ask is having charts that need to be shareable.
some of the dashboards I’ve made in the past
The current implementation is pretty simple but not ideal.
Here’s how it works on different screen sizes.
The shared charts are not consistent.
ft. NextJS
Thanks to route handlers, we are able to share consistent charts across different screen sizes.
We can improve it further by creating a custom template (React Component) before download.
ft. Satori
with Next.js and Satori
also, it isn’t slow..
Chrome | Firefox | Safari | |
---|---|---|---|
Screenshot | 98ms | 128ms | 208ms |
Route Handler | 45ms | 43ms | 173ms |
Satori | 30ms | 23ms | 35ms |
Satori + Route | 115ms | 112ms | 400ms |
it solves for
and as a bonus, for
That’s all for today.
Code & Demo
github.com/PixeledCode/echarts-satori