How to draw concave polygon with d3.js?

86 Views Asked by At

Using bellow reference I am trying to create a polygon, however, if the order of my point/corners are not in correct sequence, the polygon will not become concave. How to order corners or is there any better way to do make a concave polygon?

https://bl.ocks.org/lwthatcher/5456840f796632c27edc813ce8ab4719

let poly = [
            {"x":0,"y":0},
            {"x":0, "y":5},    
            {"x":40,"y":10},
            {"x":60,"y":90},
            {"x":100,"y":100},
            
        ];
0

There are 0 best solutions below