Open ilisalis opened 4 years ago
You make a compelling point. Currently, if there are any duplicates found, they're skipped so they won't have a collision. However, that assumes that each annotation has no children annotations. I'm not sure how often people actually make annotations of annotations (and then load/import them later on), but we could stand to have it be as robust as possible.
Some minor notes. loadAnnotationItem
could be defined as a constant and it would be easier on my eyes if formatting was consistent. A space can make a big difference with readability, at least for me.
More importantly, I feel like there's likely a better way to run this recursion. I'm not expert in algorithms, but if loadAnnotationItem
is called for both the case where there is a duplicate found and when no duplicate is found, couldn't it be called once after the check for duplicates? I dunno. Might have to revisit optimization later.
For recursion, there may be a way to do it differently; however, this will be at the expense of readability, without being more effective. The important thing is that one must create an annotation and add it to its parent, the other must not; while continuing to treat the children.
Otherwise, it is only a proposal. In general, I use little variables in my codes. I don't really have an opinion on formatting (it already changes a lot depending on the parts of the project).
I agree, and although I haven't spent much time on it, I couldn't come up with a more efficient method. I say submit it 👍
Dans LoadProject.js, la fonction loadAnnotations ne gère pas le chargement d'annotations hiérarchiques.
A proposed correction, it considers the possibility of loading lower nodes for an already existing annotation :