Skip to content

Commit 30eb865

Browse files
authored
Merge pull request #1652 from plotly/annotationclick-event
Annotationclick event
2 parents 2105fd4 + 0a6ca10 commit 30eb865

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/components/annotations/draw.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ function drawOne(gd, index) {
112112
gd.emit('plotly_clickannotation', {
113113
index: index,
114114
annotation: optionsIn,
115-
fullAnnotation: options
115+
fullAnnotation: options,
116+
event: d3.event
116117
});
117118
});
118119

test/jasmine/tests/annotations_test.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,11 @@ describe('annotation effects', function() {
11681168
], {}) // turn off the default editable: true
11691169
.then(function() {
11701170
clickData = [];
1171-
gd.on('plotly_clickannotation', function(evt) { clickData.push(evt); });
1171+
gd.on('plotly_clickannotation', function(evt) {
1172+
expect(evt.event).toEqual(jasmine.objectContaining({type: 'click'}));
1173+
delete evt.event;
1174+
clickData.push(evt);
1175+
});
11721176

11731177
gdBB = gd.getBoundingClientRect();
11741178
pos0Head = [gdBB.left + 200, gdBB.top + 200];

0 commit comments

Comments
 (0)