# react-decisiontree

> A binary decision tree chart in React.

Latest version **1.0.2** (published 2018-04-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-decisiontree
pnpm add react-decisiontree
yarn add react-decisiontree
bun add react-decisiontree
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-04-08 |
| First published | 2018-04-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 163.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Brett Orr |
| Maintainers | singular1ty94 |

## Links

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

## Dependencies (2)

- [react](https://npm.io/package/react.md) ^16.3.1
- [typescript](https://npm.io/package/typescript.md) ^2.8.1

## Recent versions

- 1.0.2 (latest) — 2018-04-08
- 1.0.1 — 2018-04-08
- 1.0.0 — 2018-04-08

## README

# React Decision Tree

A decision tree implemented in React.

Based on the code by https://jvloenen.home.xs4all.nl/orgchart.

## Usage

```
import * as React from 'react';
import DecisionTree from 'react-decisiontree/dist';
```

The `IDecisionTree` interface is a recursive one that contains arrays with a `data` array of text
that will be joined together in the box, and an optional `subNodes` array of recursive `data/subNode` elements
that forms the body of the decision tree.

```
<DecisionTree
    chartStyles={
        {
            lineColor: "#1D78BC",
            boxFillColor: "#1D78BC",
            textColor: "#FFFFFF"
        }
    }
    rootNode={{
        data: ["petalWidth=9.8", "entropy=1.0", "class=Iris-vertosa"],
        subNodes: [
            {
                data: ["petalWidth=6.8", "entropy=0.7", "class=Iris-vertosa"],
            }, {
                data: ["petalWidth=5.8", "entropy=1.3", "class=Iris-versicolor"],
                subNodes: [
                    {
                        data: ["petalWidth=6.8", "entropy=0.7", "class=Iris-vertosa"],
                    },
                    {
                        data: ["petalWidth=3.8", "entropy=0.4", "class=Iris-versicolor"],
                    }
                ]
            }
        ]
    }}
 />
```

![react-decisiontree](https://imgur.com/w4H23R2.jpg)

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