Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dc8ba12

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

File tree

1 file changed

+5
-3
lines changed
Filter options

1 file changed

+5
-3
lines changed

‎src/traces/sankey/defaults.js

Copy file name to clipboardExpand all lines: src/traces/sankey/defaults.js
+5-3Lines changed: 5 additions & 3 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.