You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "NeBene (via GitHub)" <gi...@apache.org> on 2025/11/20 12:01:25 UTC

[I] Embedded Dashboard ignores spacing between charts [superset]

NeBene opened a new issue, #36204:
URL: https://github.com/apache/superset/issues/36204

   ### Bug description
   
   I have embedded the Sales Dashboard Demo in a test angular application using the superset embedded sdk. The embedded Dashboard is not showing me the same spacing as the original Dashboard.
   
   Original: Has spacing between all charts
   
   <img width="2558" height="1140" alt="Image" src="https://github.com/user-attachments/assets/d5bf5d69-b909-49f4-82f2-a7e64590af49" />
   
   Embedded: No Spacing between charts and unnecessary horizontal scrollbar:
   
   <img width="1944" height="1084" alt="Image" src="https://github.com/user-attachments/assets/b26a27f0-47bc-4ccb-b7cd-8167681b53b8" />
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   master / latest-dev
   
   ### Python version
   
   I don't know
   
   ### Node version
   
   16
   
   ### Browser
   
   Firefox
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
   - [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
   - [ ] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.


-- 
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: notifications-unsubscribe@superset.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Embedded Dashboard ignores spacing between charts [superset]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #36204:
URL: https://github.com/apache/superset/issues/36204#issuecomment-3600945189

   <!-- Answer -->
   You're exactly right—the missing `.ant-layout` wrapper and its `box-sizing: border-box` style in the embedded dashboard is the root cause of the spacing issue. This global style ensures consistent sizing and padding for charts in the main app, but it's absent in the iframe embed, leading to the layout discrepancies you described. Injecting a CSS rule like:
   
   ```css
   .dashboard-component-chart-holder {
     width: 100%;
     box-sizing: border-box;
   }
   ```
   
   into the embedded dashboard context restores the expected spacing and makes the embedded view visually match the original [source](https://github.com/apache/superset/issues/35900).
   
   For iframe-based embedding (using the official SDK), this CSS injection is the most effective workaround. If you're embedding via direct DOM injection (not using an iframe), recent changes added a scoped stylesheet (`embed-overrides.less`) under a `.superset-embed` wrapper to restore grid spacing without affecting standard dashboards [source](https://github.com/apache/superset/pull/36229).
   
   Theming support for embedded dashboards is improving—Superset 6.0 will let you customize appearance more robustly, and the SDK now supports dynamic theme configuration via `setThemeConfig`, though this doesn't directly fix grid spacing [source](https://github.com/apache/superset/pull/34273).
   
   If you need technical details about where layout and theming are handled in Superset, let me know!
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/daf4d5b1-1bea-45c2-9fd9-5bcd08aa9fa2?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/daf4d5b1-1bea-45c2-9fd9-5bcd08aa9fa2?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/daf4d5b1-1bea-45c2-9fd9-5bcd08aa9fa2?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/daf4d5b1-1bea-45c2-9fd9-5bcd08aa9fa2?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/daf4d5b1-1bea-45c2-9fd9-5bcd08aa9fa2?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/daf4d5b1-1bea-45c2-9fd9-5bcd08aa9fa2?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/daf4d5b1-1bea-45c2-9fd9-5bcd08aa9fa2?feedback_type=other)</sup>
   
   [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=You%27re%20exactly%20right%E2%80%94the%20missing%20%60.ant-layout%60%20wrapper%20and%20its%20%60box-sizing%3A%20border-box%60%20style%20in%20the%20embedded%20dashboard%20is%20the%20root%20cause%20of%20the%20spacing%20issue.%20This%20global%20style%20ensures%20consistent%20sizing%20and%20padding%20for%20charts%20in%20the%20main%20app%2C%20but%20it%27s%20absent%20in%20the%20iframe%20embed%2C%20leading%20to%20the%20layout%20discrepancies%20you%20described.%20Injecting%20a%20CSS%20rule%20like%3A%0A%0A%60%60%60css%0A.dashboard-component-chart-holder%20%7B%0A%20%20width%3A%20100%25%3B%0A%20%20box-sizing%3A%20border-box%3B%0A%7D%0A%60%60%60%0A%0Ainto%20the%20embedded%20dashboard%20context%20restores%20the%20expected%20spacing%20and%20makes%20the%20embedde
 d%20view%20visually%20match%20the%20original%20%5Bsource%5D%28https%3A//github.com/apache/superset/issues/35900%29.%0A%0AFor%20iframe-based%20embedding%20%28using%20the%20official%20SDK%29%2C%20this%20CSS%20injection%20is%20the%20most%20effective%20workaround.%20If%20you%27re%20embedding%20via%20direct%20DOM%20injection%20%28not%20using%20an%20iframe%29%2C%20recent%20changes%20added%20a%20scoped%20stylesheet%20%28%60embed-overrides.less%60%29%20under%20a%20%60.superset-embed%60%20wrapper%20to%20restore%20grid%20spacing%20without%20affecting%20standard%20dashboards%20%5Bsource%5D%28https%3A//github.com/apache/superset/pull/36229%29.%0A%0ATheming%20support%20for%20embedded%20dashboards%20is%20improving%E2%80%94Superset%206.0%20will%20let%20you%20customize%20appearance%20more%20robustly%2C%20and%20the%20SDK%20now%20supports%20dynamic%20theme%20configuration%20via%20%60setThemeConfig%60%2C%20though%20this%20doesn%27t%20directly%20fix%20grid%20spacing%20%5Bsource%5D%28https%3A//github.co
 m/apache/superset/pull/34273%29.%0A%0AIf%20you%20need%20technical%20details%20about%20where%20layout%20and%20theming%20are%20handled%20in%20Superset%2C%20let%20me%20know%21)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/36204)


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Embedded Dashboard ignores spacing between charts [superset]

