d3 / d3-shape

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

How to add pointer effect to the shape? #202

Closed dotku closed 2 years ago

dotku commented 2 years ago

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

Fil commented 2 years 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")