superset icon indicating copy to clipboard operation
superset copied to clipboard

[SIP-145] Proposal for Embeddable Charts using the same mechanism as #17187

Open jayakrishnankk opened this issue 1 year ago • 6 comments

SIP-145 Proposal for Embeddable Charts using the same mechanism as #17187

Motivation

The existing method of embedding charts is using iframe method. What this means is that the user have to be logged-in in parallel to the superset system for the chart to display without a login screen in the embedded mode.

Similar to embedding dashboards as outlined in SIP-75, superset dashboard developers would like to embed charts in a similar fashion so that the login page does not appear and a parallel login is not needed by the end user, avoiding the user to have an account created in superset to view the charts.

Proposed Change

This SIP is aimed to implement the Embedded Charts capability using the same GuestToken method that the Embeddable Dashboards are using.

New or Changed Public Interfaces

Added REST endpoints

GET    {host}/api/v1/chart/{pk}/embedded
POST   {host}/api/v1/chart/{pk}/embedded
DELETE {host}/api/v1/chart/{pk}/embedded

Added Views

In addition to existing view {host}/embedded/{uuid}, added the following

{host}/embedded/dashboard/{uuid} 
{host}/embedded/chart/{uuid}

NOTE: {host}/embedded/dashboard/{uuid} works the same way as {host}/embedded/{uuid}, which should be deprecated and removed in one of the subsequent versions.

New dependencies

None

Migration Plan and Compatibility

Needs a migration. Please see the attached merge request to see the migration details. A new table called embedded_charts will be added and a foreign key reference will be made to the slices table.

Rejected Alternatives

Did not discuss alternate approaches

jayakrishnankk avatar Aug 30 '24 20:08 jayakrishnankk

Is this done

Michila0 avatar Sep 06 '24 12:09 Michila0

Is this done

Not even close... the proposal has been numbered, but has not yet been put up for a discussion on the ASF list, which then would lead to a vote, which then would open the door for the work to be completed/merged.

@Michila0 do you have thoughts on the proposal you'd like to add to carry the discussion forward?

rusackas avatar Sep 06 '24 14:09 rusackas

ASF list? I like contribute with you

Michila0 avatar Sep 07 '24 09:09 Michila0

Discussion opened! Feedback welcome, and anyone volunteering to help contribute to this should chime in on the linked PR and/or reach out to @jayakrishnankk on slack or other means.

rusackas avatar Sep 10 '24 23:09 rusackas

I'll open the vote on this, if everyone agrees it's ready.

rusackas avatar Sep 25 '24 16:09 rusackas

I'd like to add here that I think this is a natural progression of SIP-75, and could arguably have been considered being covered by that SIP already. So big thanks @jayakrishnankk for taking this on, this will be very valuable for cases where one wants to only embed a single chart, as opposed to a full dashboard.

villebro avatar Oct 18 '24 19:10 villebro

Hey I just wanted to point out that an easy workaround is to create a single-chart dashboard and embed that, which may not fully cover all the use cases. It's not unlikely that in the future of Superset - once we allow for in-dashboard-chart-creation, that charts wouldn't exist outside the context of a dashboard.

mistercrunch avatar Oct 28 '24 22:10 mistercrunch

Closing and moving this on the SIP board, since the VOTE thread has PASSED! Thanks @jayakrishnankk and thanks in advance for the implementation!

rusackas avatar Nov 06 '24 22:11 rusackas

@jayakrishnankk is this still on your roadmap? I still like the idea :D

rusackas avatar Apr 22 '25 23:04 rusackas

@amaannawab923 thanks for the PR, but it seems to be quite out of date and needs a rebase. Still intending to get that through?

rusackas avatar Dec 03 '25 17:12 rusackas