-
Notifications
You must be signed in to change notification settings - Fork 11.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
Bar options should not be defined on scale #6249
Conversation
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.
I'd first merge #5621 and rebase / refactor this to utilize changes in that.
I've rebased on to #5621 but I'm not sure it's really possible to use those changes to help much since this has to support reading the values from the scale options for backwards compatibility |
My concern is that the "category width" is calculated per scale, and By the way, these options might be able to be indexable and scriptable. If they are dataset options, they can be resolved in |
I actually like that this is more configurable and I'm not sure why they would have to be common. If you want one thick bar and one thin bar I don't see an issue with that. However, if you'd like to have them be common, you can still do that by setting
Yeah, good idea. Done! |
It is completely fine to set
Edit: The comment above was not correct. A stack group is used to group multiple bars into a stack but the group is nothing to do with
This may be acceptable, and it makes more sense than having these options in a scale. Edit: So, these options are unique to a scale. I think they are still better to be dataset's options, though. |
97f4a75
to
8d67984
Compare
@kurkle thanks for approving this PR earlier. I just rebased it to fix merge conflicts with recent commits. Mind giving it another look? |
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.
Looks good, one minimization thing can be fixed and I'd add some fixture tests for mixed configuration between datasets (if the results are acceptable).
If results are bad , just add note / issue / todo / comment
src/controllers/controller.bar.js
Outdated
var min = helpers.isNullOrUndef(options.barThickness) | ||
? computeMinSampleSize(ruler.scale, ruler.pixels) | ||
: -1; |
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.
So after this barThickness
can be changed between datasets?
I think a fixture test for this would be good addition.
thickness
instead of options.barThickness
Also I'm curious what happens if datasets with mixed barThickness
are stacked?
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.
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.
Thanks, but I don't see that test committed? I'd same without stacking too (if it works alright)
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.
Oops. Looks like I forgot to push the commit earlier. Done 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.
I'm not sure if that other test provides anything new; I was thinking multiple unstacked datasets with mixed barThickness. (So same config as in stacked one, but just with stacked: false)
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.
Ok. I've made it so that there are multiple datasets now
* Bar options should not be defined on scale * Improve minimization * Add tests * Multiple datasets in test
Moves the bar options
barPercentage
,barThickness
,categoryPercentage
,minBarLength
, andmaxBarThickness
from scale defaults to bar dataset defaults.Closes #5134 #4587 #4096