Skip to content

Latest commit

 

History

History
55 lines (34 loc) · 1.69 KB

README.md

File metadata and controls

55 lines (34 loc) · 1.69 KB

Plugins

⚠️ the API in this document refer to siibra-explorer>=2.7.0. For migration guide/rationale, please see MIGRATION.md

siibra-explorer provides a plugin system, which allow a third party application to interact with siibra-explorer.

Quickstart

manifest

The plugin need to expose a manifest json file. The manifest file needs to have the following properties:

{
  "iframeUrl": "<iframeUrl>",
  "name": "<name>",
  "siibra-explorer": "<siibra-explorer>"
}
property required desc
iframeUrl true points to the html where the iframe is located. If does not start with https?://, siibra-explorer will try to resolve it relative to the absolute path of manifest.
name true name of the plugin
siibra-explorer true the version siibra-explorer this plugin is targetting. Should be >= 2.7.0. n.b. currently this entry is partially implemented, and any truthy value is sufficient.

|

Architecture

The plugin needs to provide a HTML page, served over HTTP. This will be embedded into siibra-explorer as an iframe.

All communications between siibra-explorer and plugin will occur via the postMessage API.

Lifecycle

handshake.init (up to 10x attempts, 1sec debounce) -> {broadcast|request} -> handshake.exit (NYI)

Please note that the handshake.init needs to be responded to, before any other messages are sent.

API References

The API is generated automatically with the following script:

npm run api-schema

handshake API

broadcast API

request API