handle missing scales #939
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With initializers (and perhaps with identity scales), it’s possible that a channel that is normally associated with a scale does not have an associated scale. In this case the mark should handle the scale being undefined instead of crashing. It’s also technically possible that the associated scale could be the wrong type, but this shouldn’t be the responsibility of the mark to check.
This also adds an assertion to prevent initializers from declaring position scales. This is not currently supported because position scales affect default dimensions and axes; constructing or modifying a position scale in an initializer would hence not be correctly reflected in the defaults. We may support this in the future, but for now it’s safer to have an explicit error.
Fixes #918. Previously #936 #930 #929 #927. 😓