This commit is contained in:
garrying
2021-04-25 18:31:26 +00:00
parent 948203897d
commit 1a9f355010
38 changed files with 164 additions and 164 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -148,11 +148,11 @@ const d3 = window.d3
if (typeof window.graphData !== 'undefined') {
const MINIMAL_NODE_SIZE = 10
const MAX_NODE_SIZE = 12
const MAX_NODE_SIZE = 16
const STROKE = 1
const FONT_SIZE = 12
const TICKS = 200
const FONT_BASELINE = 35
const FONT_BASELINE = 42
const MAX_LABEL_LENGTH = 50
const nodesData = window.graphData.nodes
@ -163,9 +163,9 @@ if (typeof window.graphData !== 'undefined') {
const updateNodeSize = () => {
nodesData.forEach((el) => {
let weight =
3 *
8 *
Math.sqrt(
linksData.filter((l) => l.source === el.id || l.target === el.id)
linksData.filter((l) => l.source.id === el.id || l.target.id === el.id)
.length + 1
)
if (weight < MINIMAL_NODE_SIZE) {
@ -280,7 +280,7 @@ if (typeof window.graphData !== 'undefined') {
const ticked = () => {
node.attr('cx', (d) => d.x).attr('cy', (d) => d.y)
status.attr('x', (d) => d.x - 24).attr('y', (d) => d.y)
status.attr('x', (d) => d.x - 2).attr('y', (d) => d.y)
text
.attr('x', (d) => d.x)
.attr('y', (d) => d.y - (FONT_BASELINE - nodeSize[d.id]))