AD4M Perspectives can be rendered and interacted with in many different ways.
The thinking behind AD4M is that there can and should be many different UIs to visualized all or parts of the same Perspective. These different UIs can take the form of applications that connect to the AD4M-executor and select their Perspective(s) to visualize.
But already for both first AD4M applications, Junto's Flux and Perspect3ve, we are dealing with multiple Prespectives (all Perspectives in the case of Perspect3ve) that should be displayed and interacted with in different ways:
- as graph
- as chat thread
- as plain list of links for debugging
- ...
There is nothing conceptually stopping us from regarding these different ways of displaying of and interacting with Perspectives as re-usable componentes, that are largely independent from the actual app in which they are used (Flux / Perspect3ve / ...) and thus could be build as web components and shared between apps.
For that to pragmatically work out, we have to agree on an interface for these web components - that is agree on their properties, events and methods.
perspective
: PerspectiveProxyexpressionClient
: ExpressionClientme
: Agent
The Perspective View component needs to be initialized with the Perspective to render and with access to it.
We don't want to provide access to the whole Ad4mClient for security reasons.
PerspectiveProxy
wraps the Ad4mClient
and provides access exactly to one Perspective.
Since the Perspective View likely needs to get Expression data or create new Expressions, it needs the ExpressionClient.
me
the Agent
object of the local user/agent.
Perspective Views trigger the following DOM events with corresponding parameters:
agent-click
(did)agent-viewed
(did)expression-click
(url)expression-viewed
(url)expression-blur
(url)perspective-click
(perspective-uuid)perspective-viewed
(perspective-uuid)external-click
(url)
The last one, external-click, is triggered when a web 2.0 link was clicked that should be opened externally in another app.
revealExpression(url: string)
Scrolls or zooms to the given expression.selectExpression(url: string)
If the Perspective View implements selection capabilities, this methods selects the given expression.