Skip to content

Feature Request: It is not possible to disable default click/doubleclick behavior for legends #52

@Schmaga

Description

@Schmaga

From the official plotly documentation and when using simple JavaScript, it is possible to do something like this to disable the default behavior for legend clicking:
myPlot.on('plotly_legendclick', function(data){ return false; });

After looking into your code, the angular wrapper seems to simply register a corresponding EventEmitter for every plot event and does not provide a way to disable those events at all. It would be nice to be able to disable the legend click or double-click behavior. Maybe it is possible to build a property like [disableLegendClick] and [disableLegendDoubleClick] or something? Or transfer the 'return false' approach to the Angular wrapper, if technically possible.

My next approach would be to somehow get the underlying plotly div from the template through whatever means and manually overwrite the two events. But I am not sure which side-effects that might have and it also somehow defeats the purpose of the wrapper by working around it.

Any ideas? Is there a way I have not yet tried? I am not sure if this is actually a bug or a feature request. After I had a look into the code I simply assumed the latter. I am using version 1.1.0 of the wrapper and plotly.js 1.45.3.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions