Skip to content

Commit 8b8bdea

Browse files
committed
don't (uselessly) add data-index to ann text+bg & arrow groups
- one `data-index` attr on the top-level ann group should be enough.
1 parent aa58118 commit 8b8bdea

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/components/annotations/draw.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ function drawOne(gd, index) {
101101

102102
// another group for text+background so that they can rotate together
103103
var annTextGroup = annGroup.append('g')
104-
.classed('annotation-text-g', true)
105-
.attr('data-index', String(index));
104+
.classed('annotation-text-g', true);
106105

107106
var annTextGroupInner = annTextGroup.append('g')
108107
.style('pointer-events', options.captureevents ? 'all' : null)
@@ -474,8 +473,7 @@ function drawOne(gd, index) {
474473

475474
var arrowGroup = annGroup.append('g')
476475
.style({opacity: Color.opacity(arrowColor)})
477-
.classed('annotation-arrow-g', true)
478-
.attr('data-index', String(index));
476+
.classed('annotation-arrow-g', true);
479477

480478
var arrow = arrowGroup.append('path')
481479
.attr('d', 'M' + tailX + ',' + tailY + 'L' + headX + ',' + headY)
@@ -498,7 +496,6 @@ function drawOne(gd, index) {
498496
.classed('annotation', true)
499497
.classed('anndrag', true)
500498
.attr({
501-
'data-index': String(index),
502499
d: 'M3,3H-3V-3H3ZM0,0L' + (tailX - arrowDragHeadX) + ',' + (tailY - arrowDragHeadY),
503500
transform: 'translate(' + arrowDragHeadX + ',' + arrowDragHeadY + ')'
504501
})

0 commit comments

Comments
 (0)