Untitled
✓ Published0🌍 Public
This interactive map of Canada displays province names in a tooltip as the mouse moves over each region. Hovering a province turns it red via a CSS `:hover` rule, while the tooltip div follows the cursor and is hidden on mouse-out. The visualization uses d3.v7’s `d3.json` to load GeoJSON data and `d3.geoAlbers` projection with `d3.geoPath` to render the SVG paths. Tooltip positioning and visibility are managed through CSS classes and inline styles.
AI-generated descriptionAn 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
MIT Licensed