This is a follow on from the simple tooltip graph written with d3.js v5 here.
It extends a tooltip technique which I find particularly neat.
This graph is part of the code samples for the update to the book D3 Tips and Tricks to version 5 of d3.js.