Fork of Axes with Hover and labels
✓ Published0🌍 Public
Rrichard.adamson@hotmail.com
This interactive chart displays a simple empty plot with labeled X and Y axes, rendered using D3 version 7. As the user moves the mouse over the inner gray rectangle, dashed crosshair lines extend from the cursor position to both axes, with small solid tick marks and numeric labels showing the current coordinate values. The implementation uses D3's `scaleLinear` for axis mapping, `axisBottom` and `axisLeft` for the axes, and the `pointer` method to track mouse position. A `ResizeObserver` monitors the container size, and hover state updates trigger redraws of the crosshair lines and value labels.
AI-generated descriptionAdding a hover effect to the inner rectangle to extend lines from the cursor to the axes.
Challenge
- challange exepted, but i like the axis as they are and there is room enough at right and upper margins
MIT Licensed