Skip to content

Commit 2b8a1d5

Browse files
committed
tick alignments would stay upwards, set api
1 parent 9194456 commit 2b8a1d5

File tree

3 files changed

+9
-30
lines changed

3 files changed

+9
-30
lines changed

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"gl-mat4": "^1.2.0",
7979
"gl-mesh3d": "^2.0.0",
8080
"gl-plot2d": "^1.3.1",
81-
"gl-plot3d": "git://github.com/gl-vis/gl-plot3d.git#ecb160755f0e0398a9c56763dc5c4a74738d0a00",
81+
"gl-plot3d": "git://github.com/gl-vis/gl-plot3d.git#865fc8e434adbba9315975893375fe992ef7efbf",
8282
"gl-pointcloud2d": "^1.0.1",
8383
"gl-scatter3d": "^1.0.11",
8484
"gl-select-box": "^1.0.2",

src/plots/gl3d/layout/convert.js

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,13 @@ function AxesOptions() {
2525
this.tickFont = [ 'sans-serif', 'sans-serif', 'sans-serif' ];
2626
this.tickSize = [ 12, 12, 12 ];
2727
this.tickAngle = [ 0, 0, 0 ];
28-
this.tickAlign = [ 'auto', 'auto', 'auto' ];
2928
this.tickColor = [ [0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1] ];
3029
this.tickPad = [ 18, 18, 18 ];
3130

3231
this.labels = [ 'x', 'y', 'z' ];
3332
this.labelEnable = [ true, true, true ];
3433
this.labelFont = ['Open Sans', 'Open Sans', 'Open Sans'];
3534
this.labelSize = [ 20, 20, 20 ];
36-
this.labelAngle = [ 0, 0, 0 ];
37-
this.labelAlign = [ 'auto', 'auto', 'auto' ];
3835
this.labelColor = [ [0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1] ];
3936
this.labelPad = [ 30, 30, 30 ];
4037

@@ -93,18 +90,6 @@ proto.merge = function(sceneLayout) {
9390
if(axes.titlefont.family) opts.labelFont[i] = axes.titlefont.family;
9491
if(axes.titlefont.size) opts.labelSize[i] = axes.titlefont.size;
9592
}
96-
// Title rotation/alignment similar to ticks
97-
if('titleangle' in axes) {
98-
if(axes.titleangle === 'auto') {
99-
opts.labelAlign[i] = 'auto';
100-
opts.labelAngle[i] = 0;
101-
} else {
102-
opts.labelAlign[i] = -1;
103-
opts.labelAngle[i] = Math.PI * -axes.labelangle / 180;
104-
}
105-
}
106-
if(axes.titlealign === 'auto') opts.labelAlign[i] = 'auto';
107-
if('titlealign' in axes) opts.lableAlign[i] = axes.titlealign;
10893

10994
// Lines
11095
if('showline' in axes) opts.lineEnable[i] = axes.showline;
@@ -132,16 +117,10 @@ proto.merge = function(sceneLayout) {
132117
if('tickcolor' in axes) opts.lineTickColor[i] = str2RgbaArray(axes.tickcolor);
133118
if('tickwidth' in axes) opts.lineTickWidth[i] = axes.tickwidth;
134119
if('tickangle' in axes) {
135-
if(axes.tickangle === 'auto') {
136-
opts.tickAlign[i] = 'auto';
137-
opts.tickAngle[i] = 0;
138-
} else {
139-
opts.tickAlign[i] = -1;
140-
opts.tickAngle[i] = Math.PI * -axes.tickangle / 180;
141-
}
120+
opts.tickAngle[i] = (axes.tickangle === 'auto') ?
121+
-3600 : // i.e. special number to set auto option
122+
Math.PI * -axes.tickangle / 180;
142123
}
143-
if(axes.tickalign === 'auto') opts.tickAlign[i] = 'auto';
144-
if('tickalign' in axes) opts.tickAlign[i] = axes.tickalign;
145124

146125
// tick labels
147126
if('showticklabels' in axes) opts.tickEnable[i] = axes.showticklabels;

0 commit comments

Comments
 (0)