d3 / d3-shape

Graphical primitives for visualization, such as lines and areas.
https://d3js.org/d3-shape
ISC License
2.47k stars 304 forks source link

How to add pointer effect to the shape? #202

Closed dotku closed 1 year ago

dotku commented 1 year ago

eg when user handover the curve, mouse would display pointer ({cursor: pointer})?

Fil commented 1 year ago

The role of d3-shape is to create shapes. What you do with them is out of scope.

For example, if you use the shape to draw a path in svg, you can set its css with d3-selection like so:

 d3.create("path").attr("d", shape).style("cursor", "pointer")