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

diagrama-react

v1.1.2

Published

React diagrams

Readme

Getting Started

Installation

To install and set up the library, run:

$ npm install diagrama-react

Usage

Importing

Import diagram component with

$ import { Diagram } from "diagrama-react"

Params

A two-dimensional Array. Every array on it represents a column

| Name | Type | Description | --- | --- | --- | | data | Array[ ][ ] | Matrix of Nodes | arrows | Array[ ] | Array of Arrows

Param values

Node

Node object represent every single cell on the diagram.

| Name | Type | Description | --- | --- | --- | | id | string | Identificator of the node. must be unique | value | string | Value that represents the node (Optional) | label | string | Label asociated to the node (Optional) | description | string | Description asociated to the node (Optional) | route | Array[ ] | Array of id's that will be highlighted on hover. If not provided, hover will map every related node (Optional) | icon | image | Image that will be displayed as node cover | type | '0', '1', '2', '3', '4', '5' | Type of node (If type is provided, icon is not displayed) (Optional) | actions | Array[ ] | Array of Actions

Note:`` <0, >5, null, undefined or NaN values will display icon (if provided) or id`

Example:

const data = [
    //First column
    [
    { id: "11",
      value: "1",
      label: "John Q. Public",
      description: "[email protected]",
      type: 0,
      route: ["21", "31", "33"],
      actions = [
        ...actions
      ]
    },
    { id: "12",
      value: "2",
      label: "Jane Doe",
      description: "[email protected]",
      type: 0,
      route: ["21", "32"],
      actions = [
        ...actions
      ]
    },
    { id: "13",
      value: "3",
      label: "Petter B. P.",
      description: "[email protected]",
      type: 0,
      route: ["21", "31", "32"],
      actions = [
        ...actions
      ]
    },
  ],
  //Second column
  [
    {
      id: "21",
      value: "1",
      label: "Awesome Company",
      type: 1,
      actions: [
        ...actions
      ]
    },
  ]//Third Column
    [
    { id: "31",
      value: "1",
      label: "H.R.",
      description: "5th Floor",
      actions: [
        ...actions
      ]
    },
    { id: "32",
      value: "2",
      label: "I.T.",
      description: "6th Floor",
      actions: [
        ...actions
      ]
    },
    { id: "33",
      value: "3",
      label: "Sales",
      description: "2ndFloor",
      actions: [
        ...actions
      ]
    },
  ],
]

Arrows

Arrow object represent every single relation on the diagram.

| Name | Type | Description | --- | --- | --- | | startID | string | Identificator of the node at the left. | endID | string | Identificator of the node at the left.

Example:

const arrows = [
    {startID: "11", endID: "21"},
    {startID: "12", endID: "21"},
    {startID: "13", endID: "21"},
    {startID: "21", endID: "31"},
    {startID: "21", endID: "32"},
    {startID: "21", endID: "33"},
]

Actions

Actions that will be displayed on node click. returns an <HTMLDivElement>

| Name | Type | Description | --- | --- | --- | | id | string | Identificator of the action. must be unique | label | string | Label that will be shown on dropdown menu | onClick | React.MouseEventHandler | Action that will be executed.

Example:

const action = (e: any) => {
  console.log("Action for", e.target.id, "option");
};

const actions = [
  { id: "print-action", label: "More details", onClick: action },
  { id: "print-action-2", label: "Another print details", onClick: action, }
];