mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 10:01:23 +01:00
Draw state labels improvement (#1155)
* chore: render debug elements * feat: redo draw state labels algo --------- Co-authored-by: Azgaar <azgaar.fmg@yandex.com>
This commit is contained in:
parent
efbe0373b0
commit
87e1dc2c5d
6 changed files with 156 additions and 128 deletions
|
|
@ -56,3 +56,17 @@ function drawRouteConnections() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
function drawPoint([x, y], {color = "red", radius = 0.5}) {
|
||||
debug.append("circle").attr("cx", x).attr("cy", y).attr("r", radius).attr("fill", color);
|
||||
}
|
||||
|
||||
function drawPath(points, {color = "red", width = 0.5}) {
|
||||
const lineGen = d3.line().curve(d3.curveBundle);
|
||||
debug
|
||||
.append("path")
|
||||
.attr("d", round(lineGen(points)))
|
||||
.attr("stroke", color)
|
||||
.attr("stroke-width", width)
|
||||
.attr("fill", "none");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue