jhwang1992/network-visualization

anyway to edit the graph in the website

Opened this issue · 3 comments

thanks for the demo, but is there any way to edit the graph on the website, such as adding nodes, adding a connection, etc.

To edit the nodes and edges in the graph one would have to modify the two .csv files defined on lines 26 and 27 shown below:
edge1 = pd.read_csv('edge1.csv')
node1 = pd.read_csv('node1.csv')

The above two lines use pandas dataframe objects to read in the csv files and then display them thereafter using plotly graph objects.

Please note that there is a dedicated node/edge visualization package called cytoscape found here.

I actually read all the source code and know exactly what is happening, but I am just asking are there good way to edit the graph directly on the browser, it seems that dash doesn't have this functionality .

For the most part, you are correct in that Dash and Plotly are meant for static data that lives on the server/host. However, because Dash has a set of components that allow the user to input data, like text boxes and buttons, you could use those components to edit the edges and nodes.

For my own project, I use an instance of dcc.Textarea( ) to allow the user to input equations. Then, I parse those equations and put the symbols into nodes and edges using dash callbacks. Although my website is a little sluggish, you can try it out at my site. The relevant source is found on my application.py file. I have a dcc.Textarea( ) used and that is related to the page_1_text( ) callback.