Skip to content

Add attribute descriptions for mesh3d #115

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 2 commits into from
Dec 15, 2015
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
158 changes: 79 additions & 79 deletions src/traces/mesh3d/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,122 +8,122 @@


var colorscaleAttrs = require('../../components/colorscale/attributes');
var surfaceAtts = require('../surface/attributes');
var extendFlat = require('../../lib/extend').extendFlat;


module.exports = {
x: {valType: 'data_array'},
y: {valType: 'data_array'},
z: {valType: 'data_array'},
x: {
valType: 'data_array',
description: 'Sets the x coordinates of the vertices'
},
y: {
valType: 'data_array',
description: 'Sets the y coordinates of the vertices'
},
z: {
valType: 'data_array',
description: 'Sets the z coordinates of the vertices'
},

i: {valType: 'data_array'},
j: {valType: 'data_array'},
k: {valType: 'data_array'},
i: {
valType: 'data_array',
description: 'Sets the indices of x coordinates of the vertices'
},
j: {
valType: 'data_array',
description: 'Sets the indices of y coordinates of the vertices'
},
k: {
valType: 'data_array',
description: 'Sets the indices of z coordinates of the vertices'
},

delaunayaxis: {
valType: 'enumerated',
role: 'info',
values: [ 'x', 'y', 'z' ],
dflt: 'z'
valType: 'enumerated',
role: 'info',
values: [ 'x', 'y', 'z' ],
dflt: 'z',
description: [
'Sets the Delaunay axis from which the triangulation of the mesh',
'takes place.',
'An alternative to setting the `i`, `j`, `k` indices triplets.'
].join(' ')
},

alphahull: {
valType: 'number',
role: 'style',
dflt: -1
valType: 'number',
role: 'style',
dflt: -1,
description: [
'Sets the shape of the mesh',
'If *-1*, Delaunay triangulation is used',
'If *>0*, the alpha-shape algorithm is used',
'If *0*, the convex-hull algorithm is used',
'An alternative to the `i`, `j`, `k` indices triplets.'
].join(' ')
},

intensity: {valType: 'data_array'},
intensity: {
valType: 'data_array',
description: [
'Sets the vertex intensity values,',
'used for plotting fields on meshes'
].join(' ')
},

//Color field
color: {
valType: 'color',
role: 'style'
role: 'style',
description: 'Sets the color of the whole mesh'
},
vertexcolor: {
valType: 'data_array', // FIXME: this should be a color array
role: 'style'
role: 'style',
description: [
'Sets the color of each vertex',
'Overrides *color*.'
].join(' ')
},
facecolor: {
valType: 'data_array',
role: 'style'
role: 'style',
description: [
'Sets the color of each face',
'Overrides *color* and *vertexcolor*.'
].join(' ')
},

//Opacity
opacity: {
valType: 'number',
role: 'style',
min: 0,
max: 1,
dflt: 1
},
opacity: extendFlat({}, surfaceAtts.opacity),

//Flat shaded mode
flatshading: {
valType: 'boolean',
role: 'style',
dflt: false
dflt: false,
description: [
'Determines whether or not normal smoothing is applied to the meshes,',
'creating meshes with a low-poly look.'
].join(' ')
},

contour: {
show: {
valType: 'boolean',
role: 'info',
dflt: false
},
color: {
valType: 'color',
role: 'style',
dflt: '#000'
},
width: {
valType: 'number',
role: 'style',
min: 1,
max: 16,
dflt: 2
}
show: extendFlat({}, surfaceAtts.contours.x.show, {
description: [
'Sets whether or not dynamic contours are shown on hover'
].join(' ')
}),
color: extendFlat({}, surfaceAtts.contours.x.color),
width: extendFlat({}, surfaceAtts.contours.x.width)
},

colorscale: colorscaleAttrs.colorscale,
reversescale: colorscaleAttrs.reversescale,
showscale: colorscaleAttrs.showscale,

lighting: {
ambient: {
valType: 'number',
role: 'style',
min: 0.00,
max: 1.0,
dflt: 0.8
},
diffuse: {
valType: 'number',
role: 'style',
min: 0.00,
max: 1.00,
dflt: 0.8
},
specular: {
valType: 'number',
role: 'style',
min: 0.00,
max: 2.00,
dflt: 0.05
},
roughness: {
valType: 'number',
role: 'style',
min: 0.00,
max: 1.00,
dflt: 0.5
},
fresnel: {
valType: 'number',
role: 'style',
min: 0.00,
max: 5.00,
dflt: 0.2
}
},
lighting: extendFlat({}, surfaceAtts.lighting),

_nestedModules: { // nested module coupling
'colorbar': 'Colorbar'
Expand Down
7 changes: 6 additions & 1 deletion src/traces/mesh3d/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ var Mesh3D = module.exports = {};

Plotly.Plots.register(Mesh3D, 'mesh3d', ['gl3d'], {
description: [
''
'Draws sets of triangles with coordinates given by',
'three 1-dimensional arrays in `x`, `y`, `z` and',
'(1) a sets of `i`, `j`, `k` indices',
'(2) Delaunay triangulation or',
'(3) the Alpha-shape algorithm or',
'(4) the Convex-hull algorithm'
].join(' ')
});

Expand Down