benmaier/netwulf

visualize(network) should let the user specify which node and edge attributes to use

davhin opened this issue · 5 comments

I have networks whose nodes may be grouped and therefore coloured differently according to several distinct node attributes. Likewise, my networks hold several different attributes inside one edge (total count, percentage) and I need to use either of them, depending on the situation, to layout the network.

I propose to allow the user to pass two strings to visualize, one to decide which node attribute to use as the denominator for groups, the other to specify which numerical edge attribute to use as the weight:

visualize(network, node_group='node_attr_1', edge_weight='edge_attr_2') as a specific example.

I will open a pull request to this end.

I just thought: maybe it's better if this is done on the web app side -- include two drop down menus, in which the node attributes (edge attributes, respectively) are shown, inferred from the data, such that one can dynamically choose.

Nevertheless, the initial value of those menus can then be passed to the function visualize

For now it might suffice to add additional attributes though.

I had the same idea, but until that is implemented this could be a workaround. Also, if you know you are only interested in one specific combination this reduces JSON size, which may or may not be important depending on the resources consumed by the app.

paging @ulfaslak here. This is not super important, but I agree it'd be a nice feature to scan node and link attributes from the uploaded network and then have two drop-down menus from which to choose the attribute name for node-color and link-width. What do you think? I say let's keep this in mind for later versions.

we decided that for now, filtering/choosing is done on the python side