{"version":"1.0","type":"rich","title":"<!DOCTYPE html> <html lang=\"en\"> <head> <meta charset=\"UTF-8\"> <title>Closest Point on a Path and Its Tangent","description":"A draggable circle snaps to the nearest point along a closed, cardinal-interpolated path while a red tangent line updates to show the path's direction at that location. Built with D3 v3 and SVG, the example demonstrates the `closestPoint` algorithm using `getPointAtLength` with a linear scan and binary search, and `getTangent` to compute the tangent via nearby points. The code relies on the `pathSegList` API and the `pathseg.js` polyfill for compatibility with modern browsers.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-cb9c53581cdac51718d5?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}