Skip to content

Commit d2c5ae8

Browse files
committed
Use plots/domain and handleDomainDefaults
1 parent 7b75100 commit d2c5ae8

File tree

2 files changed

+4
-34
lines changed

2 files changed

+4
-34
lines changed

src/traces/parcats/attributes.js

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
var extendFlat = require('../../lib/extend').extendFlat;
1212
var colorAttributes = require('../../components/colorscale/attributes');
13-
13+
var domainAttrs = require('../../plots/domain').attributes;
1414
var scatterAttrs = require('../scatter/attributes');
1515
var scatterLineAttrs = scatterAttrs.line;
1616
var colorbarAttrs = require('../../components/colorbar/attributes');
@@ -31,37 +31,7 @@ var line = extendFlat({
3131
});
3232

3333
module.exports = {
34-
domain: {
35-
x: {
36-
valType: 'info_array',
37-
role: 'info',
38-
items: [
39-
{valType: 'number', min: 0, max: 1, editType: 'calc'},
40-
{valType: 'number', min: 0, max: 1, editType: 'calc'}
41-
],
42-
dflt: [0, 1],
43-
editType: 'calc',
44-
description: [
45-
'Sets the horizontal domain of this `parcats` trace',
46-
'(in plot fraction).'
47-
].join(' ')
48-
},
49-
y: {
50-
valType: 'info_array',
51-
role: 'info',
52-
items: [
53-
{valType: 'number', min: 0, max: 1, editType: 'calc'},
54-
{valType: 'number', min: 0, max: 1, editType: 'calc'}
55-
],
56-
dflt: [0, 1],
57-
editType: 'calc',
58-
description: [
59-
'Sets the vertical domain of this `parcats` trace',
60-
'(in plot fraction).'
61-
].join(' ')
62-
},
63-
editType: 'calc'
64-
},
34+
domain: domainAttrs({name: 'parcats', trace: true, editType: 'calc'}),
6535

6636
tooltip: {
6737
valType: 'boolean',

src/traces/parcats/defaults.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ var Lib = require('../../lib');
1212
var attributes = require('./attributes');
1313
var parcatConstants = require('./constants');
1414
var colorbarDefaults = require('../../components/colorbar/defaults');
15+
var handleDomainDefaults = require('../../plots/domain').defaults;
1516

1617
function markerDefaults(traceIn, traceOut, defaultColor, layout, coerce) {
1718

@@ -102,8 +103,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
102103

103104
dimensionsDefaults(traceIn, traceOut);
104105

105-
coerce('domain.x');
106-
coerce('domain.y');
106+
handleDomainDefaults(traceOut, layout, coerce);
107107

108108
markerDefaults(traceIn, traceOut, defaultColor, layout, coerce);
109109

0 commit comments

Comments
 (0)