Skip to main content
Public

Share visualization

Loading preview…

Event Handling-- mouseover, mouseout, still has bug

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

Event Handling-- mouseover, mouseout, still has bug

0
Ssgzzhinde
Last edited Dec 22, 2020
Created on Dec 21, 2020
Forked from Event Handling

This example demonstrates interactive data points on a scatterplot, where hovering with the mouse highlights a circle by changing its fill to orange, doubling its radius, and displaying its x and y coordinates as a nearby text label; moving the mouse away reverts these changes. Users can also click anywhere on the SVG to add a new circle at that location, appending the coordinates to the dataset. The visualization uses d3.v5 with SVG rendering, employing d3.scaleLinear for axes and d3.axisTop and d3.axisLeft for tick marks. Event handling relies on the `.on('mouseover')` and `.on('mouseout')` methods, though the code contains a typo, `'mouiseout'`, in the click handler, which prevents proper mouseout behavior for newly added points.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed