About Big Data with Datashader demo

Big Data with Datashader demo。 The input type can scale normally and display details, but when it is integrated into Django, zooming cannot display specific details
my code

  from os.path import join
from pathlib import Path
import bokeh.plotting as bp
from bokeh.io import curdoc
from bokeh.layouts import column
from bokeh.models import HoverTool
from bokeh.themes import Theme
from datashader.bokeh_ext import InteractiveImage
import datashader as ds
import pandas as pd
import numpy as np
import datashader.transfer_functions as tf
from utils import matUtil
from ykkj_ai import settings
theme = Theme(filename=join(settings.THEMES_DIR, "theme.yaml"))
data = matUtil.loadmat(Path(join(settings.BASE_DIR, "featrue_bokeh", "1575362779.mat")))["data"]
# 工具
hover = HoverTool(
    tooltips=[
        ("(x值,y值)", "($x, $y)"),
    ]
)
p = bp.figure(x_axis_type="datetime", x_range=(0, 5), tools=[hover, 'pan', 'wheel_zoom', 'box_zoom', 'save', 'reset'],
              y_range=(np.min(data), np.max(data)))
dists = {cat: pd.DataFrame(dict(x=np.arange(0, len(data), 1) / float(44100),
                                y=data,
                                val=val, cat=cat))
         for x, y, s, val, cat in
         [(2, 2, 0.01, 10, "d1"), (2, -2, 0.1, 20, "d2"), (-2, -2, 0.5, 30, "d3"), (-2, 2, 1.0, 40, "d4"),
          (0, 0, 3, 50, "d5")]}
df = pd.concat(dists, ignore_index=True)
df["cat"] = df["cat"].astype("category")


def image_callback(x_range, y_range, w, h):
    cvs = ds.Canvas(plot_width=w, plot_height=h, x_range=x_range, y_range=y_range)
    agg = cvs.line(df, 'x', 'y', ds.count_cat('cat'))
    img = tf.shade(agg)
    print('=========被调用', w, h)
    # return tf.dynspread(img, threshold=0.25)
    return tf.shade(ds.Canvas().line(df,'x','y'))

InteractiveImage(p, image_callback)
doc = curdoc()
doc.theme = theme
doc.add_root(column(p, sizing_mode='stretch_both'))
doc.title = "信号数据"

Hi @416970882 Altough it has built integrations with Bokeh, Datashader is not part of the Bokeh library, it is a completely separate tool. It is probably better if you take questions about Datashader to the “PyViz” team that maintains it:

The code I see in the following example,

@416970882 That appendix was created and added by the Datashader devs, not the Bokeh devs. I just tried the live Binder tutorial and it was working as expected. If you can reproduce some issue I would suggest you file an issue on the Datashader issue tracker with complete information to reproduce, especially any versions, platform info, etc.

I have studied the source code here, and found the data requested only after I sent websocket message with I Python in the example
What should I do to request the background to update the data to the corresponding front end when the x_range changes with CustomJs