Repository: bokeh/bokeh

Issue:
[FEATURE] Scientific notation for NumberFormatter
### FOLLOW THESE INSTRUCTIONS CAREFULLY
NumberFormatter(format="0.[00]") allows me to set the number of decimals for a number to 2. I use this to format my cells in a DataTable.

But if I have very small numbers with a variable number of 0's, e.g. in the case of P-values, I only see 0's.

If I use no formatter for a column I get:
![image](https://user-images.githubusercontent.com/7702207/67021109-744c6080-f0ff-11e9-9ad3-905cc18d113e.png)

But what I would like to have is to have this scientific notation + be able how many significant numbers are shown. I have not succeeded in getting that to work and the documentation does not mention such a use case.

**Describe the solution you'd like**
have the option use_scientific also for NumberFormatter
if this is passed, then only the part outside of the exponent is formatted using formatting rules.
NumberFormatter(format="0.[00]", use_scientific=True) should give something like 1.62e-10 rather than 1.6234252343e-10

Also an update to the docs is needed. 

**Describe alternatives you've considered**
My alternative would be converting to a string and show the string, but this breaks sorting
I tried basictickformatter which has use_scientific, but that doesn't work, besides that, I am not sure if you can set the # of decimals




Discussion:
I think we would need to make a new `CellFormatter` subclass. If we just add some flag `use_scientific` to `NumberFormatter` then it become possible for users to pass combinations of parameters that don't make sense together, and that is an invitation for support issues. 

Alternatively, if there is a new format string that is easily and completely distinguishable from any of the existing Numbro formats that can be tested for in a simple way, then we could go the route of making `NumberFormatter` understand the new formats. 

@harmbuisman This is a nice self-contained task that would be ideally suited for a new contributor. Would you be interested in working up a PR with some guidance/help?

Resolving patch:
diff --git a/bokeh/models/widgets/tables.py b/bokeh/models/widgets/tables.py
--- a/bokeh/models/widgets/tables.py
+++ b/bokeh/models/widgets/tables.py
@@ -56,6 +56,7 @@
     'NumberEditor',
     'NumberFormatter',
     'PercentEditor',
+    'ScientificFormatter',
     'SelectEditor',
     'StringEditor',
     'StringFormatter',
@@ -113,6 +114,24 @@ class StringFormatter(CellFormatter):
     details.
     """)
 
+class ScientificFormatter(StringFormatter):
+    ''' Display numeric values from continuous ranges as "basic numbers",
+    using scientific notation when appropriate by default.
+    '''
+    precision = Int(10, help="""
+    How many digits of precision to display.
+    """)
+
+    power_limit_high = Int(5, help="""
+    Limit the use of scientific notation to when::
+        log(x) >= power_limit_high
+    """)
+
+    power_limit_low = Int(-3, help="""
+    Limit the use of scientific notation to when::
+        log(x) <= power_limit_low
+    """)
+
 class NumberFormatter(StringFormatter):
     ''' Number cell formatter.
 


Test patch:
diff --git a/bokehjs/test/size.ts b/bokehjs/test/size.ts
--- a/bokehjs/test/size.ts
+++ b/bokehjs/test/size.ts
@@ -15,7 +15,7 @@ const LIMITS: {[key: string]: number} = {
   // es6
   "js/bokeh-es6.min.js":         640,
   "js/bokeh-widgets-es6.min.js":  90,
-  "js/bokeh-tables-es6.min.js":  250,
+  "js/bokeh-tables-es6.min.js":  270,
   "js/bokeh-api-es6.min.js":      90,
   "js/bokeh-gl-es6.min.js":       70,
   // css