Skip to content

Add Categorical Axis Ordering and Axis Category Array #239

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

Merged

Conversation

alex-bohm-nimbelink
Copy link
Contributor

This adds Axis category ordering along with the Axis category array.

This should fix #237

@alex-bohm-nimbelink alex-bohm-nimbelink force-pushed the feature/GH-237-axis-category-order branch from e81a4f7 to aabfe3d Compare October 29, 2024 19:24
@alex-bohm-nimbelink
Copy link
Contributor Author

I'm not sure what kinds of tests or examples I should add? Is there anything I should focus on including?

@alex-bohm-nimbelink alex-bohm-nimbelink force-pushed the feature/GH-237-axis-category-order branch from aabfe3d to 8f64be7 Compare October 29, 2024 21:11
@alex-bohm-nimbelink alex-bohm-nimbelink marked this pull request as ready for review October 29, 2024 22:26
@andrei-ng
Copy link
Collaborator

@alex-bohm-nimbelink , thank you for your PR!

If you could add an example either from your use case or something similar to the plots in https://plotly.com/python/categorical-axes/#controlling-the-category-order-with-plotly-express , it would be great. It would serve as an example for others to see how to make use of it.

In terms of tests, something along other existing tests, like serializing one plot with categorical axes, something like

fn test_serialize_histogram() {

Let me know if you need help with that .

@andrei-ng andrei-ng self-requested a review October 30, 2024 23:56
@alex-bohm-nimbelink alex-bohm-nimbelink force-pushed the feature/GH-237-axis-category-order branch from 8f64be7 to 66a5adc Compare October 31, 2024 17:09
@alex-bohm-nimbelink
Copy link
Contributor Author

Thanks! I added some tests based off what other tests I see. I also added two examples.
A scatter plot with y axis categories:
image

A bar chart with x axis category sorting:
image

@andrei-ng
Copy link
Collaborator

Thanks! I added some tests based off what other tests I see. I also added two examples. A scatter plot with y axis categories: image

A bar chart with x axis category sorting: image

Awesome ! 😍
Thank your for your contribution! I will merge it in.

@andrei-ng andrei-ng merged commit 1119c84 into plotly:main Oct 31, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Categorical Axis ordering
2 participants