Plexora

Browser API

What a plugin's JavaScript registers with the viewer, and the context every hook receives.

Generated from Plexora 0.0.55

A plugin's browser script calls Plexora.registerPlugin(definition) when it loads. The viewer activates it when the tool opens and passes every hook a context object. The pages below are generated from the type definitions in the viewer's own source, so they describe exactly what the running version provides.

Plexora.registerPlugin({
  name: "my_tool",
  createInstance(ctx) {
    return { markers: ctx.dataset.markers };
  },
  createSidebarController(ctx) {
    return {
      setup() {
        ctx.sidebar.textContent = `${ctx.sample.name}: ${ctx.columns.length} columns`;
      },
    };
  },
});