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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@craftthingy-digital-innovation/cty-ocr-interactive-bbox-web

v1.0.3

Published

Interactive responsive bounding box drawer and form target aligner for OCR applications.

Downloads

506

Readme

@craftthingy-digital-innovation/cty-ocr-interactive-bbox-web

Bilingual documentation: Bahasa Indonesia | English


Bahasa Indonesia

Library client-side JavaScript modular untuk menggambar, menyelaraskan, dan menangani interaksi kotak bounding box OCR secara interaktif dan responsif di atas elemen gambar.

Fitur Utama

  • 📐 Penskalaan Responsif: Bounding box otomatis menyesuaikan skala saat browser di-resize (mengubah koordinat piksel alami gambar ke skala render aktif).
  • ✏️ Target Field Alignment: Mengisi kolom formulir target yang sedang aktif saat kotak OCR diklik.
  • ⏭️ Auto-Advance Sequencing: Berpindah ke kolom formulir berikutnya secara otomatis jika kolom aktif selesai diisi.
  • 🎨 Self-Contained Styles: Menyematkan styles modern bawaan secara dinamis saat diinisialisasi.

Instalasi

npm install @craftthingy-digital-innovation/cty-ocr-interactive-bbox-web

Cara Penggunaan

import { OcrBboxVisualizer } from '@craftthingy-digital-innovation/cty-ocr-interactive-bbox-web';

const visualizer = new OcrBboxVisualizer({
  container: '#ocr-interactive-container', // Element container gambar
  image: '#ocr-interactive-image', // Element gambar <img>
  bboxes: ocrResults, // Array data [{ text, box: { x, y, width, height } }]
  activeTargetField: 'ocr-field-no_paspor',
  fieldsSequence: ['ocr-field-no_paspor', 'ocr-field-nama_pemohon', 'ocr-field-tempat_lahir'],
  autoAdvance: true,
  onWordClick: (word, activeField) => {
    // Dipanggil saat bbox diklik
    const input = document.getElementById(activeField);
    if (input) {
      input.value = word.text;
      input.dispatchEvent(new Event('input'));
    }
  },
  onAutoAdvance: (nextField) => {
    // Dipanggil saat berpindah target aktif
    const nextBtn = document.querySelector(`.btn-ocr-target[data-target="${nextField}"]`);
    if (nextBtn) nextBtn.click();
  }
});

// Render bboxes
visualizer.draw();

// Update target aktif secara dinamis
visualizer.setActiveTargetField('ocr-field-nama_pemohon');

// Hancurkan listener jika modal ditutup
visualizer.destroy();

English

A modular client-side JavaScript library to draw, scale, and manage interactive OCR bounding boxes responsively on top of image viewport elements.

Key Features

  • 📐 Responsive Auto-Scaling: BBoxes scale automatically on viewport resize (computes raw natural resolution to active display widths/heights).
  • ✏️ Target Field Alignment: Maps clicked OCR boxes directly to active form target inputs.
  • ⏭️ Auto-Advance Sequencing: Cycles automatically to the next form field key sequence once a click is registered.
  • 🎨 Self-Contained Styles: Injects high-performance CSS styles automatically upon instantiation.

Installation

npm install @craftthingy-digital-innovation/cty-ocr-interactive-bbox-web

Usage

import { OcrBboxVisualizer } from '@craftthingy-digital-innovation/cty-ocr-interactive-bbox-web';

const visualizer = new OcrBboxVisualizer({
  container: '#ocr-interactive-container',
  image: '#ocr-interactive-image',
  bboxes: ocrResults,
  activeTargetField: 'ocr-field-no_paspor',
  fieldsSequence: ['ocr-field-no_paspor', 'ocr-field-nama_pemohon', 'ocr-field-tempat_lahir'],
  autoAdvance: true,
  onWordClick: (word, activeField) => {
    const input = document.getElementById(activeField);
    if (input) {
      input.value = word.text;
      input.dispatchEvent(new Event('input'));
    }
  },
  onAutoAdvance: (nextField) => {
    const nextBtn = document.querySelector(`.btn-ocr-target[data-target="${nextField}"]`);
    if (nextBtn) nextBtn.click();
  }
});

visualizer.draw();
visualizer.setActiveTargetField('ocr-field-nama_pemohon');
visualizer.destroy();

License

Licensed under Public-Source Corporate Royalty License (PSCRL). See LICENSE for details.