-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Proper parcoords
axis tick scale when ticktext
is unordered
#1945
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
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
926e7c6
proper axis tick scale when ticktext is unordered
monfera 5829dc3
undefined, null `ticktext[i]` to fall back on `tickvals[i]` - formatted
monfera 37780bd
new mock
monfera 7ef816e
DRYing up tick logic
monfera 42b71d3
code simplification (hat tip: AlexJ)
monfera 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 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
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.
Maybe filter out
null
too?Actually, looks like cartesian
tickvals
/ticktext
just stringifies falsy values: https://codepen.io/etpinard/pen/aywJNK?editors=0010 - which might be considered a bug, but I'd vote for making the parcoord implementation consistent(ly buggy).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.
What this does right now: if
ticktext[i]
isundefined
, ie. the array is nonexistent or too short, then it'll use thetickvals[i]
value (which can be the intention), represented as thed
in the green line. If it's however defined, then it'll be used (and stringified) whether falsy or not, in line with what you describe for Cartesian. Is it OK or would you rather that a missingticktext
array or missingticktext[i]
yields an'undefined'
as the tick label?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.
Ideally, it would be nice to make parcoords reuse some of the
cartesian/axes.js
routines.Now, should we consider the current cartesian behavior a bug? I'd vote yes. I'd think only
typeof strings
ticktext values should be visible cc @alexcjohnsonThere 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.
What should be the next step? It'd be good to see the missing tick label fixed promptly and continuing the above convo here, or I could copy it in a separate issue
to be discussed
.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.
Enjoy your weekend. We'll revisit this Monday 🎉
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 to summarise if I understand your latest comments and Étienne's comment on the top, this PR needs these:
parcoords
, ifticktext[i]
is eitherundefined
ornull
, then we consider it unsupplied, ie. revert to just usingtickvals[i]
(the current PR currently checks forundefined
only but I can extend)tickvals[i]
should be subject totickformat
as on my above screenshot with the percentages in column 3 and 4.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.
@monfera that all sounds exactly right 💯
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.
Maybe even: if ticktext[i] is either undefined or null or false [...]?
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.
I'd let
false
pass through (ie get stringified) - not super useful, but it would be weird to stringifytrue
but turnfalse
into some number.null
andundefined
don't have opposites in the same way.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.
Thanks for the clarifications! The commit is done but I want to do some code simplification once
crossfilter
is tightened up. I can push where I am though.