We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
text_align attribute in NumberFormatter not doing anything
When making a `datatable`, I want to right align numerical values in the table, but when I set the `text_align` attribute in `NumberFormatter`, the values continue to remain left aligned.  Here is my enviornment:
* Python 2.7.12 :: Anaconda 4.1.1 (64-bit)
* numpy==1.11.1
* pandas==0.18.1
* bokeh==0.12.4
* Windows 7, Chrome

And here is a code snippet:
```
import pandas as pd
import numpy as np
from bokeh.models import ColumnDataSource
from bokeh.models.widgets import DataTable, NumberFormatter, TableColumn
from bokeh.plotting import show

df = []
for ii in range(1, 11):
    df.append({'x': ii, 'y': 1000 * np.random.rand()})
df = pd.DataFrame(df)

source = ColumnDataSource(data=df)

columns = [
    TableColumn(field='x', title='Col 1'),
    TableColumn(field='y', title='Col 2',
                formatter=NumberFormatter(format='$0,0.00',
                                          text_align='right')),
]

dt = DataTable(source=source, columns=columns, width=500, height=200, row_headers=False)

show(dt)
```

Here is the output I am getting in my Jupyter Notebook:
![untitled](https://cloud.githubusercontent.com/assets/6929405/21940662/53797720-d993-11e6-9a39-a1f2a6d11f80.png)

I would expect that the dollar amounts in `Col 2` would be right aligned, but they aren't.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `examples/integration/widgets/data_table_customization.py`
Content:
```
1 from bokeh.io import save
2 from bokeh.models import ColumnDataSource
3 from bokeh.models.widgets import DataTable, TableColumn, HTMLTemplateFormatter
4 
5 from bokeh.sampledata.periodic_table import elements
6 
7 elements['name_lower'] = elements['name'].str.lower()
8 source = ColumnDataSource(elements)
9 
10 html_font_template = '<font color="<%= CPK %>"><%= value %></font>'
11 html_image_template = """
12 <a href="http://images-of-elements.com/<%= value %>.php" target="_blank">
13   <img src="http://images-of-elements.com/<%= value %>.jpg" style="width:40px;height:40px;border:0">
14 </a>
15 """
16 columns = [
17     TableColumn(field='atomic number', title='Atomic Number'),
18     TableColumn(field='symbol', title='Symbol'),
19     TableColumn(field='name', title='Name',
20                 formatter=HTMLTemplateFormatter(template=html_font_template)),
21     TableColumn(field='name_lower', title='Image',
22                 formatter=HTMLTemplateFormatter(template=html_image_template))
23 ]
24 data_table = DataTable(source=source, columns=columns, editable=False, row_height=45)
25 
26 save(data_table)
27
```

Path: `examples/app/dash/main.py`
Content:
```
1 from collections import Counter
2 from math import pi
3 
4 import numpy as np
5 import pandas as pd
6 
7 from bokeh.io import curdoc
8 from bokeh.layouts import column
9 from bokeh.models import ColumnDataSource, DataTable, RangeTool, TableColumn
10 from bokeh.palettes import Spectral11
11 from bokeh.plotting import figure
12 from bokeh.transform import cumsum
13 from bokeh.sampledata.autompg2 import autompg2 as mpg
14 from bokeh.sampledata.stocks import AAPL
15 
16 # Timeseries
17 
18 dates = np.array(AAPL['date'], dtype=np.datetime64)
19 source = ColumnDataSource(data=dict(date=dates, close=AAPL['adj_close']))
20 
21 p = figure(plot_height=110, tools="", toolbar_location=None, #name="line",
22            x_axis_type="datetime", x_range=(dates[1500], dates[2500]), sizing_mode="scale_width")
23 
24 p.line('date', 'close', source=source, line_width=2, alpha=0.7)
25 p.yaxis.axis_label = 'Traffic'
26 p.background_fill_color="#f5f5f5"
27 p.grid.grid_line_color="white"
28 
29 select = figure(plot_height=50, plot_width=800, y_range=p.y_range,
30                 x_axis_type="datetime", y_axis_type=None,
31                 tools="", toolbar_location=None, sizing_mode="scale_width")
32 
33 range_rool = RangeTool(x_range=p.x_range)
34 range_rool.overlay.fill_color = "navy"
35 range_rool.overlay.fill_alpha = 0.2
36 
37 select.line('date', 'close', source=source)
38 select.ygrid.grid_line_color = None
39 select.add_tools(range_rool)
40 select.toolbar.active_multi = range_rool
41 select.background_fill_color="#f5f5f5"
42 select.grid.grid_line_color="white"
43 select.x_range.range_padding = 0.01
44 
45 layout = column(p, select, sizing_mode="scale_width", name="line")
46 
47 curdoc().add_root(layout)
48 
49 # Donut chart
50 
51 x = Counter({ 'United States': 157, 'United Kingdom': 93, 'Japan': 89, 'China': 63,
52               'Germany': 44, 'India': 42, 'Italy': 40, 'Australia': 35, 'Brazil': 32,
53               'France': 31, 'Taiwan': 31  })
54 
55 data = pd.DataFrame.from_dict(dict(x), orient='index').reset_index().rename(index=str, columns={0:'value', 'index':'country'})
56 data['angle'] = data['value']/sum(x.values()) * 2*pi
57 data['color'] = Spectral11
58 
59 region = figure(plot_height=350, toolbar_location=None, outline_line_color=None, sizing_mode="scale_both", name="region", x_range=(-0.4, 1))
60 
61 region.annular_wedge(x=-0, y=1, inner_radius=0.2, outer_radius=0.32,
62                   start_angle=cumsum('angle', include_zero=True), end_angle=cumsum('angle'),
63                   line_color="white", fill_color='color', legend='country', source=data)
64 
65 region.axis.axis_label=None
66 region.axis.visible=False
67 region.grid.grid_line_color = None
68 region.legend.label_text_font_size = "0.7em"
69 region.legend.spacing = 1
70 region.legend.glyph_height = 15
71 region.legend.label_height = 15
72 
73 curdoc().add_root(region)
74 
75 # Bar chart
76 
77 plats = ("IOS", "Android", "OSX", "Windows", "Other")
78 values = (35, 22, 13, 26, 4)
79 platform = figure(plot_height=350, toolbar_location=None, outline_line_color=None, sizing_mode="scale_both", name="platform",
80                   y_range=list(reversed(plats)), x_axis_location="above")
81 platform.x_range.start = 0
82 platform.ygrid.grid_line_color = None
83 platform.axis.minor_tick_line_color = None
84 platform.outline_line_color = None
85 
86 platform.hbar(left=0, right=values, y=plats, height=0.8)
87 
88 curdoc().add_root(platform)
89 
90 # Table
91 
92 source = ColumnDataSource(data=mpg[:6])
93 columns = [
94     TableColumn(field="cyl", title="Counts"),
95     TableColumn(field="cty", title="Uniques"),
96     TableColumn(field="hwy", title="Rating"),
97 ]
98 table = DataTable(source=source, columns=columns, height=210, width=330, name="table", sizing_mode="scale_both")
99 
100 curdoc().add_root(table)
101 
102 # Setup
103 
104 curdoc().title = "Bokeh Dashboard"
105 curdoc().template_variables['stats_names'] = ['users', 'new_users', 'time', 'sessions', 'sales']
106 curdoc().template_variables['stats'] = {
107     'users'     : {'icon': 'user',        'value': 11200, 'change':  4   , 'label': 'Total Users'},
108     'new_users' : {'icon': 'user',        'value': 350,   'change':  1.2 , 'label': 'New Users'},
109     'time'      : {'icon': 'clock-o',     'value': 5.6,   'change': -2.3 , 'label': 'Total Time'},
110     'sessions'  : {'icon': 'user',        'value': 27300, 'change':  0.5 , 'label': 'Total Sessions'},
111     'sales'     : {'icon': 'dollar-sign', 'value': 8700,  'change': -0.2 , 'label': 'Average Sales'},
112 }
113
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/examples/app/dash/main.py b/examples/app/dash/main.py
--- a/examples/app/dash/main.py
+++ b/examples/app/dash/main.py
@@ -6,7 +6,8 @@
 
 from bokeh.io import curdoc
 from bokeh.layouts import column
-from bokeh.models import ColumnDataSource, DataTable, RangeTool, TableColumn
+from bokeh.models import ColumnDataSource, DataTable, RangeTool, TableColumn, \
+                         NumberFormatter, StringFormatter
 from bokeh.palettes import Spectral11
 from bokeh.plotting import figure
 from bokeh.transform import cumsum
@@ -92,8 +93,10 @@
 source = ColumnDataSource(data=mpg[:6])
 columns = [
     TableColumn(field="cyl", title="Counts"),
-    TableColumn(field="cty", title="Uniques"),
-    TableColumn(field="hwy", title="Rating"),
+    TableColumn(field="cty", title="Uniques",
+                formatter=StringFormatter(text_align="center")),
+    TableColumn(field="hwy", title="Rating",
+                formatter=NumberFormatter(text_align="right")),
 ]
 table = DataTable(source=source, columns=columns, height=210, width=330, name="table", sizing_mode="scale_both")
 
diff --git a/examples/integration/widgets/data_table_customization.py b/examples/integration/widgets/data_table_customization.py
--- a/examples/integration/widgets/data_table_customization.py
+++ b/examples/integration/widgets/data_table_customization.py
@@ -1,5 +1,5 @@
 from bokeh.io import save
-from bokeh.models import ColumnDataSource
+from bokeh.models import ColumnDataSource, NumberFormatter, StringFormatter
 from bokeh.models.widgets import DataTable, TableColumn, HTMLTemplateFormatter
 
 from bokeh.sampledata.periodic_table import elements
@@ -14,8 +14,10 @@
 </a>
 """
 columns = [
-    TableColumn(field='atomic number', title='Atomic Number'),
-    TableColumn(field='symbol', title='Symbol'),
+    TableColumn(field='atomic number', title='Atomic Number',
+                formatter=NumberFormatter(text_align="right")),
+    TableColumn(field='symbol', title='Symbol',
+                formatter=StringFormatter(text_align="center")),
     TableColumn(field='name', title='Name',
                 formatter=HTMLTemplateFormatter(template=html_font_template)),
     TableColumn(field='name_lower', title='Image',

{"golden_diff": "diff --git a/examples/app/dash/main.py b/examples/app/dash/main.py\n--- a/examples/app/dash/main.py\n+++ b/examples/app/dash/main.py\n@@ -6,7 +6,8 @@\n \n from bokeh.io import curdoc\n from bokeh.layouts import column\n-from bokeh.models import ColumnDataSource, DataTable, RangeTool, TableColumn\n+from bokeh.models import ColumnDataSource, DataTable, RangeTool, TableColumn, \\\n+                         NumberFormatter, StringFormatter\n from bokeh.palettes import Spectral11\n from bokeh.plotting import figure\n from bokeh.transform import cumsum\n@@ -92,8 +93,10 @@\n source = ColumnDataSource(data=mpg[:6])\n columns = [\n     TableColumn(field=\"cyl\", title=\"Counts\"),\n-    TableColumn(field=\"cty\", title=\"Uniques\"),\n-    TableColumn(field=\"hwy\", title=\"Rating\"),\n+    TableColumn(field=\"cty\", title=\"Uniques\",\n+                formatter=StringFormatter(text_align=\"center\")),\n+    TableColumn(field=\"hwy\", title=\"Rating\",\n+                formatter=NumberFormatter(text_align=\"right\")),\n ]\n table = DataTable(source=source, columns=columns, height=210, width=330, name=\"table\", sizing_mode=\"scale_both\")\n \ndiff --git a/examples/integration/widgets/data_table_customization.py b/examples/integration/widgets/data_table_customization.py\n--- a/examples/integration/widgets/data_table_customization.py\n+++ b/examples/integration/widgets/data_table_customization.py\n@@ -1,5 +1,5 @@\n from bokeh.io import save\n-from bokeh.models import ColumnDataSource\n+from bokeh.models import ColumnDataSource, NumberFormatter, StringFormatter\n from bokeh.models.widgets import DataTable, TableColumn, HTMLTemplateFormatter\n \n from bokeh.sampledata.periodic_table import elements\n@@ -14,8 +14,10 @@\n </a>\n \"\"\"\n columns = [\n-    TableColumn(field='atomic number', title='Atomic Number'),\n-    TableColumn(field='symbol', title='Symbol'),\n+    TableColumn(field='atomic number', title='Atomic Number',\n+                formatter=NumberFormatter(text_align=\"right\")),\n+    TableColumn(field='symbol', title='Symbol',\n+                formatter=StringFormatter(text_align=\"center\")),\n     TableColumn(field='name', title='Name',\n                 formatter=HTMLTemplateFormatter(template=html_font_template)),\n     TableColumn(field='name_lower', title='Image',\n", "issue": "text_align attribute in NumberFormatter not doing anything\nWhen making a `datatable`, I want to right align numerical values in the table, but when I set the `text_align` attribute in `NumberFormatter`, the values continue to remain left aligned.  Here is my enviornment:\r\n* Python 2.7.12 :: Anaconda 4.1.1 (64-bit)\r\n* numpy==1.11.1\r\n* pandas==0.18.1\r\n* bokeh==0.12.4\r\n* Windows 7, Chrome\r\n\r\nAnd here is a code snippet:\r\n```\r\nimport pandas as pd\r\nimport numpy as np\r\nfrom bokeh.models import ColumnDataSource\r\nfrom bokeh.models.widgets import DataTable, NumberFormatter, TableColumn\r\nfrom bokeh.plotting import show\r\n\r\ndf = []\r\nfor ii in range(1, 11):\r\n    df.append({'x': ii, 'y': 1000 * np.random.rand()})\r\ndf = pd.DataFrame(df)\r\n\r\nsource = ColumnDataSource(data=df)\r\n\r\ncolumns = [\r\n    TableColumn(field='x', title='Col 1'),\r\n    TableColumn(field='y', title='Col 2',\r\n                formatter=NumberFormatter(format='$0,0.00',\r\n                                          text_align='right')),\r\n]\r\n\r\ndt = DataTable(source=source, columns=columns, width=500, height=200, row_headers=False)\r\n\r\nshow(dt)\r\n```\r\n\r\nHere is the output I am getting in my Jupyter Notebook:\r\n![untitled](https://cloud.githubusercontent.com/assets/6929405/21940662/53797720-d993-11e6-9a39-a1f2a6d11f80.png)\r\n\r\nI would expect that the dollar amounts in `Col 2` would be right aligned, but they aren't.\n", "before_files": [{"content": "from bokeh.io import save\nfrom bokeh.models import ColumnDataSource\nfrom bokeh.models.widgets import DataTable, TableColumn, HTMLTemplateFormatter\n\nfrom bokeh.sampledata.periodic_table import elements\n\nelements['name_lower'] = elements['name'].str.lower()\nsource = ColumnDataSource(elements)\n\nhtml_font_template = '<font color=\"<%= CPK %>\"><%= value %></font>'\nhtml_image_template = \"\"\"\n<a href=\"http://images-of-elements.com/<%= value %>.php\" target=\"_blank\">\n  <img src=\"http://images-of-elements.com/<%= value %>.jpg\" style=\"width:40px;height:40px;border:0\">\n</a>\n\"\"\"\ncolumns = [\n    TableColumn(field='atomic number', title='Atomic Number'),\n    TableColumn(field='symbol', title='Symbol'),\n    TableColumn(field='name', title='Name',\n                formatter=HTMLTemplateFormatter(template=html_font_template)),\n    TableColumn(field='name_lower', title='Image',\n                formatter=HTMLTemplateFormatter(template=html_image_template))\n]\ndata_table = DataTable(source=source, columns=columns, editable=False, row_height=45)\n\nsave(data_table)\n", "path": "examples/integration/widgets/data_table_customization.py"}, {"content": "from collections import Counter\nfrom math import pi\n\nimport numpy as np\nimport pandas as pd\n\nfrom bokeh.io import curdoc\nfrom bokeh.layouts import column\nfrom bokeh.models import ColumnDataSource, DataTable, RangeTool, TableColumn\nfrom bokeh.palettes import Spectral11\nfrom bokeh.plotting import figure\nfrom bokeh.transform import cumsum\nfrom bokeh.sampledata.autompg2 import autompg2 as mpg\nfrom bokeh.sampledata.stocks import AAPL\n\n# Timeseries\n\ndates = np.array(AAPL['date'], dtype=np.datetime64)\nsource = ColumnDataSource(data=dict(date=dates, close=AAPL['adj_close']))\n\np = figure(plot_height=110, tools=\"\", toolbar_location=None, #name=\"line\",\n           x_axis_type=\"datetime\", x_range=(dates[1500], dates[2500]), sizing_mode=\"scale_width\")\n\np.line('date', 'close', source=source, line_width=2, alpha=0.7)\np.yaxis.axis_label = 'Traffic'\np.background_fill_color=\"#f5f5f5\"\np.grid.grid_line_color=\"white\"\n\nselect = figure(plot_height=50, plot_width=800, y_range=p.y_range,\n                x_axis_type=\"datetime\", y_axis_type=None,\n                tools=\"\", toolbar_location=None, sizing_mode=\"scale_width\")\n\nrange_rool = RangeTool(x_range=p.x_range)\nrange_rool.overlay.fill_color = \"navy\"\nrange_rool.overlay.fill_alpha = 0.2\n\nselect.line('date', 'close', source=source)\nselect.ygrid.grid_line_color = None\nselect.add_tools(range_rool)\nselect.toolbar.active_multi = range_rool\nselect.background_fill_color=\"#f5f5f5\"\nselect.grid.grid_line_color=\"white\"\nselect.x_range.range_padding = 0.01\n\nlayout = column(p, select, sizing_mode=\"scale_width\", name=\"line\")\n\ncurdoc().add_root(layout)\n\n# Donut chart\n\nx = Counter({ 'United States': 157, 'United Kingdom': 93, 'Japan': 89, 'China': 63,\n              'Germany': 44, 'India': 42, 'Italy': 40, 'Australia': 35, 'Brazil': 32,\n              'France': 31, 'Taiwan': 31  })\n\ndata = pd.DataFrame.from_dict(dict(x), orient='index').reset_index().rename(index=str, columns={0:'value', 'index':'country'})\ndata['angle'] = data['value']/sum(x.values()) * 2*pi\ndata['color'] = Spectral11\n\nregion = figure(plot_height=350, toolbar_location=None, outline_line_color=None, sizing_mode=\"scale_both\", name=\"region\", x_range=(-0.4, 1))\n\nregion.annular_wedge(x=-0, y=1, inner_radius=0.2, outer_radius=0.32,\n                  start_angle=cumsum('angle', include_zero=True), end_angle=cumsum('angle'),\n                  line_color=\"white\", fill_color='color', legend='country', source=data)\n\nregion.axis.axis_label=None\nregion.axis.visible=False\nregion.grid.grid_line_color = None\nregion.legend.label_text_font_size = \"0.7em\"\nregion.legend.spacing = 1\nregion.legend.glyph_height = 15\nregion.legend.label_height = 15\n\ncurdoc().add_root(region)\n\n# Bar chart\n\nplats = (\"IOS\", \"Android\", \"OSX\", \"Windows\", \"Other\")\nvalues = (35, 22, 13, 26, 4)\nplatform = figure(plot_height=350, toolbar_location=None, outline_line_color=None, sizing_mode=\"scale_both\", name=\"platform\",\n                  y_range=list(reversed(plats)), x_axis_location=\"above\")\nplatform.x_range.start = 0\nplatform.ygrid.grid_line_color = None\nplatform.axis.minor_tick_line_color = None\nplatform.outline_line_color = None\n\nplatform.hbar(left=0, right=values, y=plats, height=0.8)\n\ncurdoc().add_root(platform)\n\n# Table\n\nsource = ColumnDataSource(data=mpg[:6])\ncolumns = [\n    TableColumn(field=\"cyl\", title=\"Counts\"),\n    TableColumn(field=\"cty\", title=\"Uniques\"),\n    TableColumn(field=\"hwy\", title=\"Rating\"),\n]\ntable = DataTable(source=source, columns=columns, height=210, width=330, name=\"table\", sizing_mode=\"scale_both\")\n\ncurdoc().add_root(table)\n\n# Setup\n\ncurdoc().title = \"Bokeh Dashboard\"\ncurdoc().template_variables['stats_names'] = ['users', 'new_users', 'time', 'sessions', 'sales']\ncurdoc().template_variables['stats'] = {\n    'users'     : {'icon': 'user',        'value': 11200, 'change':  4   , 'label': 'Total Users'},\n    'new_users' : {'icon': 'user',        'value': 350,   'change':  1.2 , 'label': 'New Users'},\n    'time'      : {'icon': 'clock-o',     'value': 5.6,   'change': -2.3 , 'label': 'Total Time'},\n    'sessions'  : {'icon': 'user',        'value': 27300, 'change':  0.5 , 'label': 'Total Sessions'},\n    'sales'     : {'icon': 'dollar-sign', 'value': 8700,  'change': -0.2 , 'label': 'Average Sales'},\n}\n", "path": "examples/app/dash/main.py"}], "after_files": [{"content": "from bokeh.io import save\nfrom bokeh.models import ColumnDataSource, NumberFormatter, StringFormatter\nfrom bokeh.models.widgets import DataTable, TableColumn, HTMLTemplateFormatter\n\nfrom bokeh.sampledata.periodic_table import elements\n\nelements['name_lower'] = elements['name'].str.lower()\nsource = ColumnDataSource(elements)\n\nhtml_font_template = '<font color=\"<%= CPK %>\"><%= value %></font>'\nhtml_image_template = \"\"\"\n<a href=\"http://images-of-elements.com/<%= value %>.php\" target=\"_blank\">\n  <img src=\"http://images-of-elements.com/<%= value %>.jpg\" style=\"width:40px;height:40px;border:0\">\n</a>\n\"\"\"\ncolumns = [\n    TableColumn(field='atomic number', title='Atomic Number',\n                formatter=NumberFormatter(text_align=\"right\")),\n    TableColumn(field='symbol', title='Symbol',\n                formatter=StringFormatter(text_align=\"center\")),\n    TableColumn(field='name', title='Name',\n                formatter=HTMLTemplateFormatter(template=html_font_template)),\n    TableColumn(field='name_lower', title='Image',\n                formatter=HTMLTemplateFormatter(template=html_image_template))\n]\ndata_table = DataTable(source=source, columns=columns, editable=False, row_height=45)\n\nsave(data_table)\n", "path": "examples/integration/widgets/data_table_customization.py"}, {"content": "from collections import Counter\nfrom math import pi\n\nimport numpy as np\nimport pandas as pd\n\nfrom bokeh.io import curdoc\nfrom bokeh.layouts import column\nfrom bokeh.models import ColumnDataSource, DataTable, RangeTool, TableColumn, \\\n                         NumberFormatter, StringFormatter\nfrom bokeh.palettes import Spectral11\nfrom bokeh.plotting import figure\nfrom bokeh.transform import cumsum\nfrom bokeh.sampledata.autompg2 import autompg2 as mpg\nfrom bokeh.sampledata.stocks import AAPL\n\n# Timeseries\n\ndates = np.array(AAPL['date'], dtype=np.datetime64)\nsource = ColumnDataSource(data=dict(date=dates, close=AAPL['adj_close']))\n\np = figure(plot_height=110, tools=\"\", toolbar_location=None, #name=\"line\",\n           x_axis_type=\"datetime\", x_range=(dates[1500], dates[2500]), sizing_mode=\"scale_width\")\n\np.line('date', 'close', source=source, line_width=2, alpha=0.7)\np.yaxis.axis_label = 'Traffic'\np.background_fill_color=\"#f5f5f5\"\np.grid.grid_line_color=\"white\"\n\nselect = figure(plot_height=50, plot_width=800, y_range=p.y_range,\n                x_axis_type=\"datetime\", y_axis_type=None,\n                tools=\"\", toolbar_location=None, sizing_mode=\"scale_width\")\n\nrange_rool = RangeTool(x_range=p.x_range)\nrange_rool.overlay.fill_color = \"navy\"\nrange_rool.overlay.fill_alpha = 0.2\n\nselect.line('date', 'close', source=source)\nselect.ygrid.grid_line_color = None\nselect.add_tools(range_rool)\nselect.toolbar.active_multi = range_rool\nselect.background_fill_color=\"#f5f5f5\"\nselect.grid.grid_line_color=\"white\"\nselect.x_range.range_padding = 0.01\n\nlayout = column(p, select, sizing_mode=\"scale_width\", name=\"line\")\n\ncurdoc().add_root(layout)\n\n# Donut chart\n\nx = Counter({ 'United States': 157, 'United Kingdom': 93, 'Japan': 89, 'China': 63,\n              'Germany': 44, 'India': 42, 'Italy': 40, 'Australia': 35, 'Brazil': 32,\n              'France': 31, 'Taiwan': 31  })\n\ndata = pd.DataFrame.from_dict(dict(x), orient='index').reset_index().rename(index=str, columns={0:'value', 'index':'country'})\ndata['angle'] = data['value']/sum(x.values()) * 2*pi\ndata['color'] = Spectral11\n\nregion = figure(plot_height=350, toolbar_location=None, outline_line_color=None, sizing_mode=\"scale_both\", name=\"region\", x_range=(-0.4, 1))\n\nregion.annular_wedge(x=-0, y=1, inner_radius=0.2, outer_radius=0.32,\n                  start_angle=cumsum('angle', include_zero=True), end_angle=cumsum('angle'),\n                  line_color=\"white\", fill_color='color', legend='country', source=data)\n\nregion.axis.axis_label=None\nregion.axis.visible=False\nregion.grid.grid_line_color = None\nregion.legend.label_text_font_size = \"0.7em\"\nregion.legend.spacing = 1\nregion.legend.glyph_height = 15\nregion.legend.label_height = 15\n\ncurdoc().add_root(region)\n\n# Bar chart\n\nplats = (\"IOS\", \"Android\", \"OSX\", \"Windows\", \"Other\")\nvalues = (35, 22, 13, 26, 4)\nplatform = figure(plot_height=350, toolbar_location=None, outline_line_color=None, sizing_mode=\"scale_both\", name=\"platform\",\n                  y_range=list(reversed(plats)), x_axis_location=\"above\")\nplatform.x_range.start = 0\nplatform.ygrid.grid_line_color = None\nplatform.axis.minor_tick_line_color = None\nplatform.outline_line_color = None\n\nplatform.hbar(left=0, right=values, y=plats, height=0.8)\n\ncurdoc().add_root(platform)\n\n# Table\n\nsource = ColumnDataSource(data=mpg[:6])\ncolumns = [\n    TableColumn(field=\"cyl\", title=\"Counts\"),\n    TableColumn(field=\"cty\", title=\"Uniques\",\n                formatter=StringFormatter(text_align=\"center\")),\n    TableColumn(field=\"hwy\", title=\"Rating\",\n                formatter=NumberFormatter(text_align=\"right\")),\n]\ntable = DataTable(source=source, columns=columns, height=210, width=330, name=\"table\", sizing_mode=\"scale_both\")\n\ncurdoc().add_root(table)\n\n# Setup\n\ncurdoc().title = \"Bokeh Dashboard\"\ncurdoc().template_variables['stats_names'] = ['users', 'new_users', 'time', 'sessions', 'sales']\ncurdoc().template_variables['stats'] = {\n    'users'     : {'icon': 'user',        'value': 11200, 'change':  4   , 'label': 'Total Users'},\n    'new_users' : {'icon': 'user',        'value': 350,   'change':  1.2 , 'label': 'New Users'},\n    'time'      : {'icon': 'clock-o',     'value': 5.6,   'change': -2.3 , 'label': 'Total Time'},\n    'sessions'  : {'icon': 'user',        'value': 27300, 'change':  0.5 , 'label': 'Total Sessions'},\n    'sales'     : {'icon': 'dollar-sign', 'value': 8700,  'change': -0.2 , 'label': 'Average Sales'},\n}\n", "path": "examples/app/dash/main.py"}]}