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] Deprecate xAxisKey /zAxisKey in favor of xAxisId/zAxisId #13940

Merged
merged 6 commits into from
Jul 24, 2024

Conversation

alexfauquette
Copy link
Member

Based on #13906 (comment)

I replace series.axisKey by series.axisId for consistency.

The leftAxis prop is not replaced by leftAxisId because it can also be an object with some props for the targeted axis.
Btw not sure it's a good DX

@alexfauquette alexfauquette changed the title [charts] Deprecate xAxisKey in favor of xAxisId [charts] Deprecate xAxisKey /zAxisKey in favor of xAxisId/zAxisId Jul 22, 2024
@alexfauquette alexfauquette added the component: charts This is the name of the generic UI component, not the React module! label Jul 22, 2024
@mui-bot
Copy link

mui-bot commented Jul 22, 2024

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

Updated pages:

Generated by 🚫 dangerJS against 3af96db

@oliviertassinari oliviertassinari added deprecation New deprecation message dx Related to developers' experience labels Jul 22, 2024
@oliviertassinari
Copy link
Member

oliviertassinari commented Jul 22, 2024

The leftAxis prop is not replaced by leftAxisId because it can also be an object with some props for the targeted axis.

Oh, I see, this seems to work with rightAxis:

<LineChart
  xAxis={[{ data: sample }]}
  yAxis={[
    { id: 'linearAxis', scaleType: 'linear' },
    { id: 'logAxis', scaleType: 'log' },
  ]}
  series={[
    { yAxisKey: 'linearAxis', data: sample, label: 'linear' },
    { yAxisKey: 'logAxis', data: sample, label: 'log' },
  ]}
  rightAxis={{
    axisId: 'logAxis',
    tickFontSize: 10,
  }}
  height={400}
/>

Btw not sure it's a good DX

Having a string as a shorthand seems OK. It makes me think of https://youtu.be/g92XUzc1OHY?si=YBN3hHGUSTA3mdVG&t=103, at one point she goes into the argument of progressively exposing complexity to the users when needed, but to keep things simple otherwise.

Actually, if we expand the though beyond this problem instance, our API strategy with MUI X Charts of having low primitives that Recharts that compose well together, and one higher level abstracting like charts.js fit perfectly into this talk.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 22, 2024
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 22, 2024
@alexfauquette alexfauquette requested a review from JCQuintas July 23, 2024 14:34
@alexfauquette alexfauquette merged commit 8466d76 into mui:master Jul 24, 2024
17 checks passed
thomasmoon pushed a commit to thomasmoon/mui-x that referenced this pull request Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: charts This is the name of the generic UI component, not the React module! deprecation New deprecation message dx Related to developers' experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants