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

[charts] Handle case where gradient stop offset could be Infinite (@JCQuintas) #16309

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

JCQuintas
Copy link
Member

@JCQuintas JCQuintas commented Jan 23, 2025

Cherry-pick of #16131

Fixes #16294

@JCQuintas JCQuintas added bug 🐛 Something doesn't work cherry-pick The PR was cherry-picked from the newer alpha/beta/stable branch component: charts This is the name of the generic UI component, not the React module! labels Jan 23, 2025
@JCQuintas JCQuintas self-assigned this Jan 23, 2025
@JCQuintas JCQuintas enabled auto-merge (squash) January 23, 2025 12:55
@mui-bot
Copy link

mui-bot commented Jan 23, 2025

Deploy preview: https://deploy-preview-16309--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against d0613a3

@@ -13,6 +13,10 @@ type ChartsPiecewiseGradientProps = {
export default function ChartsPiecewiseGradient(props: ChartsPiecewiseGradientProps) {
const { isReversed, gradientId, size, direction, scale, colorMap } = props;

if (size <= 0) {
Copy link
Member

Choose a reason for hiding this comment

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

Just a not for latter. If we realise of any reason (for example ltr/rtl) that negative size are useful, we could replace that by

Suggested change
if (size <= 0) {
if (size !== 0) {

or

Suggested change
if (size <= 0) {
if (size < 0.1 && size > -0.1) {

@JCQuintas JCQuintas merged commit f8d0fb2 into mui:v7.x Jan 23, 2025
18 checks passed
@JCQuintas JCQuintas deleted the cherry-pick-charts-piecewise-gradient branch January 23, 2025 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work cherry-pick The PR was cherry-picked from the newer alpha/beta/stable branch component: charts This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants