1.0.2 • Published 10 months ago

@abramzog/annotorious-selector-pack v1.0.2

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
10 months ago

Annotorious Selector Pack

Additional selection tools for Annotorious and the Annotorious OpenSeadragon plugin.

  • Point
  • Circle
  • Ellipse
  • Freehand
  • Multi-polygon

Using

Include the plugin in your page directl from the CDN:

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

    <!-- Selector Pack plugin -->
    <script src="https://cdn.jsdelivr.net/npm/@abramzog/annotorious-selector-pack@latest/dist/annotorious-selector-pack.min.js"></script>
  </head>

  <body>
    <img id="hallstatt" src="640px-Hallstatt.jpg">
    <script>
      window.onload = function() {
        // Init Annotorious
        var anno = Annotorious.init({
          image: 'hallstatt'
        });

        // Init the plugin
        Annotorious.SelectorPack(anno);

        // [ 'rect', 'polygon', 'point', 'circle', 'ellipse', 'freehand' ]
        console.log(anno.listDrawingTools());

        anno.setDrawingTool('ellipse');
      }
    </script>
  </body>
</html>

If you only want to include some tools

You can set the tools to include when initializing the plugin.

// Will only include ellipse and freehand, but not circle
Annotorious.SelectorPack(anno, {
  tools: ['ellipse', 'freehand']
});

Installation with npm

npm i @abramzog/annotorious-selector-pack

Using with VueJS

To use the plugin in VueJS, please follow this guide.

Development

To run in development mode:

$ npm install
$ npm start
1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago

0.5.4

10 months ago