npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

annota

v0.8.10

Published

A React annotation framework for digital pathology and whole slide imaging

Readme

Annota is designed for applications that need to handle thousands of annotations on large, zoomable images. While it excels at whole slide imaging and digital pathology workflows, it's versatile enough for any domain requiring image annotation at scale.

Features

  • High Performance - Hardware-accelerated PixiJS rendering with viewport culling for smooth 60 FPS with 10,000+ annotations
  • 🎨 Rich Annotation Tools - Points, rectangles, polygons, contour detection, and vertex editing
  • 🔌 Event-Driven Architecture - Comprehensive event system for the annotation lifecycle
  • 📦 Multi-Layer Organization - Independent visibility, opacity, and locking controls
  • 💾 Flexible Data Loading - Built-in loaders for H5, JSON, and PGM formats
  • ⚛️ React First - Modern hooks API with TypeScript support

Installation

npm install annota
# Modern package managers (npm 7+, pnpm) automatically install peer dependencies

# For npm 6 or below, install peer dependencies explicitly:
npm install annota openseadragon react react-dom

Quick Start

import { AnnotaProvider, AnnotaViewer, Annotator } from 'annota';
import { useState } from 'react';
import 'annota/dist/index.css';

function App() {
  const [viewer, setViewer] = useState(null);

  return (
    <AnnotaProvider slideId="slide-001">
      <div style={{ width: '100vw', height: '100vh' }}>
        <AnnotaViewer
          options={{
            tileSources: '/path/to/image.dzi',
            prefixUrl: 'https://cdn.jsdelivr.net/npm/openseadragon@4/build/openseadragon/images/',
          }}
          onViewerReady={setViewer}
        />
        <Annotator viewer={viewer} />
      </div>
    </AnnotaProvider>
  );
}

For more examples including tools, event handling, and layer management, see the documentation.

Performance

Annota is optimized for large-scale annotation workflows:

  • Viewport Culling - Only renders visible annotations
  • Level of Detail - Adaptive rendering based on zoom level
  • Smart Caching - Graphics re-rendered only when necessary
  • R-tree Indexing - Fast spatial queries in O(log n) time
  • Hardware Acceleration - WebGL rendering for 60 FPS performance

Benchmark: Smooth interaction with 10,000+ annotations at 60 FPS.

Core APIs

React Hooks

useAnnotator()       // Access annotator instance
useAnnotations()     // Get all annotations
useSelection()       // Access selected annotations
useTool(options)     // Activate annotation tool
useLayerManager()    // Control layers

Annotation Tools

  • PointTool - Create point markers
  • RectangleTool - Draw rectangular regions
  • PolygonTool - Freeform polygons with vertex editing
  • ContourTool - Automated contour detection
  • PushTool - Interactive vertex manipulation

Data Loaders

  • loadH5Masks - Load polygon masks from HDF5
  • loadH5Coordinates - Load point coordinates from HDF5
  • loadJSON - Load annotations from JSON
  • loadPGM - Load mask data from PGM images

Use Cases

  • Digital Pathology & whole slide imaging
  • Medical imaging analysis
  • AI/ML training dataset creation
  • Geospatial & satellite imagery
  • High-resolution document analysis
  • Quality control & defect tracking

Browser Support

  • Chrome/Edge 90+
  • Firefox 88+
  • Safari 14+

Requires WebGL support for hardware-accelerated rendering.

Documentation

Contributing

See CONTRIBUTING.md for development setup, code style, and PR guidelines.

For publishing releases, see PUBLISHING.md.

Local Development with Documentation Site

When developing the library and testing changes in the documentation site locally:

# In the docs directory
cd docs
pnpm link ../

This creates a direct symlink from your local library source to the docs project. Any changes you make to the library will be available in the docs after rebuilding the library with pnpm build or pnpm dev.

To switch back to the npm version:

cd docs
pnpm install --force

Note: The docs project uses the npm version (^0.7.9) in production deployments. The symlink setup is only for local development.

License

MIT

Acknowledgments

Built with OpenSeadragon, PixiJS, RBush, and React.