annotation-tool icon indicating copy to clipboard operation
annotation-tool copied to clipboard

"Clustering" annotations in the new timeline

Open JulianKniephoff opened this issue 5 years ago • 4 comments

The annotation tool currently has the following feature:

When two or more annotations of a given label, or three annotations of arbitrary type overlap on a track, all one of them per label, and all but two overall are consolidated into a placeholder annotation that spans their cumulative duration. Hovering over this sentinel reveals all the hidden annotations in a popover, and clicking on it expands all clusters in a track.

This was implemented as part of the Münster-update in #31.

This feature required a lot of very unwieldy custom code on top of the preexisting custom code responsible for integrating the timeline library into the tool. This library is now obsolete and will soon be replaced as part of https://github.com/opencast/annotation-tool/projects/2. A lot of the aforementioned custom code could actually be removed due to the many fixes, improvements and new features in the new vis-timeline library, instead of having to be ported. That's great! :tada:

However, this is not true for the code surrounding the above feature, unfortunately. :cry:

Of course I can port the logic behind it to the new library, however that would be a significant engineering effort initially, and we would still have a significant amount of custom code surrounding the timeline, which is of course a maintenance burden, and to be totally honest, the logic behind the feature is not the best to begin with, so I would hesitate to just reimplement it without seriously thinking about some aspects, which would of course exacerbate the issues I just mentioned.

Now the good news is that the new timeline offers some features that are at least similar to what we had before, and it might be sensible to just dump the old feature in favor of (potentially a combination of) the techniques illustrated in the following examples:

The clustering feature is unfortunately still a bit awkward to use, but it might be a nice to have addition later on.

In both, the nested group and subgroup examples, I would map the individual categories and the "virtual category" free text annotations to the higher level groups, and the labels beneath each category to the nested groups/subgroups.

This would give us, in the nested group example, the ability to show/hide individual labels and also entire categories. The disadvantage is that when we collapse a category, for example, we don't see the individual label annotations at all anymore.

The subgroup example shows that we can control wheter or not overlapping items are stacked on different levels, namely on the level of the category and the label (in terms of our use case). This is, I think, closest to our current feature. By default, we could "un-stack" all categories and the free text annotations, so that any track would have two "lanes" by default, one which contains free text annotations, which potentially overlap, and one with all the structured annotations, which also potentially overlap. One could than enable stacking for the free text annotations and for the categories individually, so that overlapping annotations of different categories would stack, but annotations with the same label would still potentially overlap. Finally one could expand the label "lanes" once more and have everything stack.

This is hard to put into words, and I would encourage @ebbertd to play around with the examples to get a feeling for these features. I agreed with @dagraf that we would build a prototype of this new feature near the end of the Timeline project.

The question for @ebbertd and @dagraf as (representatives of) the biggest adopters (I think) then is: Would this be an adequate replacement for the original clustering feature?

JulianKniephoff avatar Nov 07 '19 16:11 JulianKniephoff

@JulianKniephoff Thank you very much for the proposal. I consider it a good solution. Perhaps it would be worth thinking about integrating the option "Enable grouping" from the clustering example. So as a starting point for all the "unstacking" possibilities. Only when I activate "Enable grouping" will the free text and category annotations be split into two different "lanes".

After having written down this suggestion I'm not sure anymore if this additional option would be too much and that it confuses rather than helps. I'm curious to hear your suggestions/opinions.

dagraf avatar Nov 11 '19 08:11 dagraf

Where we would put all these options, even without your additional suggestion @dagraf, is indeed a challenge. Especially the controls in the "track header" get very crowded very quickly. One possibility to tame this complexity would be to move/add stuff to the track editing dialog, where you can at least put a descriptive label next to the checkbox/radio button/whatever. I am not a user, though, so I can't say anything about which options should be accessible from the header, and which are okay to be shoved into that dialog. :thinking:

JulianKniephoff avatar Nov 11 '19 14:11 JulianKniephoff

@JulianKniephoff Yes, this would be a adequate replacement. The clustering feature is amazing. As @dagraf wrote it is worth thinking about using the Enable grouping feature. Being able to split a track into sub-tracks per category is certainly a wish our users expressed.

ebbertd avatar Nov 13 '19 16:11 ebbertd

Without knowing how the tracks will look like after the timeline has been updated I would suggest to move all controls concerning this new feature in the track editing dialog. As default setting I would suggest that free text and category annotations would be split into two different "lanes" an all other categories are "un-stacked" (as Julian proposed).

dagraf avatar Nov 14 '19 10:11 dagraf