add stroke properties to discrete color legend (#860)#994
Merged
mcnuttandrew merged 2 commits intoOct 8, 2018
Conversation
strokeDasharray, strokeStyle, strokeWidth
mcnuttandrew
approved these changes
Oct 8, 2018
mcnuttandrew
left a comment
Contributor
There was a problem hiding this comment.
You are on fire! I think this is a fine solution to this problem. Would you mind adding a test to support this change?
update tests to use svg properties, add tests for stroke dasharray and stroke width, and filter out unused styles
Contributor
Author
|
Oh shoot! Tests, of course! I updated the tests to match the svg styles/elements and added stroke-width and stroke-dasharray tests. Thanks for the speedy response! |
Contributor
|
Looks good! Thanks again |
ayarcohaila
pushed a commit
to ayarcohaila/react-vis
that referenced
this pull request
Jun 30, 2021
* add stroke properties to discrete color legend (uber#860) strokeDasharray, strokeStyle, strokeWidth * update tests for discrete color legend update tests to use svg properties, add tests for stroke dasharray and stroke width, and filter out unused styles
ayarcohaila
added a commit
to ayarcohaila/react-vis
that referenced
this pull request
May 30, 2023
* add stroke properties to discrete color legend (uber#860) strokeDasharray, strokeStyle, strokeWidth * update tests for discrete color legend update tests to use svg properties, add tests for stroke dasharray and stroke width, and filter out unused styles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added the ability to set stroke properties (strokeDasharray, strokeStyle, strokeWidth) of Discrete Color Legend items to match Line Series components. At first I considered mimicking the
colorsattribute and letting users add astrokeWidthsarray, but it seemed to over-complicate the api, so I settled with grabbing those properties from anitem's object.The legend items now render an svg path instead of a 2x14px div, which was necessary to match the dash-array property, but it also might help keep the legend consistent with the chart.
I edited one of the legend examples to show the implementation - happy to remove it if it's too heavy-handed.
Happy to hear any feedback, thanks!