Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2112994

Browse files
committed
Merge pull request plotly#131 from plotly/gl-tickangle
Correct gl2d and gl3d tick angles [fixes plotly#119]
2 parents a7ab01b + 242f716 commit 2112994

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

src/plots/gl2d/convert.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ proto.merge = function(options) {
123123

124124
this.tickEnable[i+j] = false;
125125
this.tickColor[i+j] = str2RGBArray((ax.tickfont || {}).color);
126-
this.tickAngle[i+j] = (ax.tickangle === 'auto') ? 0 : -ax.tickangle;
126+
this.tickAngle[i+j] = (ax.tickangle === 'auto') ?
127+
0 :
128+
Math.PI * -ax.tickangle / 180;
127129
this.tickPad[i+j] = this.getTickPad(ax);
128130

129131
this.tickMarkLength[i+j] = 0;

src/plots/gl3d/layout/convert.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ proto.merge = function(sceneLayout) {
109109
if ('tickcolor' in axes) opts.lineTickColor[i] = str2RgbaArray(axes.tickcolor);
110110
if ('tickwidth' in axes) opts.lineTickWidth[i] = axes.tickwidth;
111111
if ('tickangle' in axes) {
112-
opts.tickAngle[i] = axes.tickangle === 'auto' ? 0 : axes.tickangle;
112+
opts.tickAngle[i] = (axes.tickangle === 'auto') ?
113+
0 :
114+
Math.PI * -axes.tickangle / 180;
113115
}
114116
//// tick labels
115117
if ('showticklabels' in axes) opts.tickEnable[i] = axes.showticklabels;
313 Bytes
Loading

test/image/mocks/gl3d_surface-lighting.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -550,16 +550,19 @@
550550
"xaxis": {
551551
"showbackground": true,
552552
"type": "linear",
553-
"backgroundcolor": "rgb(255, 127, 14)"
553+
"backgroundcolor": "rgb(255, 127, 14)",
554+
"tickangle": 180
554555
},
555556
"yaxis": {
556557
"showbackground": true,
557558
"type": "linear",
558-
"backgroundcolor": "rgb(255, 0, 0)"
559+
"backgroundcolor": "rgb(255, 0, 0)",
560+
"tickangle": -45
559561
},
560562
"zaxis": {
561563
"showbackground": true,
562-
"backgroundcolor": "rgb(44, 160, 44)"
564+
"backgroundcolor": "rgb(44, 160, 44)",
565+
"tickangle": 30
563566
}
564567
}
565568
}

0 commit comments

Comments
 (0)