It seems to me that this should be possible via either of the following:
- Using Plotly Python + Plotly.js as per Streamlit components - Scatterplot with selection using Plotly.js - DEV Community and How to customize Plotly Tooltip.
- Using Dash as per How to customize the tooltip? - #4 by chriddyp.