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

@iriograph/layout-elk

v0.12.3

Published

Optional ELK.js layered layout adapter for Iriograph scenes.

Readme

@iriograph/layout-elk

日本語

Optional ELK.js Layered layout adapter for @iriograph/core. It keeps the semantic document and engine-specific ELK options separate: a document stores only a stable layoutRef, while this package translates the Core layout request into ELK's graph model.

Install

npm install --save-exact @iriograph/core @iriograph/layout-elk

Use the bundled engine

import { LayoutAdapterRegistry } from "@iriograph/core";
import {
  ELK_LAYOUT_REFS,
  ElkLayeredLayoutAdapter,
} from "@iriograph/layout-elk";

const layouts = new LayoutAdapterRegistry([
  new ElkLayeredLayoutAdapter(ELK_LAYOUT_REFS.layeredLr, "LR"),
  new ElkLayeredLayoutAdapter(ELK_LAYOUT_REFS.layeredTb, "TB"),
]);

The default engine lazily loads elkjs/lib/elk.bundled.js. Applications that need a browser Worker can inject an engine or a lazy factory. The injected object only needs the public ElkLayoutEngine contract, so Worker construction and asset URLs remain host responsibilities.

import ELK from "elkjs/lib/elk-api.js";
import { ElkLayeredLayoutAdapter } from "@iriograph/layout-elk";

const adapter = new ElkLayeredLayoutAdapter("urn:example:layout:worker", "LR", {
  engineFactory: {
    create: () => new ELK({
      workerUrl: new URL("./elk-worker.min.js", import.meta.url).toString(),
    }),
  },
});

Do not store ELK option keys in an Iriograph document. Direction, spacing, containment, node dimensions and routing intent are translated from the Core request by this adapter.

Fixed geometry

ELK Layered does not provide a hard guarantee for arbitrary pinned positions. When a request contains a pinned element or placement: "user", this adapter therefore does not run ELK and does not restore coordinates after routing. It uses Core's deterministic conservative layout instead, preserves fixed geometry exactly, reroutes every edge against the resulting geometry, and returns diagnostics describing the fallback or an impossible fixed constraint.

Manual waypoints are retained as view geometry. Every result contains geometry for every input element and a complete source-to-target route for every edge; missing, invalid, or failed engine output is diagnosed and completed through a deterministic fallback. This is the adapter's declared, backward-compatible fallbackPolicy: "standard". A host that requires ELK-only execution can set fallbackPolicy: "none"; failures then return diagnostics and never invoke a different layout engine.

License notice

This Iriograph adapter is MIT licensed. See LICENSE.

This package depends on ELK.js. ELK.js declares EPL-2.0 OR GPL-3.0-or-later; review the applicable license terms when redistributing a bundle containing it. Iriograph does not copy ELK engine options or code into saved documents.