-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
3D cone traces #2641
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
3D cone traces #2641
Changes from 1 commit
ec64895
5736290
cb7cb7f
89eaf11
863b0da
fa32a74
71e46af
a2c3694
a2db567
db8222b
55700b8
e4a2035
a02dd11
cb7ef43
e718c66
f651eec
3f3bfac
aaf7249
d5d6f33
b7465fb
5a42de0
04d3d91
2a45dae
8dca9ae
3d26d47
5a59bc7
3dd6cf5
fb2ec1e
74ecbf8
abb11e0
8e8f5d6
2c08357
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -60,7 +60,7 @@ describe('Test cone defaults', function() { | |||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
describe('@gl Test cone autorange', function() { | ||||||||||||||||||||||||||||||||||||||||
describe('@gl Test cone autorange:', function() { | ||||||||||||||||||||||||||||||||||||||||
var gd; | ||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
beforeEach(function() { | ||||||||||||||||||||||||||||||||||||||||
|
@@ -117,6 +117,55 @@ describe('@gl Test cone autorange', function() { | |||||||||||||||||||||||||||||||||||||||
_assertAxisRanges('scaled down', | ||||||||||||||||||||||||||||||||||||||||
[-0.39, 4.39], [-0.39, 4.39], [-0.39, 4.39] | ||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
var trace = fig.data[0]; | ||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
var x = trace.x.slice(); | ||||||||||||||||||||||||||||||||||||||||
x.push(5); | ||||||||||||||||||||||||||||||||||||||||
var y = trace.y.slice(); | ||||||||||||||||||||||||||||||||||||||||
y.push(5); | ||||||||||||||||||||||||||||||||||||||||
var z = trace.z.slice(); | ||||||||||||||||||||||||||||||||||||||||
z.push(5); | ||||||||||||||||||||||||||||||||||||||||
var u = trace.u.slice(); | ||||||||||||||||||||||||||||||||||||||||
u.push(0); | ||||||||||||||||||||||||||||||||||||||||
var v = trace.v.slice(); | ||||||||||||||||||||||||||||||||||||||||
v.push(0); | ||||||||||||||||||||||||||||||||||||||||
var w = trace.w.slice(); | ||||||||||||||||||||||||||||||||||||||||
w.push(0); | ||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
return Plotly.restyle(gd, { | ||||||||||||||||||||||||||||||||||||||||
x: [x], y: [y], z: [z], | ||||||||||||||||||||||||||||||||||||||||
u: [u], v: [v], w: [w] | ||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||
}) | ||||||||||||||||||||||||||||||||||||||||
.then(function() { | ||||||||||||||||||||||||||||||||||||||||
_assertAxisRanges('after adding one cone outside range but with norm-0', | ||||||||||||||||||||||||||||||||||||||||
[-0.45, 6.45], [-0.45, 6.45], [-0.45, 6.45] | ||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @alexcjohnson unfortunately I can't get this to "stick" to the previous plotly.js/src/plots/gl3d/scene.js Lines 479 to 483 in fb75158
which scales the autorange bounds with the plotly.js/src/plots/gl3d/scene.js Lines 394 to 407 in fb75158
Hopefully this iteration is close enough. As a side note, we should spend some time replacing this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New issue about the |
||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
return Plotly.restyle(gd, 'sizeref', 10); | ||||||||||||||||||||||||||||||||||||||||
}) | ||||||||||||||||||||||||||||||||||||||||
.then(function() { | ||||||||||||||||||||||||||||||||||||||||
_assertAxisRanges('after increasing sizeref', | ||||||||||||||||||||||||||||||||||||||||
[-12.4, 18.4], [-12.4, 18.4], [-12.4, 18.4] | ||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
return Plotly.restyle(gd, 'sizeref', 0.1); | ||||||||||||||||||||||||||||||||||||||||
}) | ||||||||||||||||||||||||||||||||||||||||
.then(function() { | ||||||||||||||||||||||||||||||||||||||||
_assertAxisRanges('after decreasing sizeref', | ||||||||||||||||||||||||||||||||||||||||
[0.74, 5.26], [0.74, 5.26], [0.74, 5.26] | ||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
return Plotly.restyle(gd, { | ||||||||||||||||||||||||||||||||||||||||
sizemode: 'absolute', | ||||||||||||||||||||||||||||||||||||||||
sizeref: 2 | ||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||
}) | ||||||||||||||||||||||||||||||||||||||||
.then(function() { | ||||||||||||||||||||||||||||||||||||||||
_assertAxisRanges('with sizemode absolute', | ||||||||||||||||||||||||||||||||||||||||
[-1.25, 7.25], [-1.25, 7.25], [-1.25, 7.25] | ||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||
}) | ||||||||||||||||||||||||||||||||||||||||
.catch(failTest) | ||||||||||||||||||||||||||||||||||||||||
.then(done); | ||||||||||||||||||||||||||||||||||||||||
|
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.
Shoutout to @alexcjohnson for the tip!