-
-
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
Merged
Merged
3D cone traces #2641
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
ec64895
scaffold cone
etpinard 5736290
move 3d parseColorScale to gl_format_color
etpinard cb7cb7f
get cone colorbar and vx/vy/vz mesh grid to work
etpinard 89eaf11
add three cone mocks
etpinard 863b0da
implement 'sizemode' and 'sizeref'
etpinard fa32a74
add lib/cone.js + add cone to gl3d bundle
etpinard 71e46af
hook in hover labels for cones
etpinard a2c3694
clean up scene computeTraceBounds
etpinard a2db567
find min/max u/v/w norm in calc directly
etpinard db8222b
add "pad" using max u/v/w norm around cone bounds
etpinard 55700b8
add 'anchor' to mimic gl-cone3d's coneOffset
etpinard e4a2035
add cone-specific hoverinfo flags
etpinard a02dd11
fixup cmin/cmax -> vertexIntensityBounds
etpinard cb7ef43
improve interplay between vector and cone position attributes
etpinard e718c66
fixup hover gl-scatter3d trace for cone with set `cones.(x|y|z)`
etpinard f651eec
use stashed gl-cone3d field as hover x/y/z u/v/w fields
etpinard 3f3bfac
rename image-exporter -> orca
etpinard aaf7249
mv gl3d_cone-* out of `npm run test-image` into noci_test.sh
etpinard d5d6f33
add some cone tests
etpinard b7465fb
add hover label test for cones
etpinard 5a42de0
comment out cones.(x|y|z) attributes for now
etpinard 04d3d91
better pad value for autoranged cones
etpinard 2a45dae
revert to current gl-cone3d master
etpinard 8dca9ae
factor out `visible: false` converse test
etpinard 3d26d47
fixup cone autorange pad computation
etpinard 5a59bc7
fixup pad autorange (again)
etpinard 3dd6cf5
pass gl-mesh3d lighting params
etpinard fb2ec1e
use gl-cone2d "vectorScale" to get better autorange pad value
etpinard 74ecbf8
scaled pad value by normMax only under sizemode: 'scaled'
etpinard abb11e0
sub in npm version for gl-cone3d
etpinard 8e8f5d6
fixup tests post 74ecbf8
etpinard 2c08357
add autorange test case for "scaled up the x/y/z arrays"
etpinard 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
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 |
---|---|---|
|
@@ -17,18 +17,26 @@ module.exports = function calc(gd, trace) { | |
var len = Math.min(u.length, v.length, w.length); | ||
var normMax = -Infinity; | ||
var normMin = Infinity; | ||
var compMax = -Infinity; | ||
|
||
for(var i = 0; i < len; i++) { | ||
var uu = u[i]; | ||
var u2 = uu * uu; | ||
var vv = v[i]; | ||
var v2 = vv * vv; | ||
var ww = w[i]; | ||
var norm = Math.sqrt(uu * uu + vv * vv + ww * ww); | ||
var w2 = ww * ww; | ||
var norm = Math.sqrt(u2 + v2 + w2); | ||
|
||
normMax = Math.max(normMax, norm); | ||
normMin = Math.min(normMin, norm); | ||
compMax = Math.max(compMax, u2, v2, w2); | ||
} | ||
|
||
// stash max norm value to convert cmix/cmax -> vertexIntensityBounds | ||
trace._normMax = normMax; | ||
// stash max 'component' value for autorange pad | ||
trace._compMax = Math.sqrt(compMax); | ||
|
||
colorscaleCalc(trace, [normMin, normMax], '', 'c'); | ||
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. Shoutout to @alexcjohnson for the tip! |
||
}; |
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.
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"data": [ | ||
{ | ||
"type": "cone", | ||
"x": [ 1, 1, 1, 1, 3, 3, 3, 3 ], | ||
"y": [ 1, 1, 3, 3, 1, 1, 3, 3 ], | ||
"z": [ 1, 3, 1, 3, 1, 3, 1, 3 ], | ||
"u": [ 1, 2, 3, 4, 1, 2, 3, 4 ], | ||
"v": [ 1, 1, 2, 2, 3, 3, 4, 4 ], | ||
"w": [ 4, 4, 1, 1, 2, 2, 3, 3 ], | ||
"showscale": false | ||
} | ||
], | ||
"layout": { | ||
"scene": { | ||
"camera": { | ||
"eye": { | ||
"x": -0.009629409001286008, | ||
"y": 2.5216768185264913, | ||
"z": 0.42700218501677245 | ||
} | ||
} | ||
}, | ||
"width": 500, | ||
"height": 500, | ||
"margin": {"t": 0, "b": 0, "l": 0, "r": 0} | ||
} | ||
} |
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.
This gives a better estimate. The data off #2641 (comment) now gives:
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.
Great! Yeah, I was wrong with
[0, 4]
- this looks awesome.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, this is still not quite right though. If I double all the u, v, w values, the cones don't change (as they shouldn't) but the padding increases.
v * 1
(as above):v * 2
:I don't need to tell you what happens with
v / 10
do I? 😉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.
latest attempt: 3d26d47