-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[TSVB][Top N aggregation] Unable to deal with negative values #43581
Conversation
Hey @StephanBenning I think that one was first time of someone using the TopN with negative values (@AlonaNadler can you confirm this?). We'd like to know from you and Alona what do you imagine to be the right behaviour with negative values. |
Pinging @elastic/kibana-app |
💚 Build Succeeded |
💔 Build Failed |
retest |
💚 Build Succeeded |
💚 Build Succeeded |
My preference on is to emulate a standard horizontal bar chart with negative values. Having the base line on the left for negative values maybe can leads to wrong assumption is the user didn't see the minus sign. There is also a subsequent case: what happen when we have positive and negative numbers? |
Thanks @markov00 I like an idea with green/red lines. Unfortunattly I haven't seen it before in Kibana. |
TopN is often using when in several use cases:
I love @markov00 suggestions and think it is ideal if possible |
@markov00 I like your idea of positive/negative bars. I've had a similar idea. |
Thanks Team, so I've added 3 different modes: Switching works automatically based on the transmitted data. @AlonaNadler @markov00 could you please check it? |
💔 Build Failed |
retest |
💚 Build Succeeded |
💚 Build Succeeded |
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.
I ran this in Chrome and it works as intended with negative values, keeping the 0 line in the center of the visualization when there are positive values too. The range for negative and positive values depends on the max of the individual scales, as previously requested but does not change when the data refreshes (the range remains the same). I'm not sure if the range is intended to be dynamic.
Example: I create the visualization:
Once the data refreshes, I get:
If it's intended to not change the range (scale of the graph), then it LGTM.
@TinaHeiligers I see 2 different values (-4.1KB and -1.5KB) on your charts it's a reason of different views |
💚 Build Succeeded |
@alexwizp the different values are because the data refreshed. What I was trying to ask about is why does the range of the visualization not change? TL;DR: does the range of the visualization get calculated on each render? For example, in the first case, we have the most negative value of -4.1KB and the range of the negative values is -10KB to 0KB. |
@TinaHeiligers we recalculate range on each render. In general formula for calculating range (valid only for MIXED mode) looks like:
Then we use the About your example: why you see -10KB. interval. It's just because max positive value is 10KB |
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.
Testes in Chrome and it works as expected.
LGTM.
…c#43581) * [TSVB][Top N aggregation] Unable to deal with negative values * change logic only for negative values * fix PR comments * fix scss styles * fix calculating interval length * Fix PR comments
#44972) * [TSVB][Top N aggregation] Unable to deal with negative values * change logic only for negative values * fix PR comments * fix scss styles * fix calculating interval length * Fix PR comments
…ete-for-distance_feature * 'master' of github.com:elastic/kibana: (89 commits) Replace TSVB timeseries charts with elastic-charts (elastic#33558) [TSVB][Top N aggregation] Unable to deal with negative values (elastic#43581) [alerting] Adds Action Type configuration support and whitelisting (elastic#44483) FTR: fix WebDriver Actions calls (elastic#44605) [Code] add NodeRepositoriesService to watch new repositories on local node (elastic#44677) [skip-ci][Maps] Improve Maps intro page (elastic#44721) [Maps] Update titles and descriptions for data sources (elastic#44833) Types + Extract Integration Util (elastic#44433) Downgrade log level from info to debug for cases when we cannot handle authentication attempt. (elastic#44933) [Reporting] Remove Chome stdout/stderr observables, Add Browser Logger observable (elastic#44359) Update Jest script to output coverage (elastic#44447) [ftr] support --kibana-install-dir flag (elastic#44552) [WATCHER] Allow user to set a threshold value of 0 (elastic#44810) Remove injectI18n in dashboard plugin. (elastic#44580) [Graph] Save modal (elastic#44261) Use external script for the OIDC Implicit flow handler page. (elastic#44866) disable router prefixing with pluginId (elastic#44855) [SIEM] Fix bug on url + inspect functionality on hosts/hostDetails page (elastic#44671) [ML] File data viz limiting uploaded doc chunk size (elastic#44768) [code] Append go env variable 'GOCACHE' to go lsp spawn command. (elastic#44864) ...
…plate * 'master' of github.com:elastic/kibana: (91 commits) [APM] Make number of x ticks responsive to the plot width (elastic#44870) [ML] Single metric viewer: Fix top nav refresh behaviour. (elastic#44860) Replace TSVB timeseries charts with elastic-charts (elastic#33558) [TSVB][Top N aggregation] Unable to deal with negative values (elastic#43581) [alerting] Adds Action Type configuration support and whitelisting (elastic#44483) FTR: fix WebDriver Actions calls (elastic#44605) [Code] add NodeRepositoriesService to watch new repositories on local node (elastic#44677) [skip-ci][Maps] Improve Maps intro page (elastic#44721) [Maps] Update titles and descriptions for data sources (elastic#44833) Types + Extract Integration Util (elastic#44433) Downgrade log level from info to debug for cases when we cannot handle authentication attempt. (elastic#44933) [Reporting] Remove Chome stdout/stderr observables, Add Browser Logger observable (elastic#44359) Update Jest script to output coverage (elastic#44447) [ftr] support --kibana-install-dir flag (elastic#44552) [WATCHER] Allow user to set a threshold value of 0 (elastic#44810) Remove injectI18n in dashboard plugin. (elastic#44580) [Graph] Save modal (elastic#44261) Use external script for the OIDC Implicit flow handler page. (elastic#44866) disable router prefixing with pluginId (elastic#44855) [SIEM] Fix bug on url + inspect functionality on hosts/hostDetails page (elastic#44671) ...
Closes: #43579
Summary
Issue with the visual builder TopN Visualization. It is unable to deal with negative values correctly. The visualization seems to work correctly, if they use a Math script and display the absolute value.
Root cause analysis
This issue happens because TopN view always uses
0
as amin value
for calculating line width. I think it's not right and instead of0
we should use themin value
based on showed dataWhat was changed in this Pull Request
For negative values instead of
0
I offer to add1%
offset based on min value. It should fix problem with negative numbers. See:For positive values it should works like before
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers