datasette-plot icon indicating copy to clipboard operation
datasette-plot copied to clipboard

Make re-usable charts for use across tables/SQL queries of the same schema

Open asg017 opened this issue 2 years ago • 3 comments

We should have some option where you can "save" a chart's configuration to re-use in other places.

For example, you have have some scatterplot/linear regression visualization that you want to re-use across your Datasette instance - say one chart per month. Currently, you'll have to re-build the chart manually for every new data source (table or SQL query), but that can get tiresome.

This will likely use Datasette's new internal database to persist chart components across restarts.

asg017 avatar Dec 21 '23 07:12 asg017

I think that applying a filter to the dataset currently resets the plot? It would be great if the plot definition could persist across changes, because then we can drill down into the dataset while being able to directly see the effect of filters on the (same) plot.

tomsing1 avatar Dec 22 '23 23:12 tomsing1

@tomsing1 yup, that's a current limitation! Though I think we can listen for form submissions and inject query parameters on submit, which means persisting across changes. I'll give it a shot!

asg017 avatar Dec 23 '23 20:12 asg017

It would be good to link this to canned queries, so you can have a pre-configured plot associated with a query with an additional "plot" parameter in the config file.

ptsefton avatar Jan 08 '24 22:01 ptsefton