-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
st_echarts are not visualized in multitabs #43
Comments
+1 on this issue, we are seeing this too. @Nemecsek did you ever find a workaround? Thank you! |
No, I didn't. I rewrote the app as a single page, as a temporary solution. |
Hi, you should be able to solve this issue by simply adding:
at the beginning of your main script. Just keep in mind that this will be affecting to all the iframes in your streamlit app. But in the case your are describing shouldn't be a problem |
@jesusprieto-tomtom ...and how it fixes the issue. I have the same problem and it resolved the disappearing eCharts gauge. However, I have a lottie animation right above my eChart that has a height of only 120px and that ends up making that space out too much. Trying to understand this so I might be able to make both work. Thanks in advance. |
It forces a height of 300px to all iframe components in the page, because clicking the tab does not apparently refresh the height of the component 😢 (you can check out https://www.youtube.com/watch?v=SLyS0v8br20 and the ending of https://www.youtube.com/watch?v=OVgPJEMDkak for more details on the CSS selection) @chamath5334 In the meantime use: st.markdown(""" <style>iframe[title="streamlit_echarts.st_echarts"]{ height: 300px !important } """, unsafe_allow_html=True) to only target iframes that contain st_echarts, and not lottie animations. And if you need finer heights per echarts, for now you'll need to do custom css selection (from the videos above). I think I know how to fix this but I'm low on time right now, I'm thinking
Thanks @jesusprieto-tomtom for the initial idea |
@andfanilo Thank you! I take it this is a Streamlit issue since -- 'clicking the tab does not apparently refresh the height of the component'. I opened it up as such and it was closed showing that I should open it as an eCharts and Lottie issue. @andfanilo is there a way to target echarts more specifically, to a tab? or even create an ID for specific ones and then target those instead of depending on generated tags? |
I use sac.tabs in my custom components streamlit-antd-components instand of st.tabs. |
Note: published on Stackoverflow
I want a 4-tab page in Streamlit: 2 echarts + 2 plotly.
Why is any echart plot (but the first) not visualized, while plotly's ones are ok?
(The real app needs a Sankey with special features that only Echarts can provide, so using another library (after extensive research) is not feasible: as in this stripped down example, only the first Sankey is visualised, not the next ones, as echarts "forgets" to refresh the visualisation after switching the tab)
The text was updated successfully, but these errors were encountered: