Redash: Images embedded on dashboards don't scale to the widget size

Created on 17 Jan 2019  路  8Comments  路  Source: getredash/redash

Issue Summary

Images embedded in a dashboard maintain their aspect ratio and DPI from the source file. The displayed image remains the same size even when I resize the dashboard widget.

Steps to Reproduce

  1. Embed this image in a dashboard
  2. Notice how on smaller sized widgets (less than 400px) the image is chopped off

I expect that the image should be auto-scaled down to fit the widget. I'd like to include my company logo on our dashboards but our standard available assets are way too big for dashboards.

Technical details:

  • Redash Version: current Saas version
  • Browser/OS: Chrome & Firefox
    screen shot 2019-01-17 at 07 16 04
Bug Frontend help wanted

All 8 comments

One way to go about this is to let image dimensions be set with non-standard markdown syntax.
I'm unaware of an npm package that allows this, but if found it's an easy fix.

How about max-width: 100% for #markdown img for now?

How about max-width: 100% for #markdown img for now?

I like it. @gabrieldutra @kravets-levko any input on this?

I like it. @gabrieldutra @kravets-levko any input on this?

LGTM, the resulting behavior is pretty much what I expected :slightly_smiling_face:

I don't think we should change Markdown syntax, the max-width solution should be good enough for now. In the future we will probably switch over to a different parser, which will allow safe HTML. Then people can customize this with an <img> tag.

max-width: 100% is not enough. We also need height: auto

max-width: 100% is not enough. We also need height: auto

@gpakosz height: auto is supposed to be the default browser behavior, can you provide more details on which browser and version it fails? If possible you can try to reproduce it in our preview instance to make sure the latest master branch is tested.

Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

susodapop picture susodapop  路  3Comments

brylie picture brylie  路  3Comments

arikfr picture arikfr  路  4Comments

Leedorado picture Leedorado  路  3Comments

GitSumito picture GitSumito  路  3Comments