facebookresearch / hiplot

HiPlot makes understanding high dimensional data easy
https://facebookresearch.github.io/hiplot/
MIT License
2.74k stars 139 forks source link

Hiplot doesn't resize in streamlit web app #221

Closed Emmanuelpean closed 2 years ago

Emmanuelpean commented 2 years ago

For example, when viewing the distribution of a certain column, the Hiplot "frame" does not resize and some of it is hidden. The only way to force the frame to update is to slice data by clicking on one of the columns.

import streamlit as st
import hiplot as hip

data = [{'uid': 'a', 'dropout<sub>3</sub>': 0.1, 'lr': 0.001, 'loss': 10.0, 'optimizer': 'SGD'},
        {'uid': 'b', 'dropout<sub>3</sub>': 0.15, 'lr': 0.01, 'loss': 3.5, 'optimizer': 'Adam'},
        {'uid': 'c', 'dropout<sub>3</sub>': 0.3, 'lr': 0.1, 'loss': 4.5, 'optimizer': 'Adam'}]
xp = hip.Experiment.from_iterable(data)

ret_val = xp.to_streamlit(ret="selected_uids", key="hip").display()
danthe3rd commented 2 years ago

Hi @Emmanuelpean and thanks for the report. Can you attach a screenshot (+ steps to reproduce) to explain what is happening? I'm not sure if I understand correctly.

Emmanuelpean commented 2 years ago

I've made a quick video to explain the problem. Hope that helps. https://user-images.githubusercontent.com/56644205/139914958-210e303c-fcbc-4b48-9738-05b045adbee6.mov

danthe3rd commented 2 years ago

ooh right I see what you mean! I'll take a look when I have some time

Emmanuelpean commented 2 years ago

Thanks for the fix. It looks like that changing the number of rows/entries displayed does not update the streamlit layout as well.