Open nicolaskruchten opened 4 years ago
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?
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.
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?
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 ;)
Do you agree that polar plots should end up with the same scaling by default? If not then that makes things a bit simpler!
I'm not sure I understand the question... what does "same scaling" mean in this case?
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.
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 :)
Hey,
Any update on the facets in PX maps?
Kind regards
Today PX only supports faceting for 2d-cartesian functions, but it should support faceting for all functions, in principle.