Skip to main content
100%

Fork of D3 Scale Invert() in action practice

✓ Published1🌍 Public
SSubhendu Karmakar
Last edited Dec 27, 2023
Created on Dec 27, 2023

This example demonstrates the inverse of a D3 scale, translating pixel coordinates back into data values. A grey SVG rectangle acts as a clickable area; clicking it uses `d3.pointer` to capture the mouse position and `scaleLinear.invert()` to compute corresponding X and Y values on two linear scales ranged from 0 to 100. The result updates a text display with both coordinates. The scales also employ `.nice()` to round the domain, with axes rendered via `d3.axisBottom` and `d3.axisLeft`.

AI-generated description

D3 Scales - scaleTime()

MIT Licensed

Similar vizzes