mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-26 05:19:01 +00:00
feat: better graph scaling (closes #170)
This commit is contained in:
parent
ff770927fd
commit
3dcc1f1106
1 changed files with 1 additions and 1 deletions
|
@ -155,7 +155,7 @@ async function drawGraph(baseUrl, isHome, pathColors, graphConfig) {
|
||||||
const nodeRadius = (d) => {
|
const nodeRadius = (d) => {
|
||||||
const numOut = index.links[d.id]?.length || 0
|
const numOut = index.links[d.id]?.length || 0
|
||||||
const numIn = index.backlinks[d.id]?.length || 0
|
const numIn = index.backlinks[d.id]?.length || 0
|
||||||
return 3 + (numOut + numIn) / 4
|
return 2 + Math.sqrt(numOut + numIn)
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw individual nodes
|
// draw individual nodes
|
||||||
|
|
Loading…
Reference in a new issue