Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Map hover

Public visualization

More options

Embed on a websiteCopy iframe embed code

The embed preserves the visualization's visibility and project dataset permissions.

Download & exportHTML, source ZIP and authorized project data

Source ZIP contains editable visualization files; it does not include project datasets. Standalone HTML is available where authorized and packages readable referenced data for offline use. Dataset ZIP requires project read permission.

Standalone HTMLSource ZIP
Publishing & handoffCopy a client maintenance summary

Includes the canonical link, visibility, and available export formats. Confirm dataset attribution, licensing and maintenance responsibilities with the publisher.

Map hover

0 stars5🌍 Public
AAurélien
Last edited Dec 1, 2021
Created on Dec 1, 2021
Forked from Hello VizHub

This example demonstrates interactive hover behavior on a map of Canada, where moving the mouse over a province highlights it by changing its fill color and triggers a tooltip displaying the province name. The tooltip, a positioned HTML div, appears near the cursor, shows the region’s name, and hides on mouseout. Built with D3 v7, it uses `d3.geoAlbers` for projection, `d3.geoPath` for rendering GeoJSON features, and CSS classes to manage visibility and styling.

AI-generated description

An example showing hovering on a map:

  • Loads d3v7 via UNPKG.
  • Loads map of Canada
  • On mouse move :
    • shows a div by modifying its css properties
    • modifies the content and position of a div (the tooltip)
    • changes the css class of the state to change its color
  • On mouse out :
    • hides the tooltip div

Comments

Sign in to join the discussion.

MIT Licensed