refactor: submap - don't add middle points, unified findPath fn

This commit is contained in:
Azgaar 2024-11-11 13:28:38 +01:00
parent 3d79a527e2
commit 41a710302b
8 changed files with 103 additions and 238 deletions

View file

@ -796,14 +796,12 @@ function drawRivers() {
TIME && console.time("drawRivers");
rivers.selectAll("*").remove();
lineGen.curve(d3.curveCatmullRom.alpha(0.1));
const riverPaths = pack.rivers.map(({cells, points, i, widthFactor, sourceWidth}) => {
if (!cells || cells.length < 2) return;
if (points && points.length !== cells.length) {
console.error(
`River ${i} has ${cells.length} cells, but only ${points.length} points defined.`,
"Resetting points data"
`River ${i} has ${cells.length} cells, but only ${points.length} points defined. Resetting points data`
);
points = undefined;
}