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

indicator: several improvements/fixes #4029

Merged
merged 18 commits into from
Jul 19, 2019
Merged

indicator: several improvements/fixes #4029

merged 18 commits into from
Jul 19, 2019

Conversation

antoinerg
Copy link
Contributor

@antoinerg antoinerg commented Jul 8, 2019

This PR attempts to fix a few visual issues that can occur on animation:

  • fill color of delta is not consistent with the currently displayed value (ce3f2d1)
  • precompute the final size and position of numbers to rescale properly when the animation start (hence preventing overlap). We effectively save one Drawing.bBox call (1e7f21d)
  • numbers (either number or delta) can jump around if the text size changes a lot from the start value to end value. We solve this by aligning the numbers using the minimum X offset seen up to this point (2c378e0).
  • fix transition on first animation (6e9def2)

Additional bug fix:

  • it reverts to default valueformat for both number and delta if an empty string is specified (4d2ad95)
  • fix bullet with range spanning negative values (3b9028a)
  • do not display SI suffix when passing through zero if no SI suffixes are present in start and end value (8cea8e7)
  • add support for blank valueformat
  • do not draw value on gauge with null value
  • render exponent properly

https://codepen.io/antoinerg/pen/bPQEPr?editors=0010

Sorry, something went wrong.

@antoinerg
Copy link
Contributor Author

antoinerg commented Jul 8, 2019

Do we have a mock testing the "range spanning negative values" case?

Added one in 68c2aef

@etpinard etpinard added this to the v1.49.0 milestone Jul 8, 2019
@antoinerg
Copy link
Contributor Author

antoinerg commented Jul 11, 2019

Codepen has been updated to use bundle built off commit b942832: https://codepen.io/antoinerg/pen/bPQEPr?editors=0010

@etpinard
Copy link
Contributor

@antoinerg are you planning on addressing

I would prefer if *tickformat: '' would result in the default Axes.tickText formatting

as mentioned in #4029 (comment) ?

Is Axes.tickText still giving you trouble? Maybe @archmoj can help?

That said, this is a small detail, I'd be ok punting this for later. The fixes here in this PR are fantastic!

@etpinard etpinard added status: reviewable bug something broken labels Jul 11, 2019
@antoinerg
Copy link
Contributor Author

Is Axes.tickText still giving you trouble? Maybe @archmoj can help?

It was giving me NaN and I didn't investigate much more. I still think using exponent or SI notation is a better default but consistency with the axes is also good... If @archmoj can get it to work I could get behind it.

@archmoj
Copy link
Contributor

archmoj commented Jul 11, 2019

Is Axes.tickText still giving you trouble? Maybe @archmoj can help?

Yes the blank is not working.
I am on it.

@antoinerg
Copy link
Contributor Author

Yes the blank is not working.
I am on it.

Thanks @archmoj ! Don't push directly on this branch as I will need to test it thoroughly before accepting the change.

@archmoj
Copy link
Contributor

archmoj commented Jul 18, 2019

By defaulting tickformat to .3s we would get 1.00 and 10.0 as presented on the image on the left.
What is we could mock linear axis in a way that the tickText work with blank tickformat?
In that case we can get 1 and 10 as presented on the image on the right.
Screenshot from 2019-07-16 14-43-20
So I am wondering if the blank may be a better default?

First demo using modified version of '.3s' format - I noticed the m suffix may still show up sometimes.
Second demo using plolt.js Cartesian blank format - using different setup 1a05658

cc: @nicolaskruchten @alexcjohnson @jonmmease
Please also consider removing Math.floor from the JS code to compare transition between non-integers in two cases.

@nicolaskruchten
Copy link
Contributor

Generally speaking, I prefer "blank as the default" rather than 3-decimals.

@nicolaskruchten
Copy link
Contributor

But I don't think the default for negative values should be red + triangle-down + parens + minus-sign. that feels like overkill squared :)

@antoinerg
Copy link
Contributor Author

But I don't think the default for negative values should be red + triangle-down + parens + minus-sign. that feels like overkill squared :)

@nicolaskruchten Which one should we ship as a default? A minus sign or parentheses?

@nicolaskruchten
Copy link
Contributor

Minus sign, no parens plz

@archmoj
Copy link
Contributor

archmoj commented Jul 18, 2019

What about default formatting for relative deltas?
It could default to either '2%' or blank. But which one is best?

@etpinard
Copy link
Contributor

What about default formatting for relative deltas?
It could default to either '2%' or blank. But which one is best?

'2%' is probably fine here.

@archmoj
Copy link
Contributor

archmoj commented Jul 18, 2019

What about default formatting for relative deltas?
It could default to either '2%' or blank. But which one is best?

'2%' is probably fine here.

Great! I also think so.

archmoj and others added 5 commits July 19, 2019 15:09
- use ax.setScale and Axes.calcTicks with mocked range [0, 1.5 * value]
  or the gauge.axis one to make that work.
- fixup jasmine tests and baselines
... so that we don't get console warnings
@etpinard
Copy link
Contributor

@antoinerg feel free to merge this PR 💃 for me!

@antoinerg
Copy link
Contributor Author

Thank you @etpinard and @archmoj for helping me bring this to the finish line 🏁

@antoinerg antoinerg merged commit 72f885a into master Jul 19, 2019
@antoinerg antoinerg deleted the indicator-fixes branch July 19, 2019 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants