-
Notifications
You must be signed in to change notification settings - Fork 12k
Convert axis options from arrays to objects #6770
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
Conversation
* Updated all chart type defaults * Throw errors when axis type or position are not specified * Avoid raising unnecessary errors when merging options into the default configs
|
Thanks for rebasing this @benmccann. The biggest risk / flaw I have with my work in #6626 is deciding how to default axes for different charts. To me, having the user specify a 2nd Y axis by defining Perhaps this means that arrays, while flawed, are the best way to handle it within the confines of config merge. The other possibility is that we need to go back to the drawing board and rethink the concept of merging options entirely. If charts did not specify axes in their defaults, this problem would be a non-issue. |
|
It's not totally clear to me how things work today. If I specified the below configuration it would end up with only one y scale? But you think there's some reason we couldn't have the code below result in the same outcome? |
|
I think its straight forward. If dataset has a scale ID define, update or create one with that ID. If not, use the first scale on that axis (maybe first with the default type? ) and apply defaults over undefined properties. |
I'm assuming you mean get or create one with that ID. It doesn't seem like you'd ever need to update a scale in this scenario. I would be okay with this behavior though I think it might be good to log a warning or even throw an exception instead since it seems like a user error to specify a scale ID that doesn't exist yet on a dataset.
Yeah, using the first scale makes sense to me |
That's exactly it.
I'm not sure how the first scale is defined in this case because if we look at @benmccann's example above: after config merge there are two Y scales defined in the options: |
I don't think that has to be the case. We could make it so that |
|
Made a proposal for the merging in #6773 |
|
Closing in favor of #6773 |
This takes #6626 a bit further by updating all the fixtures. There's still a bunch of failing tests though
I won't have much time for the next couple weeks, so feel free to take this over. Hope this helps drive it forward a bit further since it's a big change