Learn how to use Dash Bio for next-gen sequencing & quality control. 🧬 Access the recorded webinar.

How to Highlight Other Counties When Hovering on a County Map?

I’m trying to create a USA county map like this: the map is monochrome, except when you hover on a county, a set of other counties highlight as well as the one you’re currently hovering on. I have the array of other counties that should highlight for each county in a separate column.

I’ve Googled around, and read Plotly docs, but I’m not still seeing how to go about this.

Thanks for any tips or for pointing me to the right documentation.

I know Javascript, and I’m assuming this will require it. I’ve been making county maps with Plotly express.choropleth and python, and I don’t see a feature built in to do what I want to do.

Ideally I would be able to take a blank county map with no scale, just the county outlines, and then add in some JS to produce the highlighting effect I want. But I’m open to any other ideas of how to get there.