You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Violins and Boxes not always honoring 'group' #3390
I'm not super clear on what it's doing or why but temporarily deleting that block does force things back into grouping mode, like it says in the comment. BUT I then get this odd behaviour, where it's grouping "too much"... it's like it doesn't think that the various "female" groups are the same and so it's leaving a bunch of extra room in each subplot :) ... split off into #3402
Hmm actually the “too much grouping” is present in the first two screenshots as well, just less obviously-so. That might just be a separate issue. (see #3402)
In brief, currently we "disable" grouping when there are as many distinct box/violin positions as there are box/violin traces. One could argue that this piece of logic is too magical. Afterall, boxmode: 'overlay' by default: if we 🔪 boxmode in the above snippet, we get
both on master and after 🔪 ing the aforementioned block that "disables" grouping.
The case brought in https://plot.ly/~nicolaskruchten/252 is even more subtle. Here, there are as many distinct violin positions as there are violin traces on only one particular subplot (the bottom-left one, 1 violin position for 1 violin trace). So, this disables grouping for all subplots. This is obviously wrong: that check should happen at the graph-level, not the subplot-level. Fixing this would be easy.
That said, instead of just fixing the above case, should we instead remove the magical disable-grouping block altogether?
I would be fine with removing this magic, given that it can be turned on explicitly with overlay. This would cause further deviations from what bar does in group mode, however (which is basically to have the bars stretch to fill the available space, no matter how many there are).
Activity
etpinard commentedon Jan 3, 2019
Would it be too much to ask to share the "data" / "layout" of that graph. I'm not too familiar with
px(yet). Thanks!nicolaskruchten commentedon Jan 4, 2019
https://plot.ly/~nicolaskruchten/252
nicolaskruchten commentedon Jan 4, 2019
OK, so the reason it's not grouping is because of this block:
plotly.js/src/traces/box/cross_trace_calc.js
Lines 80 to 84 in 364cdec
I'm not super clear on what it's doing or why but temporarily deleting that block does force things back into grouping mode, like it says in the comment. BUT I then get this odd behaviour, where it's grouping "too much"... it's like it doesn't think that the various "female" groups are the same and so it's leaving a bunch of extra room in each subplot :) ... split off into #3402
nicolaskruchten commentedon Jan 5, 2019
Maybe related? plotly/plotly.py#1389
nicolaskruchten commentedon Jan 5, 2019
Hmm actually the “too much grouping” is present in the first two screenshots as well, just less obviously-so. That might just be a separate issue. (see #3402)
[-]Violins and Boxes not honoring 'group'[/-][+]Violins and Boxes not always honoring 'group'[/+]etpinard commentedon Jan 16, 2019
Consider the following:
which currently looks like:
codepen: https://codepen.io/etpinard/pen/GPLXWX?editors=1010
Now after 🔪 ing block
plotly.js/src/traces/box/cross_trace_calc.js
Lines 80 to 84 in 364cdec
like it was proposed in #3390 (comment), we get
In brief, currently we "disable" grouping when there are as many distinct box/violin positions as there are box/violin traces. One could argue that this piece of logic is too magical. Afterall,
boxmode: 'overlay'by default: if we 🔪boxmodein the above snippet, we getboth on
masterand after 🔪 ing the aforementioned block that "disables" grouping.The case brought in https://plot.ly/~nicolaskruchten/252 is even more subtle. Here, there are as many distinct violin positions as there are violin traces on only one particular subplot (the bottom-left one, 1 violin position for 1 violin trace). So, this disables grouping for all subplots. This is obviously wrong: that check should happen at the graph-level, not the subplot-level. Fixing this would be easy.
That said, instead of just fixing the above case, should we instead remove the magical disable-grouping block altogether?
nicolaskruchten commentedon Jan 17, 2019
I would be fine with removing this magic, given that it can be turned on explicitly with
overlay. This would cause further deviations from whatbardoes in group mode, however (which is basically to have the bars stretch to fill the available space, no matter how many there are).etpinard commentedon Jan 21, 2019
done in #3445