|
8 | 8 |
|
9 | 9 |
|
10 | 10 | var colorscaleAttrs = require('../../components/colorscale/attributes');
|
| 11 | +var surfaceAtts = require('../surface/attributes'); |
| 12 | +var extendFlat = require('../../lib/extend').extendFlat; |
| 13 | + |
11 | 14 |
|
12 | 15 | 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 | + }, |
16 | 28 |
|
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 | + }, |
20 | 41 |
|
21 | 42 | 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(' ') |
26 | 52 | },
|
27 | 53 |
|
28 | 54 | 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 | + ] |
32 | 65 | },
|
33 | 66 |
|
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 | + }, |
35 | 74 |
|
36 | 75 | //Color field
|
37 | 76 | color: {
|
38 | 77 | valType: 'color',
|
39 |
| - role: 'style' |
| 78 | + role: 'style', |
| 79 | + description: 'Sets the color of the whole mesh' |
40 | 80 | },
|
41 | 81 | vertexcolor: {
|
42 | 82 | 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(' ') |
44 | 88 | },
|
45 | 89 | facecolor: {
|
46 | 90 | 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(' ') |
48 | 96 | },
|
49 | 97 |
|
50 | 98 | //Opacity
|
51 |
| - opacity: { |
52 |
| - valType: 'number', |
53 |
| - role: 'style', |
54 |
| - min: 0, |
55 |
| - max: 1, |
56 |
| - dflt: 1 |
57 |
| - }, |
| 99 | + opacity: extendFlat({}, surfaceAtts.opacity), |
58 | 100 |
|
59 | 101 | //Flat shaded mode
|
60 | 102 | flatshading: {
|
61 | 103 | valType: 'boolean',
|
62 | 104 | 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(' ') |
64 | 110 | },
|
65 | 111 |
|
66 | 112 | 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) |
84 | 120 | },
|
85 | 121 |
|
86 | 122 | colorscale: colorscaleAttrs.colorscale,
|
87 | 123 | reversescale: colorscaleAttrs.reversescale,
|
88 | 124 | showscale: colorscaleAttrs.showscale,
|
89 | 125 |
|
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), |
127 | 127 |
|
128 | 128 | _nestedModules: { // nested module coupling
|
129 | 129 | 'colorbar': 'Colorbar'
|
|
0 commit comments