Kanaries / pygwalker

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

[Question]How to set width & height parameter when you use pygwalker on flask app? #348

Closed relakuman closed 9 months ago

relakuman commented 9 months ago

hello.I use pygwalker on flask app. but display size is a little big, so I would like to resize it. Though I tried width & height parameter to pyg.walk function, it didn't work. Is there any way to resize it?

Code) df = pd.read_sql(sql,engine)

# Get Pygwalker as html
html_str = pyg.walk(df, return_html=True, show_cloud_tool=False, dark='dark', width=800,height=400,scrolling=True)

return templates.TemplateResponse("pygwalker.html",{"request": request, "html_str": html_str})
longxiaofei commented 9 months ago

try it, in your template file: pygwalker.html.

<div style="width: 1000px; height: 900px; overflow-y: auto;">
{{ html_str }}
</div>
relakuman commented 9 months ago

Thank you, pygwalker was displayed at the specified size in html file. Additionally, Is it possible to specify size to pygwalker directly (to avoid displaying scrollbar)?

longxiaofei commented 9 months ago

The height of graphic-walker is fixed, so if the parent container height is too small, scroll bars will inevitably appear, otherwise graphic-walker cannot be used completely.

relakuman commented 9 months ago

I understood. thank you!