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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@eavfw/er-diagram

v1.2.1

Published

A powerful React component library for visualizing and editing Entity-Relationship diagrams with built-in internationalization support, module organization, and interactive features.

Readme

@eavfw/er-diagram

A powerful React component library for visualizing and editing Entity-Relationship diagrams with built-in internationalization support, module organization, and interactive features.

ER Diagram Example

Features

  • 🎨 Interactive ER diagram visualization
  • 🌐 Built-in internationalization (i18n) support
  • 📦 Module-based organization
  • ↔️ Smart relationship routing
  • 🔄 Real-time updates
  • 📱 Responsive design
  • 🎯 Context menus for quick actions
  • 🔑 Primary and foreign key visualization
  • 🎭 Dark mode support

Installation

npm install @eavfw/er-diagram

Quick Start

import { ERDiagram, DataModelProvider } from '@eavfw/er-diagram';

function App() {
  const schema = {
    modules: ['Core'],
    tables: [
      {
        name: 'users',
        module: 'Core',
        locales: {
          '1033': { singular: 'User', plural: 'Users' }
        },
        attributes: {
          id: { 
            name: 'id', 
            type: 'uuid', 
            isPrimary: true 
          },
          email: { 
            name: 'email', 
            type: 'varchar(255)' 
          }
        }
      }
    ]
  };

  return (
    <DataModelProvider initialSchema={schema}>
      <div className="w-screen h-screen">
        <ERDiagram />
      </div>
    </DataModelProvider>
  );
}

Schema Structure

SchemaData

interface SchemaData {
  modules: string[];           // List of modules
  tables: Table[];            // List of tables
  variables?: Record<string, any>; // Optional variables for reuse
}

Table Definition

interface Table {
  name: string;               // Table name
  pluralName?: string;        // Plural form
  module?: string;            // Module name
  sitemap?: string;          // UI navigation location
  locales?: Record<string, {  // Localized names
    singular: string;
    plural: string;
  }>;
  attributes: {              // Table columns
    [key: string]: {
      name: string;
      type: string;
      isPrimary?: boolean;
      isForeign?: boolean;
      references?: {
        table: string;
        attribute: string;
      };
    }
  };
}

Advanced Features

Variable Support

Use variables to define reusable attribute sets:

const schema = {
  variables: {
    audit: {
      "Modified On": {
        type: { type: "DateTime", required: true },
        locale: { "1030": { displayName: "Ændret" } }
      },
      "Created On": {
        type: { type: "DateTime", required: true },
        locale: { "1030": { displayName: "Oprettet" } }
      }
    }
  },
  tables: [
    {
      name: "users",
      attributes: {
        "[merge()]": "[variables('audit')]",
        // ... other attributes
      }
    }
  ]
};

Supported Localizations

The component supports multiple locales out of the box:

  • 🇺🇸 English (US) - 1033
  • 🇩🇰 Danish - 1030
  • 🇩🇪 German - 1031
  • 🇫🇷 French - 1036
  • 🇪🇸 Spanish - 1034
  • 🇳🇴 Norwegian - 1044
  • 🇸🇪 Swedish - 1053

Module Organization

Tables can be organized into modules for better visualization:

const schema = {
  modules: ['Core', 'Blog', 'Commerce'],
  tables: [
    {
      name: 'products',
      module: 'Commerce',
      // ... other properties
    }
  ]
};

API Reference

Components

ERDiagram

Main component for rendering the ER diagram.

<ERDiagram />

DataModelProvider

Context provider for schema data and actions.

<DataModelProvider initialSchema={schema}>
  {children}
</DataModelProvider>

Hooks

useDataModel

Access and modify the data model from any component.

const { schema, dispatch, selectedLocale } = useDataModel();

Contributing

Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

  • 📧 Email: [email protected]
  • 🌐 Documentation: https://docs.example.com
  • 🐛 Issue Tracker: https://github.com/EAVFW/er-diagram/issues

Acknowledgments

  • Built with React and ReactFlow
  • Styled with Tailwind CSS
  • UI components from Radix UI