Functional Quadtrees

Mouse-powered map zoom sparks praise, nitpicks, and a link glitch

TLDR: A Clojure demo shows a “functional quadtree” that sharpens detail near your cursor while simplifying far areas. Commenters loved the visuals but sparred over odd split behavior, claimed quadtrees are basic, and laughed at a sharing glitch—highlighting how data structures power maps while stirring classic nerd drama.

A dev built a browser demo of a “functional quadtree” in Clojure—think: your mouse is the camera, nearby squares get super detailed, far-away ones stay chunky. He prefers a rebuild-the-whole-thing approach over fiddling with parts, and shows off a tree walk technique with lots of “Looking at” steps. The crowd? Loud and divided.

Fans cheered the visuals, with one user wanting to literally count every step to make the concept “click.” Another swooped in with design swagger, dropping their quadtree-inspired identity at trace.systems. But the nitpick squad arrived fast: one commenter questioned why two tiny squares split when the cursor clearly sits in one, and a classic “this isn’t new” take surfaced, arguing quadtrees are in every basic data structure book. Cue the functional-vs-imperative cage match.

Then came the chaos: a reader sharing the post from a Pixel 8 to Arc via Pushbullet landed on a different site at lindelystables.dk, sparking jokes about portal trees and haunted links. The thread morphed into a feature wishlist—add step counters, compare to a simple linear search, let users play with thresholds—because nothing unites the internet like turning a demo into a dashboard. Drama, memes, and math—this one has it all.

Key Points

  • The article implements a functional Quadtree in Clojure for a browser-based visualization that adapts resolution to camera/mouse position.
  • Nodes split into four children when the camera is within a threshold distance of the node’s center and the node width exceeds a defined minimum size.
  • A minimal node model stores bounds, center, and width; helper functions determine distance, proximity (too-close?), and whether to split.
  • Clojure’s postwalk (and prewalk) are used for declarative, depth-first tree traversal, demonstrated with an example that prints elements in post-order.
  • The approach emphasizes rebuilding the tree declaratively and rapidly instead of imperative in-place edits and housekeeping.

Hottest takes

“what if we numbered every ‘Looking at’ step” — Waterluvian
“two cells divided downto their smallest size” — wiz21c
“Aren’t Quadtrees covered by almost all basic data-structure books?” — torusle
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.