Skip to content

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

Merged
JCQuintas merged 1 commit intomui:v7.xfrom
JCQuintas:cherry-pick-charts-piecewise-gradient
Jan 23, 2025
Merged

[charts] Handle case where gradient stop offset could be Infinite (@JCQuintas)#16309
JCQuintas merged 1 commit intomui:v7.xfrom
JCQuintas:cherry-pick-charts-piecewise-gradient

Conversation

@JCQuintas
Copy link
Member

@JCQuintas JCQuintas commented Jan 23, 2025

Cherry-pick of #16131

Fixes #16294

@JCQuintas JCQuintas added type: bug It doesn't behave as expected. cherry-pick The PR was cherry-picked from the newer alpha/beta/stable branch. scope: charts Changes related to the charts. 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

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
@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

cherry-pick The PR was cherry-picked from the newer alpha/beta/stable branch. scope: charts Changes related to the charts. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants