# bst-visualizer

> ```js class Node { constructor(val) { this.val = val this.left = null this.right = null } }

Latest version **1.0.1** (published 2020-06-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install bst-visualizer
pnpm add bst-visualizer
yarn add bst-visualizer
bun add bst-visualizer
```

## 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.1 |
| Published | 2020-06-08 |
| First published | 2020-06-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 141.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | everthis |

## Links

- npm: https://www.npmjs.com/package/bst-visualizer
- Repository: https://github.com/everthis/BST-visualizer
- Homepage: https://github.com/everthis/BST-visualizer#readme
- Issues: https://github.com/everthis/BST-visualizer/issues
- npm.io page: https://npm.io/package/bst-visualizer

## Recent versions

- 1.0.1 (latest) — 2020-06-08
- 1.0.0 — 2020-06-08

## README

# BST-visualizer

```js
class Node {
  constructor(val) {
    this.val = val
    this.left = null
    this.right = null
  }
}

const root = new Node([32])
const l1_1 = new Node([19])
const l1_2 = new Node([14])
const l2_0 = new Node([9])
const l2_1 = new Node([8])
const l2_2 = new Node([5])
const l2_3 = new Node([33])
const l3_1 = new Node([1,2,3])
const l3_2 = new Node([1])
const l4_2 = new Node([10, 11, 12])
const l5_2 = new Node([11])
const l6_2 = new Node([12])
const l7_2 = new Node([13])
const l8_2 = new Node([14,15])
const l4_1 = new Node([99])
const l4_3 = new Node([79])
const l5_3 = new Node([78,79,80])
root.left = l1_1
root.right = l1_2
l1_2.right = l2_0
l1_2.left = l2_3
l1_1.left = l2_1
l1_1.right = l2_2
l2_2.right = l3_2
l3_2.right = l4_2
l4_2.right = l5_2
l5_2.right = l6_2
l6_2.right = l7_2
l7_2.right = l8_2
l2_1.left = l3_1
l3_1.left = l4_1
l2_3.left = l4_3
l4_3.left = l5_3

const cvs = document.getElementById("cvs")
const tree = new BinaryTree({ canvas: cvs, root })

tree.plot()
```

![Imgur](https://i.imgur.com/eS536ZH.png 'example')

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