Reusable D3 Tooltip
This example demonstrates a reusable tooltip function for D3 charts, built with D3 v4 and rendered as SVG. A simple bar chart displays dummy data with columns labeled A through F, each with a count and description. The tooltip is initialized with configurable options for extent, labels, font size, padding, and margin, and it automatically positions itself relative to the mouse pointer, flipping to the opposite quadrant when near the edges of the chart area. The reusable `d3.tooltip()` function attaches mouseenter, mouseleave, and mousemove events to chart elements without overwriting existing handlers, and it displays the specified data properties in a styled black rectangle with white text. The example demonstrates how to integrate the tooltip into a bar chart using D3 v4 with SVG rendering.