Skip to content

Conversation

@JCQuintas
Copy link
Member

Some cleanup related to #13405 but moved here to make that PR cleaner

@JCQuintas JCQuintas added type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. scope: charts Changes related to the charts. labels Jun 26, 2024
@JCQuintas JCQuintas requested a review from alexfauquette June 26, 2024 14:47
@JCQuintas JCQuintas self-assigned this Jun 26, 2024
@mui-bot
Copy link

mui-bot commented Jun 26, 2024

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

Generated by 🚫 dangerJS against 27a2c0a

{xAxisHighlight === 'band' && axis.x !== null && isBandScale(xScale) && (
<ChartsAxisHighlightPath
d={`M ${xScale(axis.x.value)! - (xScale.step() - xScale.bandwidth()) / 2} ${
d={`M ${(xScale(axis.x.value) ?? 0) - (xScale.step() - xScale.bandwidth()) / 2} ${
Copy link
Member

Choose a reason for hiding this comment

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

If xScale(axis.x.value) is not defined, Maybe it would make more sense not to render this component instead of placing it at coordinate 0

Copy link
Member Author

Choose a reason for hiding this comment

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

I went with rendering at 0 because it would be clearer that something is wrong, rather than silently failing. Though I don't have a strong preference

Copy link
Member

Choose a reason for hiding this comment

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

What about logging a warning?

This should not append, but I think it's better to have a non working features that logs in the console why it's not working

Copy link
Member Author

Choose a reason for hiding this comment

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

🤔 Wait I did something wrong 😅

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed 👍

{xAxisHighlight === 'band' && axis.x !== null && isBandScale(xScale) && (
<ChartsAxisHighlightPath
d={`M ${xScale(axis.x.value)! - (xScale.step() - xScale.bandwidth()) / 2} ${
d={`M ${(xScale(axis.x.value) ?? 0) - (xScale.step() - xScale.bandwidth()) / 2} ${
Copy link
Member

Choose a reason for hiding this comment

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

What about logging a warning?

This should not append, but I think it's better to have a non working features that logs in the console why it's not working

@JCQuintas JCQuintas requested a review from alexfauquette June 27, 2024 09:30
Copy link
Member

@alexfauquette alexfauquette left a comment

Choose a reason for hiding this comment

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

Just a nitpick. Otherwise it's a nice refactoring 👍

@JCQuintas JCQuintas enabled auto-merge (squash) June 27, 2024 12:02
@JCQuintas JCQuintas merged commit 8380f86 into mui:master Jun 27, 2024
@JCQuintas JCQuintas deleted the charts-improvements-for-zoom branch June 27, 2024 12:19
DungTiger pushed a commit to DungTiger/mui-x that referenced this pull request Jul 23, 2024
…rror being thrown (mui#13637)

Signed-off-by: Jose C Quintas Jr <[email protected]>
Co-authored-by: Alexandre Fauquette <[email protected]>
thomasmoon pushed a commit to thomasmoon/mui-x that referenced this pull request Sep 9, 2024
…rror being thrown (mui#13637)

Signed-off-by: Jose C Quintas Jr <[email protected]>
Co-authored-by: Alexandre Fauquette <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: charts Changes related to the charts. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants