Update brushable histogram x-tick number format #1363
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.
Fixes #1349
Sub-issues
Repeating tick mark issue
The issue was that significant digits that differentiated consecutive tick marks were cropped in number string formatting.
Strategy to fix number formatting: increase the number of significant digits shown in scientific notation number formatting to 2 (format
.2e
) instead of 1 (format.1s
).For more information see https://github.com/d3/d3-format
Note that does not fully fix the issue described in #1349, but rather makes the formatting issue far less likely. It is still possible for this to occur if the difference between two ticks in axes happens in the a significant digit cropped by the scientific notation format.
milli
notation (123m
) is not intuitiveUsers reported that using an
m
to denote a number (trueValue = 0.001 * displayNumber
) was not intuitive. This PR changes the behavior of the formatting logic to use unabbreviated numbers when the domain of a variable is-10000 < min < max < 10000
and use scientific notation otherwise. We letd3
determine xticks for decimals since it generally choses values without many significant digits.Results
The following are images show improvements over the example problems in #1349:
litvinukova20_restricted.processed.h5ad
lukassen20_airway_orig.processed.h5ad