mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
visgraph: fix logic error with relationship direction
This commit is contained in:
parent
e7900b8b21
commit
58f7715643
@ -295,7 +295,7 @@ const store = createStore({
|
||||
color: 'lightblue',
|
||||
font: { color: '#33839d' },
|
||||
dashes: true, //physics: false,
|
||||
label: getRelationshipLabel(r, false),
|
||||
label: getRelationshipLabel(r),
|
||||
title: getRelationshipTitle(r),
|
||||
})
|
||||
for (let person of [r.fromPerson, r.toPerson]) {
|
||||
|
@ -292,11 +292,11 @@ const getHouseholdWidth = (member) => {
|
||||
/**
|
||||
* Return label edge
|
||||
* @param relationship
|
||||
* @param reverse
|
||||
* @returns string
|
||||
*/
|
||||
const getRelationshipLabel = (relationship, reverse) => {
|
||||
return (!reverse) ? relationship.relation.title.fr : relationship.relation.reverseTitle.fr
|
||||
const getRelationshipLabel = (relationship) => {
|
||||
return (!relationship.reverse) ?
|
||||
relationship.relation.title.fr : relationship.relation.reverseTitle.fr
|
||||
}
|
||||
|
||||
/**
|
||||
@ -305,10 +305,9 @@ const getRelationshipLabel = (relationship, reverse) => {
|
||||
* @returns string
|
||||
*/
|
||||
const getRelationshipTitle = (relationship) => {
|
||||
return relationship.relation.title.fr + ': '
|
||||
+ relationship.fromPerson.text + '\n'
|
||||
+ relationship.relation.reverseTitle.fr + ': '
|
||||
+ relationship.toPerson.text
|
||||
return (!relationship.reverse) ?
|
||||
relationship.relation.title.fr + ': ' + relationship.fromPerson.text + '\n' + relationship.relation.reverseTitle.fr + ': ' + relationship.toPerson.text :
|
||||
relationship.relation.title.fr + ': ' + relationship.toPerson.text + '\n' + relationship.relation.reverseTitle.fr + ': ' + relationship.fromPerson.text
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user