Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 30eb865

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

File tree

Expand file treeCollapse file tree

2 files changed

+7
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-2
lines changed

‎src/components/annotations/draw.js

Copy file name to clipboardExpand all lines: src/components/annotations/draw.js
+2-1Lines changed: 2 additions & 1 deletion
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

Copy file name to clipboardExpand all lines: test/jasmine/tests/annotations_test.js
+5-1Lines changed: 5 additions & 1 deletion
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.