A crowded graph stays readable when you fold, fade and shed detail instead of deleting it.

The problem

Real graphs are lopsided. Open a supplier and it touches 47 orders, a dozen products and one warehouse. Draw every order as its own circle and the warehouse, the interesting part, disappears under a fan of identical dots.

The usual fixes make it worse. Filtering removes nodes, so the layout reflows and you lose your place. Hover that hides everything else gives you a clean picture, then snaps the whole graph back when the mouse moves. And at overview zoom, every label piles into a gray smear.

What I concluded

Never throw the shape away. Everything stays on the canvas, and there are three ways to make it quieter.

Pack siblings into one counted node

Siblings that share a parent, a kind, and the same relationship in the same direction become one node: “Orders (47)”. The relationship matters as much as the kind. “Ships” and “refunds” never merge, or the pack would lie about what connects it. A pack needs at least two members.

// Same parent, same relationship, same direction, same kind.
const key = [e.source, e.label, "out", kindOf(e.target)].join("|");
buckets.set(key, [...(buckets.get(key) ?? []), e.target]);
// buckets with 2+ members become one counted node

Peeling a pack releases members a batch at a time. The leftover keeps the same id and position, so the layout sees a node it already knows and nothing else moves. The new members land around the pack’s spot. Undo folds them back.

Dim instead of hide

Focusing a node fades everything outside its one-hop neighborhood. Faded nodes stay where they are, still laid out and still clickable. Only edges that touch the focus stay bright, so the star around it reads clearly.

The fade has to be cheap. Hover lives in a small external store, the canvas sets one attribute, and CSS does the canvas-wide fade. Each node subscribes to one boolean, “am I lit,” so only the nodes that flip re-render.

Shed labels as you zoom out

Labels follow a ladder. Zoomed far out you see chips only. Closer in, node labels appear where they win a collision pass. Closer still, edge labels join, and they always yield to nodes. Selected nodes and packs claim space first, since a count is usually the most useful thing to read. Holding Alt shows every label at any zoom until you let go.

Rules

  • Pack by relationship, not just kind. A pack has to mean “these all connect the same way.”
  • Peeling keeps the pack’s id. Same id, same position, so nothing else on screen moves.
  • Focus fades, it never removes. Dimmed nodes stay in place, in tab order and in the accessibility tree.
  • Labels yield in a fixed order. Selection, then packs, then the rest, with a stable tiebreak so the same zoom always gives the same answer.
  • Put the hidden text in the name. A pack’s accessible name says “47 orders,” and a shed label still lives in the node’s name.

What you get

A few hundred raw nodes come out as a few dozen, and the graph keeps its shape whatever you focus on or however far you zoom. The demo shows the packing, the peel, the dimming and undo. Label shedding isn’t in it.

Related: Graph layout, Chart plumbing