# running bokeh + datashader "dashboard" app on standalone server

**URL:** <https://discourse.bokeh.org/t/running-bokeh-datashader-dashboard-app-on-standalone-server/2588>\
**Category:** Community Support\
**Created:** [November 7, 2017, 12:04am UTC](https://discourse.bokeh.org/t/running-bokeh-datashader-dashboard-app-on-standalone-server/2588 "2017-11-07T00:04:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Tumlinson](https://discourse.bokeh.org/letter_avatar_proxy/v4/letter/j/b38774/32.png) [@Jason\_Tumlinson](https://discourse.bokeh.org/u/Jason_Tumlinson)\
**Post date:** [November 7, 2017, 12:04am UTC](https://discourse.bokeh.org/t/running-bokeh-datashader-dashboard-app-on-standalone-server/2588/1 "2017-11-07T00:04:27Z")

</div>

Hi,  
I am trying to adapt the bokeh + data shader app packaged with

datashader-examples to a custom implementation.

The app needs to run alongside some other apps I have that are run

in “directory” format because they have to be wrapped in a bunch of custom

HTML and CSS, which is most convenient in the directory form, e.g.:

bokeh serve —show dashboard

However, the dashboard example as given uses a tornado server (relevant code below):

python dashboard.py

and I cannot see how this could be adapted to directory form, especially since

the example uses the server itself to serve the datashader layer.

So, is it even possible to adapt this example to a standalone server / directory

implementation? Or should I be attempting to incorporate my custom HTML / css

formatting in a different fashion?

Thanks

JT

if **name** == ‘ **main** ’:

```
def add_roots(doc):

    model = AppState(False) # argument = "outofcore" = False by default 

    view = AppView(model)

    GetDataset.model = model # GetDataset.model has type "AppState" 

    curdoc().add_root(view.layout) # view.layout has type "Row" 

app = Application(FunctionHandler(add_roots))

io_loop = IOLoop.current()      

server = Server({'/': app}, io_loop=io_loop, extra_patterns=[('/datashader', GetDataset)], port=5006)

server.start()                  

io_loop.add_callback(server.show, "/")

io_loop.start()
```

---

<div class="post-metadata">

**Author:** ![James\_A\_Bednar](https://discourse.bokeh.org/letter_avatar_proxy/v4/letter/j/d6d6ee/32.png) [@James\_A\_Bednar](https://discourse.bokeh.org/u/James_A_Bednar)\
**Post date:** [November 7, 2017, 8:36pm UTC](https://discourse.bokeh.org/t/running-bokeh-datashader-dashboard-app-on-standalone-server/2588/2 "2017-11-07T20:36:29Z")

</div>

I’m not sure about the specific question you are asking, but there is an example of using datashader with a directory-style Bokeh app with an HTML/CSS template at: [https://github.com/ioam/jupytercon2017-holoviews-tutorial/tree/master/notebooks/apps/nyc\_taxi](https://github.com/ioam/jupytercon2017-holoviews-tutorial/tree/master/notebooks/apps/nyc_taxi)

> **···**
>
> On Mon, Nov 6, 2017 at 6:04 PM, Jason Tumlinson [jasontumlinson@gmail.com](mailto:jasontumlinson@gmail.com) wrote:
> 
> > Hi,  
> > I am trying to adapt the bokeh + data shader app packaged with
> 
> > datashader-examples to a custom implementation.
> 
> > 
> 
> > The app needs to run alongside some other apps I have that are run
> 
> > in “directory” format because they have to be wrapped in a bunch of custom
> 
> > HTML and CSS, which is most convenient in the directory form, e.g.:
> 
> > 
> 
> > bokeh serve —show dashboard
> 
> > 
> 
> > However, the dashboard example as given uses a tornado server (relevant code below):
> 
> > 
> 
> > python dashboard.py
> 
> > 
> 
> > and I cannot see how this could be adapted to directory form, especially since
> 
> > the example uses the server itself to serve the datashader layer.
> 
> > 
> 
> > So, is it even possible to adapt this example to a standalone server / directory
> 
> > implementation? Or should I be attempting to incorporate my custom HTML / css
> 
> > formatting in a different fashion?
> 
> > 
> 
> > Thanks
> 
> > JT
> 
> > 
> 
> > 
> 
> > 
> 
> > 
> 
> > 
> 
> > 
> 
> > 
> 
> > 
> 
> > 
> 
> > if **name** == ‘ **main** ’:
> 
> > 
> 
> > ```
> > def add_roots(doc):
> > 
> > ```
> 
> > ```
> > model = AppState(False) # argument = "outofcore" = False by default 
> > 
> > ```
> 
> > ```
> > view = AppView(model)
> > 
> > ```
> 
> > ```
> > GetDataset.model = model # GetDataset.model has type "AppState" 
> > 
> > ```
> 
> > ```
> > curdoc().add_root(view.layout) # view.layout has type "Row" 
> > 
> > ```
> 
> > 
> 
> > ```
> > app = Application(FunctionHandler(add_roots))
> > 
> > ```
> 
> > 
> 
> > ```
> > io_loop = IOLoop.current()      
> > 
> > ```
> 
> > 
> 
> > ```
> > server = Server({'/': app}, io_loop=io_loop, extra_patterns=[('/datashader', GetDataset)], port=5006)
> > 
> > ```
> 
> > ```
> > server.start()                  
> > 
> > ```
> 
> > 
> 
> > ```
> > io_loop.add_callback(server.show, "/")
> > 
> > ```
> 
> > ```
> > io_loop.start()
> > 
> > ```
> 
> > 
> 
> > –
> > 
> > You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
> > 
> > To unsubscribe from this group and stop receiving emails from it, send an email to [bokeh+unsubscribe@continuum.io](mailto:bokeh+unsubscribe@continuum.io).
> > 
> > To post to this group, send email to [bokeh@continuum.io](mailto:bokeh@continuum.io).
> > 
> > To view this discussion on the web visit [https://groups.google.com/a/continuum.io/d/msgid/bokeh/BE6B44A2-70D8-4E4E-98E7-EB522864A22F%40gmail.com](https://groups.google.com/a/continuum.io/d/msgid/bokeh/BE6B44A2-70D8-4E4E-98E7-EB522864A22F%40gmail.com?utm_medium=email&utm_source=footer).
> > 
> > For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads.bokeh.org/original/2X/1/14eb24f9e10e4e9b78e3f10f66c04ffa96446e5a.svg) [@system](https://discourse.bokeh.org/u/system)\
**Post date:** [July 21, 2021, 9:13pm UTC](https://discourse.bokeh.org/t/running-bokeh-datashader-dashboard-app-on-standalone-server/2588/3 "2021-07-21T21:13:24Z")

</div>


