using document.elementFromPoint to get nearby path
问题 For my website, I want the users to be able to click on various svg elements. I've coded up a quick function to let users click on enclosed shapes. I basically just run document.elementFromPoint(x, y) on them. This works great for any enclosed shape, since they have clickable area. Open paths, however, are a pain to click because they're only 1-2 pixels in size. I would like to allow the user to select them by clicking 'close enough' to it, such that if the click is, for example, 10 or fewer