|
10 | 10 |
|
11 | 11 | var heatmapAttrs = require('../heatmap/attributes'); |
12 | 12 | var scatterAttrs = require('../scatter/attributes'); |
| 13 | +var colorscaleAttrs = require('../../components/colorscale/attributes'); |
13 | 14 | var extendFlat = require('../../lib/extend').extendFlat; |
14 | 15 |
|
15 | 16 | var scatterLineAttrs = scatterAttrs.line; |
16 | 17 |
|
17 | | -module.exports = { |
18 | | - z: heatmapAttrs.z, |
19 | | - x: heatmapAttrs.x, |
20 | | - x0: heatmapAttrs.x0, |
21 | | - dx: heatmapAttrs.dx, |
22 | | - y: heatmapAttrs.y, |
23 | | - y0: heatmapAttrs.y0, |
24 | | - dy: heatmapAttrs.dy, |
25 | | - text: heatmapAttrs.text, |
26 | | - transpose: heatmapAttrs.transpose, |
27 | | - xtype: heatmapAttrs.xtype, |
28 | | - ytype: heatmapAttrs.ytype, |
| 18 | +module.exports = extendFlat({}, |
| 19 | + colorscaleAttrs, |
| 20 | + {autocolorscale: extendFlat({}, colorscaleAttrs.autocolorscale, {dflt: false})}, |
| 21 | + { |
| 22 | + z: heatmapAttrs.z, |
| 23 | + x: heatmapAttrs.x, |
| 24 | + x0: heatmapAttrs.x0, |
| 25 | + dx: heatmapAttrs.dx, |
| 26 | + y: heatmapAttrs.y, |
| 27 | + y0: heatmapAttrs.y0, |
| 28 | + dy: heatmapAttrs.dy, |
| 29 | + text: heatmapAttrs.text, |
| 30 | + transpose: heatmapAttrs.transpose, |
| 31 | + xtype: heatmapAttrs.xtype, |
| 32 | + ytype: heatmapAttrs.ytype, |
29 | 33 |
|
30 | | - zauto: heatmapAttrs.zauto, |
31 | | - zmin: heatmapAttrs.zmin, |
32 | | - zmax: heatmapAttrs.zmax, |
33 | | - colorscale: heatmapAttrs.colorscale, |
34 | | - autocolorscale: heatmapAttrs.autocolorscale, |
35 | | - reversescale: heatmapAttrs.reversescale, |
36 | | - showscale: heatmapAttrs.showscale, |
| 34 | + connectgaps: heatmapAttrs.connectgaps, |
37 | 35 |
|
38 | | - connectgaps: heatmapAttrs.connectgaps, |
39 | | - |
40 | | - autocontour: { |
41 | | - valType: 'boolean', |
42 | | - dflt: true, |
43 | | - role: 'style', |
44 | | - description: [ |
45 | | - 'Determines whether or not the contour level attributes are', |
46 | | - 'picked by an algorithm.', |
47 | | - 'If *true*, the number of contour levels can be set in `ncontours`.', |
48 | | - 'If *false*, set the contour level attributes in `contours`.' |
49 | | - ].join(' ') |
50 | | - }, |
51 | | - ncontours: { |
52 | | - valType: 'integer', |
53 | | - dflt: 0, |
54 | | - role: 'style', |
55 | | - description: [ |
56 | | - 'Sets the number of contour levels.', |
57 | | - 'Has an effect only if `autocontour` is *true*.' |
58 | | - ].join(' ') |
59 | | - }, |
60 | | - |
61 | | - contours: { |
62 | | - start: { |
63 | | - valType: 'number', |
64 | | - dflt: null, |
65 | | - role: 'style', |
66 | | - description: 'Sets the starting contour level value.' |
67 | | - }, |
68 | | - end: { |
69 | | - valType: 'number', |
70 | | - dflt: null, |
71 | | - role: 'style', |
72 | | - description: 'Sets the end contour level value.' |
73 | | - }, |
74 | | - size: { |
75 | | - valType: 'number', |
76 | | - dflt: null, |
77 | | - role: 'style', |
78 | | - description: 'Sets the step between each contour level.' |
79 | | - }, |
80 | | - coloring: { |
81 | | - valType: 'enumerated', |
82 | | - values: ['fill', 'heatmap', 'lines', 'none'], |
83 | | - dflt: 'fill', |
| 36 | + autocontour: { |
| 37 | + valType: 'boolean', |
| 38 | + dflt: true, |
84 | 39 | role: 'style', |
85 | 40 | description: [ |
86 | | - 'Determines the coloring method showing the contour values.', |
87 | | - 'If *fill*, coloring is done evenly between each contour level', |
88 | | - 'If *heatmap*, a heatmap gradient coloring is applied', |
89 | | - 'between each contour level.', |
90 | | - 'If *lines*, coloring is done on the contour lines.', |
91 | | - 'If *none*, no coloring is applied on this trace.' |
| 41 | + 'Determines whether or not the contour level attributes are', |
| 42 | + 'picked by an algorithm.', |
| 43 | + 'If *true*, the number of contour levels can be set in `ncontours`.', |
| 44 | + 'If *false*, set the contour level attributes in `contours`.' |
92 | 45 | ].join(' ') |
93 | 46 | }, |
94 | | - showlines: { |
95 | | - valType: 'boolean', |
96 | | - dflt: true, |
| 47 | + ncontours: { |
| 48 | + valType: 'integer', |
| 49 | + dflt: 0, |
97 | 50 | role: 'style', |
98 | 51 | description: [ |
99 | | - 'Determines whether or not the contour lines are drawn.', |
100 | | - 'Has only an effect if `contours.coloring` is set to *fill*.' |
| 52 | + 'Sets the number of contour levels.', |
| 53 | + 'Has an effect only if `autocontour` is *true*.' |
101 | 54 | ].join(' ') |
102 | | - } |
103 | | - }, |
| 55 | + }, |
104 | 56 |
|
105 | | - line: { |
106 | | - color: extendFlat({}, scatterLineAttrs.color, { |
107 | | - description: [ |
108 | | - 'Sets the color of the contour level.', |
109 | | - 'Has no if `contours.coloring` is set to *lines*.' |
110 | | - ].join(' ') |
111 | | - }), |
112 | | - width: scatterLineAttrs.width, |
113 | | - dash: scatterLineAttrs.dash, |
114 | | - smoothing: extendFlat({}, scatterLineAttrs.smoothing, { |
115 | | - description: [ |
116 | | - 'Sets the amount of smoothing for the contour lines,', |
117 | | - 'where *0* corresponds to no smoothing.' |
118 | | - ].join(' ') |
119 | | - }) |
120 | | - }, |
| 57 | + contours: { |
| 58 | + start: { |
| 59 | + valType: 'number', |
| 60 | + dflt: null, |
| 61 | + role: 'style', |
| 62 | + description: 'Sets the starting contour level value.' |
| 63 | + }, |
| 64 | + end: { |
| 65 | + valType: 'number', |
| 66 | + dflt: null, |
| 67 | + role: 'style', |
| 68 | + description: 'Sets the end contour level value.' |
| 69 | + }, |
| 70 | + size: { |
| 71 | + valType: 'number', |
| 72 | + dflt: null, |
| 73 | + role: 'style', |
| 74 | + description: 'Sets the step between each contour level.' |
| 75 | + }, |
| 76 | + coloring: { |
| 77 | + valType: 'enumerated', |
| 78 | + values: ['fill', 'heatmap', 'lines', 'none'], |
| 79 | + dflt: 'fill', |
| 80 | + role: 'style', |
| 81 | + description: [ |
| 82 | + 'Determines the coloring method showing the contour values.', |
| 83 | + 'If *fill*, coloring is done evenly between each contour level', |
| 84 | + 'If *heatmap*, a heatmap gradient coloring is applied', |
| 85 | + 'between each contour level.', |
| 86 | + 'If *lines*, coloring is done on the contour lines.', |
| 87 | + 'If *none*, no coloring is applied on this trace.' |
| 88 | + ].join(' ') |
| 89 | + }, |
| 90 | + showlines: { |
| 91 | + valType: 'boolean', |
| 92 | + dflt: true, |
| 93 | + role: 'style', |
| 94 | + description: [ |
| 95 | + 'Determines whether or not the contour lines are drawn.', |
| 96 | + 'Has only an effect if `contours.coloring` is set to *fill*.' |
| 97 | + ].join(' ') |
| 98 | + } |
| 99 | + }, |
121 | 100 |
|
122 | | - _nestedModules: { |
123 | | - 'colorbar': 'Colorbar' |
124 | | - } |
125 | | -}; |
| 101 | + line: { |
| 102 | + color: extendFlat({}, scatterLineAttrs.color, { |
| 103 | + description: [ |
| 104 | + 'Sets the color of the contour level.', |
| 105 | + 'Has no if `contours.coloring` is set to *lines*.' |
| 106 | + ].join(' ') |
| 107 | + }), |
| 108 | + width: scatterLineAttrs.width, |
| 109 | + dash: scatterLineAttrs.dash, |
| 110 | + smoothing: extendFlat({}, scatterLineAttrs.smoothing, { |
| 111 | + description: [ |
| 112 | + 'Sets the amount of smoothing for the contour lines,', |
| 113 | + 'where *0* corresponds to no smoothing.' |
| 114 | + ].join(' ') |
| 115 | + }) |
| 116 | + }, |
| 117 | + |
| 118 | + _nestedModules: { |
| 119 | + 'colorbar': 'Colorbar' |
| 120 | + } |
| 121 | + }); |
0 commit comments