7
7
*/
8
8
9
9
10
- /*eslint block-scoped-var: 0*/
11
- /*eslint no-redeclare: 0*/
12
-
13
10
'use strict' ;
14
11
15
12
var createPlot = require ( 'gl-plot3d' ) ;
@@ -34,6 +31,8 @@ var STATIC_CANVAS, STATIC_CONTEXT;
34
31
35
32
function render ( scene ) {
36
33
34
+ var trace ;
35
+
37
36
// update size of svg container
38
37
var svgContainer = scene . svgContainer ;
39
38
var clientRect = scene . container . getBoundingClientRect ( ) ;
@@ -69,9 +68,10 @@ function render(scene) {
69
68
70
69
if ( lastPicked !== null ) {
71
70
var pdata = project ( scene . glplot . cameraParams , selection . dataCoordinate ) ,
72
- trace = lastPicked . data ,
73
71
hoverinfo = trace . hoverinfo ;
74
72
73
+ trace = lastPicked . data ;
74
+
75
75
var xVal = formatter ( 'xaxis' , selection . traceCoordinate [ 0 ] ) ,
76
76
yVal = formatter ( 'yaxis' , selection . traceCoordinate [ 1 ] ) ,
77
77
zVal = formatter ( 'zaxis' , selection . traceCoordinate [ 2 ] ) ;
@@ -172,7 +172,7 @@ function initializeGLPlot(scene, fullLayout, canvas, gl) {
172
172
showNoWebGlMsg ( scene ) ;
173
173
}
174
174
175
- var relayoutCallback = function ( scene , domEvent ) {
175
+ var relayoutCallback = function ( scene ) {
176
176
var update = { } ;
177
177
update [ scene . id ] = getLayoutCamera ( scene . camera ) ;
178
178
scene . graphDiv . emit ( 'plotly_relayout' , update ) ;
@@ -292,6 +292,7 @@ proto.recoverContext = function() {
292
292
var axisProperties = [ 'xaxis' , 'yaxis' , 'zaxis' ] ;
293
293
294
294
function coordinateBound ( axis , coord , d , bounds ) {
295
+ var x ;
295
296
for ( var i = 0 ; i < coord . length ; ++ i ) {
296
297
if ( Array . isArray ( coord [ i ] ) ) {
297
298
for ( var j = 0 ; j < coord [ i ] . length ; ++ j ) {
@@ -303,7 +304,7 @@ function coordinateBound(axis, coord, d, bounds) {
303
304
}
304
305
}
305
306
else {
306
- var x = axis . d2l ( coord [ i ] ) ;
307
+ x = axis . d2l ( coord [ i ] ) ;
307
308
if ( ! isNaN ( x ) && isFinite ( x ) ) {
308
309
bounds [ 0 ] [ d ] = Math . min ( bounds [ 0 ] [ d ] , x ) ;
309
310
bounds [ 1 ] [ d ] = Math . max ( bounds [ 1 ] [ d ] , x ) ;
@@ -326,7 +327,7 @@ proto.plot = function(sceneData, fullLayout, layout) {
326
327
if ( this . glplot . contextLost ) return ;
327
328
328
329
var data , trace ;
329
- var i , j ;
330
+ var i , j , axis , axisType ;
330
331
var fullSceneLayout = fullLayout [ this . id ] ;
331
332
var sceneLayout = layout [ this . id ] ;
332
333
@@ -350,7 +351,7 @@ proto.plot = function(sceneData, fullLayout, layout) {
350
351
351
352
// Update axes functions BEFORE updating traces
352
353
for ( i = 0 ; i < 3 ; ++ i ) {
353
- var axis = fullSceneLayout [ axisProperties [ i ] ] ;
354
+ axis = fullSceneLayout [ axisProperties [ i ] ] ;
354
355
setConvert ( axis ) ;
355
356
}
356
357
@@ -426,7 +427,7 @@ proto.plot = function(sceneData, fullLayout, layout) {
426
427
427
428
for ( i = 0 ; i < 3 ; ++ i ) {
428
429
axis = fullSceneLayout [ axisProperties [ i ] ] ;
429
- var axisType = axis . type ;
430
+ axisType = axis . type ;
430
431
431
432
if ( axisType in axisTypeRatios ) {
432
433
axisTypeRatios [ axisType ] . acc *= dataScale [ i ] ;
0 commit comments