mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
visgraph: post, patch and delete relationship link works!
This commit is contained in:
@@ -160,6 +160,30 @@ const store = createStore({
|
||||
addLink(state, link) {
|
||||
state.links.push(link)
|
||||
},
|
||||
updateLink(state, link) {
|
||||
console.log('updateLink', link)
|
||||
let link_ = {
|
||||
from: `person_${link.fromPerson.id}`,
|
||||
to: `person_${link.toPerson.id}`,
|
||||
id: 'relationship_' + splitId(link.id,'id')
|
||||
+ '-person_' + link.fromPerson.id + '-person_' + link.toPerson.id,
|
||||
arrows: getRelationshipDirection(link),
|
||||
color: 'lightblue',
|
||||
font: { color: '#33839d' },
|
||||
dashes: true,
|
||||
label: getRelationshipLabel(link),
|
||||
title: getRelationshipTitle(link),
|
||||
relation: link.relation,
|
||||
reverse: link.reverse
|
||||
}
|
||||
// find row position and replace by updatedLink
|
||||
state.links.splice(
|
||||
state.links.findIndex(item => item.id === link_.id), 1, link_
|
||||
)
|
||||
},
|
||||
removeLink(state, link_id) {
|
||||
state.links = state.links.filter(l => l.id !== link_id)
|
||||
},
|
||||
|
||||
//// id markers
|
||||
markInWhitelist(state, person) {
|
||||
|
Reference in New Issue
Block a user