Bar options should not be defined on scale#6249
Conversation
|
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? |
kurkle
left a comment
There was a problem hiding this comment.
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.
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.
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.
Oops. Looks like I forgot to push the commit earlier. Done now!
There was a problem hiding this comment.
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.
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, andmaxBarThicknessfrom scale defaults to bar dataset defaults.Closes #5134 #4587 #4096