This code, must help you to order an array of points { x:Number,y:Number } for get a Secuence of Points to use into a Grapher Library, for example "AreaSeries" of React-vis from Uber. For this, we get the idea from "Graham" Algorithm, and, to get the angle of points we use https://stackoverflow.com/a/1707251/11447878.
This code was created for solve an Polygon Area in this project https://github.com/santinozaracho/optimizer-pl-io/ Thanks.