Posted by "chmelevskij (via GitHub)" <gi...@apache.org>.
chmelevskij commented on issue #36204:
URL: https://github.com/apache/superset/issues/36204#issuecomment-3611562935

   As a workaround for those with the issue, it's possible to fix it with css templates. Adding something like:
   ```css
   *,
   *::before,
   *::after {
     box-sizing: border-box;
   }
   ```
   
   will give the same look like main dashboard.


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Embedded Dashboard ignores spacing between charts [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #36204:
URL: https://github.com/apache/superset/issues/36204#issuecomment-3572097471

   Do you have any custom CSS happening anywhere here? It seems like you might based on the space I _do_ see around the markdown component, and there's a difference at the bottom of the filter bar too. 


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Embedded Dashboard ignores spacing between charts [superset]

Posted by "wlopez-enkoding (via GitHub)" <gi...@apache.org>.
wlopez-enkoding commented on issue #36204:
URL: https://github.com/apache/superset/issues/36204#issuecomment-4217154493

   > *,
   > *::before,
   > *::after {
   >   box-sizing: border-box;
   > }
   
   I love you so bad !


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Embedded Dashboard ignores spacing between charts [superset]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #36204:
URL: https://github.com/apache/superset/issues/36204#issuecomment-3557667481

   <!-- Greeting -->
   Hi @NeBene! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the superset team.
   
   <!-- Answer -->
   This is a known issue: embedded dashboards sometimes lose spacing between charts because the embedded iframe doesn't include some of the global styles (like the top-level `ant-layout` class and its `box-sizing: border-box` style) that the main Superset app uses. This affects how charts and components are rendered inside the iframe, leading to the layout problems you described.
   
   A common workaround is to inject the following CSS into the embedded dashboard context to restore proper spacing:
   
   ```css
   .dashboard-component-chart-holder {
     width: 100%;
     box-sizing: border-box;
   }
   ```
   
   You can inject this CSS dynamically (for example, using a postMessage handler or by customizing your Superset instance to append styles to the iframe). Also, make sure your iframe and its parent container match the native dashboard's dimensions and don't have conflicting CSS constraints, which can help avoid unnecessary scrollbars. More details and discussion are available in this related issue: [source](https://github.com/apache/superset/issues/35900).
   
   Currently, there are no official configuration options in the embedded SDK to control layout or spacing between charts, but systemic theming support is under development for future releases. If you want to further customize the look, you can use the `setThemeConfig` API in the embedded SDK to tweak theme tokens, but this won't directly address the spacing issue unless you specifically target the affected classes.
   
   If you continue to see issues, check for browser console errors and try in other browsers to rule out browser-specific quirks.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/ec16cc1f-555d-4a61-8021-29e033336a64?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/ec16cc1f-555d-4a61-8021-29e033336a64?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/ec16cc1f-555d-4a61-8021-29e033336a64?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/ec16cc1f-555d-4a61-8021-29e033336a64?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/ec16cc1f-555d-4a61-8021-29e033336a64?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/ec16cc1f-555d-4a61-8021-29e033336a64?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/ec16cc1f-555d-4a61-8021-29e033336a64?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu
 b)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/36204)


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Embedded Dashboard ignores spacing between charts [superset]

Posted by "SatyamKumarCS (via GitHub)" <gi...@apache.org>.
SatyamKumarCS commented on issue #36204:
URL: https://github.com/apache/superset/issues/36204#issuecomment-3558664598

   Hi! I’d like to work on this issue.
   I’ve reviewed the details and can help reproduce the spacing bug and work on a fix for the embedded dashboard layout.
   If no one is actively working on it, please consider this assigned to me — I’ll start investigating and submit a PR.


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Embedded Dashboard ignores spacing between charts [superset]

Posted by "chmelevskij (via GitHub)" <gi...@apache.org>.
chmelevskij commented on issue #36204:
URL: https://github.com/apache/superset/issues/36204#issuecomment-3600938619

   Hi all, so this seems to be the same issue as https://github.com/apache/superset/issues/35900 and @dosubot is right about the problem.
   
   Mainly there is following styles applied in the main app.
   
   <img width="502" height="78" alt="Image" src="https://github.com/user-attachments/assets/808f59f4-cf14-43b2-ba82-5a4873078a51" />
   
   but in the embedded dashboard there is not `.ant-layout` wrapper which would have this classname causing the issue.


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Embedded Dashboard ignores spacing between charts [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #36204:
URL: https://github.com/apache/superset/issues/36204#issuecomment-4456285943

   Fixed on master in #38351 (merged 2026-03-12) — same `*, *::before, *::after { box-sizing: border-box }` reset that several folks were using as a CSS-template workaround, but baked into the embedded route via a `<Global>` style. Will ship in the next release.
   
   Closing as resolved — please reopen if you're still seeing this on a build that includes #38351.


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Embedded Dashboard ignores spacing between charts [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #36204: Embedded Dashboard ignores spacing between charts
URL: https://github.com/apache/superset/issues/36204


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org