-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix setting tickwidth, tickcolor, ticklen, linecolor and possibly more attributes via template #4904
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
Merged
Merged
Fix setting tickwidth, tickcolor, ticklen, linecolor and possibly more attributes via template #4904
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
bddaafa
allow template input in Lib.coerce2 - fix issue 4852
archmoj 11fd23c
update axes_breaks-round-weekdaysm baseline
archmoj 756a0ee
refactor coerce rename v to valIn
archmoj a2c1c93
refactor coerce rename out to valOut
archmoj 8d0b4cb
exit early
archmoj 5c3be81
rename propOut to valOut
archmoj 642bf28
add internal _coerce function
archmoj 57cec14
reduce condition checks
archmoj 1d9cc4a
keep track of source and input in _coerce function
archmoj cf7c061
fixup Lib.coerce2 description and color test
archmoj 21b86cd
add jasmine tests to cover invalid inputs in Lib.coerce2
archmoj 2b911d1
make room for opts - rename opts to attr
archmoj adc36cd
validate input when calling from coerce2
archmoj 24d1da9
remove unnecessary validation, also
archmoj 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 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file
E864
is invalid so it cannot be displayed.
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
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
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
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.
Hmm, I'm not sure about this, but at this point I think the best way to handle it will be extensive jasmine testing.
I see we actually do have a test that contradicts one thing I was hoping to "fix":
plotly.js/test/jasmine/tests/lib_test.js
Line 781 in be70865
Do we have a good reason for that behavior? It seems contrary to what we do with templates, as well as contrary to what I think the purpose of
coerce2
should be, which would be stated something like:@archmoj do you see any issue if we make such a change? I feel like that test is locking down a bug rather than useful behavior.
(while we're at it there's a piece of copypasta in that test
plotly.js/test/jasmine/tests/lib_test.js
Lines 795 to 798 in be70865
colOut
lines and 2sizeOut
lines)So what I'd like to see is a test covering each of the valTypes used by
coerce2
, and for each one:'2'
to2
) if such a thing exists for this valType'2'
to2
) if such a thing exists for this valTypeI suspect getting this to work for all valTypes may not be worthwhile - especially since there are things like
colorscale
where even the default may be "fixed" by the coercion process, andsubplotid
where the default affects which input values are allowed. But we should be able to find a way to make it work for the ones we actually use forcoerce2
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.
@alexcjohnson thanks for the review. Please see cf7c061 and 21b86cd.
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.
@alexcjohnson wondering what should be the result of this test?
https://github.com/plotly/plotly.js/blob/master/test/jasmine/tests/axes_test.js#L1791-L1797
Shouldn't it be
?
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.
@alexcjohnson this PR is ready for another review.
Please see adc36cd.