0.2.0 • Published 2 years ago

@recogito/annotorious-better-polygon v0.2.0

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
2 years ago

Annotorious Better Polygon

A better polygon selection tool for Annotorious. Compatible with both the Annotorious standard version and Annotorious for OpenSeadragon.

Demo video

Features

  • Close the polygon either by double clicking (or long tap), or re-selecting the first point
  • When approaching the first point, the mouse will snap to it to make selecting easier
  • Add points by clicking and dragging the line midpoint handles
  • Remove points by selecting them with a click and pressing the DEL key
  • Optionally start drawing by drag or single click

Installation

Better Polygon requires Annotorious version 2.5.9 or higher.

<html>
  <head>
    <!-- Import Annotorious first -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@recogito/annotorious@latest/dist/annotorious.min.css">
    <script src="https://cdn.jsdelivr.net/npm/@recogito/annotorious@latest/dist/annotorious.min.js"></script>

    <!-- Import the Better Polygon script -->
    <script src="https://cdn.jsdelivr.net/npm/@recogito/annotorious-better-polygon@latest/dist/annotorious-better-polygon.js"></script>
  </head>
  <body>
    <img id="hallstatt" src="640px-Hallstatt.jpg" />

    <script type="text/javascript">
      (function() {
        // Init Annotorious
        var anno = Annotorious.init({
          image: 'hallstatt'
        });

        // Init the plugin
        Annotorious.BetterPolygon(anno);
      })();
    </script>
  </body>
</html>

Or via npm:

$ npm i @recogito/annotorious-better-polygon

Import and initialize:

import BetterPolygon from '@recogito/annotorious-better-polygon';

//...

BetterPolygon(anno);
0.2.0

2 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago