Skip to content
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

[formats] add better defaults for time + number formatting #4843

Merged

Conversation

williaster
Copy link
Contributor

@williaster williaster commented Apr 19, 2018

This PR is all about making better default for time + number formatting 🚀 It adds:

  • a more concise multi-format tick formatter. Here is the before and after (and you can play with it in this observable notebook):
    image 1

  • sets most default number formats to 1 decimal place instead of 3

  • reduces the number of y-axis ticks (to ~5), there is no need for ~10+ that nvd3 sets by default

  • rich tooltip => false by default, this makes tooltips look pretty bad, you can still hover over individual lines to see their values, or toggle on rich tooltips if you want them.

@mistercrunch @hughhhh @john-bodley @graceguo-supercat @michellethomas @fabianmenges

@williaster williaster force-pushed the chris--better-timeseries-tick-format branch from 69f6d94 to ee3cdf9 Compare April 19, 2018 18:14
@codecov-io
Copy link

codecov-io commented Apr 19, 2018

Codecov Report

Merging #4843 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4843   +/-   ##
=======================================
  Coverage   76.96%   76.96%           
=======================================
  Files          44       44           
  Lines        8534     8534           
=======================================
  Hits         6568     6568           
  Misses       1966     1966

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a98c3cf...b11b359. Read the comment docs.

@williaster
Copy link
Contributor Author

it looks like the verbose format is not always being used in the tooltip, will fix this / if you have tips ( ;) ) let me know

@williaster
Copy link
Contributor Author

Tested this with a bunch of production examples and fixed a bug where undefined for showing min/max resulted in truthy interpretation by nvd3. Here's an example, note verbose format in tooltips + reduced y-axis tick count.

@oxydash
Copy link
Contributor

oxydash commented Apr 20, 2018

It would be nice to add quarters -Q1, Q2, Q3, Q4

@williaster
Copy link
Contributor Author

@oxydash while I agree that'd be nice, it's not trivial:

  1. this is only affecting defaults, not adding new format options (quarters seems specialized)
  2. quarters would also require logic for defining the actual ticks, which d3 does automagically at the moment.

@fabianmenges
Copy link
Contributor

Looks good, this should fix a lot of axis label problems.

@williaster williaster merged commit 66fcf9b into apache:master Apr 20, 2018
@williaster williaster deleted the chris--better-timeseries-tick-format branch April 20, 2018 22:55
michellethomas pushed a commit to michellethomas/panoramix that referenced this pull request May 24, 2018
* [formats] add better defaults for time + number formatting

* [formatDate] add tests for concise formatDate

* [nvd3] use verbose time format in tooltips

* [number format] improve number format description

* [formats] revert to .3s defaults, tweak number format preview

* [formats] default number vis to .3s
timifasubaa pushed a commit to timifasubaa/incubator-superset that referenced this pull request May 31, 2018
* [formats] add better defaults for time + number formatting

* [formatDate] add tests for concise formatDate

* [nvd3] use verbose time format in tooltips

* [number format] improve number format description

* [formats] revert to .3s defaults, tweak number format preview

* [formats] default number vis to .3s
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
* [formats] add better defaults for time + number formatting

* [formatDate] add tests for concise formatDate

* [nvd3] use verbose time format in tooltips

* [number format] improve number format description

* [formats] revert to .3s defaults, tweak number format preview

* [formats] default number vis to .3s
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.25.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.25.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants