Skip to main content
Public

Share visualization

Loading preview…

Fork of Axes with Hover

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Fork of Axes with Hover

0
Oownerofthesoul0000@gmail.com
Last edited Feb 16, 2024
Created on Feb 16, 2024
Forked from Axes with Hover

This visualization demonstrates hover interaction on a chart with labeled axes. Moving the cursor inside the gray plot area draws black crosshair lines from the pointer to the x and y axes, using the D3 `pointer` event and state management. The plot uses `d3.scaleLinear` for both axes, with `axisBottom` and `axisLeft` rendering ticks. The code relies on D3’s select/join pattern to update the SVG elements dynamically as the mouse position changes.

AI-generated description

Adding a hover effect to the inner rectangle to extend lines from the cursor to the axes.

Challenge

  • Show the hovered numbers in place of tick marks on the axes themselves.

Comments

Sign in to join the discussion.

MIT Licensed