Is there a way to fill the box/lasso selected area?

I’m using Plotly scatterplot inside R shiny. I tried to use the box/lasso selection tool to select points and fit the selected points to other analyses. However, the selected areas are not so distinct from other points merely by color? Does plotly have the function to fill the selected area with some color and opacity?

I tried to inspect the generated Rshiny HTML, I was able to identify that we need to style the element “select-count”. However, this element only appear after we actually made the selection, which results in that I couldn’t grab the element in the first place.

I solved this problem by using simple CSS. After we run the code and we can inspect the elements of the UI then modify the style of the element. For my case, I can modify the box background color as following:

.js-plotly-plot .plotly .zoomlayer .select-outline-1 {
fill: rgba(255, 255, 0,0.4);
color: rgba(255, 255, 0,0.4);

stroke-width: 1;
}

.js-plotly-plot .plotly .zoomlayer .select-outline-2 {
fill: rgba(255, 255, 0,0.4);
color: rgba(255, 255, 0,0.4);
stroke-width: 1;
}