-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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
[axis formatting] Override the valueformat to be percentage when contribution is selected #4866
[axis formatting] Override the valueformat to be percentage when contribution is selected #4866
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4866 +/- ##
=======================================
Coverage 76.96% 76.96%
=======================================
Files 44 44
Lines 8534 8534
=======================================
Hits 6568 6568
Misses 1966 1966 Continue to review full report at Codecov.
|
@@ -332,6 +333,10 @@ export default function nvd3Vis(slice, payload) { | |||
throw new Error('Unrecognized visualization for nvd3' + vizType); | |||
} | |||
|
|||
if (fd.contribution) { |
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.
Check out line 393
where you could handle this.
But what if the user would like to resolve minor differences and thus prefers .2% or even .3%? We do have use cases from both... |
I thought about this as I was doing the original change: maybe in the future we'll have a controls side-effect effect framework where checking the box can change the format once, but user can still alter it. We can an issue for this but I don't think it's as pressing as this was. |
…ribution is selected (apache#4866) * force the valueformat to be percentage when contribution is selected * remove extra empty lines * simplied the logic by reusing some existing code
…ribution is selected (apache#4866) * force the valueformat to be percentage when contribution is selected * remove extra empty lines * simplied the logic by reusing some existing code
…ribution is selected (apache#4866) * force the valueformat to be percentage when contribution is selected * remove extra empty lines * simplied the logic by reusing some existing code
Currently, the default value format when
contribution
is selected is not intuitive. (e.g., 0.5 -> 500m). In this PR, the value format will be overridden by.1%
.The reason here why I don' want want to change and save the current formatting to percentage are 1) the user selected format will be preserved when users uncheck
contribution
. 2) It seems in all the cases when user checkcontribution
, percentage format for the value is the best approach.also, it fixed a typo where
f
hadn't changed tovalueFormater
inpiechart
@williaster