block by mpmckenna8 3cd59e6d46d869cc63e4

d3 sloppy code transformations on click

Full Screen

My first adventure with trying to do some transformations of my map on click events. It got pretty sloppy and I was kept re adding rectangles because I was setting them to display:none and I guess there’s no going back from that. http://svg-whiz.com/svg/HideShow.svg

I did get the So Cal bounding box to come back without redrawing but decided not to fix all of it because it’s a weird example of different ways of doing stuff. Even if it’s a bit of a mess I think I can learn something from it.

Click on the Bay Area to zoom in then on the green box to zoom back out and then repeat to your hearts desire.

Better yet show me how I should have coded it….

The map is of California Congressional Assembly Districts until 2020.

index.html