Skip to content

Commit

Permalink
Use plots/domain and handleDomainDefaults
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmmease committed Aug 8, 2018
1 parent 7b75100 commit d2c5ae8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 34 deletions.
34 changes: 2 additions & 32 deletions src/traces/parcats/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

var extendFlat = require('../../lib/extend').extendFlat;
var colorAttributes = require('../../components/colorscale/attributes');

var domainAttrs = require('../../plots/domain').attributes;
var scatterAttrs = require('../scatter/attributes');
var scatterLineAttrs = scatterAttrs.line;
var colorbarAttrs = require('../../components/colorbar/attributes');
Expand All @@ -31,37 +31,7 @@ var line = extendFlat({
});

module.exports = {
domain: {
x: {
valType: 'info_array',
role: 'info',
items: [
{valType: 'number', min: 0, max: 1, editType: 'calc'},
{valType: 'number', min: 0, max: 1, editType: 'calc'}
],
dflt: [0, 1],
editType: 'calc',
description: [
'Sets the horizontal domain of this `parcats` trace',
'(in plot fraction).'
].join(' ')
},
y: {
valType: 'info_array',
role: 'info',
items: [
{valType: 'number', min: 0, max: 1, editType: 'calc'},
{valType: 'number', min: 0, max: 1, editType: 'calc'}
],
dflt: [0, 1],
editType: 'calc',
description: [
'Sets the vertical domain of this `parcats` trace',
'(in plot fraction).'
].join(' ')
},
editType: 'calc'
},
domain: domainAttrs({name: 'parcats', trace: true, editType: 'calc'}),

tooltip: {
valType: 'boolean',
Expand Down
4 changes: 2 additions & 2 deletions src/traces/parcats/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ var Lib = require('../../lib');
var attributes = require('./attributes');
var parcatConstants = require('./constants');
var colorbarDefaults = require('../../components/colorbar/defaults');
var handleDomainDefaults = require('../../plots/domain').defaults;

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

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

dimensionsDefaults(traceIn, traceOut);

coerce('domain.x');
coerce('domain.y');
handleDomainDefaults(traceOut, layout, coerce);

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

Expand Down

0 comments on commit d2c5ae8

Please sign in to comment.