Js_on_change not working properly for Select widget on Network Graph


I am trying to update my Network graph based on a column filter using a select widget. The graph is showing properly but only for the default values. When I use the select widget nothing happens, I also don’t see any errors when I inspect the console on my browser. I followed carefully a working example (non for a network graph, though), but it is not working.

Here is a post in Stackoverflow which includes a MRE with my latest efforts. Unfortunately no one has replied yet ( I have tried posting a couple times). I don’t know what else to try.

Trying to investigate… What is “nx” in your code? It’s not in your import statements in your SO post.

Thank you for pointing out. Forgot to include these two imports

import networkx as nx
import networkx

I have updated the SO post as well.

So I have a clue that’ll probably help: the datasource being used to draw the edge_renderer is NOT the same datasource you instantiate with source:


I’d try rearranging your code a little bit and then passing not your original source but network_graph.edge_renderer.data_source into the CustomJS code and update that.