0

I am working with bokeh library in python to generate charts like bar chart , histogram , line chart for visualization of data.

Our code was developed in bokeh version 1.4.0. Now, I want to upgrade the bokeh version to 2.4.3 but, here the issue is when we are upgrading the code the chart is not getting generated….

We found the function SERVER_DOCUMENT() response in 1.4.0 was something like this as shown below……….

<script src=http://localhost:5004/histogram/autoload.js?bokeh-autoload-element=1094&bokeh-app-path=/histogram&bokeh-absolute-url=http://localhost:5004/histogram id="1094"></script>

Whereas, in 2.4.3 the SERVER_DOCUMENT() response is …….

<script id="1002">
  (function() {
    const xhr = new XMLHttpRequest()
    xhr.responseType = 'blob';
    xhr.open('GET', http://localhost:5004/histogram/autoload.js?bokeh-autoload-element=1002&bokeh-app-path=/histogram&bokeh-absolute-url=http://localhost:5004/histogram, true);
    xhr.onload = function (event) {
      const script = document.createElement('script');
      const src = URL.createObjectURL(event.target.response);
      script.src = src;
      document.body.appendChild(script);
    };
    xhr.send();
  })();
</script>

Previously, the server used to trigger “/histogram” endpoint but, in recent response the server is not triggering…

Attempts we tried but, failed to trigger the “/histogram” endpoint.. For bokeh 1.4.0 server is defined as

Server({'/histogram': histogram_doc},extra_patterns=[('/', ChartHandler)], allow_websocket_origin=["localhost:2502"],port=5004)

Now, for bokeh 2.4.3 server is defined as…

Server({'/histogram': histogram_doc},extra_patterns=[('/', ChartHandler)], allow_websocket_origin=["localhost:2502"],port=5004,use_xheaders=True)

We are expecting to trigger this endpoint.. Please share your thoughts…. To resolve the issue…

0 Answers0