I am creating a webapp where I want to display the plots using d3.js or apexcharts library. Users can select from the dropdown to see the trendlines for 1 month/3 month/ 6 months/ 1year/ 5 years. The issue I am facing is that, the processing of the plots take a lot of time, but the good thing is, data doesn't update very often(once every 3 month). My initial idea was to preprocess the plots for given time-period, and as soon as user queries those, my server in the backend can simply return back the json file with information about that plot which I can display using d3 or apex charts.
Help needed:
I am looking for a way I can save the plots in a format that is acceptable to d3, so when I make a get request from frontend, I can simply fetch the respective json(or any other format - I am open for anything). Initially, I thought to save the plots as pngs/jpgs and then return the image back as the request comes, but those plots won't be interactive.
Can anyone help me with this or provide any ideas?