These are chat archives for UniversalViewer/universalviewer

31st
Oct 2015
jeffreycwitt
@jeffreycwitt
Oct 31 2015 20:11
@edsilv hey you around?
Edward Silverton
@edsilv
Oct 31 2015 20:38
yep!
jeffreycwitt
@jeffreycwitt
Oct 31 2015 20:42
hey quick question
Edward Silverton
@edsilv
Oct 31 2015 20:42
shoot
jeffreycwitt
@jeffreycwitt
Oct 31 2015 20:42
regarding searchWithin
do you think its odd that in the spec that in order to retrieve the coordinates for a "hit" you have jump back up to the annotations and then find the matching annotations for the hit
the only way I can think to do this, is run a loop until I find the annotation that matches the targeted annotation in the hits -> annotations array
but this seems like it could end up taking a really long time, especially if the search results are long.
does that make any sense?
I wonder if you've got a better way of retrieving coordinates for a hit from its targeted annotations than just looping through all annotations until you find a match.
Another way of saying it is, it would be nice if the hits had a property for coordinates, so you could bypass altogether the extra step of looking for the annotation
Edward Silverton
@edsilv
Oct 31 2015 20:47

this is what a wellcome search result looks like:

http://wellcomelibrary.org/annoservices/search/b18035723?q=dieselbe

jeffreycwitt
@jeffreycwitt
Oct 31 2015 20:48
right, so say you are looping over the hits, and for each one you wanted to get the coordinates...
Edward Silverton
@edsilv
Oct 31 2015 20:48
the id of the annotation does contain the coords, but I think you'd still want to use the annotation's on property
jeffreycwitt
@jeffreycwitt
Oct 31 2015 20:48
don't you have search back through the "resources" to find the matching resource so that you can then grab the coordinates
I think its dangerous to rely on the coordinates in the id
Edward Silverton
@edsilv
Oct 31 2015 20:49
personally I have no problem with looping over the annotations each time
jeffreycwitt
@jeffreycwitt
Oct 31 2015 20:49
we should be getting the from the "on" property
Edward Silverton
@edsilv
Oct 31 2015 20:49
yep
jeffreycwitt
@jeffreycwitt
Oct 31 2015 20:49
oh ok, doesn't feel to slow
Edward Silverton
@edsilv
Oct 31 2015 20:49
loops are so ridiculously fast that for me it's a no brainer
manifesto takes a sort of "brute force" approach like that. haven't noticed any perf issues
jeffreycwitt
@jeffreycwitt
Oct 31 2015 20:50
ok, that's sounds fine then. That's basically how I've been doing it. I just worried professionals might have a secret trick :)
Edward Silverton
@edsilv
Oct 31 2015 20:50
shaun was saying that he tried manifesto and it solved a few bugs for him. I haven't got as far as implementing the hits property yet though - only using the annotations
it's on the todo list for the near future though
jeffreycwitt
@jeffreycwitt
Oct 31 2015 20:51
great; many thanks
Edward Silverton
@edsilv
Oct 31 2015 20:51
but I'd use the "brute force" approach
jeffreycwitt
@jeffreycwitt
Oct 31 2015 21:05
happy halloween