rusackas commented on code in PR #43906:
URL: https://github.com/apache/superset/pull/43906#discussion_r3949799904
##########
docs/docs/using-superset/embedding.mdx:
##########
@@ -139,6 +139,27 @@ The following URL parameters can be passed through the
`urlParams` option in `da
---
+## Embedding a Single Chart
+
+Individual charts can also be embedded standalone, outside of a dashboard,
using a chart permalink. From Explore, generate a permalink for the chart, then
append URL parameters to it:
+
+```
+/explore/p/<permalink-key>/?standalone=1&show_download=1
+```
+
+| Parameter | Values | Effect
|
+| --------------- | -------- |
-------------------------------------------------------------------------- |
+| `standalone` | `0`, `1` | `0`: normal Explore view; `1`: hide the Explore
header and controls |
+| `show_download` | `0`, `1` | Show a compact download control (CSV, JSON,
Excel) on the standalone chart |
+
+`show_download` is opt-in and has no effect outside of `standalone=1`. The
download control still respects the viewer's export permissions — it's hidden
for users who lack them even when the parameter is set. With the
`GRANULAR_EXPORT_CONTROLS` feature flag enabled, this requires the
`can_export_data` permission on `Superset`; otherwise it falls back to
`can_csv` on `Superset`.
+
+Explore's **Embed Code** button on a chart also generates one of these
permalink URLs wrapped in an `<iframe>`, giving you a session-authenticated
iframe embed. That's a separate flow from dashboard embedding above: it doesn't
go through `@superset-ui/embedded-sdk`, guest tokens, or the
`dashboardUiConfig` options — the viewer just needs an existing Superset
session with access to the chart.
Review Comment:
Confirmed — the permalink route requires `can read on Explore` via
`has_access`/`permission_name("read")` on the `Explore` class, separate from
dashboard-chart access. Noted that explicitly.
##########
docs/docs/using-superset/embedding.mdx:
##########
@@ -139,6 +139,27 @@ The following URL parameters can be passed through the
`urlParams` option in `da
---
+## Embedding a Single Chart
+
+Individual charts can also be embedded standalone, outside of a dashboard,
using a chart permalink. From Explore, generate a permalink for the chart, then
append URL parameters to it:
+
+```
+/explore/p/<permalink-key>/?standalone=1&show_download=1
+```
+
+| Parameter | Values | Effect
|
+| --------------- | -------- |
-------------------------------------------------------------------------- |
+| `standalone` | `0`, `1` | `0`: normal Explore view; `1`: hide the Explore
header and controls |
+| `show_download` | `0`, `1` | Show a compact download control (CSV, JSON,
Excel) on the standalone chart |
+
+`show_download` is opt-in and has no effect outside of `standalone=1`. The
download control still respects the viewer's export permissions — it's hidden
for users who lack them even when the parameter is set. With the
`GRANULAR_EXPORT_CONTROLS` feature flag enabled, this requires the
`can_export_data` permission on `Superset`; otherwise it falls back to
`can_csv` on `Superset`.
+
+Explore's **Embed Code** button on a chart also generates one of these
permalink URLs wrapped in an `<iframe>`, giving you a session-authenticated
iframe embed. That's a separate flow from dashboard embedding above: it doesn't
go through `@superset-ui/embedded-sdk`, guest tokens, or the
`dashboardUiConfig` options — the viewer just needs an existing Superset
session with access to the chart.
+
+One caveat when the host page lives on a different site than Superset: the
default `SESSION_COOKIE_SAMESITE = "Lax"` setting keeps the session cookie out
of cross-site iframe requests, so the viewer lands on the login page instead of
the chart. Serving both from the same site avoids this; otherwise set
`SESSION_COOKIE_SAMESITE = "None"` together with `SESSION_COOKIE_SECURE = True`
and allow the host origin in your `TALISMAN_CONFIG` `frame-ancestors`.
Review Comment:
Fair — third-party cookie blocking (Safari included) can still land the
viewer on the login page even with SameSite=None configured. Added a note
pointing to same-site hosting or the guest-token SDK flow as the alternative.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]