File tree 2 files changed +18
-0
lines changed
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,7 @@ function createCamera(scene) {
113
113
result . lastInputTime = Date . now ( ) ;
114
114
unSetAutoRange ( ) ;
115
115
scene . cameraChanged ( ) ;
116
+ scene . handleAnnotations ( ) ;
116
117
}
117
118
break ;
118
119
}
@@ -152,6 +153,7 @@ function createCamera(scene) {
152
153
result . lastInputTime = Date . now ( ) ;
153
154
unSetAutoRange ( ) ;
154
155
scene . cameraChanged ( ) ;
156
+ scene . handleAnnotations ( ) ;
155
157
break ;
156
158
}
157
159
Original file line number Diff line number Diff line change 9
9
10
10
'use strict' ;
11
11
12
+ var Registry = require ( '../../registry' ) ;
12
13
var Axes = require ( '../../plots/cartesian/axes' ) ;
13
14
var Fx = require ( '../../plots/cartesian/graph_interact' ) ;
14
15
@@ -323,10 +324,25 @@ proto.cameraChanged = function() {
323
324
this . glplotOptions . ticks = nextTicks ;
324
325
this . glplotOptions . dataBox = camera . dataBox ;
325
326
this . glplot . update ( this . glplotOptions ) ;
327
+ this . handleAnnotations ( ) ;
328
+
326
329
relayoutCallback ( this ) ;
327
330
}
328
331
} ;
329
332
333
+ proto . handleAnnotations = function ( ) {
334
+ var gd = this . graphDiv ,
335
+ annotations = this . fullLayout . annotations ;
336
+
337
+ for ( var i = 0 ; i < annotations . length ; i ++ ) {
338
+ var ann = annotations [ i ] ;
339
+
340
+ if ( ann . xref === this . xaxis . _id && ann . yref === this . yaxis . _id ) {
341
+ Registry . getComponentMethod ( 'annotations' , 'drawOne' ) ( gd , i ) ;
342
+ }
343
+ }
344
+ } ;
345
+
330
346
proto . destroy = function ( ) {
331
347
var traces = this . traces ;
332
348
You can’t perform that action at this time.
0 commit comments