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

Support scientific notation for very small numbers #5811

Open
Tracked by #57707
NeilCondon opened this issue Jan 5, 2016 · 14 comments
Open
Tracked by #57707

Support scientific notation for very small numbers #5811

NeilCondon opened this issue Jan 5, 2016 · 14 comments
Labels
Feature:FieldFormatters Feature:Lens Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure upstream
Projects

Comments

@NeilCondon
Copy link

To overcome the limitation of integer-only intervals on aggs{histogram} queries, I have been using aggs{range} to construct histograms where my fields contain numbers less than one. This works great, but when Kibana 4.3.0 draws the histogram chart, it displays any bin "from:to" values that are less than 0.001 as '0'... see attached pic.
histogram
I checked the response body and ElasticSearch v2.1 passes these "from:to" values correctly in scientific format - e.g.
"buckets": {
"0.0-1.0E-4": {
"from": 0,
"from_as_string": "0.0",
"to": 0.0001,
"to_as_string": "1.0E-4",
"doc_count": 104
},
"1.0E-4-2.0E-4": {
"from": 0.0001,
"from_as_string": "1.0E-4",
"to": 0.0002,
"to_as_string": "2.0E-4",
"doc_count": 19
},
...so Kibana is rounding down values it uses on the x-axis.

Would it be possible to preserve the scientific notation, say for numbers less than 0.01?

Full text of request and response follows...
request_body.txt
response_body.txt

@spalger
Copy link
Contributor

spalger commented Jan 5, 2016

We are currently using numeral.js to format our numeric values, which does not offer scientific notation currently. The only work around would be to increase the default precision in advanced config of specify a different field formatter for that field with a larger precision.

@spalger spalger changed the title Small numbers displayed as '0' on range histograms Support scientific notation for very small numbers Jan 5, 2016
@simianhacker simianhacker added the P4 label Jan 5, 2016
@mercuriete
Copy link

mercuriete commented Aug 30, 2016

have the same issue.

I have numeric values in float. 0.001 0.002

I am trying to do statistic of my events using input filter elapsed.
https://www.elastic.co/guide/en/logstash/current/plugins-filters-elapsed.html

the default format of elapsed is in Seconds. All my events occurs in miliseconds or less.

Interval is numeric integer. so the histogram create only 1 bar from 0 to 1.

I have to use range chart to specify the range.

I want automatic range 😄
I want to have something like -> https://en.wikipedia.org/wiki/Freedman%E2%80%93Diaconis_rule

By the way. your work is awesome. Thank you so much.

@mercuriete
Copy link

mercuriete commented Aug 31, 2016

I will rewrite my request because maybe is not clear in my previous post 😄

Description: Interval in histogram (Vertical bar chart) is an integer value.
Feature request: Do Interval float value.

Use Case: Create histogram easily when your data is always between 0 and 1. or between 2 numbers.

DataSet example: 0.001, 0.002, 0.003, 0.004
Interval = 1
Output: an histogram with only 1 bar (useless histogram)

Expected behaviour with Interval float:
Dataset example: 0.001, 0.002, 0.003, 0.004
Interval = 0.001
Output: an histogram with 4 bars (Usefull histogram)

I hope you understand my use case. I am not creating a new issue because is in topic of small numbers.

Thank you very much for this awesome application 😄 👍

kibana interval

@tbragin tbragin added the Feature:Visualizations Generic visualization features (in case no more specific feature label is available) label Nov 15, 2016
@sophiec20
Copy link
Contributor

sophiec20 commented Feb 14, 2017

We have numeric values that we would ideally want to display in scientific notation.

For example..
When viewed in Discover in the JSON tab:

    "probability": 8.79889e-22,

When viewed in Discover in the table tab:

   probability 0

And when using Visualize Data Table, this will only display the min(probability) as 0.

The numeral.js format pattern does not give sufficient precision.

@spalger
Copy link
Contributor

spalger commented Feb 14, 2017

Interesting that the standard JSON representation is sufficient, I hadn't considered that as an option. In that case, using the String formatter for those fields might be sufficient

@spalger
Copy link
Contributor

spalger commented Feb 14, 2017

String(0.000000000000000000000879889) => 8.79889e-22

@epixa epixa removed the P4 label Apr 25, 2017
@TheNeikos
Copy link

TheNeikos commented Sep 28, 2017

Is this still something that could be worked on?

I am currently working with values in the 10e-6 range, and while scaling them up is a possibility, it does not seem possible to scale them down for displaying them.

@spalger numeral-js now does support exponential notation, however, visualizations still show everything as 0

@spalger
Copy link
Contributor

spalger commented Sep 29, 2017

Sorry @TheNeikos, but the other breaking changes in Numeral prevent us from upgrading without breaking everyone's saved field formats. Have you tried using the string formatter?

@TheNeikos
Copy link

I did try the one for fields in the Settings, but that did not work. Is there another place I could try it out?

@spalger
Copy link
Contributor

spalger commented Sep 29, 2017

Nope, that's it, how small is the number?

@spalger spalger closed this as completed Sep 29, 2017
@spalger spalger reopened this Sep 29, 2017
@TheNeikos
Copy link

The numbers are around 10^-8.

@w33ble
Copy link
Contributor

w33ble commented Nov 30, 2017

This might fix the problem, but I kind of doubt it: #15309

If anyone here cares to check, it should be going into 5.6.5 and 6.0.1 or newer.

@peteharverson
Copy link
Contributor

See this ML issue for another example of where providing support for scientific format in the fork of numeral.js would add benefit, in the formatting of very small actual and typical anomaly values - #34115.

@ghudgins
Copy link

Numeral.js appears to have support but Kibana does not yet (due to our fork...) http://numeraljs.com/#format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:FieldFormatters Feature:Lens Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure upstream
Projects
No open projects
Lens
  
Long-term goals
Development

No branches or pull requests