svg & canvas & brush
This example overlays a canvas-rendered scatterplot of 1,000 randomly generated points with an SVG layer containing axes and a d3.brush selection rectangle. The canvas continuously redraws each frame using `requestAnimationFrame`, highlighting points under the mouse cursor via `ctx.isPointInPath` and filling those inside the brush area. The SVG brush, configured with `d3.brush()`, updates the selection bounds, demonstrating a hybrid approach that combines canvas performance with SVG’s interactive brush capabilities.
AI-generated descriptionThis demo is utilised with svg and canvas and brush features.
DOM structure: div.box > canvas + svg , div is relative positioned and the graphic elements are absolute and the svg is on the top of canvas.
SVG has some performance issues when nodes quantity reach 10k. d3.brush is a good feature but it is not working on canvas. So I put them together.