Networkx integration issues - updating and saving


I’m currently working on an annotating system using bokeh and have 2 issues regarding working with network graphs.

I’m using from_networkx to create a network graph plot and I’m updating it with respect to what the user annotated.

  1. when I’m renaming node indices and updating - the node disappears
        data_src=label_data.data_src, output=label_data.output_data,
        selected_label=change_label_selector, new_label=change_label_input,
        graph_src = label_data.network_graph.node_renderer.data_source, output_graph = output_graph_data,
        edges=label_data.network_graph.edge_renderer.data_source, output_edges = output_edges_data,
        graph_src=label_data.network_graph, output_graph=label_data.output_graph,
        new_classes=[], select_label_selector=select, is_new_label = is_new_label_checkbox),
        for (var i =0; i<['index'].length;i++) {
  ['index'][i] =['index'][i] === selected_label.value ? new_label.value :['index'][i]
        for (var i=0; i<['end'].length;i++) {
  ['end'][i] =['end'][i] === selected_label.value ? new_label.value :['end'][i]
        for (var i=0; i<['start'].length;i++) {
  ['start'][i] =['start'][i] === selected_label.value ? new_label.value :['start'][i]
    = =
  1. I was wondering if there’s a way to retrieve the new structure I created on the graph. meaning the opposite action of from_networkx. I want to save the output graph inside a pickle (or any other file in that manner).

thanks a lot!


HI @amitsandhel please edit your post to use code formatting so that the code is intelligible (either with the </> icon on the editing toolbar, or triple backtick ``` fences around the code blocks)

1 Like

@Bryan sorry, edited :slight_smile:

No there is nothing built-in that would do that. Bokeh only knows how to ingest NetworkX.

For the first question there is not much that can be said without a complete Minimal Reproducible Example to run and investigate directly. If I were debugging the first thing I would do would be to add some console.log statements to inspect the data that is getting set and make sure it is what I expect it to be.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.