Hello, your componet is wonderfull.
But i have an issue.
I'm trying to get DPI from a Streamlit app to scale my plotly images.
In streamlit code I add custom element with fixed size 1x1 inch:
dpi = '<div id="dpi" style="height: 1in;left: -100%;position: absolute;top: -100%;width: 1in;;"></div>'st.markdown(dpi, unsafe_allow_html=True)
I then try to get the width/height of the element using your component.
js_code = """document.getElementById("dpi").offsetHeight"""height = st_javascript(js_code)
And have exception
TypeError: Cannot read properties of null (reading 'offsetHeight')
But in console I can get elemnt parameters with eval()
st_javascript does not see the created element at the time of the call
Hello, your componet is wonderfull. But i have an issue. I'm trying to get DPI from a Streamlit app to scale my plotly images. In streamlit code I add custom element with fixed size 1x1 inch:
dpi = '<div id="dpi" style="height: 1in;left: -100%;position: absolute;top: -100%;width: 1in;;"></div>'
st.markdown(dpi, unsafe_allow_html=True)
I then try to get the width/height of the element using your component.js_code = """document.getElementById("dpi").offsetHeight"""
height = st_javascript(js_code)
And have exceptionTypeError: Cannot read properties of null (reading 'offsetHeight')
But in console I can get elemnt parameters with eval() st_javascript does not see the created element at the time of the call