superset icon indicating copy to clipboard operation
superset copied to clipboard

Iframe embedding misaligned

Open darabos opened this issue 10 years ago • 5 comments

Make sure these boxes are checked before submitting your issue - thank you!

  • [x] I have checked the superset logs for python stacktraces and included it here as text if any
  • [x] I have reproduced the issue with at least the latest released version of superset
  • [x] I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

0.13.2 from https://hub.docker.com/r/amancevice/superset/

Expected results

Charts show up nicely in iframes.

Actual results

Charts are displayed too low or too big, and as a result half of them falls below the bottom of the iframe.

superset-embedding

Steps to reproduce

Load example data. Explore the charts on the World Bank dashboard. Copy the embedding links. Resulting HTML:

<html>
  <body style="background: salmon">

    <iframe src="http://localhost:8088/superset/explore/table/2/?metric=sum__SP_POP_TOTL&add_to_dash=false&flt_col_0=&until=2011-01-01&datasource_id=2&datasource_name=wb_health_population&force=false&since=2011-01-01&groupby=region&groupby=country_name&having=&granularity_sqla=year&slice_name=Rural+Breakdown&time_grain_sqla=Time+Column&new_slice_name=&datasource_type=table&rdo_save=overwrite&flt_eq_0=&secondary_metric=sum__SP_RUR_TOTL&save_to_dashboard_id=&standalone=true&previous_viz_type=sunburst&flt_op_0=in&goto_dash=false&viz_type=sunburst&collapsed_fieldsets=&new_dashboard_name=&userid=1&row_limit=5000&where="
            width="600"
            height="400"
            seamless frameBorder="0" scrolling="no">
    </iframe>

    <iframe src="http://localhost:8088/superset/explore/table/2/?metric=sum__SP_RUR_TOTL_ZS&show_bubbles=y&show_bubbles=false&add_to_dash=false&flt_col_0=&until=2014-01-02&country_fieldtype=cca3&datasource_id=2&datasource_name=wb_health_population&force=false&since=2014-01-01&having=&granularity_sqla=year&goto_dash=false&time_grain_sqla=Time+Column&new_slice_name=&datasource_type=table&rdo_save=overwrite&flt_eq_0=&secondary_metric=sum__SP_POP_TOTL&save_to_dashboard_id=&standalone=true&previous_viz_type=world_map&flt_op_0=in&entity=country_code&viz_type=world_map&slice_name=%25+Rural&collapsed_fieldsets=&new_dashboard_name=&userid=1&max_bubble_size=25&where="
            width="600"
            height="400"
            seamless frameBorder="0" scrolling="no">
    </iframe>

  </body>
</html>

darabos avatar Nov 17 '16 16:11 darabos

I tried with &V2=true and got the same result.

darabos avatar Nov 17 '16 16:11 darabos

When I am using the slice iframes in webpage, it asks me to login. Can i somehow bypass the login ?

Sarrae1406 avatar Jan 03 '17 10:01 Sarrae1406

there's a hidden height querystring param you can pass to the explore view as in http://localhost:8088/superset/explore/table/2/?metric=sum__SP_RUR_TOTL_ZS&show_bubbles=y&show_bubbles=false&add_to_dash=false&flt_col_0=&until=2014-01-02&country_fieldtype=cca3&datasource_id=2&datasource_name=wb_health_population&force=false&since=2014-01-01&having=&granularity_sqla=year&goto_dash=false&time_grain_sqla=Time+Column&new_slice_name=&datasource_type=table&rdo_save=overwrite&flt_eq_0=&secondary_metric=sum__SP_POP_TOTL&save_to_dashboard_id=&standalone=true&previous_viz_type=world_map&flt_op_0=in&entity=country_code&viz_type=world_map&slice_name=%25+Rural&collapsed_fieldsets=&new_dashboard_name=&userid=1&max_bubble_size=25&where=&heigh=300, notice the &height=300

The height prop of your iframe should match the querystring's height parameter

mistercrunch avatar Jan 04 '17 18:01 mistercrunch

here's a fix: https://github.com/airbnb/superset/pull/1898

mistercrunch avatar Jan 04 '17 18:01 mistercrunch

This works in a browser window.But login required in Iframe.How to bypass login?

rojan507 avatar Dec 04 '18 16:12 rojan507