Git Product home page Git Product logo

json_to_tree_diagram's Introduction

Tree Diagram Generator

Project Description

This project is a Python-based tool for generating tree diagrams from structured JSON data. It uses NetworkX and Matplotlib for creating and visualising the tree structures, making it suitable for analysing and presenting hierarchical data.

Features

  • Generate tree diagrams from JSON data.
  • Customisable layout and presentation.
  • Support for visualising complex hierarchical structures.

Installation

Prerequisites

  • Python 3.x
  • pip (Python package installer)

Dependencies

Install the required Python packages:

The requirements.txt file includes the following packages:

  • networkx
  • matplotlib

Graphviz Installation

For advanced graph layouts with pygraphviz, install Graphviz:

  • Windows: Download and install from Graphviz's website.
    • Installation via conda is highly recommended on Windows!
  • MacOS: Use Homebrew with brew install graphviz.
  • Linux (Ubuntu/Debian): Use sudo apt install graphviz.

Usage

To generate a tree diagram:

  1. Prepare your JSON data representing the hierarchical structure.
  2. Run the script with the JSON data.
  3. The script will generate and display the tree diagram.

Required JSON Structure

{
    "key": "NodeKey",
    "children": {
        "Child1Key": {
            "key": "Child1Key",
            "children": { ... },
            "otherProperty": "value"
        },
        "Child2Key": {
            "key": "Child2Key",
            "children": { ... },
            "otherProperty": "value"
        }
    },
    "otherProperty": "value"
}

Sample Screenshots

Single Branch (properties off) Figure_1

Multiple Branch (properties on) Figure_2

Customisation

You can customise the tree diagram by modifying the script. The script allows for adjustments in the layout, node properties, and more.

Contributing

Contributions to this project are welcome! Feel free to fork the repository and submit pull requests.

License

This project is open source and available under the MIT License.

json_to_tree_diagram's People

Contributors

yunemse48 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.