Skip to content

Commit dc8ba12

Browse files
committed
sankey move defaultLinkColor outside for loop to speed up coerce
1 parent ccaef04 commit dc8ba12

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: src/traces/sankey/defaults.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
5656
coerceLink('hoverinfo');
5757
handleHoverLabelDefaults(linkIn, linkOut, coerceLink, layout.hoverlabel);
5858

59+
var defautLinkColor = tinycolor(layout.paper_bgcolor).getLuminance() < 0.333 ?
60+
'rgba(255, 255, 255, 0.6)' :
61+
'rgba(0, 0, 0, 0.2)';
62+
5963
coerceLink('color', linkOut.value.map(function() {
60-
return tinycolor(layout.paper_bgcolor).getLuminance() < 0.333 ?
61-
'rgba(255, 255, 255, 0.6)' :
62-
'rgba(0, 0, 0, 0.2)';
64+
return defautLinkColor;
6365
}));
6466

6567
handleDomainDefaults(traceOut, layout, coerce);

0 commit comments

Comments
 (0)