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

dependency-graph-construction

v1.0.2

Published

A powerful tool to construct dependency graphs for JavaScript and TypeScript projects. Useful for project structure analysis and debugging.

Readme

Frontend - File Dependency Graph (FDG)

This project is a React-based FDG constructor designed to create, render, and interact with hierarchical file dependency graphs. The tool constructs dependencies between modules, folders, and files in a structured graph format. Developers can use this tool to understand and analyze project structures.

Features

  • Dynamic Graph Generation: Automatically generates a dependency graph based on the provided project structure.
  • Interactive Visualization: Enables interaction with graph nodes and edges.
  • Zoom and Navigation: Includes zoom-in, zoom-out, and reset functionality for easy navigation
  • Customizable Events: Supports event handlers for user interactions such as node/edge clicks.
  • Hierarchical Structure: Visualizes folders and files with distinct styles and properties for better clarity.

File Structure

Below is an overview of the main files and their responsibilities:

Components

  • NavBar: Handles user interactions and controls graph visualization.
  • GraphMenu: Provides options for managing hidden nodes and graph-related settings.
  • ZoomSwitcher: Enables zoom-in, zoom-out, and reset functionality.

Hooks

  • useZoom: Manages zoom level states and their corresponding handlers.
  • useLevelGraphVisualization: Visualizes graph levels dynamically.

Visualizer

  • event.js: Initializes and manages event handlers for nodes, edges, and clusters.
  • generateDotSchema.js: Converts node data into DOT schema for graph rendering.
  • setupGraph.js: Configures graph properties and creates the initial graph structure.

Utils

  • graphProperties.js: Defines properties like shapes, colors, and styles for nodes and edges.
  • buildGraph.js: Builds level-wise dependency graphs using data from dependencyGraph.json.
  • dependencyGraph.json: Contains structured data defining nodes and their dependencies.

Installation and Setup

Follow the steps below to set up and run the project:

  1. Clone the repository:
git clone https://github.com/DixitLukhi/frontend-fdg.git
  1. Navigate to the project directory:
cd frontend-fdg
  1. Install dependencies:
npm install
  1. Run the application:
npm start
  1. Access the application: Open http://localhost:3000 in your browser to view the FDG.

Steps to Use the FDG Constructor

  1. Prepare Project Data:
  • Structure your project according to the dependency requirements.
  • Update the dependencyGraph.json file with your project nodes and dependencies.
  1. Customize Graph Settings:
  • Modify the bundler.config.json file to include root modules or update the Babel configuration.
  1. Run the Application:
  • Start the application to automatically generate and render the dependency graph.
  1. Interact with the Graph:
  • Click on nodes or edges to see their relationships.
  • Use the GraphMenu to hide/unhide specific nodes.
  • Adjust zoom levels using the ZoomSwitcher

How It Works

  1. Graph Setup:
  • setupGraph.js initializes graph properties such as layout, colors, and styles.
  • generateDotSchema.js translates node data into a DOT schema for rendering.
  1. Rendering:
  • App.js manages rendering the graph using Viz.js.
  • SVG elements are appended dynamically to the DOM.
  1. Event Handling:
  • event.js initializes click, hover, and keyboard events for user interaction.
  • Utility functions in utils/handlers.js process these events.
  1. Dynamic Visualization:
  • Graph levels and dependencies are visualized dynamically using useLevelGraphVisualization.