Avaiga / taipy-gui

Graphical User Interface generator for Taipy
Apache License 2.0
60 stars 18 forks source link

Need to set height and width of `iframe` with `on_user_content()` #784

Closed Dr-Irv closed 1 year ago

Dr-Irv commented 1 year ago

Description

Trying to use the new on_user_content() feature as described here: https://github.com/Avaiga/taipy-gui/issues/669#issuecomment-1476339616

The problem here is that the iframe that the content is set inside has a default height and width that I want to override. In the example that I showed, I used html_string = f'<iframe src="/{filename}" height="{height}" width="100%" style="border:none;" scrolling="no"></iframe>' . I need to be able to set the height and width (and other properties as well, ideally)

@FredLL-Avaiga as implemented, the feature isn't that useful because we need control over the size of the generated iframe !!

FredLL-Avaiga commented 1 year ago

We came across that same problem today :-( The workaround is to use css for now. But we'll add something about that!

On Fri, Jun 9, 2023, 21:40 Irv Lustig @.***> wrote:

  • Taipy version: 2.2
  • Python version: 3.10
  • Operating System: Windows

Description

Trying to use the new on_user_content() feature as described here: #669 (comment) https://github.com/Avaiga/taipy-gui/issues/669#issuecomment-1476339616

The problem here is that the iframe that the content is set inside has a default height and width that I want to override. In the example that I showed, I used html_string = f'<iframe src="/{filename}" height="{height}" width="100%" style="border:none;" scrolling="no">' . I need to be able to set the height and width (and other properties as well, ideally)

@FredLL-Avaiga https://github.com/FredLL-Avaiga as implemented, the feature isn't that useful because we need control over the size of the generated iframe !!

— Reply to this email directly, view it on GitHub https://github.com/Avaiga/taipy-gui/issues/784, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVQBA5BSA4CO4B3LSQZ4Z4LXKN34JANCNFSM6AAAAAAZBBLSFY . You are receiving this because you were mentioned.Message ID: @.***>

Dr-Irv commented 1 year ago

I hope the CSS workaround can be dynamic, i.e., where the height of the iframe is based on the embedded content.

What I am doing now is embedding a plotly timeline, and setting the height of the plot based on the number of "rows" of the Gantt chart. Then I can use that value to get the height of the iframe .

FredLL-Avaiga commented 1 year ago

Sadly it won't be be (css dynamic) But we might be able to include a dynamic height property to the part while setting the iframe's width and height to 100% in the upcoming 2.3 release...

On Fri, Jun 9, 2023, 22:00 Irv Lustig @.***> wrote:

I hope the CSS workaround can be dynamic, i.e., where the height of the iframe is based on the embedded content.

What I am doing now is embedding a plotly timeline, and setting the height of the plot based on the number of "rows" of the Gantt chart. Then I can use that value to get the height of the iframe .

— Reply to this email directly, view it on GitHub https://github.com/Avaiga/taipy-gui/issues/784#issuecomment-1585067100, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVQBA5CH73HDEZ7H3XHPQFTXKN6EDANCNFSM6AAAAAAZBBLSFY . You are receiving this because you were mentioned.Message ID: @.***>

FredLL-Avaiga commented 1 year ago

cf. #785 https://github.com/Avaiga/taipy-gui/pull/786

FredLL-Avaiga commented 1 year ago

@Dr-Irv This is available in taipy-gui dev release 2.3.0.dev5 https://pypi.org/project/taipy-gui/#history

Dr-Irv commented 1 year ago

Thanks. I installed that and now my Gantt chart displays.