Add menu for canvas choice#1748
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@jamesmisson is attempting to deploy a commit to the Universal Viewer Team on Vercel. A member of the Team first needs to authorize it. |
demiankatz
left a comment
There was a problem hiding this comment.
Thanks, @jamesmisson, this looks like it's off to a good start. See below for some questions and suggestions.
Also, a more general question: I see that you have logic to make this work in 2-up mode, but what happens if each canvas in 2-up view has a different set of choices? I'm not sure how the UI would work in that situation... but maybe that will be more clear when you provide the more complex sample manifest you alluded to in your comments.
|
Hi @demiankatz , thanks very much for taking a look. I think on reflection I should rethink the 2-up view. As you say, they might have different choices; my current approach assumes there's at least some overlap in the choices and tries to merge them into one list. A more generalizable approach would be to have two sections in the choice menu, one for each canvas, if 2-up view is enabled. I'll work on that this afternoon. |
|
Hi @demiankatz , I've made a few improvements. These mostly concern the 2-up display, which is now working across a range of choice combinations. I've added the 'Paged choice combinations' manifest to the examples to test this. The canvas pairs test these combinations:
That all seems to be working. NB the images I've used are very different sizes so the right hand canvases appear very small. Our production manifest is still in the works until the images are online. And I've covered your suggestions:
|
|
Thanks, @jamesmisson, I think your approach to the 2-up UI makes sense and it seems to work well for me. Do you want me to take another look at the code now, or do you want me to wait until you've checked off more of your TODOs? |
|
Thanks @demiankatz , I'll be working on those remaining things this week so probably best to hold off until they're done |
This adds support for manifests using 'choice' on the canvas as part of the BL's multispectral work, adding a dropdown menu to the image control buttons to switch between layers. I'll leave it in draft as there are a couple of outstanding things.
Most of the logic occurs in the openMedia function in OpenSeadragonCenterPanel, which now checks for choices and branches off into a slightly different way of handling image display.
This currently works for 1-up or 2-up views, provided the canvases all have at least one choice.
I don't think this will work in a scenario where the first of the canvas pair does not use choice and the second one does (because if a choice is detected on either, openMedia branches off into rendering choices only). I'll come back to this.
It should work if canvases have a different number of choices and at least 1 choice (though I still need to create a manifest to test this).
I've added the cookbook choice recipe to the example manifests. We're currently working on a more substantial manifest to test this.
I've used the existing dialogue component for the dropdown choice menu, but have developed it slightly to be positionable above or below its anchor.
I had some problems rebasing this onto v4.4.0 so the commits might look a bit weird. The work in progress can be seen on my original branch: https://github.com/jamesmisson/universalviewer/tree/choice
To do:
I think ultimately the image adjustment dialogue (brightness etc.) should be streamlined and restyled to resemble this one.