How to use the blessed-contrib.tree function in blessed-contrib

To help you get started, we’ve selected a few blessed-contrib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github radareorg / radare2-extras / blessr2 / index.js View on Github external
percent: 10,
            label: '.header',
            color: 'yellow',
        }]
    });
    screen.append(donut);
    var map = contrib.map({
        label: 'World Map',
        border: config.border,
        width: '80%',
        height: '60%',
        draggable: true
    });
    //map.addMarker({"lon" : "-79.0000", "lat" : "37.5000", color: "red", char: "X" })
    screen.append(map);
    var tree = contrib.tree({
        fg: 'orange',
        label: 'Fruit Tree',
        border: config.border,
        width: '50%',
        height: '30%',
        draggable: true
    });

    //allow control the table with the keyboard
    tree.focus();

    tree.on('select', function(node) {
        if (node.myCustomProperty) {
            console.log(node.myCustomProperty);
        }
        console.log(node.name);