feat: routes - add route on burg creation

This commit is contained in:
Azgaar 2024-08-11 15:47:15 +02:00
parent 16b441c5cf
commit 6907c9dcac
7 changed files with 191 additions and 95 deletions

View file

@ -84,15 +84,12 @@ function createRoute(defaultGroup) {
.attr("r", 0.6);
const group = byId("routeCreatorGroupSelect").value;
const lineGen = d3.line();
lineGen.curve(ROUTE_CURVES[group] || ROUTE_CURVES.default);
const path = round(lineGen(points), 1);
routes.select("#routeTemp").remove();
routes
.select("#" + group)
.append("path")
.attr("d", path)
.attr("d", Routes.getPath({group, points}))
.attr("id", "routeTemp");
}