visgraph: improve label with basic markdown

This commit is contained in:
Mathieu Jaumotte 2021-10-30 00:27:10 +02:00
parent 09903c2f52
commit 851a246257

View File

@ -118,6 +118,9 @@ window.options = {
//physics: true,
borderWidth: 1,
borderWidthSelected: 3,
font: {
multi: 'md'
}
},
edges: {
//physics: true,
@ -148,7 +151,7 @@ window.options = {
border: '#b0b0b0',
background: 'rgb(193,229,222)',
highlight: {
border: '#368d7e',
border: '#8d3686',
background: 'rgb(193,229,222)'
}
}
@ -174,7 +177,7 @@ const adapt2vis = (entity, options = {}) => {
switch (entity.type) {
case 'person':
entity._id = entity.id
entity.label = `${entity.text}\n` + getGender(entity.gender) +' - '+ getAge(entity.birthdate)
entity.label = `*${entity.text}*\n_${getGender(entity.gender)} - ${getAge(entity.birthdate)}_`
if (options.folded) {
entity.title = visMessages.fr.visgraph.click_to_expand
entity._label = entity.label // keep label