Hello,
I’ve been playing around with the selectionbox in both plotly Python and plotly.js, and I’ve noticed that in both, when adding a selection to a figure (with fig.add_selection(...)
in python, and with Plotly.relayout(fig, {'selections':[...]})
in plotly.js), the selectbox appears inactive, and it’s only editable when clicking on it.
My issue is that I want to have the selection appear active when I add it to the figure (preferrably in plotly.js, since I’m working on some clientside callbacks in my dash application).
This is my current (relevant) code:
Plotly.relayout(
fig,
{
'selections': [
{
"xref": "x",
"yref": "y",
"line": {
"width": 1,
"dash": "dot"
},
"type": "rect",
"x0": xrange[0],
"x1": xrange[1],
"y0": yrange[0],
"y1": yrange[1]
}
]
}
);
I have tried looking into the differences in the _fullLayout and the layout of the figure between active and non-active selectionbox, but all I could find was a key-value pair_activeSelectionIndex' : 0
in the _fullLayout. I’ve tried to include in the Plotly.relayout, but it didnt work.
Any ideas would be really useful, thank you in advance.