diff --git a/src/cubic.js b/src/cubic.js index 82d6bb2..dc86c73 100644 --- a/src/cubic.js +++ b/src/cubic.js @@ -1,7 +1,7 @@ /* * Cubic map * - * Implemented for D3.js by Enrico Spinielli (2017) and Philippe Rivière (2017, 2018) + * Implemented for D3.js by Enrico Spinielli (2017) and Philippe Rivière (2017—2024) * */ import voronoi from "./polyhedral/voronoi.js"; @@ -38,7 +38,6 @@ export default function() { return voronoi() .polygons(polygons) .parents(parents) - .angle(0) .scale(96.8737) .center([135, -45]) .rotate([120,0]); diff --git a/src/polyhedral/voronoi.js b/src/polyhedral/voronoi.js index 11fa9e9..4ba7efd 100644 --- a/src/polyhedral/voronoi.js +++ b/src/polyhedral/voronoi.js @@ -12,7 +12,10 @@ import polyhedral from "./index.js"; const faceProjection0 = (face) => gnomonic() .scale(1) .translate([0, 0]) - .rotate([-face.site[0], -face.site[1]]); + .rotate([ + Math.abs(face.site[1]) > 89.99999999 ? 0 : -face.site[0], + -face.site[1] + ]); export default function( parents = [],