Kanaries / pygwalker

PyGWalker: Turn your pandas dataframe into an interactive UI for visual analysis
https://kanaries.net/pygwalker
Apache License 2.0
11.08k stars 570 forks source link

[DEV-759] [BUG] pygwalker visualization size not rendered correctly in streamlit app #479

Open ObservedObserver opened 5 months ago

ObservedObserver commented 5 months ago

Original bug report: https://toriaezuugoku.com/pygwalker-2/

Windows10 streamlit==1.27.0 pygwalker==0.4.7

It seems pygwalker does not rendered with correct size so the charts in the article only shows legend parts.

image

related code with bug

https://github.com/Kanaries/pygwalker/blob/ac6c12dbadf85ac03e4e36e35c130351be3689fa/pygwalker/api/streamlit.py#L223

DEV-759

longxiaofei commented 5 months ago

This is because when the size of graphic-walker is auto, pygwalker does not correctly give the streamlit iframe a correct width and height.

chart_size_config["mode"] = "fixed"

The above code is for pygwalker to render the graphic-walker chart according to the width and height passed in by the user.

ObservedObserver commented 5 months ago

Progress update:

Identified problems,

  1. pygwalker changed users's size mode settings which it shouldn't
  2. pygwalker for now does not implement streamlit components in a offical way, which make it a liitle bit hard to set the iframe container size correctly.

Actions: