Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DRY up color attributes #609

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jun 7, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
581a dry colors - bar
  • Loading branch information
monfera committed Jun 7, 2016
commit eb4d42a7b54e46d766b8cd15a1ab75de0e0c633c
33 changes: 11 additions & 22 deletions src/traces/bar/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@

'use strict';

var scatterAttrs = require('../scatter/attributes'),
scatterMarkerAttrs = scatterAttrs.marker,
scatterMarkerLineAttrs = scatterMarkerAttrs.line;
var scatterAttrs = require('../scatter/attributes');
var colorAttributes = require('../../components/colorscale/color_attributes');
var extendDeep = require('../../lib/extend').extendDeep;

var scatterMarkerAttrs = scatterAttrs.marker;
var scatterMarkerLineAttrs = scatterMarkerAttrs.line;


module.exports = {
Expand All @@ -31,26 +34,12 @@ module.exports = {
'along the vertical (horizontal).'
].join(' ')
},
marker: {
color: scatterMarkerAttrs.color,
colorscale: scatterMarkerAttrs.colorscale,
cauto: scatterMarkerAttrs.cauto,
cmax: scatterMarkerAttrs.cmax,
cmin: scatterMarkerAttrs.cmin,
autocolorscale: scatterMarkerAttrs.autocolorscale,
reversescale: scatterMarkerAttrs.reversescale,
marker: extendDeep({}, colorAttributes('marker'), {
showscale: scatterMarkerAttrs.showscale,
line: {
color: scatterMarkerLineAttrs.color,
colorscale: scatterMarkerLineAttrs.colorscale,
cauto: scatterMarkerLineAttrs.cauto,
cmax: scatterMarkerLineAttrs.cmax,
cmin: scatterMarkerLineAttrs.cmin,
width: scatterMarkerLineAttrs.width,
autocolorscale: scatterMarkerLineAttrs.autocolorscale,
reversescale: scatterMarkerLineAttrs.reversescale
}
},
line: extendDeep({}, colorAttributes('marker.line'), {
width: scatterMarkerLineAttrs.width
})
}),

r: scatterAttrs.r,
t: scatterAttrs.t,
Expand Down