Black Lives Matter. Please consider donating to Black Girls Code today.

Heatmap select2d/lasso2d ModeBar doesn't work

The select2d and lasso2d modebar buttons don’t show by default on heatmaps, and I’m unable to add them using modeBarButtonsToAdd.

Minimal example: https://codepen.io/ifland/pen/oGoPaK

You can set dragmode to ‘select’, which gives the desired behavior, but if you select any other tools, you can’t get back to the select tool.

Am I using modeBarButtonsToAdd incorrectly, or is this a known behavior?

Yes, lasso/select box is only supported for a limited amount of trace types at the moment.

Sorry for the inconvenience.

It seems strange that the standard buttons wouldn’t be supported when the functionality is present.

For anyone else who finds this, you can add the button in manually with a little extra work: https://codepen.io/ifland/pen/ZXvmQz

Is there a way to implement this in Dash using config?