Red-Black Binary Tree
This example visualizes a red-black binary tree, demonstrating node insertion and layout in real time. It uses D3.js v4 with a force-directed simulation (`d3.forceSimulation`) to position nodes, applying forces for body repulsion, link attraction, and depth-based horizontal/vertical positioning. Users can toggle between SVG and Canvas rendering, with an optional low-resolution Canvas mode on high-DPI displays. The tree structure is built via `d3.binaryTree`, and the code instruments the `insert` method to animate each new node’s placement before re-rendering.