D3.js create an outline to the clipath shape

I have created a foot and added color gradient as shown in the solution for the below questions.
Add multi color gradient for different points in d3.js
d3.js scatter plot connecting dots with line
D3.js create an outline to the clipath shape

I have used clipath method to clip this foot. Now I want to set a black outline to this foot mask like in the picture below

D3.js create an outline to the clipath shape

Here is the Stackblitz Link

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

Add:

this.svgInner
  .append("path") 
  .attr("d", line(ordered))
  .style("stroke", "black")
  .style("stroke-width", 1)
  .style("fill", "none");

After line 300 of scatter-plot.component.ts in your StackBlitz

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply