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

@opencoachingformat/renderer

v0.4.0

Published

Reference renderer for the Open Coaching Format — draws OCF documents as top-down court diagrams (three.js).

Downloads

319

Readme

OCF Renderer

Reference renderer for the Open Coaching Format — turns an OCF document into a rendered basketball diagram, using Three.js so the same engine can grow from a static print-style view into full animation without a rewrite.

Companion to the spec and the validator. The renderer is the visual foundation the future editor builds on.

Status

v1 implemented: the tactical_print view mode — a single frame rendered as a static, top-down, orthographic scene (court + entities + action paths derived from the frame's semantic actions) via OCFRenderer.renderToCanvas.

This is a pivot from an earlier SVG-string design (see docs/superpowers/specs/2026-06-06-ocf-renderer-design.md, superseded); the current architecture is documented in docs/superpowers/specs/2026-07-20-ocf-renderer-threejs-design.md.

Try it: npm run build && npx serve ., then open examples/index.html.

Installation

npm install @opencoachingformat/renderer
import { OCFRenderer } from "@opencoachingformat/renderer";
// or, for a prebuilt browser bundle (Three.js included):
// import { OCFRenderer } from "@opencoachingformat/renderer/browser";

const canvas = document.querySelector("canvas");
const renderer = new OCFRenderer(ocfDocument, { mode: "tactical_print" });
renderer.renderToCanvas(0, canvas); // frameIndex, canvas

Implemented

  • TypeScript + Three.js, rendering into a <canvas> via OCFRenderer.renderToCanvas (browser / headless-GL). Public API: src/index.ts.
  • ViewModeController switches between view modes; tactical_print is fully built, coaching_animation is architecturally acknowledged but not yet built.
  • Court styles (default "Soft / Modern"), per-ruleset court geometry — FIBA half_court and full_court (both baskets), plus custom_dimensions override.
  • Entity symbols: offense (filled circle + number), defense (FIBA "arms" glyph, directional via rotation), ball (offset when carried), coach, cone.
  • Action notation derived from semantic actions: move/cut (solid), dribble (wave), pass (dashed), screen (end bar), shoot (glyph at the shooter).
  • Path geometry: smoothing through moves anchors, arc-length resampling, trimmed arrowheads, and collision avoidance (paths steer around symbols).
  • Test coverage: unit tests, whole-scene snapshot tests, and Playwright pixel-diff visual regression tests against real-browser renders.

Roadmap (post-v1)

  • coaching_animation view mode (dynamic, frame-to-frame playback).
  • Multi-frame composite ("playbook" image with step numbers).
  • Shot-type glyph differentiation (variant/tags).
  • NBA / NCAA / NFHS court geometry (FIBA_DEFAULTS is structured to become one of several rulesets).
  • True FIBA corner-3 straight-line three-point boundary (v1 uses a constant-radius arc approximation as an intentional simplification).

License

CC BY 4.0 — same as the OCF spec.