Skip to content

Plot.geo highlight country on hover: border thickness varies on swapping neighbouring countries #2260

Answered by Fil
espinielli asked this question in Q&A
Discussion options

You must be logged in to vote

It depends on the order in which the shapes are drawn (ie. Mongolia is drawn after Russia, so its fill is drawn on top of Russia's stroke).

To fix this you can create two marks (one for the fill, one for the stroke); use javascript (e.g. d3.selection's raise); or clip the shapes by themselves to ensure the stroke is drawn “inwards” (hard to do with Plot).

I've sent you a suggestion that implements the first suggestion
https://observablehq.com/compare/d423284aa770eb88...23b3a136ce8e492a

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@espinielli
Comment options

Answer selected by Fil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants