forked from plotly/plotly.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle_defaults.js
32 lines (26 loc) · 1.04 KB
/
style_defaults.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
'use strict';
var Color = require('../../components/color');
var hasColorscale = require('../../components/colorscale/helpers').hasColorscale;
var colorscaleDefaults = require('../../components/colorscale/defaults');
module.exports = function handleStyleDefaults(traceIn, traceOut, coerce, defaultColor, layout) {
coerce('marker.color', defaultColor);
if(hasColorscale(traceIn, 'marker')) {
colorscaleDefaults(
traceIn, traceOut, layout, coerce, {prefix: 'marker.', cLetter: 'c'}
);
}
coerce('marker.line.color', Color.defaultLine);
if(hasColorscale(traceIn, 'marker.line')) {
colorscaleDefaults(
traceIn, traceOut, layout, coerce, {prefix: 'marker.line.', cLetter: 'c'}
);
}
coerce('marker.line.width');
coerce('marker.opacity');
coerce('marker.patternfill.shape');
coerce('marker.patternfill.bgcolor');
coerce('marker.patternfill.scale');
coerce('marker.patternfill.solidity');
coerce('selected.marker.color');
coerce('unselected.marker.color');
};