mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-23 16:13:50 +00:00
visgraph: improve nodes that are hidden when uncheck layer
- a new getter count links by node. before exclude person, check first if node has others visible links - links id are rewrote to serve count links getter - unfold and expand only folded person
This commit is contained in:
@@ -140,7 +140,10 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['nodes', 'edges']),
|
||||
...mapGetters(['nodes', 'edges',
|
||||
// not used
|
||||
'isInWhitelist', 'isHouseholdLoading', 'isCourseLoaded', 'isRelationshipLoaded', 'isPersonLoaded', 'isExcludedNode', 'countLinksByNode', 'getParticipationsByCourse', 'getMembersByHousehold', 'getFoldedPersons',
|
||||
]),
|
||||
...mapState(['households', 'courses', 'excludedNodesIds', 'persons',
|
||||
// not used
|
||||
'links', 'relationships', 'whitelistIds', 'personLoadedIds', 'householdLoadingIds', 'courseLoadedIds', 'relationshipLoadedIds',
|
||||
@@ -234,16 +237,15 @@ export default {
|
||||
if (data.nodes.length > 1) {
|
||||
throw 'Multi selection is not allowed. Disable it in options.interaction !'
|
||||
}
|
||||
let nodeType = splitId(data.nodes[0], 'type')
|
||||
switch (nodeType) {
|
||||
let node = data.nodes[0]
|
||||
|
||||
// test
|
||||
console.log(
|
||||
splitId('accompanying_period_124', 'id')
|
||||
)
|
||||
//this.countLinksByNode(node)
|
||||
|
||||
let nodeType = splitId(node, 'type')
|
||||
switch (nodeType) {
|
||||
case 'person':
|
||||
let person = this.nodes.filter(n => n.id === data.nodes[0])[0]
|
||||
let person = this.nodes.filter(n => n.id === node)[0]
|
||||
console.log('@@@@@@ event on selected Node', person.id)
|
||||
if (person.label === null) {
|
||||
this.$store.commit('unfoldPerson', person)
|
||||
@@ -252,14 +254,14 @@ export default {
|
||||
break
|
||||
|
||||
case 'household':
|
||||
let household = this.nodes.filter(n => n.id === data.nodes[0])[0]
|
||||
let household = this.nodes.filter(n => n.id === node)[0]
|
||||
console.log('@@@@@@ event on selected Node', household.id)
|
||||
this.$store.dispatch('unfoldPersonsByHousehold', household)
|
||||
this.forceUpdateComponent()
|
||||
break
|
||||
|
||||
case 'accompanying_period':
|
||||
let course = this.nodes.filter(n => n.id === data.nodes[0])[0]
|
||||
let course = this.nodes.filter(n => n.id === node)[0]
|
||||
console.log('@@@@@@ event on selected Node', course.id)
|
||||
this.$store.dispatch('unfoldPersonsByCourse', course)
|
||||
this.forceUpdateComponent()
|
||||
|
Reference in New Issue
Block a user