Skip to content

Commit 2d34832

Browse files
sunburstPattern : reuse handleMarkerDefaults function
1 parent b065a96 commit 2d34832

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

draftlogs/6622_add.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
add pattern to sunburst trace type [[#6622](https://github.com/plotly/plotly.js/pull/6622)]

src/traces/sunburst/defaults.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var Lib = require('../../lib');
44
var attributes = require('./attributes');
55
var handleDomainDefaults = require('../../plots/domain').defaults;
66
var handleText = require('../bar/defaults').handleText;
7-
var coercePattern = require('../../lib').coercePattern;
7+
var handleMarkerDefaults = require('../pie/defaults').handleMarkerDefaults;
88

99
var Colorscale = require('../../components/colorscale');
1010
var hasColorscale = Colorscale.hasColorscale;
@@ -33,14 +33,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
3333
coerce('level');
3434
coerce('maxdepth');
3535

36-
var lineWidth = coerce('marker.line.width');
37-
if(lineWidth) coerce('marker.line.color', layout.paper_bgcolor);
38-
39-
var markerColors = coerce('marker.colors');
40-
coercePattern(coerce, 'marker.pattern', markerColors);
41-
// push the marker colors (with s) to the foreground colors, to work around logic in the drawing pattern code on marker.color (without s, which is okay for a bar trace)
42-
if(traceIn.marker && !traceOut.marker.pattern.fgcolor) traceOut.marker.pattern.fgcolor = traceIn.marker.colors;
43-
if(!traceOut.marker.pattern.bgcolor) traceOut.marker.pattern.bgcolor = layout.paper_bgcolor;
36+
handleMarkerDefaults(traceIn, traceOut, layout, coerce, 'sunburst');
4437

4538
var withColorscale = traceOut._hasColorscale = (
4639
hasColorscale(traceIn, 'marker', 'colors') ||

0 commit comments

Comments
 (0)