-
-
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
two layer or grouped axes label / ticks #2799
Comments
I propose that we break this up into two batches:
|
This comment has been minimized.
This comment has been minimized.
This was asked about in the dash community forum today here: https://community.plot.ly/t/boxplot-with-multiple-categories-in-dash/14652/2. interestingly we already have an R example that fakes it: https://plot.ly/r/axes/#subcategory-axes |
This comment has been minimized.
This comment has been minimized.
This is what I'm thinking: (x|y)axis.categorygroups: [{
name: 'Group 1',
values: ['a', 'b', 'c'],
level: 1 || 2 // (to start, more level later),
bgcolor: '',
side: '',
font: {},
// more style/positioning things ...
}, {
// ...
},
// ...
] where |
Hmmm to me this is more of a
|
It probably has to be both - the The categories in an inner level need not be the same for each instance of an outer level. There could be missing values (q4 2018 hasn't happened yet, for example) and we should honor that, or the inner level values could be be totally different from one outer value to the next - eg https://peltiertech.com/chart-with-a-dual-category-axis/ An categorygroups: [{
name: 'Year',
values: [16, 17, 18, 16, 17, 18, 16, 17, 18, 16, 17, 18, 16, 17, 18, 16, 17, 18],
order: 'category ascending'
}, {
name: 'Rating',
values: ['BB+', 'BB+', 'BB+', 'BB', 'BB', 'BB', 'BB-', 'BB-', 'BB-', 'B+', 'B+', 'B+', 'B', 'B', 'B', 'B-', 'B-', 'B-'],
order: 'array'
}]
Is |
Yes, but the base case is that it'll just be specified in
Yes, of course, there's no coupling there. |
That might be sufficient... we just look for |
That was what I was thinking yes. Any downside to this? |
Also, ideally the order would default to the |
It occurs to me that from an RCE perspective at least, treating Also: I could easily see this feature being scoped tightly to |
In @nicolaskruchten 's data = [{
x: ["q1", "q2", "q3", "q4","q1", "q2", "q3", "q4"],
x2: ["2017","2017","2017","2017","2018","2018","2018","2018",]
...}] the By the way, I'm not a big fan of Let me try to make my first xaxis.categorygroups: [{
name: 'BB+',
values: ['16', '17', '18']
}, {
name: 'BB',
values: ['16', '17', '18']
}
// ...
] and with xaxis.categories: [
// ...
{
name: 'Double letters',
values: ['BB', 'BB-', 'BB+'],
level: 2
}, {
name: 'Single letters',
values: ['B', 'B-', 'B+'],
level: 2
}] .... but maybe keeping things "flat" would be better 🤔
To replicate things like: |
This categorygroups object seems very hard to map into RCE widgets...
…On Wed, Nov 7, 2018 at 18:17 Étienne Tétreault-Pinard < ***@***.***> wrote:
In @nicolaskruchten <https://github.com/nicolaskruchten> 's
data = [{
x: ["q1", "q2", "q3", "q4","q1", "q2", "q3", "q4"],
x2: ["2017","2017","2017","2017","2018","2018","2018","2018",] ...}]
the x categories here will have to behave differently than for
"traditional" type: 'category' axes. The "effective" categories are x[i]
+ y[i] - which we'll map 1-to-1 to integers >=0. So maybe adding type:
'category2' or groupedcategory or categorygroup would make sense.
By the way, I'm not a big fan of x2 - it sounds potentially confusing
with trace attributes xaxis: 'x2'. Maybe xgroup would be best.
------------------------------
Let me try to make my first categorygroups specs attempt clearer. To
describe the graph in the PR description, we'd get:
xaxis.categorygroups: [{
name: 'BB+',
values: ['16', '17', '18']
}, {
name: 'BB',
values: ['16', '17', '18']
}// ...
]
and with level we could add an additional label level (to be drawn below
the BB-, BB, ...) e.g.
xaxis.categories: [// ...
{
name: 'Double letters',
values: ['BB', 'BB-', 'BB+'],
level: 2
}, {
name: 'Single letters',
values: ['B', 'B-', 'B+'],
level: 2
}]
.... but maybe keeping things "flat" would be better 🤔
------------------------------
What would side do per group? Isn't axis.side enough?
What's bgcolor for?
To replicate things like:
[image: image]
<https://stackoverflow.com/questions/36099799/displaying-separate-means-within-fill-groups-in-ggplot-boxplot>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2799 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAMbAxplNLVsmA-bSW6xr6c1c5xJiLDYks5us2n-gaJpZM4VJe-Z>
.
|
Quick question: how should we handle overlapping labels? Consider something like: Here the To me, that would make multi-category axes look a little odd. I'm thinking perhaps we should truncate the "upper" labels instead of rotating them on multi-category axes. Does anyone have a strong opinion against truncating long tick labels scenarios like this one? |
Wow that's a hard to grok chart! Compare 2017 across categories :) I generally agree with:
|
Indeed, I've been pondering if there's a way to improve that. Certainly showing gridlines for the outer category only would help. Trying to think through an analog of |
sometimes you need more than one chart. Or facets/small multiples :)
…On Tue, Nov 27, 2018 at 17:34 alexcjohnson ***@***.***> wrote:
Wow that's a hard to grok chart! Compare 2017 across categories :)
Indeed, I've been pondering if there's a way to improve that. Certainly
showing gridlines for the outer category only would help. Trying to think
through an analog of bargap / bargroupgap, ie to give a bigger gap at the
outer category boundary... but it seems tough to square that with the ticks
& gridlines. Also would probably be a major headache to implement, as the
spacing between categories would no longer be constant.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2799 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAMbA5uqmvISwsgwbueU6XWc_tAkiaufks5uzb3sgaJpZM4VJe-Z>
.
|
This comment has been minimized.
This comment has been minimized.
Oh, one more question I forget to ask this morning: Should we add support for |
From in-person @nicolaskruchten : yeah, let's do that in the first iteration. |
A request has come in for a feature that could replicate this multi-level axes ticks / labels.
The following image shows something like an
x2
attr on bars.Note that to support positioning axes labels between ticks perhaps this #1673 (comment) will be a requirement.
The text was updated successfully, but these errors were encountered: