-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
make offsetgroup work with barmode 'stacked' and 'relative' for bar traces #7009
base: master
Are you sure you want to change the base?
Conversation
barpolar trace has no offsetgroup property
poffset is not only different for different offsetgroups but also when the trace has a different width.
Previous attempt that used bar.p + offsetIndex resulted in the same bin for a bar with bar.p 0 and offsetIndex 1 and a bar with bar.p 1 and offsetIndex 0
Getting closer. |
Previously, all offsetgroups of different trace types were listed together, leading to undesired grouping interaction between different trace types. Fixes failing baseline test "legendgroup".
Thanks @archmoj, I was able to restore the original looks of the legendgroup mock. Two general questions to ensure that my changes make sense:
EDIT: I accidentally overwrote the content of the previously linked codepen with something else. Now I've recreated my example: And here is the output of the same figure in my branch: |
@alexcjohnson Hi Alex, do you have input on my last question above? Currently I am not sure what the desired behavior is. |
Yes, somewhere we need more complete documentation of what
The default for
Both of those look wrong to me based on the rules above: Clearly something is wrong if the boxes in the same Explicitly setting Also, clearly something is wrong if boxes with different |
Thanks @alexcjohnson for your comprehensive analysis! 2 remarks:
To make sure I understand you correctly: Given a chart with bars A, B, C and scatters X, Y, Z, the following traces should share an implicit
I think the behavior you describe sounds reasonable and will try to incorporate it in my PR. For bars I will implement the behavior as follows: barmode group: bars without |
@my-tien yes, that’s all correct, and thank you for catching my error, I will fix it above. |
…t have a mode "stack", i.e. scatter, box, violin, waterfall
…group for stackable traces
…up for stackable traces
After spending way too much time trying to implement the implicit alignment and offsetgroups I figured that I don't actually need that for this PR. Regarding the two still failing baseline tests, the new images look to me more like what I would expect based on their mocks (ticks and grid at whole numbers). What do you think? If you agree, I'll replace the baseline images with the new ones. E.g. compare current baseline: New image: |
@my-tien Would you please fetch |
done @archmoj |
This change makes it possible to create groups of stacked bar traces by setting barmode: "stacked" (or relative) on the axis and setting the same
bar.offsetgroup
for bars that should stack together. If no offsetgroup is defined, all bars at the same position are stacked together.To summarize the interaction between axis.barmode and bar.offsetgroup after this change:
barmode 'group': bars without offsetgroup are automatically offsetted to appear next to each other. If some bars should appear at the same location, they should have the same offsetgroup.
other barmodes: bars without offsetgroup share the same position on the axis. If some bars should appear next to each other, they should have differing offsetgroups.