Skip to content

Commit a31549d

Browse files
committed
replace 'annotation' class for 'annotation-text' for annation text nodes
- so that the `selectAll('.annotation')` call Annotation.draw doesn't clear 3d annotation text nodes.
1 parent 8cb10c1 commit a31549d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/components/annotations/draw.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ function drawRaw(gd, options, index, xa, ya) {
189189
var font = options.font;
190190

191191
var annText = annTextGroupInner.append('text')
192-
.classed('annotation', true)
192+
.classed('annotation-text', true)
193193
.attr('data-unformatted', options.text)
194194
.text(options.text);
195195

@@ -524,7 +524,7 @@ function drawRaw(gd, options, index, xa, ya) {
524524
arrowDragHeadY += options.standoff * (tailY - headY) / arrowLength;
525525
}
526526
var arrowDrag = arrowGroup.append('path')
527-
.classed('annotation', true)
527+
.classed('annotation-arrow', true)
528528
.classed('anndrag', true)
529529
.attr({
530530
d: 'M3,3H-3V-3H3ZM0,0L' + (tailX - arrowDragHeadX) + ',' + (tailY - arrowDragHeadY),

test/jasmine/tests/drawing_test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ describe('Drawing', function() {
381381
width: 500
382382
})
383383
.then(function() {
384-
var node = d3.select('text.annotation').node();
384+
var node = d3.select('text.annotation-text').node();
385385
assertBBox(Drawing.bBox(node), {
386386
height: 14,
387387
width: 27.671875,
@@ -395,7 +395,7 @@ describe('Drawing', function() {
395395
return Plotly.relayout(gd, 'annotations[0].text', 'HELLO');
396396
})
397397
.then(function() {
398-
var node = d3.select('text.annotation').node();
398+
var node = d3.select('text.annotation-text').node();
399399
assertBBox(Drawing.bBox(node), {
400400
height: 14,
401401
width: 41.015625,
@@ -409,7 +409,7 @@ describe('Drawing', function() {
409409
return Plotly.relayout(gd, 'annotations[0].font.size', 20);
410410
})
411411
.then(function() {
412-
var node = d3.select('text.annotation').node();
412+
var node = d3.select('text.annotation-text').node();
413413
assertBBox(Drawing.bBox(node), {
414414
height: 22,
415415
width: 66.015625,

0 commit comments

Comments
 (0)