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

Inconsistent gap attributes causes misalignment #7133

Open
alexcjohnson opened this issue Aug 27, 2024 · 0 comments
Open

Inconsistent gap attributes causes misalignment #7133

alexcjohnson opened this issue Aug 27, 2024 · 0 comments
Labels
bug something broken sev-3 annoyance with workaround

Comments

@alexcjohnson
Copy link
Collaborator

If you provide both bargap and scattergap but they're different, traces in the same alignment and offset group do not properly align. One way or another, ensuring these traces align is more important than honoring both gaps. Here, the orange and green scatter points should be centered on the bars of the same color, but they are not:
Screenshot 2024-08-27 at 10 41 13

https://codepen.io/alexcjohnson/pen/yLdEZvo?editors=0010

This is a little tricky though:

  • If there are no bar traces, bargap will not be defined, so scattergap should be honored.
  • Even if there are bar traces but only scattergap is explicitly given, seems like it should be honored and used as the bargap value as well.
  • There are also boxgap and violingap - in principle you could have ALL of these traces in the same alignment and offset groups, do we define a hierarchy, something like bar beats scatter beats box beats violin? Or do we take the gap from the first trace in the group, and use that for all traces in that group? Or the maximum gap that applies to any trace in the group? I have no strong opinions here, so long as the result is always proper alignment.
  • All but scatter also have *groupgap attributes. There's no problem allowing these to be different.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken sev-3 annoyance with workaround
Projects
None yet
Development

No branches or pull requests

1 participant