elasticsearch/elasticsearch — pull request #3398 by richardpoole (2013-07-26 12:17:35+00:00)
Title: Added precision parameter to histogram facet

This commit adds a `precision` parameter to the histogram facet that produces variable width buckets with a fixed number of significant figures. For example, a `precision` of 1 creates the following buckets:

* 1 [0.95 <= x < 1.5)
* 2 [1.5 <= x < 2.5)
* 3 [2.5 <= x < 3.5)
* ...
* 7 [6.5 <= x < 7.5)
* 8 [7.5-8.5)
* 9 [8.5-9.5)
* 10 [9.5-15)
* 20 [15-25)
* 30 [25-35)
* ...
* 70 [65-75)
* 80 [75-85)
* 90 [85-95)
* 100 [95-150)
* 200 [150-250)
* 300 [250-350)
* etc.

This is particularly useful for graphing long tailed distributions. We use it to produce CDF plots, like this...

![screen shot 2013-07-26 at 12 28 28](https://f.cloud.github.com/assets/151069/862133/8a933abe-f5e6-11e2-834b-c9645623fb4c.png)