-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
number like categories respect layout.autotypenumbers
#5880
Draft
nicholas-esterer
wants to merge
17
commits into
master
Choose a base branch
from
number-like-categories-misinterpret
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
9caf482
Simply trying to force all strings to be categories
nicholas-esterer 536e6e9
Added notes for clarification needs in the tests
nicholas-esterer 5fc0ade
possibly break on call to getRangePositionForCategory
nicholas-esterer 69ea57c
Numeric categories in SVG paths intepreted as indices
nicholas-esterer bf90246
Original shapes test now passing
nicholas-esterer b60fe18
linting
nicholas-esterer 6b47a05
Merge branch 'master' into number-like-categories-misinterpret
nicholas-esterer 89cbf11
we cannot cast numeric strings to numbers in getDataToPixel
nicholas-esterer b3896a2
Simplification of dataToPixel code
nicholas-esterer 8ac107a
have to make special case for category axis in shapes test
nicholas-esterer 536e513
numeric-string-categories mock, shapes_test linting
nicholas-esterer 0b48de5
Added numeric-string-categories baseline image
nicholas-esterer e9901c2
Added numeric categories tests to shapes_test
nicholas-esterer 74631d8
Merge branch 'master' into number-like-categories-misinterpret
nicholas-esterer e8277a9
removed fdescribe (!)
nicholas-esterer b53aa49
Added baselines for images and annotations
nicholas-esterer 9128f4c
mock json linting
nicholas-esterer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
80 changes: 80 additions & 0 deletions
80
test/image/mocks/annotations-with-numeric-string-categories.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{ | ||
"data": [ | ||
{ | ||
"x": [ | ||
"3", | ||
"1", | ||
"5", | ||
"2", | ||
"4", | ||
"6" | ||
], | ||
"y": [ | ||
"6", | ||
"7", | ||
"8", | ||
"2", | ||
"3", | ||
"4" | ||
] | ||
} | ||
], | ||
"layout": { | ||
"xaxis": { | ||
"type": "category", | ||
"categoryarray": [ | ||
"1", | ||
"2", | ||
"3", | ||
"4", | ||
"5", | ||
"6" | ||
] | ||
}, | ||
"yaxis": { | ||
"type": "category" | ||
}, | ||
"annotations": [ | ||
{ | ||
"text": "A", | ||
"x": "2", | ||
"y": 3.5 | ||
}, | ||
{ | ||
"text": "B", | ||
"x": 0.5, | ||
"y": "3" | ||
}, | ||
{ | ||
"text": "C", | ||
"x": 2, | ||
"y": "0" | ||
}, | ||
{ | ||
"text": "D", | ||
"x": "7", | ||
"y": 3 | ||
} | ||
], | ||
"shapes": [ | ||
{ | ||
"type": "line", | ||
"x0": 0.5, | ||
"x1": 0.5, | ||
"y0": 0, | ||
"y1": 1, | ||
"xref": "x domain", | ||
"yref": "y domain" | ||
}, | ||
{ | ||
"type": "line", | ||
"y0": 0.5, | ||
"y1": 0.5, | ||
"x0": 0, | ||
"x1": 1, | ||
"xref": "x domain", | ||
"yref": "y domain" | ||
} | ||
] | ||
} | ||
} |
108 changes: 108 additions & 0 deletions
108
test/image/mocks/images-with-numeric-string-categories.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
{ | ||
"data": [ | ||
{ | ||
"x": [ | ||
"3", | ||
"1", | ||
"5", | ||
"2", | ||
"4", | ||
"6" | ||
], | ||
"y": [ | ||
"6", | ||
"7", | ||
"8", | ||
"2", | ||
"3", | ||
"4" | ||
] | ||
} | ||
], | ||
"layout": { | ||
"xaxis": { | ||
"type": "category", | ||
"categoryarray": [ | ||
"1", | ||
"2", | ||
"3", | ||
"4", | ||
"5", | ||
"6" | ||
] | ||
}, | ||
"yaxis": { | ||
"type": "category" | ||
}, | ||
"images": [ | ||
{ | ||
"source": "https://images.plot.ly/language-icons/api-home/js-logo.png", | ||
"xref": "x", | ||
"yref": "y", | ||
"sizex": 1, | ||
"sizey": 1, | ||
"x": "2", | ||
"y": 3.5, | ||
"xanchor": "left", | ||
"yanchor": "top", | ||
"opacity": 0.4 | ||
}, | ||
{ | ||
"source": "https://images.plot.ly/language-icons/api-home/js-logo.png", | ||
"xref": "x", | ||
"yref": "y", | ||
"sizex": 1, | ||
"sizey": 1, | ||
"x": 0.5, | ||
"y": "3", | ||
"xanchor": "left", | ||
"yanchor": "top", | ||
"opacity": 0.6 | ||
}, | ||
{ | ||
"source": "https://images.plot.ly/language-icons/api-home/js-logo.png", | ||
"xref": "x", | ||
"yref": "y", | ||
"sizex": 1, | ||
"sizey": 1, | ||
"x": 2, | ||
"y": "0", | ||
"xanchor": "left", | ||
"yanchor": "top", | ||
"opacity": 0.8 | ||
}, | ||
{ | ||
"source": "https://images.plot.ly/language-icons/api-home/js-logo.png", | ||
"xref": "x", | ||
"yref": "y", | ||
"sizex": 1, | ||
"sizey": 1, | ||
"x": "7", | ||
"y": 3, | ||
"xanchor": "left", | ||
"yanchor": "top", | ||
"opacity": 1 | ||
} | ||
], | ||
"shapes": [ | ||
{ | ||
"type": "line", | ||
"x0": 0.5, | ||
"x1": 0.5, | ||
"y0": 0, | ||
"y1": 1, | ||
"xref": "x domain", | ||
"yref": "y domain" | ||
}, | ||
{ | ||
"type": "line", | ||
"y0": 0.5, | ||
"y1": 0.5, | ||
"x0": 0, | ||
"x1": 1, | ||
"xref": "x domain", | ||
"yref": "y domain" | ||
} | ||
] | ||
} | ||
} |
Oops, something went wrong.
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.
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.
Could you please elaborate why using
isNumeric
here is not possible?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.
isNumeric
returnstrue
forisNumeric('1')
which we don't want. We want numeric string categories to have to use the indices.