1.5.0 • Published 4 years ago

react-direct-graph v1.5.0

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

Build Status NPM Maintainability Test Coverage JavaScript Style Guide

react-direct-graph

React component for drawing direct graphs with rectangular (non-curve) edge

Examples

Samples with code and preview

Install

npm install --save react-direct-graph

Usage

import React, { Component } from "react";

import DirectGraph from "react-direct-graph";

const graph = [
    {
        id: "A",
        next: ["B"]
    },
    {
        id: "B",
        next: ["C", "D", "E"]
    },
    {
        id: "C",
        next: ["F"]
    },
    {
        id: "D",
        next: ["J"]
    },
    {
        id: "E",
        next: ["J"]
    },
    {
        id: "J",
        next: ["I"]
    },
    {
        id: "I",
        next: ["H"]
    },
    {
        id: "F",
        next: ["K"]
    },
    {
        id: "K",
        next: ["L"]
    },
    {
        id: "H",
        next: ["L"]
    },
    {
        id: "L",
        next: ["P"]
    },
    {
        id: "P",
        next: ["M", "N"]
    },
    {
        id: "M",
        next: []
    },
    {
        id: "N",
        next: []
    }
];

export class ExampleBasic extends Component {
    render() {
        const { cellSize, padding } = this.props;
        return (
            <DirectGraph list={graph} cellSize={cellSize} padding={padding} />
        );
    }
}

License

MIT © lempiy

1.5.0

4 years ago

1.4.0

4 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.2.1

5 years ago

1.1.1

5 years ago

1.0.0

5 years ago