From 9ead2ab05fc742acd986f8d128922c109747f00b Mon Sep 17 00:00:00 2001 From: James Graham Date: Mon, 10 May 2021 12:14:09 +0100 Subject: [PATCH] fix: fit node labels inside nodes --- people/static/js/network.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/people/static/js/network.js b/people/static/js/network.js index 7aa9ca0..62c82fd 100644 --- a/people/static/js/network.js +++ b/people/static/js/network.js @@ -7,12 +7,12 @@ var network_style = [ selector: 'node[name]', style: { label: 'data(name)', - width: '50px', - height: '50px', + width: '100px', + height: '100px', 'text-halign': 'center', 'text-valign': 'center', 'text-wrap': 'wrap', - 'text-max-width': '100px', + 'text-max-width': '90px', 'font-size': 12, 'background-color': 'data(nodeColor)', 'shape': 'data(nodeShape)' @@ -58,7 +58,7 @@ function get_network() { name: person.name, kind: 'person', nodeColor: '#0099cc', - nodeShape: 'elipse' + nodeShape: 'ellipse' } }) } @@ -89,6 +89,9 @@ function get_network() { id: 'relationship-' + relationship.pk.toString(), source: 'person-' + relationship.source.pk.toString(), target: 'person-' + relationship.target.pk.toString(), + lineColor: { + 'organisation-membership': '#669933' + }[relationship.kind] || 'grey', lineArrowShape: 'triangle' } })