I want to call a CustomJS callback from the html document, but when I initialize it in python, it doesn’t show up in the html file it’s creating.
For example, I initialize the callback in Python, it gives me the id in the command line, but does not include it in the html
This CustomJS callback would call a python function via ajax to fetch the data and update the ColumnDataSource in the CustomJS callback.
If this isn’t possible I may have an idea for a workaround.
I thought it might be possible to assign the callback to a model and then make it invisible or something like that. But I dont know if there exists a model that can be set like this.
Althought it’s unusual, you might be able to add the CustomJS as a root itself with curdoc().add_root(...) (even in standalone content). But I can’t guarantee that will work, you will just have to try. Otherwise, you can add it to an some other model as a workaround, as you suggest. (A DataModel might be a good choice)