Skip to content

Commit 3d54bbe

Browse files
committed
add attribute description for mesh3d
1 parent edcfe7e commit 3d54bbe

File tree

2 files changed

+85
-80
lines changed

2 files changed

+85
-80
lines changed

src/traces/mesh3d/attributes.js

Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -8,122 +8,122 @@
88

99

1010
var colorscaleAttrs = require('../../components/colorscale/attributes');
11+
var surfaceAtts = require('../surface/attributes');
12+
var extendFlat = require('../../lib/extend').extendFlat;
13+
1114

1215
module.exports = {
13-
x: {valType: 'data_array'},
14-
y: {valType: 'data_array'},
15-
z: {valType: 'data_array'},
16+
x: {
17+
valType: 'data_array',
18+
description: 'Sets the x coordinates of the vertices'
19+
},
20+
y: {
21+
valType: 'data_array',
22+
description: 'Sets the y coordinates of the vertices'
23+
},
24+
z: {
25+
valType: 'data_array',
26+
description: 'Sets the z coordinates of the vertices'
27+
},
1628

17-
i: {valType: 'data_array'},
18-
j: {valType: 'data_array'},
19-
k: {valType: 'data_array'},
29+
i: {
30+
valType: 'data_array',
31+
description: 'Sets the indices of x coordinates of the vertices'
32+
},
33+
j: {
34+
valType: 'data_array',
35+
description: 'Sets the indices of y coordinates of the vertices'
36+
},
37+
k: {
38+
valType: 'data_array',
39+
description: 'Sets the indices of z coordinates of the vertices'
40+
},
2041

2142
delaunayaxis: {
22-
valType: 'enumerated',
23-
role: 'info',
24-
values: [ 'x', 'y', 'z' ],
25-
dflt: 'z'
43+
valType: 'enumerated',
44+
role: 'info',
45+
values: [ 'x', 'y', 'z' ],
46+
dflt: 'z',
47+
description: [
48+
'Sets the Delaunay axis from which the triangulation of the mesh',
49+
'takes place.',
50+
'An alternative to setting the `i`, `j`, `k` indices triplets.'
51+
].join(' ')
2652
},
2753

2854
alphahull: {
29-
valType: 'number',
30-
role: 'style',
31-
dflt: -1
55+
valType: 'number',
56+
role: 'style',
57+
dflt: -1,
58+
description: [
59+
'Sets the shape of the mesh',
60+
'If *-1*, Delaunay triangulation is used',
61+
'If *>0*, the alpha-shape algorithm is used',
62+
'If *0*, the convex-hull algorithm is used',
63+
'An alternative to the `i`, `j`, `k` indices triplets.'
64+
]
3265
},
3366

34-
intensity: {valType: 'data_array'},
67+
intensity: {
68+
valType: 'data_array',
69+
description: [
70+
'Sets the vertex intensity values,',
71+
'used for plotting fields on meshes'
72+
].join(' ')
73+
},
3574

3675
//Color field
3776
color: {
3877
valType: 'color',
39-
role: 'style'
78+
role: 'style',
79+
description: 'Sets the color of the whole mesh'
4080
},
4181
vertexcolor: {
4282
valType: 'data_array', // FIXME: this should be a color array
43-
role: 'style'
83+
role: 'style',
84+
description: [
85+
'Sets the color of each vertex',
86+
'Overrides *color*.'
87+
].join(' ')
4488
},
4589
facecolor: {
4690
valType: 'data_array',
47-
role: 'style'
91+
role: 'style',
92+
description: [
93+
'Sets the color of each face',
94+
'Overrides *color* and *vertexcolor*.'
95+
].join(' ')
4896
},
4997

5098
//Opacity
51-
opacity: {
52-
valType: 'number',
53-
role: 'style',
54-
min: 0,
55-
max: 1,
56-
dflt: 1
57-
},
99+
opacity: extendFlat({}, surfaceAtts.opacity),
58100

59101
//Flat shaded mode
60102
flatshading: {
61103
valType: 'boolean',
62104
role: 'style',
63-
dflt: false
105+
dflt: false,
106+
description: [
107+
'Determines whether or not normal smoothing is applied to the meshes,',
108+
'creating meshes with a low-poly look.'
109+
].join(' ')
64110
},
65111

66112
contour: {
67-
show: {
68-
valType: 'boolean',
69-
role: 'info',
70-
dflt: false
71-
},
72-
color: {
73-
valType: 'color',
74-
role: 'style',
75-
dflt: '#000'
76-
},
77-
width: {
78-
valType: 'number',
79-
role: 'style',
80-
min: 1,
81-
max: 16,
82-
dflt: 2
83-
}
113+
show: extendFlat({}, surfaceAtts.contours.x.show, {
114+
description: [
115+
'Sets whether or not dynamic contours are shown on hover'
116+
].join(' ')
117+
}),
118+
color: extendFlat({}, surfaceAtts.contours.x.color),
119+
width: extendFlat({}, surfaceAtts.contours.x.width)
84120
},
85121

86122
colorscale: colorscaleAttrs.colorscale,
87123
reversescale: colorscaleAttrs.reversescale,
88124
showscale: colorscaleAttrs.showscale,
89125

90-
lighting: {
91-
ambient: {
92-
valType: 'number',
93-
role: 'style',
94-
min: 0.00,
95-
max: 1.0,
96-
dflt: 0.8
97-
},
98-
diffuse: {
99-
valType: 'number',
100-
role: 'style',
101-
min: 0.00,
102-
max: 1.00,
103-
dflt: 0.8
104-
},
105-
specular: {
106-
valType: 'number',
107-
role: 'style',
108-
min: 0.00,
109-
max: 2.00,
110-
dflt: 0.05
111-
},
112-
roughness: {
113-
valType: 'number',
114-
role: 'style',
115-
min: 0.00,
116-
max: 1.00,
117-
dflt: 0.5
118-
},
119-
fresnel: {
120-
valType: 'number',
121-
role: 'style',
122-
min: 0.00,
123-
max: 5.00,
124-
dflt: 0.2
125-
}
126-
},
126+
lighting: extendFlat({}, surfaceAtts.lighting),
127127

128128
_nestedModules: { // nested module coupling
129129
'colorbar': 'Colorbar'

src/traces/mesh3d/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ var Mesh3D = module.exports = {};
1515

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

0 commit comments

Comments
 (0)