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

@reventlessdev/rescript-cytoscape

v1.0.0-alpha.1

Published

Cytoscape.js bindings for ReScript. The minimal surface (graph init, element builders, stylesheets, layouts, camera, events, graph algorithms, PNG export). Framework-agnostic — the Reventless AutoUI graph view mode lives in @reventlesslab/reventless-graph

Readme

@reventlessdev/rescript-cytoscape

ReScript bindings for Cytoscape.js — a narrow surface covering what a node-link view needs:

  • Cytoscape.CytoscapeBindings.make({container, elements, style, layout, …}) — an instance rendering into a container element.
  • Element descriptors: nodeElement({data: {id, label, parent}}), edgeElement({data: {id, source, target, label}}) (parent is cytoscape's compound-node mechanism — clustering for free).
  • Stylesheets: rule(~selector, [("background-color", "#333"), …]), applied at init or swapped wholesale with style(cy, sheet) (how a theme change lands).
  • Layouts: layout(cy, {name: "dagre", rankDir: "BT"})->run. Built-in names are grid / circle / concentric / breadthfirst / cose / preset; layered dagre and compound-aware fcose are extensions and need use(dagre) / use(fcose) once, first.
  • Camera: fit(cy, padding), center, resize, zoom/setZoom, pan/setPan — cytoscape ships pan/zoom, nothing to build.
  • Events: onSelector(cy, "tap", "node", e => Event.targetId(e)).
  • Algorithms: dijkstra, aStar, neighborhood, components, degree.
  • png(cy, {full: true}) → base64 data URI; destroy(cy) on unmount.

The package carries no Reventless and no React dependency — the AutoUI graph view mode built on it lives in @reventlesslab/reventless-graph.

Setup

pnpm add @reventlessdev/rescript-cytoscape cytoscape cytoscape-dagre cytoscape-fcose

rescript.json:

"dependencies": ["@reventlessdev/rescript-cytoscape"]
open Cytoscape.CytoscapeBindings

use(dagre) // once, before the first instance that asks for these layouts
use(fcose)

Cytoscape draws to a canvas and needs no stylesheet import; the container element must have a non-zero height.

Building in this repo

pnpm run build here uses rescript-legacy: the ReScript v12 build orchestrator still panics (UTF-8 underline bug) when invoked from a downstream package that walks into reventless-ui's bs-dependencies. This package has no dependencies, so build it first, then reventless-graph, then reventless-ui last — building the downstream package walks into ui and deletes its dev-source .res.mjs, which only a ui clean && build restores. Never use -with-deps from a downstream package.