-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Volume - new gl3d trace #3488
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
Volume - new gl3d trace #3488
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
3a39fd8
adding volume4d new trace
archmoj e3a59da
opacityscale as 2d array
archmoj c138d9d
correct volume baselines
archmoj 5dbe037
volume4d > volume
archmoj f141868
new baselines
archmoj b1170a9
add multi trace mock and add it to mock list
archmoj 1a49fa2
baseline for multiple volume traces
archmoj e0b786c
revised the colorscale of datacube mock
archmoj 76dae20
updated baseline with revised colorscale
archmoj fb502bd
bring isosurface draws to front and added a mock with mri data
archmoj c74daad
enter mri data
archmoj ea92715
revised mri mock
archmoj b07aa6a
fixup test
archmoj 48909e0
using new shader and mock with two volume traces in one cube
archmoj 02f171f
correct baseline using new shader
archmoj 3b7320f
added new baseline
archmoj 1ec0941
mock and baseline changes
archmoj 51035f9
exclude mri to run on CI
archmoj 7a13bde
removed mri baseline
archmoj 7249f8f
new volume mock with aspect ratio and opacityscale
archmoj 601baaa
added a draft baseline for new mock
archmoj 3580015
disable more volume mocks to run CI
archmoj 2052e9b
correct baseline
archmoj 3c0dc06
settings to speedup mesh normal calc
archmoj 04aa645
correct baselines using flatshading nomalization algo and try mri to …
archmoj dce3209
removed mri mock to run CI
archmoj fe9968e
dont run gl3d_volume_between-ranges to run on CI
archmoj 9681682
resolved conflicts and revised code based on comments
archmoj 1bb5ade
tweak image test to run for volume only
archmoj 94bfc50
fixed filter condition for image test
archmoj 4542518
rm mri mock
archmoj c2a703f
Merge branch 'master' into volume-dev
archmoj 3511f6c
dont run volume mocks on ci
archmoj 401e390
Merge remote-tracking branch 'origin/master'
archmoj 913c6e6
reduce opacityscale and move to volume folder - pass 1
archmoj 64652f9
revised min opacity in palettes
archmoj e82a826
reduced opacityscale code - updated baseline - revised jasmine test
archmoj 320485f
add hovertext support
archmoj 5da5cd7
Merge remote-tracking branch 'origin/master' into volume4d to apply n…
archmoj d35f69a
Merge remote-tracking branch 'origin/master' into volume4d
archmoj e6b0efd
run volume image test on CI
archmoj 0aa25f0
reset batch wait to 500
archmoj 77f7317
fixup volume default to coerce volume attributes and dflt - switch pr…
archmoj af17adc
revised isosurface default function exports
archmoj 130da2f
add volume and isosurface to the gl3d partial bundle list
archmoj 01a9426
revert unwanted scattergl changes in the previous commit
archmoj e23b2c3
reduced volume mock data
archmoj 4a9987d
bump gl-mesh3d 2.1.0
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
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,100 @@ | ||
/** | ||
* Copyright 2012-2019, Plotly, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
var Registry = require('../../registry'); | ||
var colorscaleDefaults = require('../../components/colorscale/defaults'); | ||
|
||
module.exports = function supplyIsoDefaults(traceIn, traceOut, defaultColor, layout, coerce) { | ||
var isomin = coerce('isomin'); | ||
var isomax = coerce('isomax'); | ||
|
||
if(isomax !== undefined && isomax !== null && | ||
isomin !== undefined && isomin !== null && | ||
isomin > isomax) { | ||
// applying default values in this case: | ||
traceOut.isomin = null; | ||
traceOut.isomax = null; | ||
} | ||
|
||
var x = coerce('x'); | ||
var y = coerce('y'); | ||
var z = coerce('z'); | ||
var value = coerce('value'); | ||
|
||
if( | ||
!x || !x.length || | ||
!y || !y.length || | ||
!z || !z.length || | ||
!value || !value.length | ||
) { | ||
traceOut.visible = false; | ||
return; | ||
} | ||
|
||
var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults'); | ||
handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout); | ||
|
||
['x', 'y', 'z'].forEach(function(dim) { | ||
var capDim = 'caps.' + dim; | ||
var showCap = coerce(capDim + '.show'); | ||
if(showCap) { | ||
coerce(capDim + '.fill'); | ||
} | ||
|
||
var sliceDim = 'slices.' + dim; | ||
var showSlice = coerce(sliceDim + '.show'); | ||
if(showSlice) { | ||
coerce(sliceDim + '.fill'); | ||
coerce(sliceDim + '.locations'); | ||
} | ||
}); | ||
|
||
var showSpaceframe = coerce('spaceframe.show'); | ||
if(showSpaceframe) { | ||
coerce('spaceframe.fill'); | ||
} | ||
|
||
var showSurface = coerce('surface.show'); | ||
if(showSurface) { | ||
coerce('surface.count'); | ||
coerce('surface.fill'); | ||
coerce('surface.pattern'); | ||
} | ||
|
||
var showContour = coerce('contour.show'); | ||
if(showContour) { | ||
coerce('contour.color'); | ||
coerce('contour.width'); | ||
} | ||
|
||
// Coerce remaining properties | ||
[ | ||
'text', | ||
'hovertext', | ||
'hovertemplate', | ||
'lighting.ambient', | ||
'lighting.diffuse', | ||
'lighting.specular', | ||
'lighting.roughness', | ||
'lighting.fresnel', | ||
'lighting.vertexnormalsepsilon', | ||
'lighting.facenormalsepsilon', | ||
'lightposition.x', | ||
'lightposition.y', | ||
'lightposition.z', | ||
'flatshading', | ||
'opacity' | ||
].forEach(function(x) { coerce(x); }); | ||
|
||
colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'c'}); | ||
|
||
// disable 1D transforms (for now) | ||
traceOut._length = null; | ||
}; |
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
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
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
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
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.
Nicely done! But I would prefer having this
supplyIsoDefaults
inisosurface/defaults.js
.We're trying to move away form this pattern where each defaults-related functions would get their own files. We now prefer having just one
defaults.js
file per trace module and have its reusable pieces exported along with the main tracesupplyDefaults.
function. Seebox/defaults.js
for an example.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.
Done in af17adc.