Is there a way to highlight all points with attribute on click?
I am working within a Streamlit framework, so Dash solutions won't work.
Similar to this post: Highlight all values from a group on hover
In the below, example, I'm looking to highlight all items from the same group
after clicking.
import pandas as pd
import plotly.express as px
df = pd.DataFrame(dict(
x=[4, 5, 1, 3, 2, 2],
y=[3, 1, 7, 9, 8, 3],
group=[0, 0, 0, 1, 1, 1],
value=[1, 2, 3, 4, 5, 6],
hover=['s1', 's2', 's3', 's4', 's5', 's6']
))
fig = px.scatter(
df,
y='y',
x='x',
color='group',
hover_name='hover',
)
fig.show()