Skip to content

Commit 2f3a712

Browse files
committed
use contour/attributes in contourcarpet/attributes
1 parent b8c75c0 commit 2f3a712

File tree

2 files changed

+10
-62
lines changed

2 files changed

+10
-62
lines changed

src/traces/contour/attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ module.exports = extendFlat({}, {
107107
role: 'style',
108108
description: [
109109
'Determines whether or not the contour lines are drawn.',
110-
'Has only an effect if `contours.coloring` is set to *fill*.'
110+
'Has an effect only if `contours.coloring` is set to *fill*.'
111111
].join(' ')
112112
},
113113
showlabels: {

src/traces/contourcarpet/attributes.js

Lines changed: 9 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
'use strict';
1010

1111
var heatmapAttrs = require('../heatmap/attributes');
12+
var contourAttrs = require('../contour/attributes');
13+
var contourContourAttrs = contourAttrs.contours;
1214
var scatterAttrs = require('../scatter/attributes');
1315
var colorscaleAttrs = require('../../components/colorscale/attributes');
1416
var colorbarAttrs = require('../../components/colorbar/attributes');
@@ -58,30 +60,8 @@ module.exports = extendFlat({}, {
5860
].join(' ')
5961
},
6062

61-
autocontour: {
62-
valType: 'boolean',
63-
dflt: true,
64-
role: 'style',
65-
description: [
66-
'Determines whether or not the contour level attributes are',
67-
'picked by an algorithm.',
68-
'If *true*, the number of contour levels can be set in `ncontours`.',
69-
'If *false*, set the contour level attributes in `contours`.'
70-
].join(' ')
71-
},
72-
ncontours: {
73-
valType: 'integer',
74-
dflt: 15,
75-
min: 1,
76-
role: 'style',
77-
description: [
78-
'Sets the maximum number of contour levels. The actual number',
79-
'of contours will be chosen automatically to be less than or',
80-
'equal to the value of `ncontours`.',
81-
'Has an effect only if `autocontour` is *true* or if',
82-
'`contours.size` is missing.'
83-
].join(' ')
84-
},
63+
autocontour: contourAttrs.autocontour,
64+
ncontours: contourAttrs.ncontours,
8565

8666
contours: {
8767
type: {
@@ -96,35 +76,11 @@ module.exports = extendFlat({}, {
9676
'`value` parameters.'
9777
].join(' ')
9878
},
99-
start: {
100-
valType: 'number',
101-
dflt: null,
102-
role: 'style',
103-
description: [
104-
'Sets the starting contour level value.',
105-
'Must be less than `contours.end`'
106-
].join(' ')
107-
},
108-
end: {
109-
valType: 'number',
110-
dflt: null,
111-
role: 'style',
112-
description: [
113-
'Sets the end contour level value.',
114-
'Must be more than `contours.start`'
115-
].join(' ')
116-
},
117-
size: {
118-
valType: 'number',
119-
dflt: null,
120-
min: 0,
121-
role: 'style',
122-
description: [
123-
'Sets the step between each contour level.',
124-
'Must be positive.'
125-
].join(' ')
126-
},
79+
start: contourContourAttrs.start,
80+
end: contourContourAttrs.end,
81+
size: contourContourAttrs.size,
12782
coloring: {
83+
// from contourAttrs.contours.coloring but no 'heatmap' option
12884
valType: 'enumerated',
12985
values: ['fill', 'lines', 'none'],
13086
dflt: 'fill',
@@ -136,15 +92,7 @@ module.exports = extendFlat({}, {
13692
'If *none*, no coloring is applied on this trace.'
13793
].join(' ')
13894
},
139-
showlines: {
140-
valType: 'boolean',
141-
dflt: true,
142-
role: 'style',
143-
description: [
144-
'Determines whether or not the contour lines are drawn.',
145-
'Has only an effect if `contours.coloring` is set to *fill*.'
146-
].join(' ')
147-
},
95+
showlines: contourContourAttrs.showlines,
14896
operation: {
14997
valType: 'enumerated',
15098
values: [].concat(constants.INEQUALITY_OPS).concat(constants.INTERVAL_OPS).concat(constants.SET_OPS),

0 commit comments

Comments
 (0)