8000 Supporting reversed ranges in 3d scenes #1940 by archmoj · Pull Request #3071 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

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
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
refactoring if statements in shaders and scene
  • Loading branch information
archmoj committed Oct 5, 2018
commit 60ee80d8346c0d9d45ec1e61bfe469e77bb55e9f
30 changes: 15 additions & 15 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
8000
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": "git://github.com/archmoj/gl-cone3d.git#823cabfbb19d8b457730320010cb58df748ff9ee",
"gl-cone3d": "git://github.com/archmoj/gl-cone3d.git#2f1afdb49bd09e28ea32604b13aea919c0a57330",
"gl-contour2d": "^1.1.4",
"gl-error3d": "git://github.com/archmoj/gl-error3d.git#d09c224fe25671fcd588a8c803fe83129156fbab",
"gl-error3d": "git://github.com/archmoj/gl-error3d.git#6b5180b0ed024430ccbafb7392dac087bb2c12c4",
"gl-heatmap2d": "^1.0.4",
"gl-line3d": "git://github.com/archmoj/gl-line3d.git#681398a5477f64cfd92ff7494215d5b6854e834b",
"gl-line3d": "git://github.com/archmoj/gl-line3d.git#3f3e383004309507df9ce42490d85da070effafa",
"gl-mat4": "^1.2.0",
"gl-mesh3d": "git://github.com/archmoj/gl-mesh3d.git#5828f6255d8c5360631d5feec65801bb104a88e8",
"gl-mesh3d": "git://github.com/archmoj/gl-mesh3d.git#b2da71e9cc4719ee5b6a69398651e578cef2f3c0",
"gl-plot2d": "^1.3.1",
"gl-plot3d": "git://github.com/archmoj/gl-plot3d.git#ce601a50cd3057899f6074f8ea5fcf0ab77f417c",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also changes to gl-axes3d as a dependency of gl-plot3d here: gl-vis/gl-axes3d@master...archmoj:rev-bounds

"gl-pointcloud2d": "^1.0.1",
"gl-scatter3d": "git://github.com/archmoj/gl-scatter3d.git#b649f8fb619242525b64ccf1def62cb2ed3f224f",
"gl-scatter3d": "git://github.com/archmoj/gl-scatter3d.git#da56cdc37d4386261539d5134a5f9a39fe878415",
"g 8000 l-select-box": "^1.0.2",
"gl-spikes2d": "^1.0.1",
"gl-streamtube3d": "git://github.com/archmoj/gl-streamtube3d.git#f4f5a63ffb19704a1ab1cadcc7aa848d7b68f7bf",
"gl-surface3d": "git://github.com/archmoj/gl-surface3d.git#2455aad56d3727b940fad8d02727806abca0fdf4",
"gl-streamtube3d": "git://github.com/archmoj/gl-streamtube3d.git#08ce753c40e2804f33738de987da5c10ec8c67c0",
"gl-surface3d": "git://github.com/archmoj/gl-surface3d.git#cb6ef0af1b3d992112b9bfc83dcf2b4e4736e2d0",
"gl-text": "^1.1.6",
"glslify": "^6.3.1",
"has-hover": "^1.0.1",
Expand Down
15 changes: 6 additions & 9 deletions src/plots/gl3d/scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,13 +383,6 @@ function computeTraceBounds(scene, trace, bounds) {
}
}

function isCloseToZero(a) {
if(Math.abs(a) > Number.MIN_VALUE) { // the smallest positive numeric value representable in JavaScript
return false;
}
return true;
}

proto.plot = function(sceneData, fullLayout, layout) {

// Save parameters
Expand Down Expand Up @@ -442,8 +435,12 @@ proto.plot = function(sceneData, fullLayout, layout) {
}
var dataScale = [1, 1, 1];
for(j = 0; j < 3; ++j) {
var diff = dataBounds[1][j] - dataBounds[0][j];
if(!isCloseToZero(diff)) dataScale[j] = 1.0 / diff;
if(dataBounds[1][j] === dataBounds[0][j]) {
dataScale[j] = 1.0;
}
else {
dataScale[j] = 1.0 / (dataBounds[1][j] - dataBounds[0][j]);
}
}

// Save scale
Expand Down
Loading
0