rclement / datasette-dashboards

Datasette plugin providing data dashboards from metadata
https://datasette-dashboards-demo.vercel.app
Apache License 2.0
137 stars 7 forks source link

Allow embedding dashboards and charts #69

Closed rclement closed 1 year ago

rclement commented 1 year ago

While the generic /-/dashboards/ experience is fine for most cases, it can be useful to be able to embed either a dashboard or a single chart within an iframe, for instance:

<iframe
    src="/-/dashboards/my-dashboard-1/embed?start_date=2023-01-01&end_date=2023-12-31"
    frameborder="0"
    width="800"
    height="600"
    allowtransparency
>
</iframe>
<iframe
    src="/-/dashboards/my-dashboard-1/my-chart-1/embed?start_date=2023-01-01&end_date=2023-12-31"
    frameborder="0"
    width="800"
    height="600"
    allowtransparency
>
</iframe>

Ideas

Inspired by Metabase dashboard public embedding:

Roadblocks

What about permissions?

rclement commented 1 year ago

Also, it would be nice to have a button to display the sharing URL to the user as well as an HTML snippet for webpage embedding.

For instance, here is the popup Metabase opens when clicking on the sharing button:

Screenshot 2023-03-21 at 16 58 45
rclement commented 1 year ago

PR #79 implement dashboards and charts embedding. However, the current implementation does nothing extra regarding the permissions:

In the future, we will had some RBAC control for dashboards and charts, and so will embeds, but this will require some more work.