Skip to main content
100%

Rectilinear Grid

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Jun 20, 2012

A mouse-driven rectilinear distortion grid demonstrates a fisheye effect on a Cartesian coordinate system. D3 v3 and SVG render vertical and horizontal paths spaced every 20 pixels, with finer 6-pixel segments preserving curve continuity. As the mouse moves, `d3.fisheye` recalculates the focal point, and the `line` generator maps each point through the fisheye function to update path attributes, creating a localized magnification that bends the grid around the cursor.

AI-generated description

The above grid shows the effect of rectilinear distortion. Move the mouse to change the focal point. I wouldn't recommend this technique; see my post on fisheye distortion for a better example of Cartesian distortion.

gpl-3.0 Licensed

Similar vizzes