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

@ship-it-ui/graph-editor

v0.0.4

Published

Graph-editing canvas for the Ship-It design system. React Flow under the hood; same `elements[]` shape as `@ship-it-ui/cytoscape` so consumers can swap viewer ↔ editor without reshaping data.

Downloads

349

Readme

@ship-it-ui/graph-editor

<GraphEditorCanvas> — the editing analog of <GraphCanvas> (from @ship-it-ui/cytoscape). React Flow under the hood; same elements[] shape on the input so consumers can swap viewer ↔ editor without reshaping data.

How this fits in

Part of the Ship-It Design System. Sibling to @ship-it-ui/cytoscape (read-only graph viewer). Both packages consume @ship-it-ui/graph-tokens for theme-token resolution; neither imports the other at runtime — tree-shaking is enforced by package boundary.

Install + import the stylesheet

pnpm add @ship-it-ui/graph-editor

Then once at your app entry (app/layout.tsx for Next.js, main.tsx for Vite, etc.):

import '@ship-it-ui/graph-editor/styles.css';

The component intentionally does not import its own CSS. Next.js's App Router rejects library-internal global CSS, and explicit consumer imports let you control load order against your own theme. The stylesheet pulls in @xyflow/react/dist/style.css and layers Ship-It overrides on top.

Quick start

'use client';

import '@ship-it-ui/graph-editor/styles.css';

import { GraphEditorCanvas, type GraphElement } from '@ship-it-ui/graph-editor';
import { useState } from 'react';

const INITIAL: GraphElement[] = [
  { data: { id: 'a', label: 'Alpha', entityType: 'service' }, position: { x: 0, y: 0 } },
  { data: { id: 'b', label: 'Beta', entityType: 'service' }, position: { x: 200, y: 0 } },
  { data: { id: 'e-ab', source: 'a', target: 'b' } },
];

export default function Editor() {
  const [elements, setElements] = useState(INITIAL);
  return (
    <div style={{ width: '100%', height: 480 }}>
      <GraphEditorCanvas
        elements={elements}
        onConnect={({ id, source, target }) =>
          setElements((prev) => [...prev, { data: { id, source, target } }])
        }
        onNodeMove={(id, position) =>
          setElements((prev) => prev.map((el) => (el.data.id === id ? { ...el, position } : el)))
        }
      />
    </div>
  );
}

See the docs site for the full API and live examples (toolbar slot, custom-node renderer, keyboard, undo/redo).

Built-in behaviors

  • Pan + zoom + mini-map (wraps @ship-it-ui/shipit's <GraphMinimap> so the editor looks identical to the viewer).
  • Click-to-select; pane-click to clear.
  • Drag-to-connect; drag-to-move (onNodeMove).
  • Delete / Backspace removes selection; arrow keys nudge (Shift = 32px); Escape clears; ⌘Z / ⌘⇧Z undo / redo.
  • Theme-token sync via @ship-it-ui/graph-tokens.
  • Built-in keyboard-accessible "+ Add" button when no toolbar is supplied.
  • role="application" on the canvas root.

Engine

React Flow (@xyflow/react@^12). The viewer (<GraphCanvas>) uses Cytoscape.js — same elements[] shape passes through via the round-trip-tested adapter (toFlowElements / toCytoscapeElements).