This is based on the code on xmrit which is the reference implementation.
In order to use this in your own evidence project, you will need to do 4 things
(1) Add the three files below to your \components
folder in your evidence project.
- ShareLinkComponent.svelte
- types.ts
- shareLink.ts
(2) Add the lz77 library to your node project
npm install lz77
(3) prepare your data for the component. the two columns must be named "x" and "value"
select start_date::date::text AS x,
value
from ${my_data}
order by start_date
(4) add the component to your project
<ShareLinkComponent
xLabel={x_label}
yLabel={y_label}
xdata={prepared_data} />