webweb icon indicating copy to clipboard operation
webweb copied to clipboard

some questions

Open zoldaten opened this issue 4 years ago • 4 comments

Great thanks for your program! I look at it after d3.js, networkx. But have some questions: 1 how to change canvas in code (width & height) ? 2 how to load edgelist to make a layered network automatically? 3 how to add weights to show like in d3.js, networkx ? (labels = nx.get_edge_attributes(G,'weight') nx.draw_networkx_edge_labels(G,pos,edge_labels=labels)) 4 is it possible to switch on edges i want to watch the path from one node to another ?

zoldaten avatar Nov 18 '20 09:11 zoldaten

Hi @zoldaten! Sorry for the delay!

  1. See https://webwebpage.github.io/docs/documentation/display/height.html for how to change height and https://webwebpage.github.io/docs/documentation/display/width.html for width
  2. not quite sure how automatic this gets it but... see https://webwebpage.github.io/docs/examples/layers.html for general layers syntax, and you can reasonably make layers in a loop by calling web.networks.mynetwork.add_layer(nx_G=G) if you have a networkx object
  3. you can add weights a number of ways! If they are on the networkx object as the weights attribute, they'll be added automatically. If you're passing an adjacency matrix, if the values in the matrix are not all 1s, they'll also be added automatically; lastly, if you are passing an edgelist, and the edges are 3 elements long, the third element will be considered a weight
  4. Hm... I'm not quite sure I understand what you mean here — do you mean something like animating the visualization to change from one network to another?

Best, Hunter

hneutr avatar Dec 07 '20 21:12 hneutr

thanks for comments. 4. i mean something like all_simple_paths in networx or all_short_paths in it.

zoldaten avatar Dec 08 '20 17:12 zoldaten

Like, is there a way to highlight particular edges? Webweb doesn't currently do that, but it may in a future release :).

hneutr avatar Dec 08 '20 17:12 hneutr

Thats will be great! I just started using graphs, heres my article - https://habr.com/ru/post/525376/ Tried to combine different solutions in this field )

zoldaten avatar Dec 08 '20 19:12 zoldaten