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

[Feature] show edge labels #247

Open
kodymoodley opened this issue May 3, 2023 · 8 comments · May be fixed by #249
Open

[Feature] show edge labels #247

kodymoodley opened this issue May 3, 2023 · 8 comments · May be fixed by #249

Comments

@kodymoodley
Copy link

How difficult would it be to show edge labels in Network explorer? I am specifically looking at cases where the edge attribute is not numeric (like an edge weight) but a categorical variable. For example, if I mine text for grammatical or linguistic relations between entities and I want to render the type of linguistic relation between the nodes in the network.

s

@janezd
Copy link
Contributor

janezd commented May 3, 2023

Just for a quick feedback: I believe this should be rather trivial to implement -- on the first glance it shouldn't take more than a day. The problem is that somebody has to do it.

This add-on is an orphan, I'm the last person who's done some serious work on it (apart from some PRs by @matejklemen, for which we're really grateful). There are other issues that need fixing, too.

I've put your suggestion on my todo, and may implement it this weekend if the weather is not good enough for cycling. Follow the weather forecast for Slovenia. (Bad news: for now it looks warm and sunny. :)

@kodymoodley
Copy link
Author

Thank you very much for putting my suggestion on your todo list @janezd! I am absolutely fine if you instead go cycling this weekend :) I will wait patiently for the feature :)

@janezd
Copy link
Contributor

janezd commented May 3, 2023

on the first glance it shouldn't take more than a day

Half an hour, rather. :) It turned out most of the code was already there, I just needed to repurpose it. I need to test this a bit, though.

Screenshot 2023-05-03 at 23 01 57

@kodymoodley
Copy link
Author

@janezd, do you have a link to a commit / branch for this feature so I can test on my end as well?

@janezd
Copy link
Contributor

janezd commented May 12, 2023

I owe you an update. The weather last weekend was awesome -- so I spent it on two wheels. Then I had an extremely busy week, including today, so I got back to this only now, on Friday evening.

The problem is getting the data for the edges. For the above image, I customized the Pajek format by adding a column with the label. I could upload that code, but, in general, the Network File widget should accept an additional table with data, I guess. This turned out to be more complicated than I anticipated both in terms of GUI as well as of efficient implementation and it seems that it will be incompatible with my existing approach to storing this information.

The good news is that the forecast for this weekend is bad, so there is a good chance I could have something by Monday.

@kodymoodley
Copy link
Author

Sorry, I was on holiday @janezd, thank you very much for the update! I am glad you had a good cycling weekend last week! 😊 I will eagerly keep following this thread, can't wait to test! :)

@janezd
Copy link
Contributor

janezd commented May 22, 2023

Here's what I have so far: #249.

File widget now allows two data tables on input. The one (that was already there before) allows attaching data to vertices; you need to choose the column with string labels, which are matched by the vertex labels from the network file. The new input allows attaching data to edges; the user has to select two columns.

File widget now has another peculiarity: the user doesn't have to load the file, but can only give two data tables on the input and it will compose a network. I added this functionality because it is practically for free, almost no additional code was needed. But then, it is weird. I have to think about it.

Network Explorer widget is changed to allow choosing the label. This also called for some additional rearrangement.

It works on the few examples that I tried, but you'll probably easily break it.

@kodymoodley
Copy link
Author

Thanks @janezd! I will test it in the next few days.

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