Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2k
New code for isosurface trace#3340
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
71ae66ebe3c5a5dfe2a85251b2d4cd8671666bf59ddee7c8eb2b7bc00ac65d9f5c6052e5c7ff0e60de840a9bf1deecd804b1f79398779a6a2a4b9fb08e15084b49dc407e11c006531f887ae392af9294bf14109804cc4b4a10b36516208cbb2f84be605ce4456b4df15311b010171bf61da04df4ac90eb49aa746d9c1fa779fdb19de20714341ba29dac7f9d94f07677c7bbe59e5441d940b41fdd08cd4530cdb4File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| 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'); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,149 @@ | ||
| /** | ||
| * 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 baseAttrs = require('../../plots/attributes'); | ||
| var extendFlat = require('../../lib/extend').extendFlat; | ||
| module.exports = extendFlat({ | ||
| x: { | ||
| valType: 'data_array', | ||
| role: 'info', | ||
| editType: 'calc+clearAxisTypes', | ||
| description: [ | ||
| 'Sets the X coordinates of the vertices on X axis.' | ||
| ].join(' ') | ||
| }, | ||
| y: { | ||
| valType: 'data_array', | ||
| role: 'info', | ||
| editType: 'calc+clearAxisTypes', | ||
| description: [ | ||
| 'Sets the Y coordinates of the vertices on Y axis.' | ||
| ].join(' ') | ||
| }, | ||
| z: { | ||
| valType: 'data_array', | ||
| role: 'info', | ||
| editType: 'calc+clearAxisTypes', | ||
| description: [ | ||
| 'Sets the Z coordinates of the vertices on Z axis.' | ||
| ].join(' ') | ||
| }, | ||
| value: { | ||
| valType: 'data_array', | ||
| role: 'info', | ||
| editType: 'calc', | ||
| description: [ | ||
| 'Sets the 4th dimension of the vertices. It should be', | ||
| 'one dimensional array containing n=width*height*depth numbers.' | ||
| ].join(' ') | ||
| }, | ||
| isocap: { | ||
| valType: 'boolean', | ||
| role: 'info', | ||
| editType: 'calc', | ||
| dflt: false, | ||
| description: [ | ||
| 'Enable caps between minimum and maximum iso values.' | ||
| ].join(' ') | ||
| }, | ||
| isovalue: { | ||
| valType: 'data_array', | ||
| role: 'info', | ||
| editType: 'calc', | ||
| dflt: [0], | ||
| description: [ | ||
| 'Sets iso surface boundaries.' | ||
| ].join(' ') | ||
| }, | ||
| text: { | ||
| valType: 'string', | ||
| role: 'info', | ||
| dflt: '', | ||
| arrayOk: true, | ||
| editType: 'calc', | ||
| 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(' ') | ||
| }, | ||
| transforms: undefined | ||
| }, | ||
| colorscaleAttrs('', { | ||
| colorAttr: '`value`', | ||
| showScaleDflt: true, | ||
| editTypeOverride: 'calc' | ||
| }), { | ||
| colorbar: colorbarAttrs, | ||
| opacity: surfaceAtts.opacity, | ||
| // Flat shaded mode | ||
| flatshading: { | ||
| valType: 'boolean', | ||
| role: 'style', | ||
| dflt: false, | ||
| editType: 'calc', | ||
| 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: { | ||
Contributor 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.
ContributorAuthor 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. The contours seem to be working on hover namely on caps. | ||
| show: extendFlat({}, surfaceAtts.contours.x.show, { | ||
| description: [ | ||
| 'Sets whether or not dynamic contours are shown on hover' | ||
| ].join(' ') | ||
| }), | ||
| color: surfaceAtts.contours.x.color, | ||
| width: surfaceAtts.contours.x.width, | ||
| editType: 'calc' | ||
| }, | ||
| lightposition: { | ||
| x: extendFlat({}, surfaceAtts.lightposition.x, {dflt: 1e5}), | ||
| y: extendFlat({}, surfaceAtts.lightposition.y, {dflt: 1e5}), | ||
| z: extendFlat({}, surfaceAtts.lightposition.z, {dflt: 0}), | ||
| editType: 'calc' | ||
| }, | ||
| lighting: extendFlat({ | ||
| vertexnormalsepsilon: { | ||
| valType: 'number', | ||
| role: 'style', | ||
| min: 0.00, | ||
| max: 1, | ||
| dflt: 1e-12, // otherwise finely tessellated things eg. the brain will have no specular light reflection | ||
| editType: 'calc', | ||
| description: 'Epsilon for vertex normals calculation avoids math issues arising from degenerate geometry.' | ||
| }, | ||
| facenormalsepsilon: { | ||
| valType: 'number', | ||
| role: 'style', | ||
| min: 0.00, | ||
| max: 1, | ||
| dflt: 1e-6, // even the brain model doesn't appear to need finer than this | ||
| editType: 'calc', | ||
| description: 'Epsilon for face normals calculation avoids math issues arising from degenerate geometry.' | ||
| }, | ||
| editType: 'calc' | ||
| }, surfaceAtts.lighting), | ||
| hoverinfo: extendFlat({}, baseAttrs.hoverinfo, {editType: 'calc'}) | ||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| /** | ||
| * 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) { | ||
| colorscaleCalc(gd, trace, { | ||
| vals: trace.isovalue, | ||
| containerStr: '', | ||
| cLetter: 'c' | ||
| }); | ||
| }; |
Uh oh!
There was an error while loading. Please reload this page.
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.
mikolalysenko/isosurface@master...archmoj:plotly-integration