# react-direct-graph

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

Latest version **1.5.0** (published 2020-06-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-direct-graph
pnpm add react-direct-graph
yarn add react-direct-graph
bun add react-direct-graph
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.5.0 |
| Published | 2020-06-11 |
| First published | 2019-06-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=8 |
| Dependencies | 0 |
| Unpacked size | 381.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 27 |
| Author | lempiy |
| Maintainers | lempiy |

## Links

- npm: https://www.npmjs.com/package/react-direct-graph
- Repository: https://github.com/lempiy/react-direct-graph
- Homepage: https://github.com/lempiy/react-direct-graph#readme
- Issues: https://github.com/lempiy/react-direct-graph/issues
- npm.io page: https://npm.io/package/react-direct-graph

## Recent versions

- 1.5.0 (latest) — 2020-06-11
- 1.4.0 — 2020-03-26
- 1.3.2 — 2019-08-24
- 1.3.1 — 2019-07-08
- 1.2.1 — 2019-07-04
- 1.1.1 — 2019-06-30
- 1.0.0 — 2019-06-20

## README

[![Build Status](https://travis-ci.org/lempiy/react-direct-graph.svg?branch=master)](https://travis-ci.org/lempiy/react-direct-graph) [![NPM](https://img.shields.io/npm/v/react-direct-graph.svg)](https://www.npmjs.com/package/react-direct-graph) [![Maintainability](https://api.codeclimate.com/v1/badges/d333ef5cfaaa6a432aca/maintainability)](https://codeclimate.com/github/lempiy/react-direct-graph/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/d333ef5cfaaa6a432aca/test_coverage)](https://codeclimate.com/github/lempiy/react-direct-graph/test_coverage) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

![react-direct-graph](./img/graph.png)

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

## Examples

[Samples with code and preview](https://lempiy.github.io/react-direct-graph/)

## Install

```bash
npm install --save react-direct-graph
```

## Usage

```jsx
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](https://github.com/lempiy)

---
_Source: https://npm.io/package/react-direct-graph · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
