visgraph: only addEdge for person to person

This commit is contained in:
2021-11-01 12:40:22 +01:00
parent 41f815bbb9
commit 5d995115ba
3 changed files with 30 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
import { createStore } from 'vuex'
import { getHouseholdByPerson, getCoursesByPerson, getRelationshipsByPerson } from './api'
import { adapt2vis, getHouseholdLabel, getHouseholdWidth, getRelationshipLabel, getRelationshipTitle } from './vis-network'
import { adapt2vis, getHouseholdLabel, getHouseholdWidth, getRelationshipLabel, getRelationshipTitle, splitId } from './vis-network'
const debug = process.env.NODE_ENV !== 'production'
@@ -235,7 +235,7 @@ const store = createStore({
commit('addLink', {
from: `${p.person.type}_${p.person.id}`,
to: `${course.id}`,
id: `p${p.person.id}-c`+ course.id.split('_')[2],
id: `p${p.person.id}-c`+ splitId(course.id,'id'),
arrows: 'from',
color: 'orange',
font: { color: 'darkorange' },