@@ -18,53 +18,53 @@ var arrayCopy1D = arrtools.copy1D;
18
18
var AXES_NAMES = [ 'xaxis' , 'yaxis' , 'zaxis' ] ;
19
19
20
20
function AxesOptions ( ) {
21
- this . bounds = [ [ - 10 , - 10 , - 10 ] ,
22
- [ 10 , 10 , 10 ] ] ;
23
-
24
- this . ticks = [ [ ] , [ ] , [ ] ] ;
25
- this . tickEnable = [ true , true , true ] ;
26
- this . tickFont = [ 'sans-serif' , 'sans-serif' , 'sans-serif' ] ;
27
- this . tickSize = [ 12 , 12 , 12 ] ;
28
- this . tickAngle = [ 0 , 0 , 0 ] ;
29
- this . tickColor = [ [ 0 , 0 , 0 , 1 ] , [ 0 , 0 , 0 , 1 ] , [ 0 , 0 , 0 , 1 ] ] ;
30
- this . tickPad = [ 18 , 18 , 18 ] ;
31
-
32
- this . labels = [ 'x' , 'y' , 'z' ] ;
33
- this . labelEnable = [ true , true , true ] ;
34
- this . labelFont = [ 'Open Sans' , 'Open Sans' , 'Open Sans' ] ;
35
- this . labelSize = [ 20 , 20 , 20 ] ;
36
- this . labelAngle = [ 0 , 0 , 0 ] ;
37
- this . labelColor = [ [ 0 , 0 , 0 , 1 ] , [ 0 , 0 , 0 , 1 ] , [ 0 , 0 , 0 , 1 ] ] ;
38
- this . labelPad = [ 30 , 30 , 30 ] ;
39
-
40
- this . lineEnable = [ true , true , true ] ;
41
- this . lineMirror = [ false , false , false ] ;
42
- this . lineWidth = [ 1 , 1 , 1 ] ;
43
- this . lineColor = [ [ 0 , 0 , 0 , 1 ] , [ 0 , 0 , 0 , 1 ] , [ 0 , 0 , 0 , 1 ] ] ;
21
+ this . bounds = [ [ - 10 , - 10 , - 10 ] ,
22
+ [ 10 , 10 , 10 ] ] ;
23
+
24
+ this . ticks = [ [ ] , [ ] , [ ] ] ;
25
+ this . tickEnable = [ true , true , true ] ;
26
+ this . tickFont = [ 'sans-serif' , 'sans-serif' , 'sans-serif' ] ;
27
+ this . tickSize = [ 12 , 12 , 12 ] ;
28
+ this . tickAngle = [ 0 , 0 , 0 ] ;
29
+ this . tickColor = [ [ 0 , 0 , 0 , 1 ] , [ 0 , 0 , 0 , 1 ] , [ 0 , 0 , 0 , 1 ] ] ;
30
+ this . tickPad = [ 18 , 18 , 18 ] ;
31
+
32
+ this . labels = [ 'x' , 'y' , 'z' ] ;
33
+ this . labelEnable = [ true , true , true ] ;
34
+ this . labelFont = [ 'Open Sans' , 'Open Sans' , 'Open Sans' ] ;
35
+ this . labelSize = [ 20 , 20 , 20 ] ;
36
+ this . labelAngle = [ 0 , 0 , 0 ] ;
37
+ this . labelColor = [ [ 0 , 0 , 0 , 1 ] , [ 0 , 0 , 0 , 1 ] , [ 0 , 0 , 0 , 1 ] ] ;
38
+ this . labelPad = [ 30 , 30 , 30 ] ;
39
+
40
+ this . lineEnable = [ true , true , true ] ;
41
+ this . lineMirror = [ false , false , false ] ;
42
+ this . lineWidth = [ 1 , 1 , 1 ] ;
43
+ this . lineColor = [ [ 0 , 0 , 0 , 1 ] , [ 0 , 0 , 0 , 1 ] , [ 0 , 0 , 0 , 1 ] ] ;
44
44
45
45
this . lineTickEnable = [ true , true , true ] ;
46
46
this . lineTickMirror = [ false , false , false ] ;
47
47
this . lineTickLength = [ 10 , 10 , 10 ] ;
48
- this . lineTickWidth = [ 1 , 1 , 1 ] ;
49
- this . lineTickColor = [ [ 0 , 0 , 0 , 1 ] , [ 0 , 0 , 0 , 1 ] , [ 0 , 0 , 0 , 1 ] ] ;
48
+ this . lineTickWidth = [ 1 , 1 , 1 ] ;
49
+ this . lineTickColor = [ [ 0 , 0 , 0 , 1 ] , [ 0 , 0 , 0 , 1 ] , [ 0 , 0 , 0 , 1 ] ] ;
50
50
51
- this . gridEnable = [ true , true , true ] ;
52
- this . gridWidth = [ 1 , 1 , 1 ] ;
53
- this . gridColor = [ [ 0 , 0 , 0 , 1 ] , [ 0 , 0 , 0 , 1 ] , [ 0 , 0 , 0 , 1 ] ] ;
51
+ this . gridEnable = [ true , true , true ] ;
52
+ this . gridWidth = [ 1 , 1 , 1 ] ;
53
+ this . gridColor = [ [ 0 , 0 , 0 , 1 ] , [ 0 , 0 , 0 , 1 ] , [ 0 , 0 , 0 , 1 ] ] ;
54
54
55
- this . zeroEnable = [ true , true , true ] ;
56
- this . zeroLineColor = [ [ 0 , 0 , 0 , 1 ] , [ 0 , 0 , 0 , 1 ] , [ 0 , 0 , 0 , 1 ] ] ;
57
- this . zeroLineWidth = [ 2 , 2 , 2 ] ;
55
+ this . zeroEnable = [ true , true , true ] ;
56
+ this . zeroLineColor = [ [ 0 , 0 , 0 , 1 ] , [ 0 , 0 , 0 , 1 ] , [ 0 , 0 , 0 , 1 ] ] ;
57
+ this . zeroLineWidth = [ 2 , 2 , 2 ] ;
58
58
59
59
this . backgroundEnable = [ true , true , true ] ;
60
60
this . backgroundColor = [ [ 0.8 , 0.8 , 0.8 , 0.5 ] ,
61
61
[ 0.8 , 0.8 , 0.8 , 0.5 ] ,
62
62
[ 0.8 , 0.8 , 0.8 , 0.5 ] ] ;
63
63
64
64
// some default values are stored for applying model transforms
65
- this . _defaultTickPad = arrayCopy1D ( this . tickPad ) ;
66
- this . _defaultLabelPad = arrayCopy1D ( this . labelPad ) ;
67
- this . _defaultLineTickLength = arrayCopy1D ( this . lineTickLength ) ;
65
+ this . _defaultTickPad = arrayCopy1D ( this . tickPad ) ;
66
+ this . _defaultLabelPad = arrayCopy1D ( this . labelPad ) ;
67
+ this . _defaultLineTickLength = arrayCopy1D ( this . lineTickLength ) ;
68
68
}
69
69
70
70
var proto = AxesOptions . prototype ;
@@ -78,22 +78,23 @@ proto.merge = function(sceneLayout) {
78
78
opts . labels [ i ] = convertHTML ( axes . title ) ;
79
79
if ( 'titlefont' in axes ) {
80
80
if ( axes . titlefont . color ) opts . labelColor [ i ] = str2RgbaArray ( axes . titlefont . color ) ;
81
- if ( axes . titlefont . family ) opts . labelFont [ i ] = axes . titlefont . family ;
82
- if ( axes . titlefont . size ) opts . labelSize [ i ] = axes . titlefont . size ;
81
+ if ( axes . titlefont . family ) opts . labelFont [ i ] = axes . titlefont . family ;
82
+ if ( axes . titlefont . size ) opts . labelSize [ i ] = axes . titlefont . size ;
83
83
}
84
84
85
85
/////// LINES ////////
86
86
if ( 'showline' in axes ) opts . lineEnable [ i ] = axes . showline ;
87
- if ( 'linecolor' in axes ) opts . lineColor [ i ] = str2RgbaArray ( axes . linecolor ) ;
88
- if ( 'linewidth' in axes ) opts . lineWidth [ i ] = axes . linewidth ;
87
+ if ( 'linecolor' in axes ) opts . lineColor [ i ] = str2RgbaArray ( axes . linecolor ) ;
88
+ if ( 'linewidth' in axes ) opts . lineWidth [ i ] = axes . linewidth ;
89
89
90
90
if ( 'showgrid' in axes ) opts . gridEnable [ i ] = axes . showgrid ;
91
- if ( 'gridcolor' in axes ) opts . gridColor [ i ] = str2RgbaArray ( axes . gridcolor ) ;
92
- if ( 'gridwidth' in axes ) opts . gridWidth [ i ] = axes . gridwidth ;
91
+ if ( 'gridcolor' in axes ) opts . gridColor [ i ] = str2RgbaArray ( axes . gridcolor ) ;
92
+ if ( 'gridwidth' in axes ) opts . gridWidth [ i ] = axes . gridwidth ;
93
93
94
- // Remove zeroline if axis type is log //
95
- if ( axes . type === 'log' ) opts . zeroEnable [ i ] = false ;
96
- else if ( 'zeroline' in axes ) opts . zeroEnable [ i ] = axes . zeroline ;
94
+ // Remove zeroline if axis type is log
95
+ // otherwise the zeroline is incorrectly drawn at 1 on log axes
96
+ if ( axes . type === 'log' ) opts . zeroEnable [ i ] = false ;
97
+ else if ( 'zeroline' in axes ) opts . zeroEnable [ i ] = axes . zeroline ;
97
98
if ( 'zerolinecolor' in axes ) opts . zeroLineColor [ i ] = str2RgbaArray ( axes . zerolinecolor ) ;
98
99
if ( 'zerolinewidth' in axes ) opts . zeroLineWidth [ i ] = axes . zerolinewidth ;
99
100
@@ -113,9 +114,9 @@ proto.merge = function(sceneLayout) {
113
114
//// tick labels
114
115
if ( 'showticklabels' in axes ) opts . tickEnable [ i ] = axes . showticklabels ;
115
116
if ( 'tickfont' in axes ) {
116
- if ( axes . tickfont . color ) opts . tickColor [ i ] = str2RgbaArray ( axes . tickfont . color ) ;
117
- if ( axes . tickfont . family ) opts . tickFont [ i ] = axes . tickfont . family ;
118
- if ( axes . tickfont . size ) opts . tickSize [ i ] = axes . tickfont . size ;
117
+ if ( axes . tickfont . color ) opts . tickColor [ i ] = str2RgbaArray ( axes . tickfont . color ) ;
118
+ if ( axes . tickfont . family ) opts . tickFont [ i ] = axes . tickfont . family ;
119
+ if ( axes . tickfont . size ) opts . tickSize [ i ] = axes . tickfont . size ;
119
120
}
120
121
121
122
if ( 'mirror' in axes ) {
@@ -133,8 +134,8 @@ proto.merge = function(sceneLayout) {
133
134
134
135
////// grid background
135
136
if ( 'showbackground' in axes && axes . showbackground !== false ) {
136
- opts . backgroundEnable [ i ] = true ;
137
- opts . backgroundColor [ i ] = str2RgbaArray ( axes . backgroundcolor ) ;
137
+ opts . backgroundEnable [ i ] = true ;
138
+ opts . backgroundColor [ i ] = str2RgbaArray ( axes . backgroundcolor ) ;
138
139
} else opts . backgroundEnable [ i ] = false ;
139
140
}
140
141
} ;
0 commit comments