Skip to content

Commit 5cfee13

Browse files
committed
Revert "make annotations & shapes 'visible' -> 'plot' edit type"
- we would need to coerce their xref and yref even when `visible:false`. Not worth the effort at the moment. This reverts commit 9a78013.
1 parent 9a78013 commit 5cfee13

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

src/components/annotations/attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports = templatedArray('annotation', {
1919
valType: 'boolean',
2020
role: 'info',
2121
dflt: true,
22-
editType: 'plot+arraydraw',
22+
editType: 'calc+arraydraw',
2323
description: [
2424
'Determines whether or not this annotation is visible.'
2525
].join(' ')

src/components/annotations/calc_autorange.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,22 @@ var draw = require('./draw').draw;
1616

1717

1818
module.exports = function calcAutorange(gd) {
19-
if(gd._fullLayout.annotations.length && gd._fullData.length) {
19+
var fullLayout = gd._fullLayout;
20+
var annotationList = Lib.filterVisible(fullLayout.annotations);
21+
22+
if(annotationList.length && gd._fullData.length) {
2023
return Lib.syncOrAsync([draw, annAutorange], gd);
2124
}
2225
};
2326

2427
function annAutorange(gd) {
28+
var fullLayout = gd._fullLayout;
29+
2530
// find the bounding boxes for each of these annotations'
2631
// relative to their anchor points
2732
// use the arrow and the text bg rectangle,
2833
// as the whole anno may include hidden text in its bbox
29-
gd._fullLayout.annotations.forEach(function(ann) {
34+
Lib.filterVisible(fullLayout.annotations).forEach(function(ann) {
3035
var xa = Axes.getFromId(gd, ann.xref);
3136
var ya = Axes.getFromId(gd, ann.yref);
3237

src/components/shapes/attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports = templatedArray('shape', {
1919
valType: 'boolean',
2020
role: 'info',
2121
dflt: true,
22-
editType: 'plot+arraydraw',
22+
editType: 'calc+arraydraw',
2323
description: [
2424
'Determines whether or not this shape is visible.'
2525
].join(' ')

src/components/shapes/calc_autorange.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ var helpers = require('./helpers');
1717

1818

1919
module.exports = function calcAutorange(gd) {
20-
var fullLayout = gd._fullLayout;
21-
var shapeList = fullLayout.shapes;
20+
var fullLayout = gd._fullLayout,
21+
shapeList = Lib.filterVisible(fullLayout.shapes);
2222

2323
if(!shapeList.length || !gd._fullData.length) return;
2424

0 commit comments

Comments
 (0)