-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add dashed support for legends #1773
Conversation
size-limit report 📦
|
a0f8792
to
e3e296c
Compare
e3e296c
to
f6ee802
Compare
@@ -105,6 +105,10 @@ export const DEFAULT_DATA: DataSeries[] = [ | |||
{value: 21, key: '2020-03-14T12:00:00'}, | |||
], | |||
color: LIGHT_THEME.seriesColors.limited[5], | |||
metadata: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using metadata for this looks like a good fit after checking others like:
metadata: {
relatedIndex: 2,
areaColor: 'rgba(218, 182, 242, 0.2)',
legendLabel: '75th - 25th percentile',
},
}: Props) { | ||
const selectedTheme = useTheme(); | ||
|
||
export function SeriesIcon({color, lineStyle, shape = 'Bar'}: Props) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought of refactoring this a bit, it didn't feel like SeriesIcon should concern about wether if its a comparison or not, I think we should pass in the color
and lineStyle
instead and calculate those from the parents
packages/polaris-viz/src/components/LinePreview/LinePreview.tsx
Outdated
Show resolved
Hide resolved
d76fb81
to
1ab29e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me except the changelog
Did not 🎩 as @envex has more context on this chart and would be good for him to have a quick look
2547296
to
5d28f30
Compare
Thanks @carysmills ! I added a link to tophat so its easier now, and added a fix for annotations as well. |
@@ -16,7 +16,7 @@ interface SingleTextLineProps { | |||
y: number; | |||
ariaHidden?: boolean; | |||
dominantBaseline?: 'middle' | 'hanging'; | |||
textAnchor?: 'left' | 'center' | 'right'; | |||
textAnchor?: 'start' | 'middle' | 'end'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are valid values for textAnchor
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/text-anchor#usage_notes
5d28f30
to
fc412a3
Compare
What does this implement/fix?
Median
line is dashed, so the legend should follow the same pattern.left
middle
right
butstart
middle
end
Before:
After:
🎩 Tophatting:
Before merging
Check your changes on a variety of browsers and devices.
Update the Changelog's Unreleased section with your changes.
Update relevant documentation, tests, and Storybook.
Make sure you're exporting any new shared Components, Types and Utilities from the top level index file of the package