Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting reversed ranges in 3d scenes (final) #3141

Merged
merged 24 commits into from
Oct 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
875067b
fixes for reversed bounds in 3d scenes
archmoj Oct 2, 2018
5e4b75b
syntax, removed white spaces
archmoj Oct 2, 2018
d338aa3
including changes to gl-axes3d which is in gl-plot3d
archmoj Oct 3, 2018
e65f346
using new version of gl-axes3d
archmoj Oct 3, 2018
ab18276
gl-axis3d fix
archmoj Oct 3, 2018
95aa008
added json mocks to collect test images
archmoj Oct 4, 2018
60ee80d
refactoring if statements in shaders and scene
archmoj Oct 5, 2018
7fa34f6
mocks to generate baseline images with CircleCi
archmoj Oct 5, 2018
0414976
removed spaces from json mocks
archmoj Oct 5, 2018
f65b388
fixed a syntax error in json streamtubes mock and added one png baseline
archmoj Oct 6, 2018
2a72dac
added streamtube baseline image
archmoj Oct 6, 2018
a8d0dab
using glslify for out-of-bound function
archmoj Oct 8, 2018
1b1a827
correct streamtubes and cones translation
archmoj Oct 8, 2018
292d34b
reformat json mocks
archmoj Oct 14, 2018
7fc8f23
using npm new module glsl-out-of-range v 1.0.1
archmoj Oct 15, 2018
a77b9fd
using glsl-out-of-range v. 1.0.2 from a plotly repo
archmoj Oct 15, 2018
8eb570a
resolved conflict with latest gl-plot3d and gl-axes3d
archmoj Oct 15, 2018
b0c1cba
updated baseline images with axes alignments only - ticks would be al…
archmoj Oct 15, 2018
f646d3f
using latest gl-vis modules
archmoj Oct 23, 2018
373a03a
resolved conflicts
archmoj Oct 23, 2018
b37f4e3
update package lock
archmoj Oct 23, 2018
b295633
reset baseline images
archmoj Oct 23, 2018
adfe19d
updated baseline images to include tick new alignments
archmoj Oct 23, 2018
1b08a4c
correct version for gl-mesh3d
archmoj Oct 24, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 33 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,21 @@
"es6-promise": "^3.0.2",
"fast-isnumeric": "^1.1.1",
"font-atlas-sdf": "^1.3.3",
"gl-cone3d": "^1.1.0",
"gl-cone3d": "^1.2.0",
"gl-contour2d": "^1.1.4",
"gl-error3d": "^1.0.7",
"gl-error3d": "^1.0.8",
"gl-heatmap2d": "^1.0.4",
"gl-line3d": "^1.1.2",
"gl-line3d": "^1.1.3",
"gl-mat4": "^1.2.0",
"gl-mesh3d": "^2.0.0",
"gl-mesh3d": "^2.0.1",
"gl-plot2d": "^1.3.1",
"gl-plot3d": "^1.5.10",
"gl-pointcloud2d": "^1.0.1",
"gl-scatter3d": "^1.0.11",
"gl-scatter3d": "^1.0.12",
"gl-select-box": "^1.0.2",
"gl-spikes2d": "^1.0.1",
"gl-streamtube3d": "^1.0.0",
"gl-surface3d": "^1.3.5",
"gl-streamtube3d": "^1.1.0",
"gl-surface3d": "^1.3.6",
"gl-text": "^1.1.6",
"glslify": "^6.3.1",
"has-hover": "^1.0.1",
Expand Down
16 changes: 9 additions & 7 deletions src/plots/gl3d/scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,16 +435,11 @@ proto.plot = function(sceneData, fullLayout, layout) {
}
var dataScale = [1, 1, 1];
for(j = 0; j < 3; ++j) {
if(dataBounds[0][j] > dataBounds[1][j]) {
if(dataBounds[1][j] === dataBounds[0][j]) {
dataScale[j] = 1.0;
}
else {
if(dataBounds[1][j] === dataBounds[0][j]) {
dataScale[j] = 1.0;
}
else {
dataScale[j] = 1.0 / (dataBounds[1][j] - dataBounds[0][j]);
}
dataScale[j] = 1.0 / (dataBounds[1][j] - dataBounds[0][j]);
}
}

Expand Down Expand Up @@ -560,6 +555,13 @@ proto.plot = function(sceneData, fullLayout, layout) {
sceneBounds[0][i] -= d / 32.0;
sceneBounds[1][i] += d / 32.0;
}

if(axis.autorange === 'reversed') {
// swap bounds:
var tmp = sceneBounds[0][i];
sceneBounds[0][i] = sceneBounds[1][i];
sceneBounds[1][i] = tmp;
}
} else {
var range = axis.range;
sceneBounds[0][i] = axis.r2l(range[0]);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
147 changes: 147 additions & 0 deletions test/image/mocks/gl3d_cone-newplot_reversed_ranges.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
{
"data": [
{
"x": [
0.2
],
"y": [
0.4
],
"z": [
-0.6
],
"u": [
1
],
"v": [
1
],
"w": [
0
],
"type": "cone"
},
{
"x": [
0.4
],
"y": [
-0.6
],
"z": [
0.2
],
"u": [
1
],
"v": [
0
],
"w": [
1
],
"type": "cone"
},
{
"x": [
-0.6
],
"y": [
0.2
],
"z": [
0.4
],
"u": [
0
],
"v": [
1
],
"w": [
1
],
"type": "cone"
},
{
"x": [
-0.2
],
"y": [
-0.4
],
"z": [
0.6
],
"u": [
-1
],
"v": [
-1
],
"w": [
0
],
"type": "cone"
},
{
"x": [
-0.4
],
"y": [
0.6
],
"z": [
-0.2
],
"u": [
-1
],
"v": [
0
],
"w": [
-1
],
"type": "cone"
},
{
"x": [
0.6
],
"y": [
-0.2
],
"z": [
-0.4
],
"u": [
0
],
"v": [
-1
],
"w": [
-1
],
"type": "cone"
}
],
"layout": {
"height": 758,
"width": 1310,
"title": "Cone objects with Y-axis using autorange: 'reversed'",
"scene": {
"yaxis": {
"autorange": "reversed"
},
"camera": {
"eye": {
"x": 1,
"y": -1.5,
"z": 1.25
}
}
}
}
}
Loading