Slow reactivity with more than 10 figures

Thanks for the response.

Initially I didn’t think that the code was necessary because I thought that I located the problem (the amount of figures) but by trying to create a minimal reproducible example, I understood that the part of the layout that is slowing the reactivity is changing text of a Div. Sorry for this misinformation.

Searching for a solution, I found this thread; here’s they explain that the problem is due to a function called during div.text that refreshes the display and in the end of the thread, the code for implementing a Div widget without this part is presented.

I tryed implementing the new widget as explained in this Guide. To do so, I did the following steps:

  • create a folder called “custom” inside the bokeh folder in my local conda environment (the path should look like this) “path/to/local_3.8.10/lib/python3.8/site-packages/bokeh/custom”
  • create a file called “custom.ts” and copy-paste the code from the guide. First problem: in the first three lines where the code imports stuff, I don’t know the correct path.
    Here’s the lines:
import {HTMLBox, HTMLBoxView} from "models/layouts/html_box"

import {div} from "core/dom"
import * as p from "core/properties"
  • create a file called “custom.py” and copy-paste the code from the guide. In the first 2 lines, I changed the code from this:
from bokeh.core.properties import String, Instance
from bokeh.models import HTMLBox, Slider

To this:

from ..core.properties import String, Instance
from ..models import HTMLBox, Slider
  • create outside the local environment a simple python file called “test.py” with the code from the guide and run it

The error that I encounter is the following:

RuntimeError: node.js v14.0.0 or higher is needed to allow compilation of custom models ("conda install nodejs" or follow https://nodejs.org/en/download/)

But by running the prompt (I’m using Manjaro Ubuntu, linux):

 $ conda list nodejs
# packages in environment at /path/to/local_3.8.10:
#
# Name                    Version                   Build  Channel
nodejs                    6.11.2               h3db8ef7_0  

I tried different things but nothing’s working.