mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
vue_visgraph: add checkbox legend to enable/disable layers
This commit is contained in:
@@ -12,7 +12,8 @@ const store = createStore({
|
||||
courses: [],
|
||||
relationships: [],
|
||||
householdLoadingIds: [],
|
||||
courseLoadedIds: []
|
||||
courseLoadedIds: [],
|
||||
excludedNodesIds: []
|
||||
},
|
||||
getters: {
|
||||
nodes(state) {
|
||||
@@ -26,6 +27,10 @@ const store = createStore({
|
||||
state.courses.forEach(c => {
|
||||
nodes.push(c)
|
||||
})
|
||||
// except excluded nodes (unchecked layers)
|
||||
state.excludedNodesIds.forEach(excluded => {
|
||||
nodes = nodes.filter(n => n.id !== excluded)
|
||||
})
|
||||
return nodes
|
||||
},
|
||||
edges(state) {
|
||||
@@ -56,7 +61,7 @@ const store = createStore({
|
||||
state.courses.push(adapt2vis(course))
|
||||
},
|
||||
addRelationship(state, relationship) {
|
||||
console.log('+ addRelationship', relationship)
|
||||
console.log('+ addRelationship from', relationship.from, 'to', relationship.to)
|
||||
state.relationships.push(relationship)
|
||||
},
|
||||
markHouseholdLoading(state, id) {
|
||||
@@ -72,6 +77,12 @@ const store = createStore({
|
||||
unmarkCourseLoaded(state, id) {
|
||||
state.courseLoadedIds = state.courseLoadedIds.filter(i => i !== id)
|
||||
},
|
||||
addExcludedNode(state, id) {
|
||||
state.excludedNodesIds.push(id)
|
||||
},
|
||||
removeExcludedNode(state, id) {
|
||||
state.excludedNodesIds = state.excludedNodesIds.filter(e => e !== id)
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
/**
|
||||
@@ -185,7 +196,7 @@ const store = createStore({
|
||||
arrows: 'to',
|
||||
color: 'orange',
|
||||
font: { color: 'orange' },
|
||||
label: 'usager',
|
||||
label: 'concerné',
|
||||
//group: 'link_person_course',
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user