dosubot[bot] commented on issue #30374:
URL: https://github.com/apache/superset/issues/30374#issuecomment-2371243883
<!-- Answer -->
To display the applied filters on embedded dashboard charts using the
`@superset-ui/embedded-sdk` package without showing the chart controls, you can
adjust the `dashboardUiConfig` parameter. Specifically, set `filters.visible`
to `true` while keeping `hideChartControls` set to `true`.
Here is the updated code:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Superset Embedding POC</title>
<style>
iframe {
width: 100%;
height: 100%;
border: none;
}
</style>
<script src="https://unpkg.com/@superset-ui/embedded-sdk"></script>
</head>
<body>
<div style="width: 100%; height: 800px;" id="my-superset-container"></div>
<script>
const dashboardConfig = {
hideTab: true,
hideTitle: true,
hideChartControls: true,
filters: {
visible: true, // Set this to true to display applied filters
expanded: false,
}
};
supersetEmbeddedSdk.embedDashboard({
id: 'embedded-id',
supersetDomain: 'domain',
mountPoint: document.getElementById("my-superset-container"),
fetchGuestToken: () => 'guest-token',
dashboardUiConfig: dashboardConfig,
});
</script>
</body>
</html>
```
This configuration ensures that the applied filters are visible on the
embedded dashboard charts without showing the chart controls
<sup>[[1]](https://github.com/apache/superset/blob/master/superset-frontend/src/dashboard/components/FiltersBadge/index.tsx)</sup><sup>[[2]](https://github.com/apache/superset/blob/master/superset-embedded-sdk/src/index.ts)</sup>.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
--
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]