mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +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',
|
color: 'lightblue',
|
||||||
font: { color: '#33839d' },
|
font: { color: '#33839d' },
|
||||||
dashes: true, //physics: false,
|
dashes: true, //physics: false,
|
||||||
label: getRelationshipLabel(r, false),
|
label: getRelationshipLabel(r),
|
||||||
title: getRelationshipTitle(r),
|
title: getRelationshipTitle(r),
|
||||||
})
|
})
|
||||||
for (let person of [r.fromPerson, r.toPerson]) {
|
for (let person of [r.fromPerson, r.toPerson]) {
|
||||||
|
@ -292,11 +292,11 @@ const getHouseholdWidth = (member) => {
|
|||||||
/**
|
/**
|
||||||
* Return label edge
|
* Return label edge
|
||||||
* @param relationship
|
* @param relationship
|
||||||
* @param reverse
|
|
||||||
* @returns string
|
* @returns string
|
||||||
*/
|
*/
|
||||||
const getRelationshipLabel = (relationship, reverse) => {
|
const getRelationshipLabel = (relationship) => {
|
||||||
return (!reverse) ? relationship.relation.title.fr : relationship.relation.reverseTitle.fr
|
return (!relationship.reverse) ?
|
||||||
|
relationship.relation.title.fr : relationship.relation.reverseTitle.fr
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -305,10 +305,9 @@ const getRelationshipLabel = (relationship, reverse) => {
|
|||||||
* @returns string
|
* @returns string
|
||||||
*/
|
*/
|
||||||
const getRelationshipTitle = (relationship) => {
|
const getRelationshipTitle = (relationship) => {
|
||||||
return relationship.relation.title.fr + ': '
|
return (!relationship.reverse) ?
|
||||||
+ relationship.fromPerson.text + '\n'
|
relationship.relation.title.fr + ': ' + relationship.fromPerson.text + '\n' + relationship.relation.reverseTitle.fr + ': ' + relationship.toPerson.text :
|
||||||
+ relationship.relation.reverseTitle.fr + ': '
|
relationship.relation.title.fr + ': ' + relationship.toPerson.text + '\n' + relationship.relation.reverseTitle.fr + ': ' + relationship.fromPerson.text
|
||||||
+ relationship.toPerson.text
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user