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():
  script = server_document('http://%s:%d/bkapp' % (APP_SERVER_ADDR,port))
return render_template("embed.html", script=script, template="Flask")

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

  *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)*

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=‘Whole_East_Coast’):
dat = datetime
dt = parse(str(dat))
yr = dt.year
mn = dt.month
d = dt.day
hr = dt.hour


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.

@sameerCoder HoloMap is not a part of Bokeh, so this is not the appropriate venue to ask. You should direct your question to the Holoviz Discourse, which has core devs for Holoviews:

Also, just speaking plainly, the question above is unintelligible due to lack of code formatting.

Thanks Bryan,
I have posted same problem in holoview Discourse
link:- https://discourse.holoviz.org/t/how-to-make-holomap-act-as-callback-function-in-flask-gunicorn-app/905