Skip to content

Commit 49319de

Browse files
piePattern : fix broken tests
funnelarea pixel tests were broken, so use the point color in way more cases
1 parent a683c2a commit 49319de

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/traces/pie/style_one.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,22 @@ module.exports = function styleOne(s, pt, trace, gd) {
1616
// console.log( 'pie style_one: s', s, 'trace', trace, 'gd', gd);
1717

1818
// to do: rework this assembler code in a next iteration.
19-
if(s[0][0].__data__.i === undefined) {
19+
var gibberish = s[0][0].__data__;
20+
if(gibberish.i === undefined) {
2021
// coming from a legend
21-
s[0][0].__data__.i = s[0][0].__data__[0].i;
22+
gibberish.i = gibberish[0].i;
2223
}
2324
// console.log( 's0 - i : ', s[0][0].__data__['i'], 'pt.color', pt.color, 'trace', trace);
2425

2526
// enforce the point color, when colors (with s) & the pattern shape are missing.
2627
// 'abuse' the color attribute, used in the Drawing component for bar trace type.
2728
// alternative could be to pass the point color as an extra parameter in pointStyle
28-
if(!trace.marker.colors && trace.marker.pattern && !trace.marker.pattern.shape) trace.marker.color = pt.color;
29+
var marker = trace.marker;
30+
if(marker.pattern) {
31+
if(!marker.colors || !marker.pattern.shape) marker.color = pt.color;
32+
} else {
33+
marker.color = pt.color;
34+
}
2935

3036
Drawing.pointStyle(s, trace, gd);
3137
// to do : push into s.style d3 logic

0 commit comments

Comments
 (0)