Skip to content

Commit 5738c1f

Browse files
committed
bar: set marker.line.width dflt to 0
- so that plotting code - which relies on marker.line.width to set the effective 'bargap' does not error out - broken since #124
1 parent e246331 commit 5738c1f

File tree

2 files changed

+17
-21
lines changed

2 files changed

+17
-21
lines changed

src/traces/bar/attributes.js

+16-8
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@ var extendFlat = require('../../lib/extend').extendFlat;
1515
var scatterMarkerAttrs = scatterAttrs.marker;
1616
var scatterMarkerLineAttrs = scatterMarkerAttrs.line;
1717

18+
var markerLineWidth = extendFlat({},
19+
scatterMarkerLineAttrs.width, { dflt: 0 });
20+
21+
var markerLine = extendFlat({}, {
22+
width: markerLineWidth
23+
}, colorAttributes('marker.line'));
24+
25+
var marker = extendFlat({}, {
26+
showscale: scatterMarkerAttrs.showscale,
27+
line: markerLine
28+
}, colorAttributes('marker'));
29+
30+
1831
module.exports = {
1932
x: scatterAttrs.x,
2033
x0: scatterAttrs.x0,
@@ -23,6 +36,7 @@ module.exports = {
2336
y0: scatterAttrs.y0,
2437
dy: scatterAttrs.dy,
2538
text: scatterAttrs.text,
39+
2640
orientation: {
2741
valType: 'enumerated',
2842
role: 'info',
@@ -33,14 +47,8 @@ module.exports = {
3347
'along the vertical (horizontal).'
3448
].join(' ')
3549
},
36-
marker: extendFlat({}, {
37-
showscale: scatterMarkerAttrs.showscale,
38-
line: extendFlat({},
39-
{width: scatterMarkerLineAttrs.width},
40-
colorAttributes('marker.line')
41-
)},
42-
colorAttributes('marker')
43-
),
50+
51+
marker: marker,
4452

4553
r: scatterAttrs.r,
4654
t: scatterAttrs.t,

src/traces/histogram/attributes.js

+1-13
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@
99
'use strict';
1010

1111
var barAttrs = require('../bar/attributes');
12-
var colorAttributes = require('../../components/colorscale/color_attributes');
1312

14-
var extendFlat = require('../../lib/extend').extendDeep;
15-
16-
var barMarkerAttrs = barAttrs.marker;
17-
var barMarkerLineAttrs = barMarkerAttrs.line;
1813

1914
module.exports = {
2015
x: {
@@ -124,14 +119,7 @@ module.exports = {
124119
},
125120
ybins: makeBinsAttr('y'),
126121

127-
marker: extendFlat({}, {
128-
showscale: barMarkerAttrs.showscale,
129-
line: extendFlat({},
130-
{width: extendFlat({}, barMarkerLineAttrs.width, {dflt: 0})},
131-
colorAttributes('marker.line'))
132-
},
133-
colorAttributes('marker')
134-
),
122+
marker: barAttrs.marker,
135123

136124
_nestedModules: {
137125
'error_y': 'ErrorBars',

0 commit comments

Comments
 (0)