Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix hover label exponents #1932

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 3 commits into from
Aug 5, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix lint errors
  • Loading branch information
rreusser committed Aug 5, 2017
commit 87d1dcb161fb1df5aec7d037a834b2f14b257d05
8 changes: 4 additions & 4 deletions 8 src/plots/cartesian/axes.js
Original file line number Diff line number Diff line change
Expand Up @@ -1207,8 +1207,8 @@ axes.tickText = function(ax, x, hover) {
return showAttr !== 'all' && x !== first_or_last;
}

if (hover) {
hideexp = 'never'
if(hover) {
hideexp = 'never';
} else {
hideexp = ax.exponentformat !== 'none' && isHidden(ax.showexponent) ? 'hide' : '';
}
Expand Down Expand Up @@ -1350,14 +1350,14 @@ function formatCategory(ax, out) {
}

function formatLinear(ax, out, hover, extraPrecision, hideexp) {
if (hideexp === 'never') {
if(hideexp === 'never') {
// If this is a hover label, then we must *never* hide the exponent
// for the sake of display, which could give the wrong value by
// potentially many orders of magnitude. If hideexp was 'never', then
// it's now succeeded by preventing the other condition from automating
// this choice. Thus we can unset it so that the axis formatting takes
// precedence.
hideexp = ''
hideexp = '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the 📚 @rreusser

} else if(ax.showexponent === 'all' && Math.abs(out.x / ax.dtick) < 1e-6) {
// don't add an exponent to zero if we're showing all exponents
// so the only reason you'd show an exponent on zero is if it's the
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.