Streamlit Sidebar collapse expand event interfering with custom D3.js visual

I have a tree hierarchy graph made in d3.js ( https://codepen.io/bumbeishvili/pen/arpJrv ) which i am using with streamlit as shown in this example. https://github.com/andfanilo/streamlit-d3-demo

when i collapse streamlit sidebar, All nodes of graph collapse.

Its like graph is resetting. which shouldn’t happen.

I think some generic event of collapse is being called when i try to collapse sidebar which also disrupts my graph.

I tried using event listener breakpoints to identify the called event but chrome hangs every time. Also minified version isn’t making much sense to me

Thanks.

1 Like