-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
Adding option to visualize negative values in Table view #4570
Adding option to visualize negative values in Table view #4570
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4570 +/- ##
==========================================
- Coverage 71.2% 71.17% -0.03%
==========================================
Files 187 187
Lines 14785 14809 +24
Branches 1083 1085 +2
==========================================
+ Hits 10527 10540 +13
- Misses 4255 4266 +11
Partials 3 3
Continue to review full report at Codecov.
|
@tanvach one suggestion would be to have the cell x-axis represent the [min(0, min-value), max(0, max-value)] range, so if you have values of (-10, -5, 10, 40, 20) it would produce the following bars:
i.e., both negative and positive values could be shown simultaneously and you wouldn't need to include the check box or change the color for visualizing negative values. |
Thanks for adding this! ^I agree with @john-bodley 's point that positive and negative should have different directions |
@john-bodley @williaster Thanks for the suggestion. I experimented with this idea but turns out the major issue is when all values are negative. The chart will then start from the right, which is confusing since it's what we have right now. Comparing these two cases for all positives and negatives. But when the values are mixed it does look pretty nice |
@john-bodley @williaster Comparison with multiple columns. After playing around for a while I feel they both have pros and cons.
Thoughts? |
@tanvach thanks for exploring the options. Negating the negative values and encoding them with a color reminds be of https://square.github.io/cubism/. As you mentioned both approaches have their pros and cons, but I think I prefer the monotone option. @williaster what are your thoughts? |
Maybe I'm just used to domain coloring since I think negative number is just a positive number with 180 deg phase angle :) |
@john-bodley @williaster Since I think the best viz type depends on context, I've simply added options: |
+1 you'll need some css3 kung fu to make that happen :) |
@tanvach thanks for exploring these options! I agree that exposing the controls to the user is ideal given the tradeoffs. a couple more thoughts:
thoughts? |
@williaster I've made red channel = 150 and it does look better. Here's aligning to the left. Actually I remember we used to have left aligned bars a few versions before. If we're doing this I'll just make these options default to off. |
I agree with @williaster regarding not having to preserve backwards compatibility and that left aligned bars make the most sense. Could we just make negative values always to be colored red? I think it wold be confusing to have both |
thanks @tanvach! @john-bodley and I think this looks good but think coloring should probably be on by default as it's possibly confusing for sorry for the back and forth, thanks again for adding this! |
@williaster @john-bodley I've pushed the change to make coloring turned on as default. Thanks for reviewing the PR! |
* Adding option to visualize negative values in Table view * Adding option for highlighting and right aligning * Fixed typo * Fixed case and condition * Formatting * Aligning left and default changes * Changing default
* Adding option to visualize negative values in Table view * Adding option for highlighting and right aligning * Fixed typo * Fixed case and condition * Formatting * Aligning left and default changes * Changing default
Resolving #4495
Currently, rows with negative values will not show background bars.
The PR adds a new option "Visualize Negative Values" which will show red tinted bars signifying negative values. This will make it useful for situations where negative values are also important (i.e. A/B testing result).
The direction of the bars for positive and negative values are the same since it'll be less cluttered and we can compare the magnitudes easily.
Passes
run_tests.sh
andnpm run test
@michellethomas @williaster @GabeLoins @mistercrunch