Repository navigation
Conversation
Shape label templates map positions with axis.d2l, which multicategory axes do not define, so a label with texttemplate throws 'axis.d2l is not a function'. On category axes d2l also appends unknown positions as categories, so the template changes the axis range. Use d2l_noadd when the axis provides it: it returns existing category indices and numeric positions without adding categories, and it is the only data-to-linear conversion multicategory axes define.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A shape with
label.texttemplatethrowsTypeError: axis.d2l is not a functionon a multicategory axis, and on a plain category axis the same conversion can append the shape's numeric positions as new categories.label_texttemplate.jsmaps shape positions withaxis.d2l. Multicategory axes do not define it, and category axes defined2l_noadd, which maps existing categories and numeric positions without adding categories. This uses that variant when the axis provides it and falls back tod2lotherwise. The new case intest/jasmine/tests/shapes_test.jsthrows on master and passes with the change.Fixes #8214