0.2.12 • Published 8 months ago

@cogic/annotorious-better-polygon v0.2.12

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
8 months 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.12

8 months ago

0.2.11

8 months ago

0.2.10

10 months ago

0.2.9

10 months ago

0.2.8

10 months ago

0.2.7

10 months ago

0.2.6

10 months ago

0.2.5

10 months ago

0.2.4

10 months ago

0.2.3

10 months ago

0.2.2

1 year ago