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

@crystaldesign/planner-2d-core

v26.12.4

Published

Browser-free 2D planner core: article SVG parsing, docking logic, dock transform math and collision geometry.

Downloads

10,037

Readme

@crystaldesign/planner-2d-core

Browser-free core of the 2D planner: article SVG parsing, docking logic, dock transform math and collision geometry. No fabric.js, no engine, no catalog API — runs in the browser and in plain Node (backend services, unit tests, agent testbeds).

Extraction concept and phase plan: docs/2d-planner-rework/CONCEPT.md. The ported logic is a behavior-faithful extraction of web-planner-logic's DockingPointHandler, the fabric-free SVGUtils methods and the docking math of DivaStandardPlanner.updateWorldPos (phase P1 — web-planner-logic still carries its own copy until P2 switches it over to this package).

Modules

| Module | Contents | | --- | --- | | svg/ | getDockingPointLines, getPolygonPoints, getOltGeometry/getOlfGeometry, removeOlf/removeMask, getMinBorder (DOM-based, Node-safe), pathBoundingBox (full command set M L H V C S Q T A Z incl. Bezier extrema and arcs) | | stretch/ | stretchArticleSvg — synchronous SAH/SAV stretch engine, behavior-faithful rewrite of the legacy ccCheckStretchAreas (OLT-then-OLF double pass, rounding rules, global-scale mode) with axis-abstracted element/path transformers and a warnings[] report; deviations: unknown path commands survive, unsupported stretch areas are ignored, viewBox scaling is applied exactly once | | docking/ | DockingPoint, DockingPointHandler (pairing rules, checkDPsDoMatch public), narrow PlannerElement2D interface | | transform/ | computeDockedTransform — pure world-transform math for a docked element | | collision/ | segmentsIntersect (fabric parity), polygon intersection/containment, outlinesCollide | | testbed/ | DockingScene + SimplePlannerElement — SVGs in, docking points/pairings/world positions out |

Node usage

The parser needs a DOM. In the browser nothing is required; in Node a jsdom window is loaded lazily as fallback (configureDom(new JSDOM('').window) only when a custom DOM should be used):

import { DockingScene } from '@crystaldesign/planner-2d-core';

const scene = new DockingScene();
const sofa = scene.addArticle(sofaSvg, { layer: 20 });
const extension = scene.addArticle(extensionSvg, { layer: 20 });
const result = scene.tryDock(extension, sofa); // -> { docked, dockingType, rotDeg, worldPosCorner }

Logging is a no-op by default; inject one via setPlanner2DLogger (e.g. a DivaUtils/diva-backend-commons logger).

Testing

ctra test @crystaldesign/planner-2d-core

The suites run under testEnvironment: node with explicitly configured jsdom — proving the browser-free contract on every run.