Long story short, I have a situation where I build the graph again in a callback with the active selected points:
import plotly.graph_objects as go
def horizontal_bar_chart(values, categories, title=None, selected_points=None):
fig = go.Figure(
go.Bar(
x=values,
y=categories,
orientation='h',
selectedpoints=selected_points
)
)
fig.update_layout(
plot_bgcolor="#fff",
paper_bgcolor="#fff",
margin={"t": 30, "b": 0, "r": 20, "l": 0, "pad": 0},
title_text = title,
transition={
'duration': 500,
'easing': 'cubic-in-out'
}
)
fig.update_yaxes(title_text='outcome')
return fig
Now, if I have selected points it will show those points(bars in my case) selected after building the graph, but! it won’t let me double-click to deselect those points.
Is this a bug or am I setting the points wrong?