File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,7 @@ function createCamera(scene) {
113113 result . lastInputTime = Date . now ( ) ;
114114 unSetAutoRange ( ) ;
115115 scene . cameraChanged ( ) ;
116+ scene . handleAnnotations ( ) ;
116117 }
117118 break ;
118119 }
@@ -152,6 +153,7 @@ function createCamera(scene) {
152153 result . lastInputTime = Date . now ( ) ;
153154 unSetAutoRange ( ) ;
154155 scene . cameraChanged ( ) ;
156+ scene . handleAnnotations ( ) ;
155157 break ;
156158 }
157159
Original file line number Diff line number Diff line change 99
1010'use strict' ;
1111
12+ var Registry = require ( '../../registry' ) ;
1213var Axes = require ( '../../plots/cartesian/axes' ) ;
1314var Fx = require ( '../../plots/cartesian/graph_interact' ) ;
1415
@@ -323,10 +324,25 @@ proto.cameraChanged = function() {
323324 this . glplotOptions . ticks = nextTicks ;
324325 this . glplotOptions . dataBox = camera . dataBox ;
325326 this . glplot . update ( this . glplotOptions ) ;
327+ this . handleAnnotations ( ) ;
328+
326329 relayoutCallback ( this ) ;
327330 }
328331} ;
329332
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+
330346proto . destroy = function ( ) {
331347 var traces = this . traces ;
332348
You can’t perform that action at this time.
0 commit comments