Socket
Socket
Sign inDemoInstall

graph-data-structure-visualizer

Package Overview
Dependencies
8
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    graph-data-structure-visualizer

Graph Data Structure Visualizer is a comprehensive React library that enables you to effortlessly create dynamic visualizations for graph-based data structures. Whether you're working with network graphs, trees, or any other complex data, this library pro


Version published
Weekly downloads
3
decreased by-66.67%
Maintainers
1
Install size
738 kB
Created
Weekly downloads
 

Readme

Source

Graph Visualizer

npm version GitHub license

Graph Visualizer is a React component that allows you to visualize graph-based data structures with ease. It provides an interactive and customizable canvas for rendering network graphs, trees, and other complex data structures.

Installation

You can install Graph Visualizer from npm:

npm i graph-data-structure-visualizer

Usage

Import the GraphVisualizer component and use it in your React application:

import React from "react";
import { GraphVisualizer } from "graph-data-structure-visualizer";

const MyComponent = () => {
  const data = {
    A: ["B", "C"],
    B: ["D", "E"],
    C: ["F"],
    D: [],
    E: ["G"],
    F: [],
    G: [],
  };

  return (
    <div>
      <h1>Graph Visualization Example</h1>
      <GraphVisualizer
        data={data}
        startingPoint="A"
        mainHeight={600}
        mainWidth={800}
        isChange={false}
      />
    </div>
  );
};

export default MyComponent;

Props

  • canvasRef (Optional): A ref for the canvas element.
  • data (Required): An object representing the graph data structure.
  • isChange (Required): A boolean flag to trigger graph visualization updates.
  • startingPoint (Required): The starting node for the graph traversal.
  • textColor (Optional): The color of the node labels. (Default: "black")
  • mainHeight (Optional): The height of the canvas. (Default: 400)
  • mainWidth (Optional): The width of the canvas. (Default: 500)
  • nodeShape (Optional): The shape of the nodes. Can be "circle" or "rectangle". (Default: "rectangle")
  • gapBetweenNodes (Optional): The gap between nodes in the same layer. (Default: 1.5)

License

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

Contributing

Contributions are welcome! Please feel free to open issues or submit pull requests.

Credits

Graph Visualizer was developed by Rohan Bindal.


Keywords

FAQs

Last updated on 02 Aug 2023

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc