Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/components/legend/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,14 @@ function styleBars(d) {
barpath.exit().remove();
barpath.each(function(d) {
var w = (d.mlw + 1 || markerLine.width + 1) - 1,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this need d -> d0 too? care to include line width and color arrays into the same mock?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good 👁️

Done in 8e718bf

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for completeness:

and color arrays

ie marker.line.color

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 81d3db1

p = d3.select(this);
p = d3.select(this),
d0 = d[0];

p.style('stroke-width', w + 'px')
.call(Color.fill, d.mc || marker.color);
.call(Color.fill, d0.mc || marker.color);

if(w) {
p.call(Color.stroke, d.mlc || markerLine.color);
p.call(Color.stroke, d0.mlc || markerLine.color);
}
});
}
Expand All @@ -193,15 +194,15 @@ function styleBoxes(d) {
.attr('d', 'M6,6H-6V-6H6Z')
.attr('transform', 'translate(20,0)');
pts.exit().remove();
pts.each(function(d) {
var w = (d.lw + 1 || trace.line.width + 1) - 1,
pts.each(function() {
var w = trace.line.width,
p = d3.select(this);

p.style('stroke-width', w + 'px')
.call(Color.fill, d.fc || trace.fillcolor);
.call(Color.fill, trace.fillcolor);

if(w) {
p.call(Color.stroke, d.lc || trace.line.color);
p.call(Color.stroke, trace.line.color);
}
});
}
Expand Down
Binary file modified test/image/baselines/bar_marker_array.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion test/image/mocks/bar_marker_array.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@
},
"type": "bar"
}
]
],
"layout": {
"showlegend": true
Copy link
Contributor Author

@etpinard etpinard Jan 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which looked like

image

before 5d0d930

}
}