-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Supporting reversed ranges in 3d scenes #1940 #3071
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
875067b
fixes for reversed bounds in 3d scenes
archmoj 5e4b75b
syntax, removed white spaces
archmoj d338aa3
including changes to gl-axes3d which is in gl-plot3d
archmoj e65f346
using new version of gl-axes3d
archmoj ab18276
gl-axis3d fix
archmoj 95aa008
added json mocks to collect test images
archmoj 60ee80d
refactoring if statements in shaders and scene
archmoj 7fa34f6
mocks to generate baseline images with CircleCi
archmoj 0414976
removed spaces from json mocks
archmoj f65b388
fixed a syntax error in json streamtubes mock and added one png baseline
archmoj 2a72dac
added streamtube baseline image
archmoj a8d0dab
using glslify for out-of-bound function
archmoj 1b1a827
correct streamtubes and cones translation
archmoj 292d34b
reformat json mocks
archmoj 7fc8f23
using npm new module glsl-out-of-range v 1.0.1
archmoj a77b9fd
using glsl-out-of-range v. 1.0.2 from a plotly repo
archmoj 8eb570a
resolved conflict with latest gl-plot3d and gl-axes3d
archmoj b0c1cba
updated baseline images with axes alignments only - ticks would be al…
archmoj f646d3f
using latest gl-vis modules
archmoj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1 @@ | ||
{ | ||
"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 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
{"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}}}}} | ||
131 changes: 1 addition & 130 deletions
131
test/image/mocks/gl3d_mesh3d_surface3d_scatter3d_line3d_error3d_log_reversed_ranges.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,130 +1 @@ | ||
{ | ||
"data": [ | ||
{ | ||
"x": [1, 1, 3, 3, 1, 1, 3, 3], | ||
"y": [21, 23, 23, 21, 21, 23, 23, 21], | ||
"z": [1e-2, 1e-2, 1e-2, 1e-2, 1e+2, 1e+2, 1e+2, 1e+2], | ||
"i": [7, 0, 0, 0, 4, 4, 2, 6, 4, 0, 3, 7], | ||
"j": [3, 4, 1, 2, 5, 6, 5, 5, 0, 1, 2, 2], | ||
"k": [0, 7, 2, 3, 6, 7, 1, 2, 5, 5, 7, 6], | ||
"type": "mesh3d" | ||
}, | ||
{ | ||
"x": [5,-5], | ||
"y": [10,15], | ||
"z": [[1e-2,1e+2],[1e+3,1e-1],[1e+2,1e-2],[1e-3,1e+1]], | ||
"type": "surface", | ||
"colorscale": [ | ||
[ | ||
0.0, | ||
"rgb(127, 127, 255)" | ||
], | ||
[ | ||
0.1, | ||
"rgb(63, 63, 255)" | ||
], | ||
[ | ||
0.2, | ||
"rgb(0, 0, 255)" | ||
], | ||
[ | ||
0.3, | ||
"rgb(0, 63, 191)" | ||
], | ||
[ | ||
0.4, | ||
"rgb(0, 127, 127)" | ||
], | ||
[ | ||
0.5, | ||
"rgb(0, 191, 63)" | ||
], | ||
[ | ||
0.6, | ||
"rgb(0, 255, 0)" | ||
], | ||
[ | ||
0.7, | ||
"rgb(63, 191, 0)" | ||
], | ||
[ | ||
0.8, | ||
"rgb(127, 127, 0)" | ||
], | ||
[ | ||
0.9, | ||
"rgb(191, 63, 0)" | ||
], | ||
[ | ||
1.0, | ||
"rgb(255, 0, 0)" | ||
] | ||
], | ||
"cmin": 0, | ||
"cmax": 2 | ||
}, | ||
{ | ||
"x": [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5], | ||
"y": [25, 16, 9, 4, 1, 0, 1, 4, 9, 16, 25], | ||
"z": [1e-5, 1e-4, 1e-3, 1e-2, 1e-1, 1e0, 1e+1, 1e+2, 1e+3, 1e+4, 1e+5], | ||
"line": { | ||
"color": "black", | ||
"width": 5 | ||
}, | ||
"text": ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K"], | ||
"type": "scatter3d", | ||
"mode": "markers+lines+text", | ||
"error_x": { | ||
"type": "sqrt", | ||
"color": "red" | ||
}, | ||
"error_y": { | ||
"type": "sqrt", | ||
"color": "green" | ||
}, | ||
"error_z": { | ||
"type": "sqrt", | ||
"color": "blue" | ||
} | ||
} | ||
], | ||
"layout": { | ||
"height": 758, | ||
"width": 1310, | ||
"title": "X-axis using autorange: 'reversed', Y-axis using range: [30, -5] & Z-axis using range: 'reversed' & type: log", | ||
"scene": { | ||
"xaxis": { | ||
"autorange": "reversed", | ||
"showbackground": true, | ||
"backgroundcolor": "rgb(127, 191, 191)", | ||
"gridcolor": "rgb(255, 255, 255)", | ||
"zerolinecolor": "rgb(63, 0, 0)", | ||
"zerolinewidth": 5 | ||
}, | ||
"yaxis": { | ||
"range": [30, -5], | ||
"showbackground": true, | ||
"backgroundcolor": "rgb(191, 127, 191)", | ||
"gridcolor": "rgb(255, 255, 255)", | ||
"zerolinecolor": "rgb(0, 63, 0)", | ||
"zerolinewidth": 5 | ||
}, | ||
"zaxis": { | ||
"autorange": "reversed", | ||
"type": "log", | ||
"showbackground": true, | ||
"backgroundcolor": "rgb(191, 191, 127)", | ||
"gridcolor": "rgb(255, 255, 255)", | ||
"zerolinecolor": "rgb(0, 0, 63)", | ||
"zerolinewidth": 5 | ||
}, | ||
"camera": { | ||
"eye": { | ||
"x": -1.75, | ||
"y": -0.75, | ||
"z": 0.75 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
{"data":[{"x":[1,1,3,3,1,1,3,3],"y":[21,23,23,21,21,23,23,21],"z":[1e-2,1e-2,1e-2,1e-2,1e+2,1e+2,1e+2,1e+2],"i":[7,0,0,0,4,4,2,6,4,0,3,7],"j":[3,4,1,2,5,6,5,5,0,1,2,2],"k":[0,7,2,3,6,7,1,2,5,5,7,6],"type":"mesh3d"},{"x":[5,-5],"y":[10,15],"z":[[1e-2,1e+2],[1e+3,1e-1],[1e+2,1e-2],[1e-3,1e+1]],"type":"surface","colorscale":[[0.0,"rgb(127,127,255)"],[0.1,"rgb(63,63,255)"],[0.2,"rgb(0,0,255)"],[0.3,"rgb(0,63,191)"],[0.4,"rgb(0,127,127)"],[0.5,"rgb(0,191,63)"],[0.6,"rgb(0,255,0)"],[0.7,"rgb(63,191,0)"],[0.8,"rgb(127,127,0)"],[0.9,"rgb(191,63,0)"],[1.0,"rgb(255,0,0)"]],"cmin":0,"cmax":2},{"x":[-5,-4,-3,-2,-1,0,1,2,3,4,5],"y":[25,16,9,4,1,0,1,4,9,16,25],"z":[1e-5,1e-4,1e-3,1e-2,1e-1,1e0,1e+1,1e+2,1e+3,1e+4,1e+5],"line":{"color":"black","width":5},"text":["A","B","C","D","E","F","G","H","I","J","K"],"type":"scatter3d","mode":"markers+lines+text","error_x":{"type":"sqrt","color":"red"},"error_y":{"type":"sqrt","color":"green"},"error_z":{"type":"sqrt","color":"blue"}}],"layout":{"height":758,"width":1310,"title":"X-axis using autorange:'reversed',Y-axis using range:[30,-5] & Z-axis using range:'reversed' & type:log","scene":{"xaxis":{"autorange":"reversed","showbackground":true,"backgroundcolor":"rgb(127,191,191)","gridcolor":"rgb(255,255,255)","zerolinecolor":"rgb(63,0,0)","zerolinewidth":5},"yaxis":{"range":[30,-5],"showbackground":true,"backgroundcolor":"rgb(191,127,191)","gridcolor":"rgb(255,255,255)","zerolinecolor":"rgb(0,63,0)","zerolinewidth":5},"zaxis":{"autorange":"reversed","type":"log","showbackground":true,"backgroundcolor":"rgb(191,191,127)","gridcolor":"rgb(255,255,255)","zerolinecolor":"rgb(0,0,63)","zerolinewidth":5},"camera":{"eye":{"x":-1.75,"y":-0.75,"z":0.75}}}}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1 @@ | ||
{ | ||
"data": [ | ||
{ | ||
"type": "streamtube", | ||
"x": [0, 0, 0, 1, 1, 1, 2, 2, 2, 0, 0, 0, 1, 1, 1, 2, 2, 2, 0, 0, 0, 1, 1, 1, 2, 2, 2], | ||
"y": [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2], | ||
"z": [0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2], | ||
"u": [1,1,1,0.5,0.5,0.5,0.25,0.25,0.25,1,1,1,0.5,0.5,0.5,0.25,0.25,0.25,1,1,1,0.5,0.5,0.5,0.25,0.25,0.25], | ||
"v": [1,1,1,1,1,1,1,1,1,1.5,1.5,1.5,1.5,1.5,1.5,1.5,1.5,1.5,2,2,2,2,2,2,2,2,2], | ||
"w": [0,0.2,0.4,0,0.2,0.4,0,0.2,0.4,0,0.2,0.4,0,0.2,0.4,0,0.2,0.4,0,0.2,0.4,0,0.2,0.4,0,0.2,0.4], | ||
"sizeref": 0.5, | ||
"cmin": 0, | ||
"cmax": 3 | ||
} | ||
], | ||
"layout": { | ||
"height": 758, | ||
"width": 1310, | ||
"title": "Streamtube, X & Y axes reversed using autorange: 'reversed', Z-axis reversed using range: [2, -2]", | ||
"scene": { | ||
"camera": { | ||
"eye": { | ||
"x": 0.5, | ||
"y": -2.0, | ||
"z": 1.0, | ||
} | ||
}, | ||
"xaxis":{ "autorange": "reversed" }, | ||
"yaxis":{ "autorange": "reversed" }, | ||
"zaxis":{ "range": [2, -2] } | ||
} | ||
} | ||
} | ||
{"data":[{"type":"streamtube","x":[0,0,0,1,1,1,2,2,2,0,0,0,1,1,1,2,2,2,0,0,0,1,1,1,2,2,2],"y":[0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2],"z":[0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2],"u":[1,1,1,0.5,0.5,0.5,0.25,0.25,0.25,1,1,1,0.5,0.5,0.5,0.25,0.25,0.25,1,1,1,0.5,0.5,0.5,0.25,0.25,0.25],"v":[1,1,1,1,1,1,1,1,1,1.5,1.5,1.5,1.5,1.5,1.5,1.5,1.5,1.5,2,2,2,2,2,2,2,2,2],"w":[0,0.2,0.4,0,0.2,0.4,0,0.2,0.4,0,0.2,0.4,0,0.2,0.4,0,0.2,0.4,0,0.2,0.4,0,0.2,0.4,0,0.2,0.4],"sizeref":0.5, "cmin":0,"cmax":3}],"layout":{"height":758,"width":1310,"title":"Streamtube, X & Y axes reversed using autorange: 'reversed', Z-axis reversed using range: [2, -2]","scene":{"camera":{"eye":{"x":0.5,"y":-2.0,"z":1.0,}},"xaxis":{"autorange":"reversed"},"yaxis":{"autorange":"reversed"},"zaxis":{"range":[2,-2]}}}} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those new mock are very nice though. Thanks very much!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When try running image tests (on CircleCi) it showed syntax errors. I thought removing the white spaces may help pass the test. But I personally like the version which is human readable. If prefer I could fix the json mocks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. The only syntax tests we run on JSON mocks are:
So, I suspect your json files had trailing newlines. You can (and should) run those test locally with
npm run test-syntax
.Would you mind reformatting those files? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new json mocks are reformatted.