Skip to main content
Public

Share visualization

Loading preview…

Bangkok Map using React D3 Hover and Zoom-in out

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

Bangkok Map using React D3 Hover and Zoom-in out

1
PPichayut Liamthong
Last edited Sep 30, 2020
Created on Sep 30, 2020

This example presents an interactive map of Bangkok with 50 constituencies, sourced from a Wikimedia Commons SVG. Using D3 and React, it enables users to hover over districts to highlight them in yellow and click to zoom in, with an active district highlighted in red. The implementation loads the SVG via `d3.xml`, applies event listeners for mouseover, mouseout, and click, and uses transitions to animate scaling and translation of the map.

AI-generated description

A bangkok map containing 50 cities from Wikimedia Commons.

The SVG Mmap was load using D3 and eventListener was implemented on zoom upon click (still in debugging since the transform still does not align the clicked region on the center).

Comments

Sign in to join the discussion.

MIT Licensed