Skip to content

n1mah/print_node_js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Print Node with Line

If you Need Draw Trees (Node trees) You can use it

⚡ Usage

HTML

Add Div To Html Structure

<div class="container">
    <div id="root">

    </div>
</div>
<div id="canvases"></div>

Add Script

    <script src="js/script.js"></script>

Add Style

    <link rel="stylesheet" href="css/style.css">

JS

Add Data Example :

const data={
        value:"A",
        left:{
            value:"B",
            left:{
                value:"D",
                right:null,
                left:null,
            },
            right:{
                value:"E",
                right:null,
                left:null,
            },
        },
        right:{
            value:"C",
            left:{
                value:"F",
                right:null,
                left:null,
            },
            right:{
                value:"G",
                right:null,
                left:{
                    value:"H",
                    right:{
                        value:"I",
                        right:null,
                        left:null,
                    },
                    left:null,
                },
            },
        },
}

📷 Screenshot

Screenshot on browser :

Enjoy it ...

About

Print Node (Tree) js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published