Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bar marker color array legend style #1289

Merged
merged 6 commits into from
Jan 17, 2017
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 7 additions & 6 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 @@ -194,14 +195,14 @@ function styleBoxes(d) {
.attr('transform', 'translate(20,0)');
pts.exit().remove();
pts.each(function(d) {
var w = (d.lw + 1 || trace.line.width + 1) - 1,
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
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

}
}