-
Notifications
You must be signed in to change notification settings - Fork 525
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
Disable inline styles #1882
Disable inline styles #1882
Changes from 11 commits
ab04ffc
13f090a
7de5e0e
5cf772d
be10879
fec2969
c960b12
b278263
76f39f2
8681221
0a7c381
96638cd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,7 +105,18 @@ const getCalculatedValues = (props) => { | |
}; | ||
|
||
const getLabelProps = (dataProps, text, style) => { | ||
const { x, y, index, scale, errorY, errorX, horizontal, labelComponent, theme } = dataProps; | ||
const { | ||
x, | ||
y, | ||
index, | ||
scale, | ||
errorY, | ||
errorX, | ||
horizontal, | ||
labelComponent, | ||
theme, | ||
disableInlineStyles | ||
} = dataProps; | ||
const getError = (type = "x") => { | ||
const baseError = type === "y" ? errorY : errorX; | ||
const error = baseError && Array.isArray(baseError) ? baseError[0] : baseError; | ||
|
@@ -129,7 +140,8 @@ const getLabelProps = (dataProps, text, style) => { | |
textAnchor: labelStyle.textAnchor || textAnchor, | ||
verticalAnchor: labelStyle.verticalAnchor || verticalAnchor, | ||
angle: labelStyle.angle, | ||
horizontal | ||
horizontal, | ||
disableInlineStyles | ||
}; | ||
|
||
if (!Helpers.isTooltip(labelComponent)) { | ||
|
@@ -160,7 +172,8 @@ const getBaseProps = (props, fallbackProps) => { | |
standalone, | ||
style, | ||
theme, | ||
width | ||
width, | ||
disableInlineStyles | ||
} = props; | ||
const initialChildProps = { | ||
parent: { | ||
|
@@ -198,7 +211,8 @@ const getBaseProps = (props, fallbackProps) => { | |
scale, | ||
style: style.data, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing a check for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll add it in for consistency - I'm not sure these conditionals are doing much in most cases when we already have the check in the |
||
x, | ||
y | ||
y, | ||
disableInlineStyles | ||
}; | ||
|
||
childProps[eventKey] = { | ||
|
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.
In this documentation, we should draw a distinction in the difference in behavior when providing the
disableInlineStyles
prop to a component likeVictoryBar
(i.e. inline styles are removed for both data and label components) vs supplying the prop to a component likeBar
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.
Done!