Skip to content

Commit f2b4bc7

Browse files
committed
New param for custom frame color on mousehover in treemaps
1 parent 2a8b19b commit f2b4bc7

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/traces/treemap/attributes.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2012-2020, Plotly, Inc.
2+
* Copyright 2012-2021, Plotly, Inc.
33
* All rights reserved.
44
*
55
* This source code is licensed under the MIT license found in the
@@ -138,6 +138,16 @@ module.exports = {
138138
},
139139

140140
colors: sunburstAttrs.marker.colors,
141+
142+
hoverframecolor: {
143+
valType: 'color',
144+
role: 'style',
145+
dflt: null,
146+
editType: 'style',
147+
description: [
148+
'Sets the color of the line enclosing each sector on mouse hover.'
149+
].join(' ')
150+
},
141151

142152
depthfade: {
143153
valType: 'enumerated',

src/traces/treemap/defaults.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2012-2020, Plotly, Inc.
2+
* Copyright 2012-2021, Plotly, Inc.
33
* All rights reserved.
44
*
55
* This source code is licensed under the MIT license found in the
@@ -73,6 +73,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
7373
var bottomText = traceOut.textposition.indexOf('bottom') !== -1;
7474

7575
var lineWidth = coerce('marker.line.width');
76+
var hoverFrameColor = coerce('marker.hoverframecolor');
7677
if(lineWidth) coerce('marker.line.color', layout.paper_bgcolor);
7778

7879
var colors = coerce('marker.colors');
@@ -101,7 +102,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
101102
marker: {
102103
line: {
103104
width: 2,
104-
color: Color.contrast(layout.paper_bgcolor)
105+
color: hoverFrameColor || Color.contrast(layout.paper_bgcolor)
105106
}
106107
}
107108
};

0 commit comments

Comments
 (0)