Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some questions #57

Open
zoldaten opened this issue Nov 18, 2020 · 4 comments
Open

some questions #57

zoldaten opened this issue Nov 18, 2020 · 4 comments

Comments

@zoldaten
Copy link

zoldaten commented Nov 18, 2020

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 ?

@hneutr
Copy link
Collaborator

hneutr commented Dec 7, 2020

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

@zoldaten
Copy link
Author

zoldaten commented Dec 8, 2020

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

@hneutr
Copy link
Collaborator

hneutr commented Dec 8, 2020

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

@zoldaten
Copy link
Author

zoldaten commented Dec 8, 2020

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 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants