-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
make offsetgroup work with barmode 'stacked' and 'relative' for bar traces #7009
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
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: |
…ype" This reverts commit e8bd5db.
@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 |
@my-tien Would you please fetch upstream/master and merge it into this branch again? |
Thanks @stephprobst I'm working on the same thing right now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO this "change" would be best to go into v3.0.0 because that could be considered a breaking change.
@alexcjohnson @gvwilson Do you agree?
👍 on including this in 3.0 cc @LiamConnors we'll have to document the changed behavior |
Many thanks for wrapping this up in my absence! <3 |
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.