Skip to content

Commit 9a78013

Browse files
committed
make annotations & shapes 'visible' -> 'plot' edit type
1 parent f1cda60 commit 9a78013

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

src/components/annotations/attributes.js

+1-1
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: 'calc+arraydraw',
22+
editType: 'plot+arraydraw',
2323
description: [
2424
'Determines whether or not this annotation is visible.'
2525
].join(' ')

src/components/annotations/calc_autorange.js

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

1717

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

2724
function annAutorange(gd) {
28-
var fullLayout = gd._fullLayout;
29-
3025
// find the bounding boxes for each of these annotations'
3126
// relative to their anchor points
3227
// use the arrow and the text bg rectangle,
3328
// as the whole anno may include hidden text in its bbox
34-
Lib.filterVisible(fullLayout.annotations).forEach(function(ann) {
29+
gd._fullLayout.annotations.forEach(function(ann) {
3530
var xa = Axes.getFromId(gd, ann.xref);
3631
var ya = Axes.getFromId(gd, ann.yref);
3732

src/components/shapes/attributes.js

+1-1
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: 'calc+arraydraw',
22+
editType: 'plot+arraydraw',
2323
description: [
2424
'Determines whether or not this shape is visible.'
2525
].join(' ')

src/components/shapes/calc_autorange.js

+2-2
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-
shapeList = Lib.filterVisible(fullLayout.shapes);
20+
var fullLayout = gd._fullLayout;
21+
var shapeList = fullLayout.shapes;
2222

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

0 commit comments

Comments
 (0)