Annotorious Boolean Operations
Adds functionality to merge and subtract annotation shapes.

Important: this plugin only supports @annotorious/openseadragon at this time. Support for
plain (JPEG, PNG,...) images is not yet implemented. Get in touch via the forum if you are interested in
using this with the @annotorious/annotorious or @annotorious/react packages.
Using with OpenSeadragon
npm install @annotorious/plugin-boolean-operations
import OpenSeadragon from 'openseadragon';
import { createOSDAnnotator } from '@annotorious/openseadragon';
import { mountPlugin as mountBooleanPlugin } from '@annotorious/plugin-boolean-operations';
import '@annotorious/openseadragon/annotorious-openseadragon.css';
const viewer = OpenSeadragon({
multiSelect: true
});
const anno = createOSDAnnotator(viewer, { });
const plugin = mountBooleanPlugin(anno);
document.getElementById('merge').addEventListener('click', () => {
plugin.mergeSelected();
});
document.getElementById('subtract').addEventListener('click', () => {
plugin.subtractSelected();
});