-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
iso-surface finalist with caps, slices & spaceframe display on uniform or non-uniform coordinates #3438
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
iso-surface finalist with caps, slices & spaceframe display on uniform or non-uniform coordinates #3438
Changes from all commits
Commits
Show all changes
169 commits
Select commit
Hold shift + click to select a range
71ae66e
new isosurface traces
archmoj be3c5a5
using full data cube
archmoj dfe2a85
use data cube dimensions i.e. width and height
archmoj 251b2d4
value > volume
archmoj cd86716
revised x y z
archmoj 66bf59d
updated baseline
archmoj dee7c8e
handle non-uniform space pass 1 for integers
archmoj b2b7bc0
real world translation
archmoj 0ac65d9
fixed interpolation
archmoj f5c6052
using isovalueand improved the mock
archmoj e5c7ff0
multiple isovalues could be applied with one trace
archmoj e60de84
http > https
archmoj 0a9bf1d
fixed update for redraw
archmoj eecd804
fixed colorscale
archmoj b1f7939
corrected new isosurface baseline with colorscale
archmoj 8779a6a
set intensity an internal value for iso-surface traces
archmoj 2a4b9fb
correct baseline with colorscale
archmoj 08e1508
added option to control which iso-surface meshing algorithm to use
archmoj 4b49dc4
fixed scale tranform
archmoj 07e11c0
isosurface baseline with correct x y z scales
archmoj 06531f8
separate meshing record process
archmoj 87ae392
improved isosurface mock to have both sides
archmoj af9294b
new two-sided isosurface baseline
archmoj f141098
fixed scales for negative ranges and prepration for isocaps
archmoj 04cc4b4
more optimized code base for iso caps
archmoj a10b365
removed unused mock
archmoj 16208cb
debug and fixed cap interpolation
archmoj b2f84be
removed debug opt
archmoj 605ce44
updated isosurface mock with caps
archmoj 56b4df1
volume > value and added checks to make trace invisible in case of em…
archmoj 5311b01
reduced tolerance ratio
archmoj 0171bf6
iso-surface baseline with reduced error for caps
archmoj 1da04df
xyzw > xyzv
archmoj 4ac90eb
may help handle parametric x y z coordinates
archmoj 49aa746
reduced color attributes
archmoj d9c1fa7
intensity > value
archmoj 79fdb19
more intensity to value
archmoj de20714
separate interpolatoin and extrapolation
archmoj 341ba29
Merge remote-tracking branch 'origin/master' into isosurface-new
archmoj dac7f9d
apply new syntax rules for camelCase and one var per variable
archmoj 94f0767
2018 > 2019 for isosurface
archmoj 7c7bbe5
reduce vertex ids on each cap
archmoj 9e5441d
reduced number of vertices of iso-surface and smoothing
archmoj 940b41f
smooth isosurface baseline
archmoj dd08cd4
removed surfaceNets and marchingTetrahedra algorithms
archmoj 530cdb4
revised to be more functional
archmoj dd2d8ea
towards isosurface with no dep module
archmoj bc8c7de
prep for draw cubes
archmoj 26aa9a7
compact code before extending tri > tetra
archmoj b64ebe4
progress on expanding tetra draw
archmoj e9b001f
major improvement
archmoj d775525
fix timeout
archmoj 2d9cfce
prototype for volume data
archmoj 996d0b4
translate opacity to mesh
archmoj 4c88b47
fixed opacity calc
archmoj 296b636
bring in section functions
archmoj 34ebfb1
new tri function
archmoj ddda735
removed old tri function
archmoj b6ec3ab
groups & sections
archmoj 1ab207f
slices and only draw crossing try
archmoj c32cfee
added new functions
archmoj ae220b7
added a recursive solver
archmoj 5e28df3
put the iso-surface mock back
archmoj 1b582cf
fixup
archmoj 57e937f
fixed few more things
archmoj 9bd799e
transparent baseline
archmoj a26f3b5
progress...
archmoj 722a6f3
plus plus
archmoj d44dca0
refactor
archmoj 29de897
simplified and more functional
archmoj 4cee4a9
defined new control attributes
archmoj 6b227ee
new baseline with transparency and new attributes
archmoj c9597ea
separated isosurface volume and cap opacity values
archmoj a0593a4
various improvements: opacity > fill, etc.
archmoj 784bde4
added slicing types
archmoj 2015d3c
added edit types for fill attributes
archmoj deedc91
display minimal volume based on tetras
archmoj e9f48ba
updated baseline with minimal volume lines
archmoj 3e387a2
easy control over caps slices iso-surfaces and volume elements
archmoj 8b77ca6
revised grouping etc.
archmoj ba0c476
revised attributes
archmoj c7694fd
minor fixes
archmoj d33e47b
forEach tables > simple for
archmoj f34004f
Revert "forEach tables > simple for"
archmoj 2c0d40f
orders
archmoj 7b5e927
added second mock
archmoj 8ac7688
edit mocks and editType
archmoj e69337f
Merge remote-tracking branch 'origin/master' into isosurface-volume
archmoj f7340f1
applied gl3d reversescale fixup PR 3418 to resolve conflict from the …
archmoj e4c86dd
added new baseline
archmoj 2ea382f
updated baseline
archmoj e3271c7
edge cases
archmoj de800c0
fixed slice and rect draw
archmoj 0bddc23
major fixup for isosurfaces when isomin is close to isomax
archmoj da66c2c
opacity > fill etc.
archmoj 03660f6
solving cap edges with recursive draws
archmoj 814b5b0
revised vertex indexing
archmoj 816044d
updated iso-surface baselines
archmoj 7a58fc0
apply the third power in mock z-axis and using reverscale true
archmoj fae95e8
new baseline to lock reversescale gl3d issue
archmoj 236bb3e
hover display
archmoj 3876831
edit before fixing caps
archmoj df82f92
caps getting better
archmoj 05ca035
pass min max to the functions
archmoj 26b2969
improved caps creation and more
archmoj d7a59d9
fixes pass 1
archmoj 3106130
fixed second pass cap interpolation added mock and removed min max fu…
archmoj cb0ee0a
new baseline
archmoj 6f6b578
removed ref to width height and depth attributes
archmoj 180350c
Merge remote-tracking branch 'origin/master' into isosurface-volume
archmoj a90227c
improved lighting and surface material for mocks
archmoj 8cfe2a7
correct baselines using new gl-mesh3d lighting
archmoj 54f400c
added a new mock with a log axis and horizontal slices
archmoj 4f03deb
added new baseline
archmoj 5b00901
mocks with hover and different aspect ratio
archmoj f32731b
corrected baseline now using different scene aspect ratio
archmoj a525261
improved cap ceration for tiny cases
archmoj c46eced
new mock for thin caps and different width X height X depths
archmoj 46aaad3
new baselines with new algo for caps and sections
archmoj 935e155
new baseline with improved caps algo
archmoj 98a2c09
debug > style now could pass as first argument to every draw function
archmoj 3b1e94d
volume > brace and slices at desired locations
archmoj 07eefa7
new baseline showing slices on desired locations
archmoj 5c0907e
fix and test mock for edge case scenario mentioned by Etienne on PR 2752
archmoj e389106
new baseline to lock out of iso-range case
archmoj e8aca82
added 4th dimension to the hover and removed vertices when no face cr…
archmoj c0def68
fixed syntax
archmoj cd291b3
applied to precision 6 for value on hover
archmoj 4a6462e
fixes and added surface pattern option and mock
archmoj e5c645b
added new baseline for pattern option
archmoj c2dd4d8
fixed pattern styling check
archmoj 2a7062c
added checker pattern options too
archmoj ceab6af
added a mock to display the usecase of volume braces and iso-surface …
archmoj 29bebd0
baseline to display the usecase of volume braces and iso-surface chec…
archmoj 52c2faa
brace > spaceframe
archmoj 99fdb28
refactor to have more functional main program - added the option to c…
archmoj 16ab1a1
baseline with multiple iso-surface sentions
archmoj e0a2845
fixed single surface case and mock order
archmoj 07708c3
added new baseline for single iso-surface 3d section
archmoj 06e8c09
correct baseline title
archmoj bae7b56
fix isomin > isomax case by setting to defaults
archmoj ea34a2d
added jasmine tests for defaults and restyle only
archmoj e575082
fill descriptions
archmoj a7373a3
added a note for slice locations
archmoj 31fb0b7
overrideAll calcs
archmoj 4aa489f
reusing mesh3d lighting attributes
archmoj 392fdd6
using mockAxis
archmoj 28fbc25
removed toPrecision
archmoj 324e69b
fixed jasmine default sync calls
archmoj bc48eea
checker > check
archmoj 6d61e43
revised few function names
archmoj 40c7fb6
improved log mock
archmoj 94b4f5e
reduced num lines
archmoj 436c0d9
now can interpolate for slices on locations between two axis points
archmoj 4b21f13
fixed a typo and updated the baseline
archmoj 0c346aa
fix noting that ceil is applied not floor
archmoj a9bf42c
updated log baseline to lock horizontal and vertical slicings between…
archmoj e6e8070
added a check to not allow ceil id to be 0
archmoj b55854e
fixed hover and added jasmine test for hover
archmoj 05f3c0d
added noCI flag for hover test i.e. similar to streamtube
archmoj eb0fb94
improved patterns
archmoj 722bade
baseline showing an example of improved triangular patterns
archmoj 9ec9f06
used flaglist also check1 > odd and check2 > even
archmoj 13c313b
added new mock and fixed gl defaults in jasmine test files
archmoj 1089724
added baseline for new mock
archmoj c66a2bb
one big change for the API
archmoj bc8334b
applied distinctVals
archmoj d82f091
description edit - fixed hover - simplified again finding nearest on …
archmoj ea8dccd
fix react-noop test
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* 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'; | ||
|
||
module.exports = require('../src/traces/isosurface'); |
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,272 @@ | ||
/** | ||
* 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 colorscaleAttrs = require('../../components/colorscale/attributes'); | ||
var colorbarAttrs = require('../../components/colorbar/attributes'); | ||
var surfaceAtts = require('../surface/attributes'); | ||
var meshAttrs = require('../mesh3d/attributes'); | ||
var baseAttrs = require('../../plots/attributes'); | ||
|
||
var extendFlat = require('../../lib/extend').extendFlat; | ||
var overrideAll = require('../../plot_api/edit_types').overrideAll; | ||
|
||
function makeSliceAttr(axLetter) { | ||
return { | ||
show: { | ||
valType: 'boolean', | ||
role: 'info', | ||
dflt: false, | ||
description: [ | ||
'Determines whether or not slice planes about the', axLetter, | ||
'dimension are drawn.' | ||
].join(' ') | ||
}, | ||
locations: { | ||
valType: 'data_array', | ||
dflt: [], | ||
role: 'info', | ||
description: [ | ||
'Specifies the location(s) of slices on the axis.', | ||
'When not locations specified slices would be created for', | ||
'all points of the axis', axLetter, 'except start and end.' | ||
].join(' ') | ||
}, | ||
fill: { | ||
valType: 'number', | ||
role: 'style', | ||
min: 0, | ||
max: 1, | ||
dflt: 1, | ||
description: [ | ||
'Sets the fill ratio of the `slices`. The default fill value of the', | ||
'`slices` is 1 meaning that they are entirely shaded. On the other hand', | ||
'Applying a `fill` ratio less than one would allow the creation of', | ||
'openings parallel to the edges.' | ||
].join(' ') | ||
} | ||
}; | ||
} | ||
|
||
function makeCapAttr(axLetter) { | ||
return { | ||
show: { | ||
valType: 'boolean', | ||
role: 'info', | ||
dflt: true, | ||
description: [ | ||
'Sets the fill ratio of the `slices`. The default fill value of the', axLetter, | ||
'`slices` is 1 meaning that they are entirely shaded. On the other hand', | ||
'Applying a `fill` ratio less than one would allow the creation of', | ||
'openings parallel to the edges.' | ||
].join(' ') | ||
}, | ||
fill: { | ||
valType: 'number', | ||
role: 'style', | ||
min: 0, | ||
max: 1, | ||
dflt: 1, | ||
description: [ | ||
'Sets the fill ratio of the `caps`. The default fill value of the', | ||
'`caps` is 1 meaning that they are entirely shaded. On the other hand', | ||
'Applying a `fill` ratio less than one would allow the creation of', | ||
'openings parallel to the edges.' | ||
].join(' ') | ||
} | ||
}; | ||
} | ||
|
||
var attrs = module.exports = overrideAll(extendFlat({ | ||
x: { | ||
valType: 'data_array', | ||
role: 'info', | ||
description: [ | ||
'Sets the X coordinates of the vertices on X axis.' | ||
].join(' ') | ||
}, | ||
y: { | ||
valType: 'data_array', | ||
role: 'info', | ||
description: [ | ||
'Sets the Y coordinates of the vertices on Y axis.' | ||
].join(' ') | ||
}, | ||
z: { | ||
valType: 'data_array', | ||
role: 'info', | ||
description: [ | ||
'Sets the Z coordinates of the vertices on Z axis.' | ||
].join(' ') | ||
}, | ||
value: { | ||
valType: 'data_array', | ||
role: 'info', | ||
description: [ | ||
'Sets the 4th dimension (value) of the vertices.' | ||
].join(' ') | ||
}, | ||
isomin: { | ||
valType: 'number', | ||
role: 'info', | ||
description: [ | ||
'Sets the minimum boundary for iso-surface plot.' | ||
].join(' ') | ||
}, | ||
isomax: { | ||
valType: 'number', | ||
role: 'info', | ||
description: [ | ||
'Sets the maximum boundary for iso-surface plot.' | ||
].join(' ') | ||
}, | ||
|
||
surface: { | ||
show: { | ||
etpinard marked this conversation as resolved.
Show resolved
Hide resolved
|
||
valType: 'boolean', | ||
role: 'info', | ||
dflt: true, | ||
description: [ | ||
'Hides/displays surfaces between minimum and maximum iso-values.' | ||
].join(' ') | ||
}, | ||
count: { | ||
valType: 'integer', | ||
role: 'info', | ||
dflt: 2, | ||
min: 1, | ||
description: [ | ||
'Sets the number of iso-surfaces between minimum and maximum iso-values.', | ||
'By default this value is 2 meaning that only minimum and maximum surfaces', | ||
'would be drawn.' | ||
].join(' ') | ||
}, | ||
fill: { | ||
valType: 'number', | ||
role: 'style', | ||
min: 0, | ||
max: 1, | ||
dflt: 1, | ||
description: [ | ||
'Sets the fill ratio of the iso-surface. The default fill value of the', | ||
'surface is 1 meaning that they are entirely shaded. On the other hand', | ||
'Applying a `fill` ratio less than one would allow the creation of', | ||
'openings parallel to the edges.' | ||
].join(' ') | ||
}, | ||
pattern: { | ||
valType: 'flaglist', | ||
flags: ['A', 'B', 'C', 'D', 'E'], | ||
extras: ['all', 'odd', 'even'], | ||
dflt: 'all', | ||
role: 'style', | ||
description: [ | ||
'Sets the surface pattern of the iso-surface 3-D sections. The default pattern of', | ||
'the surface is `all` meaning that the rest of surface elements would be shaded.', | ||
'The check options (either 1 or 2) could be used to draw half of the squares', | ||
'on the surface. Using various combinations of capital `A`, `B`, `C`, `D` and `E`', | ||
'may also be used to reduce the number of triangles on the iso-surfaces and', | ||
'creating other patterns of interest.' | ||
].join(' ') | ||
} | ||
}, | ||
|
||
spaceframe: { | ||
show: { | ||
valType: 'boolean', | ||
role: 'info', | ||
dflt: false, | ||
description: [ | ||
'Displays/hides tetrahedron shapes between minimum and', | ||
'maximum iso-values. Often useful when either caps or', | ||
'surfaces are disabled or filled with values less than 1.' | ||
].join(' ') | ||
}, | ||
fill: { | ||
valType: 'number', | ||
role: 'style', | ||
min: 0, | ||
max: 1, | ||
dflt: 0.15, | ||
description: [ | ||
'Sets the fill ratio of the `spaceframe` elements. The default fill value', | ||
'is 0.15 meaning that only 15% of the area of every faces of tetras would be', | ||
'shaded. Applying a greater `fill` ratio would allow the creation of stronger', | ||
'elements or could be sued to have entirely closed areas (in case of using 1).' | ||
].join(' ') | ||
} | ||
}, | ||
|
||
slices: { | ||
x: makeSliceAttr('x'), | ||
y: makeSliceAttr('y'), | ||
z: makeSliceAttr('z') | ||
}, | ||
|
||
caps: { | ||
x: makeCapAttr('x'), | ||
y: makeCapAttr('y'), | ||
z: makeCapAttr('z') | ||
}, | ||
|
||
text: { | ||
valType: 'string', | ||
role: 'info', | ||
dflt: '', | ||
arrayOk: true, | ||
description: [ | ||
'Sets the text elements associated with the vertices.', | ||
'If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,', | ||
'these elements will be seen in the hover labels.' | ||
].join(' ') | ||
}, | ||
}, | ||
|
||
colorscaleAttrs('', { | ||
colorAttr: '`value`', | ||
showScaleDflt: true, | ||
editTypeOverride: 'calc' | ||
}), { | ||
|
||
colorbar: colorbarAttrs, | ||
|
||
// Flat shaded mode | ||
flatshading: { | ||
valType: 'boolean', | ||
role: 'style', | ||
dflt: false, | ||
description: [ | ||
'Determines whether or not normal smoothing is applied to the isosurfaces,', | ||
'creating isosurfaces with an angular, low-poly look via flat reflections.' | ||
].join(' ') | ||
}, | ||
|
||
contour: { | ||
show: extendFlat({}, surfaceAtts.contours.x.show, { | ||
description: [ | ||
'Sets whether or not dynamic contours are shown on hover.', | ||
'Contours are more useful when hovering on caps and slices.' | ||
].join(' ') | ||
}), | ||
color: surfaceAtts.contours.x.color, | ||
width: surfaceAtts.contours.x.width | ||
}, | ||
|
||
lightposition: { | ||
x: extendFlat({}, surfaceAtts.lightposition.x, {dflt: 1e5}), | ||
y: extendFlat({}, surfaceAtts.lightposition.y, {dflt: 1e5}), | ||
z: extendFlat({}, surfaceAtts.lightposition.z, {dflt: 0}) | ||
}, | ||
lighting: meshAttrs.lighting, | ||
|
||
hoverinfo: extendFlat({}, baseAttrs.hoverinfo) | ||
}), 'calc', 'nested'); | ||
|
||
attrs.x.editType = attrs.y.editType = attrs.z.editType = attrs.value.editType = 'calc+clearAxisTypes'; | ||
attrs.transforms = undefined; |
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,37 @@ | ||
/** | ||
* 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 colorscaleCalc = require('../../components/colorscale/calc'); | ||
|
||
module.exports = function calc(gd, trace) { | ||
|
||
trace._len = Math.min(trace.x.length, trace.y.length, trace.z.length, trace.value.length); | ||
|
||
var min = Infinity; | ||
var max = -Infinity; | ||
var len = trace.value.length; | ||
for(var i = 0; i < len; i++) { | ||
var v = trace.value[i]; | ||
min = Math.min(min, v); | ||
max = Math.max(max, v); | ||
} | ||
|
||
trace._minValues = min; | ||
trace._maxValues = max; | ||
|
||
trace._vMin = (trace.isomin === undefined || trace.isomin === null) ? min : trace.isomin; | ||
trace._vMax = (trace.isomax === undefined || trace.isomin === null) ? max : trace.isomax; | ||
|
||
colorscaleCalc(gd, trace, { | ||
vals: [trace._vMin, trace._vMax], | ||
containerStr: '', | ||
cLetter: 'c' | ||
}); | ||
}; |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.