Why is Polygon.hull() result not counterclockwise ?
Kcnarf opened this issue · 2 comments
Kcnarf commented
The test below shows that the expected result is clockwise, not counterclockwise as mention in the documentation.
Line 12 in 1bfcdc8
Is it due to the fact that the y-axis direction of SVGs is going down the screen, and hence inverting some common computation results ?
mbostock commented
Yes; D3 uses the default coordinate system of Canvas and SVG, which is +x pointing right and +y pointing down.
Kcnarf commented
Fine. Thanks for your clarification.
I will refactor the d3-weighted-voronoi (and subsequently d3-voronoi-map/d3-voronoi-treemap) plugin in order to fulfill this convention.