italia / daf-dataportal

The DAF Dataportal is the front-end project of the PDND portal available at this link.
https://dataportal.daf.teamdigitale.it/
GNU Affero General Public License v3.0
22 stars 24 forks source link

Create a microservice to cache Metabase plots #46

Open ruphy opened 6 years ago

ruphy commented 6 years ago

Create a microservice which goes through the various plots, takes a screenshot, and caches them.

You can fork this repository as a starting point.

simonacca commented 6 years ago

Metabase plots are interactive javascript visualizations, the only way to cache them is therefore via spinning up a headless browser and taking a screenshot.

On the other hand, metabase has a caching facility in itself that operates at the query result level. It caches the data to be fed into the js plotting library.

Are you sure the first option is less computationally expensive and therefore worth it in terms of caching?

If yes, how is the cache supposed to be invalidated?

giux78 commented 6 years ago

Caching and using the data to feed a js plotting library is a useful feature, but how can you know which dataset type to plot with the data automatically? If it is possible to automatize the rendering, the issue could be rewritten accordingly. In any case other tools as superset do not have such a nice feature and the code of this issue can be useful in other context with other business intelligence system. In the end we are not strict and any solution can be accepted

taganaka commented 6 years ago

Happy to take a stab at it. Selenium to the rescue plus viewport screenshot and cropping?