Socket
Book a DemoInstallSign in
Socket

@mongodb-js/diagramming

Package Overview
Dependencies
Maintainers
25
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mongodb-js/diagramming

Diagram canvas for data modelling capabilities in MongoDB

1.3.4
latest
Source
npmnpm
Version published
Weekly downloads
8.4K
-2.78%
Maintainers
25
Weekly downloads
 
Created
Source

@mongodb-js/diagramming

@mongodb-js/diagramming is a React component library built on top of React Flow for creating interactive, customizable diagrams, designed specifically for use cases in the MongoDB or relational world.

Features

  • React Flow Integration: Built on the robust foundation of React Flow.
  • Custom nodes and edges: Easily define and render node or edge components.
  • Interactive UX: Dragging, connecting, zooming, and panning built in.

Installation

yarn add @mongodb-js/diagramming

Usage

Here is a basic example of how to use the Diagram component:

import React from 'react';
import { Diagram } from '@mongodb-js/diagramming';

const nodes = [
  {
    id: '1',
    type: 'collection',
    data: { label: 'Node 1' },
    position: { x: 250, y: 0 },
  },
  {
    id: '2',
    type: 'collection',
    data: { label: 'Node 2' },
    position: { x: 250, y: 250 },
  }
];

const edges = [
  {
    id: 'e1-2',
    source: '1',
    target: '2',
    type: 'default',
  }
];

export const Component = () => {
  return <Diagram nodes={nodes} edges={edges} />;
}

Running Tests

The project uses Vitest for unit testing.

To run all tests:

yarn test

Running Storybook

To explore components and their behavior in isolation: https://mongodb-js.github.io/diagramming

Changes to the Storybook will be uploaded to the link above on push to main

To run locally at http://localhost:6006 on your own branch:

yarn install
yarn storybook

Contributing

For contributing, please see CONTRIBUTING.md

Releasing

For releasing and publishing please see RELEASING.md

Resources

FAQs

Package last updated on 12 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.