How to Make HOLOMAP act as callback function in Flask+gunicorn App

Hi,
I was able to do sample sea-temperature bokeh data plot in Flask+gunicorn App .
Now i am trying to do advance example in Flask+gunicorn App.
In my advance example i am using Holomap concept so that my plot work dynamic ,
can you please let me know how i can use that HOlomap code of line inside my normal function callback, so that i am to change plot value in my Flask+gunicorn App .
Below is the code of sample sea-tempertaure bokeh code.

app = Flask( **name** )
def bkapp(doc):
print(“inside bkapp”)
df = sea_surface_temperature.copy()
source = ColumnDataSource(data=df)
plot = figure(x_axis_type=‘datetime’, y_range=(0, 25), y_axis_label=‘Temperature (Celsius)’,
title=“Sea Surface Temperature at 43.18, -70.43”)
plot.line(‘time’, ‘temperature’, source=source)


def callback(attr, old, new):
    print("inside callback")
    if new == 0:
        data = df
        print("inside if new:",data)
    else:
        data = df.rolling('{0}D'.format(new)).mean()
        print("else data:",data)
    source.data = ColumnDataSource.from_df(data)

slider = Slider(start=0, end=30, value=0, step=1, title="Smoothing by N Days")
slider.on_change('value', callback)

doc.add_root(column(slider, plot))

doc.theme = Theme(filename="theme.yaml")

bkapp = Application(FunctionHandler(bkapp))


sockets, port = bind_sockets(APP_SERVER_ADDR, 0)

 @app.route('/', methods=['GET'])
  def bkapp_page():

I think in my above lines of code i need to change only in callback function , so how to alter the code so that it accept holomap lines of code

My snippet of Advance code is below

def perdelta(strt, end, delta):
curr = strt
while curr < end:
yield curr
curr += delta

tri_new = pd.read_csv(‘fort.ele’, delim_whitespace=True, names=(‘A’, ‘B’, ‘C’, ‘D’), usecols=[1, 2, 3], skiprows=1,
dtype={‘D’: np.int})
def plotthis(datetime, regions=‘W’):
         dat = datetime
         dt = parse(str(dat))
         yr = dt.year ...

    verts = pd.DataFrame(np.stack((Longitude, Latitude, MeanWavePeriod)).T,
                         columns=['Longitude', 'Latitude', 'MeanWavePeriod'])

    tri_sub = tri_new.apply(lambda x: x - 1)

    tri = gv.TriMesh((tri_sub, gv.Points(verts)))

    return tri
allplot = {(k.strftime("%Y-%m-%d %H:%M:%S"), r): plotthis(k, r) for k in
perdelta(strt, strt + timedelta(days=9), timedelta(hours=3)) for r in
 [‘O’, ‘A’, ‘W’, ‘T’]}
tiles = gv.tile_sources.Wikipedia
hmap1 = hv.HoloMap(allplot, kdims=[‘Select Date and Time :’, ‘Select State’])

dd = df_div.opts(width=70, height=70)
dd1 = df_div1.opts(width=600, height=90)
dd2 = df_div2.opts(width=100, height=10)

finalplot=pn.Column(pn.Row(dd, dd1, dd2), tiles*rasterize(hmap1).options(*opts)logo1.opts(hooks=[absolute_position], apply_ranges=False)).servable()

finalplot

what modification need to be do in above my advance snippet, so that i get an option of dynamic holomap option in my Flask+gunicorn app.?

Thankyou.
I will really appreciate if any let me know how to work HOLOMAP in Flask+guincorn app.