Skip to content
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

Add intensitymode to allow cell intensity values in mesh3d #4446

Merged
merged 1 commit into from
Dec 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"gl-heatmap2d": "^1.0.5",
"gl-line3d": "^1.1.11",
"gl-mat4": "^1.2.0",
"gl-mesh3d": "^2.1.3",
"gl-mesh3d": "^2.2.0",
"gl-plot2d": "^1.4.2",
"gl-plot3d": "^2.3.0",
"gl-pointcloud2d": "^1.0.2",
Expand Down
15 changes: 13 additions & 2 deletions src/traces/mesh3d/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,19 @@ module.exports = extendFlat({
valType: 'data_array',
editType: 'calc',
description: [
'Sets the vertex intensity values,',
'used for plotting fields on meshes'
'Sets the intensity values for vertices or cells',
'as defined by `intensitymode`.',
'It can be used for plotting fields on meshes.'
].join(' ')
},
intensitymode: {
valType: 'enumerated',
values: ['vertex', 'cell'],
dflt: 'vertex',
editType: 'calc',
role: 'info',
description: [
'Determines the source of `intensity` values.'
].join(' ')
},

Expand Down
5 changes: 3 additions & 2 deletions src/traces/mesh3d/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,9 @@ proto.update = function(data) {
if(data.intensity) {
var cOpts = extractOpts(data);
this.color = '#fff';
config.vertexIntensity = data.intensity;
config.vertexIntensityBounds = [cOpts.min, cOpts.max];
var mode = data.intensitymode;
config[mode + 'Intensity'] = data.intensity;
config[mode + 'IntensityBounds'] = [cOpts.min, cOpts.max];
config.colormap = parseColorScale(data);
} else if(data.vertexcolor) {
this.color = data.vertexcolor[0];
Expand Down
1 change: 1 addition & 0 deletions src/traces/mesh3d/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout

if('intensity' in traceIn) {
coerce('intensity');
coerce('intensitymode');
colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'c'});
} else {
traceOut.showscale = false;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading