pygwalker icon indicating copy to clipboard operation
pygwalker copied to clipboard

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

Open ObservedObserver opened this issue 11 months ago • 2 comments

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

ObservedObserver avatar Mar 13 '24 11:03 ObservedObserver

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.

longxiaofei avatar Mar 13 '24 14:03 longxiaofei

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:

  • [ ] Formally refactor pygwalker in streamlit api to the recommended implementation.

ObservedObserver avatar Mar 15 '24 11:03 ObservedObserver