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