inception icon indicating copy to clipboard operation
inception copied to clipboard

Hide relation(s), not just label(s)

Open lucasaubertin opened this issue 4 weeks ago • 8 comments

Is your feature request related to a problem? Please describe. Hi, in my project, I have several labels under the "Relation" layer. This layer is connected to a span layer. Anyway, I have a relation that appears a lot and is often long distance. So, naturally, to verify things among the annotations, I'd like to hide this specific relation. So far, the only options I found on the left side panel are to hide all the relations (label + arc) or for a dedicated label, hide the label but not the arc itself.

Describe the solution you'd like I'd like to have the option to use a quick toggle on/off to display arcs or not for a given label (or a selection of). Or having this button (below) actually hide arc(s) instead of the label on the arc.

Image

Sorry if I missed an option or did not research previous issues enough but as of today, I have not found something to do what I'd like to do.

lucasaubertin avatar Dec 04 '25 14:12 lucasaubertin

You can hide the label from the annotation as you did. This will only hide the label, not the relation. However, if you also hide the <None> entry, then relations without any labels or with no remaining labels will be hidden too.

If relations are clogging up your screen, you can also set the render mode of the relation layer in the project settings to "when selected".

Does that help?

reckart avatar Dec 04 '25 20:12 reckart

Oh I didn't know the first tip. It is doing almost what I'd like to do except one crucial point: it is not freeing all the space between the line of texts. It works a little, lines of text are now closer if I use the first tip.

While the lines of text are now closer, the remaining visible relations are still spaced too far apart from the text, which leaves a significant amount of unnecessary white space on the page. In the screenshots below (redacted), in purple are the relations I'd like to hide and I'm hiding and in black what I still want to see on my annotation page. It should be noted that the remaining relations are ranging from an anchor at the beggining of the text to one at the very end.

The second tip isn't applicable because my workflow requires me to check multiple relations simultaneously.

I understand it may be difficult to correct or that I may be using the tool in a certain way but it's what I'm viewing when working with it.

Image --------- Image

lucasaubertin avatar Dec 05 '25 10:12 lucasaubertin

When you open the preferences menu on the annotation page (cog-wheel in the action bar), there is an option to collapse relations. Please try enabling that and check if it improves your situation.

reckart avatar Dec 05 '25 17:12 reckart

In the sense that the text lines are now closer, that is for sure. Overall, I get a better view of what is going on but I tend to avoid this option as, maybe because of my use case, arcs going/starting from the same span collapse (as they should do) into unreadable text in between the spans. I should mention that on the line where the destination/source spans are allocated, I'm able to see individual arcs so we are 90% there.

Image

Some edges cases make this solution not fully adequate. Two examples:

  • When several relations start from the same span, I'd like to be able to see what label are associated to them at the location of the span source. Having them collapsed make it difficult to select one of them also. Image

  • When a span is source and destination at the same time, collapsing the arcs make them unreadable Image

I didn't mention it but I'm using the 38.5 and this request does not need to be an urgent fix at all but it would be, to me at least, a great QOL feature.

lucasaubertin avatar Dec 08 '25 08:12 lucasaubertin

Hm, interesting. Normally, the arcs should only be collapsed if they have the same label. So that pixel salad looks like a bug.

Btw. I am surprised that hidden relations still take up space, because the server shouldn't even be sending these to the frontend anymore - so they shouldn't be able to take up space.

So it seems we have two bugs:

  • pixel salad on collapsed arcs in the brat editor
  • relations that are hidden because their last label is removed (and "none" is also hidden) still take up space

reckart avatar Dec 09 '25 11:12 reckart

That sums it up nicely. Is there anything else I can do to help or any other information needed from my end?

lucasaubertin avatar Dec 09 '25 17:12 lucasaubertin

If you want to help, you can create two separate bug reports for these two issues and maybe attach a trivial reproducer project to them which I can easily use to reproduce the problem. That would save me some time at least. And I'd close this issue here then as a support ticket.

If you feel like looking into one or the other issue yourself and provide a PR, feel invited.

The hiding of annotations via the sidebar is tricky because annotations can have multiple features with potentially even multiple labels per feature. So I'm not sure that its behaviour can be significantly improved. But if I have a good idea how things might work better in your situation, feel free to make suggestions.

reckart avatar Dec 09 '25 17:12 reckart

Hi, I've created a bug report for the first point: #5785

I was about to do the second one but I'm not able to reproduce the issue in the dummy project, hidding "none" relations works as expected. So I'm guessing A) I did something wrong in my project or B) my annotated texts are more complex and contains a lot more relations which confuse Inception. I'll need to dig deeper when I get a more time to do so.

lucasaubertin avatar Dec 11 '25 09:12 lucasaubertin