Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider APIs for content requiring interaction with containing app #176

Open
tomcrane opened this issue Jul 6, 2018 · 0 comments
Open
Labels
📣 Discussion Promote a discussion

Comments

@tomcrane
Copy link
Collaborator

tomcrane commented Jul 6, 2018

While the behaviour of CanvasPanel for many scenes is completely deterministic, some content requires, or would benefit from, user interaction.

Examples:

When there is a Choice (oa:Choice), CanvasPanel needs to supply that information somehow to the containing app, so that the containing app can generate the UI to offer the choice to the user; when the user chooses, that containing app needs to notify CP of the choice that was made. It's not CanvasPanel's job to provide that UI, but it is CP's job to make that UI and associated code trivially easy for someone knocking up a quick viewer.

More generally, with many linked annotation lists / otherContent, the containing app needs to offer UI to the user to control the visibility by list, and/or by motivation, and/or by language.

And then, there is all the anno content that is available but not desirable to render directly on the canvas. As a developer who wants to make innovative user interfaces quickly, I'm relying on CanvasPanel to do all the heavy lifting for display - but I am prepared to handle some of that display in my app, because not all the anno content should be painted onto the canvas. I don't know in advance what content the canvas bears, CP helps me process it. So it has features that are not just about it drawing pixels, but about processing content.

Example - for supplementing content in P3 (or text transcriptions in a linked annolist with otherContent), I might want to display the text off to the side, where it is selectable.

So, I need to be notified by CanvasPanel of the availability of this textual content, or query CP for the availability of the content; I want to get the content, so that I can render it.

But maybe I want to invoke a special CP mode that draws the text on top of the canvas, fitted to the anno boxes, so that it is selectable (a cool feature: #180)

All these things involve my containing app knowing about what canvaspanel has for a given canvas, sometimes obtaining that content through API on CP (rather than having to process the canvas itself again from scratch), sometimes taking care of the display externally and other times telling CP how to display it.

Example - I'd want to use CP to create something as simple as this:

https://github.com/tomcrane/wellcome-today/blob/gh-pages/viewer-min.html
(http://tomcrane.github.io/wellcome-today/viewer.html) and add support for displaying the text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📣 Discussion Promote a discussion
Projects
None yet
Development

No branches or pull requests

2 participants