Socket
Book a DemoInstallSign in
Socket

@annotorious/plugin-tools

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@annotorious/plugin-tools

Additional drawing tools for Annotorious

Source
npmnpm
Version
1.4.3
Version published
Weekly downloads
159
218%
Maintainers
1
Weekly downloads
 
Created
Source

Annotorious Tools Plugin

A plugin that adds additional drawing tools to Annotorious.

Features

  • Ellipse: Draw ellipses and circle.
    • Hold SHIFT to constrain aspect ratio to a circle.
    • Hold CTRL to draw from the center.
  • Line: Draw a straight line between two points.
  • Path: Create polylines using a combination of straight and curved segments.

Installation

npm install @annotorious/plugin-tools

Usage

The plugin support both versions of Annotorious: the standard image annotator and the OpenSeadragon integration.

Image Annotator

import { createImageAnnotator } from '@annotorious/annotorious';
import { mountPlugin as mountToolsPlugin } from '@annotorious/plugin-tools';

import '@annotorious/annotorious/annotorious.css';
import '@annotorious/plugin-tools/annotorious-plugin-tools.css';

var anno = createImageAnnotator('sample-image', {
  /** Annotorious init options **/
});

mountToolsPlugin(anno);

// ['rectangle', 'polygon', 'ellipse', 'line', 'path']
console.log(anno.listDrawingTools());

anno.setDrawingTool('path');

OpenSeadragon Annotator

import OpenSeadragon from 'openseadragon';
import { createOSDAnnotator } from '@annotorious/openseadragon';
import { mountPlugin as mountToolsPlugin } from '../src';

import '@annotorious/openseadragon/annotorious-openseadragon.css';
import '@annotorious/plugin-tools/annotorious-plugin-tools.css';

const viewer = OpenSeadragon({
  /** OpenSeadragon init options **/
});

const anno = createOSDAnnotator(viewer, {
  /** Annotorious init options **/
});

mountToolsPlugin(anno);

// ['rectangle', 'polygon', 'ellipse', 'line', 'path']
console.log(anno.listDrawingTools());

anno.setDrawingTool('path');

FAQs

Package last updated on 31 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts