Custom st.dataframe column with hover interaction

I am very impressed with the Glide Data Grid enabled st.dataframe implementation, and I found the ability to embed inline SVG images in the grid invaluable. However, the appetite of the users has grown since and now they would like hover on those images to work.

I have a great advantage in the sense that I do not actually need real SVG to implement said hover. I can literally write a function that goes from mouse coordinates within the image to additional data I want to display, I can even write canvas code that would render the hover. Think the exact functionality of LineChartColumn, except my visualization is a very customized scatterplot.

I was going to start implementing this by a) forking glide-data-grid b) forking Streamlit… but then I realized that this could have been a part of the base offering. The way it would work is that you would have UserDrawColumn which would take a snippet of javascript that implements a canvas drawing function, which would as an extra parameter get mouse hover X and Y (I believe this is how the glide data grid works internally). This code would be shipped to the browser and simply called from within Streamlit through the grid… this way anyone with some JavaScript knowledge could create absolutely wacky INTERACTIVE columns (you can draw anything using image columns, but you do not get custom interaction). I think it would be extremely powerful.

Is anyone working on this already, or do they have an alternative solution? I can always go to HTML-based tables as opposed to Canvas, but I would prefer not to, as my tables can grow quite large and complex (thousands of rows).

This request is similar to Examples of creating custom st.column_config for st.dataframe? except I also ask for interactivity - imagine the author wanted to highlight the atom the mouse is currently over in their SMILES chart.

At least as far as your request to include this in Streamlit, I recommend heading over to GitHub and writing up a GitHub issue. While our devs do answer questions on the forum, the main place they track interest in features and enhancements is GitHub issues.

I was looking for a direction which way to go for doing something like this. I will give GitHub Issues a shot, worst case it gets cancelled as out of scope. Thank you!

Here is the issue: st.dataframe supports UserDrawnColumn for hover-enabled custom charts · Issue #9598 · streamlit/streamlit · GitHub