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

I have a tree hierarchy graph made in d3.js ( ) which i am using with streamlit as shown in this example.

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


1 Like