Bokeh Application Function Handler

While using the function handler to call functions to plot, is it possible to provide the dataframe as an argument?

Eg:

def make_doc(doc):

    # do work to modify the document, add plots, widgets, etc.

    return doc

app = Application(FunctionHandler(make_doc))

Would it be possible to pass dataframes or other data sources through make_doc? Thanks

using partial?

from functools import partial

def make_doc(doc, df):

    # do work to modify the document, add plots, widgets, etc.

    return doc

make_doc_with_df = partial(make_doc, df=df)
app = Application(FunctionHandler(make_doc_with_df))
3 Likes

Hey,

This worked perfectly. Thanks a lot :smiley: