fix node sizing

This commit is contained in:
Garry Ing 2021-05-30 15:39:24 -04:00
parent 0af352156b
commit 131f3580ae
No known key found for this signature in database
GPG Key ID: 3B379B1F2193CC3E

View File

@ -148,11 +148,10 @@ const d3 = window.d3
if (typeof window.graphData !== 'undefined') { if (typeof window.graphData !== 'undefined') {
const MINIMAL_NODE_SIZE = 10 const MINIMAL_NODE_SIZE = 10
const MAX_NODE_SIZE = 16 const MAX_NODE_SIZE = 24
const STROKE = 1 const STROKE = 1
const FONT_SIZE = 12 const FONT_SIZE = 12
const TICKS = 200 const TICKS = 200
const FONT_BASELINE = 42
const MAX_LABEL_LENGTH = 50 const MAX_LABEL_LENGTH = 50
const nodesData = window.graphData.nodes const nodesData = window.graphData.nodes
@ -276,7 +275,7 @@ if (typeof window.graphData !== 'undefined') {
status.attr('x', (d) => d.x - 2).attr('y', (d) => d.y) status.attr('x', (d) => d.x - 2).attr('y', (d) => d.y)
text text
.attr('x', (d) => d.x) .attr('x', (d) => d.x)
.attr('y', (d) => d.y - (FONT_BASELINE - nodeSize[d.id])) .attr('y', (d) => d.y - nodeSize[d.id] - FONT_SIZE * 0.75)
link link
.attr('d', (d) => { .attr('d', (d) => {
const dx = d.target.x - d.source.x const dx = d.target.x - d.source.x