npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

heavy-tree-view

v0.0.1

Published

render a tree data structure with all nodes pulled to the bottom of the tree

Downloads

2

Readme

heavy-tree-view

JavaScript Style Guide CircleCI

render a tree data structure with all nodes pulled to the bottom of the tree

install

npm install heavy-tree-view

usage

var HeavyTreeView = require('heavy-tree-view')
var view = HeavyTreeView.parseTree(root)
console.log(view.toString())
// d5──┐
//     c5──┐
// b5------┤
//         a5

more examples of heavy trees here.

root is a simple tree node. nodes are a simple data structure with the following interface:

// provide `name` and `children` key value pairs
var b = { name: 'b', children: [] }
var a = { name: 'a', children: [b] }

what is it, more precisely

it's a view of the tree, where all nodes get pulled down to the deepest level.

here's a traditional tree.

here's a tree with one of its leaves pulled down to the bottom (or height) of the tree.

why is this interesting? because many trees represent things that race from their leaves, such as a task graph. in the example of a task graph, all leaf tasks may kick off in parallel, and such a representation may more gracefully visualize the time dimension. of course that example is imperfect (as tasks would not complete and proceed in lockstep), but it does demonstrate the priority run order more clearly.

here's a more complex example:

the two right-most leaves, and their parent(s) not including the root, are pulled down.

woo hoo! 🌲

discussion

i'm not sure if there's an academic concept that maps to what i am defining as "heavy trees." if there is, let me know! given the lack of pragmatic use, i assume not, but ¯\_(academics)_/¯.