documentation icon indicating copy to clipboard operation
documentation copied to clipboard

annotation

Open cldougl opened this issue 8 years ago • 1 comments

  • [ ] add clickannotations to https://plot.ly/javascript/plotlyjs-events/ and mention captureevents in the example.
  • [ ] update https://plot.ly/javascript/text-and-annotations/#styling-and-formatting-annotations example

cldougl avatar Apr 10 '17 21:04 cldougl

This needs to wait for https://github.com/plotly/plotly.js/issues/1573 to be released, which will fix this event but require the annotation to have the attribute captureevents: true.

In https://plot.ly/javascript/text-and-annotations/#styling-and-formatting-annotations - the last part:

.on('plotly_clickannotation', function(event, data) {
    Plotly.relayout('myDiv', 'annotations[' + data.index + ']', 'remove');
});

is supposed to mean that you can click on an annotation and it will disappear. But that doesn't work. You can click on the data point again to get the annotation to disappear, but not on the annotation.

While you're in there, might be good to modernize the relayout calls... to use myPlot instead of 'myDiv' and null instead of 'remove' (which is deprecated)

alexcjohnson avatar Apr 10 '17 23:04 alexcjohnson