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

enable non-cartesian facets in Plotly Express: polar, ternary, maps etc #2646

Open
nicolaskruchten opened this issue Jul 16, 2020 · 9 comments
Labels
feature something new P3 not needed for current cycle
Milestone

Comments

@nicolaskruchten
Copy link
Contributor

Today PX only supports faceting for 2d-cartesian functions, but it should support faceting for all functions, in principle.

@inkychris
Copy link

I'd like to work on this if it's still not on any internal roadmap? I see you pointed to this bit of code. Presumably the px API would also need expanding to accept the facet_* arguments too? Are there any other things that I should be aware of if I were to take this on?

@nicolaskruchten
Copy link
Contributor Author

Hi @inkychris ! No one is working on this at the moment so if you want to take it on, I'd love to accept a PR :)

I actually activated this for geo subplots in this PR https://github.com/plotly/plotly.py/pull/2923/files (although I apologize, I did it alongside a bunch of other changes).

In principle, it's as easy as just adding the facet_* kwargs in the _chart_types.py file, and everything else should "just work" but the challenge with subplot types like polar, ternary etc is that their tick labels are less well-behaved than the cartesian subplots, so they overlap. This means that some trial-and-error tuning of the default row and col facet spacings will be necessary.

@inkychris
Copy link

Okay cool. I haven't explored the code base yet but is this/does this need to be covered by unit tests or should it just be a case of tuning things until it looks okay and getting you/someone to verify it?

@nicolaskruchten
Copy link
Contributor Author

Hehe, well, I'm not proud to notice that my PR didn't have any tests, so clearly at the time I didn't feel that worried about it. Let's get things looking OK and then I'll see if anything warrants some tests. If so, they'll probably need to be fairly generic ones that I can write ;)

@inkychris
Copy link

Do you agree that polar plots should end up with the same scaling by default? If not then that makes things a bit simpler!

@nicolaskruchten
Copy link
Contributor Author

I'm not sure I understand the question... what does "same scaling" mean in this case?

@inkychris
Copy link

Polar graphs scale to fit the data so the axes aren't the same for each facet by default like they are with scatter plots.

@nicolaskruchten
Copy link
Contributor Author

Oh I see. This one is a bit tricky... for cartesian we added special Plotly.js handling to "match" axes, and in principle someday we'll do the same for polar, ternary and all the others, so I don't think that PX should do this. This will make the experience of making faceted polar charts less nice, because users will have to explicitly force the ranges to match via .update_polars(...) if that's what they want, but I think it's the right call, and the easier one to implement, yes :)

@mich119
Copy link

mich119 commented Sep 29, 2022

Hey,

Any update on the facets in PX maps?

Kind regards

@gvwilson gvwilson self-assigned this Jul 5, 2024
@gvwilson gvwilson removed their assignment Aug 2, 2024
@gvwilson gvwilson added the P3 not needed for current cycle label Aug 12, 2024
@gvwilson gvwilson changed the title Non-cartesian facets in PX: polar, ternary, maps etc enable non-cartesian facets in Plotly Express: polar, ternary, maps etc Aug 12, 2024
@gvwilson gvwilson added the feature something new label Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new P3 not needed for current cycle
Projects
None yet
Development

No branches or pull requests

4 participants