mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
vue_visgraph: improve graph
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { createStore } from 'vuex'
|
||||
import { getHouseholdByPerson, getCoursesByPerson, getRelationshipsByPerson } from './api'
|
||||
import { adapt2vis, getHouseholdLabel, getHouseholdWidth, getRelationshipLabel } from './vis-network'
|
||||
import { adapt2vis, getHouseholdLabel, getHouseholdWidth, getRelationshipLabel, getRelationshipTitle } from './vis-network'
|
||||
import { visMessages } from './i18n'
|
||||
|
||||
const debug = process.env.NODE_ENV !== 'production'
|
||||
@@ -115,7 +115,6 @@ const store = createStore({
|
||||
* 1) Add a person in state
|
||||
* @param Person person
|
||||
*/
|
||||
|
||||
addPerson({ commit, dispatch }, person) {
|
||||
commit('markPersonLoaded', person.id)
|
||||
commit('addPerson', person)
|
||||
@@ -127,7 +126,9 @@ const store = createStore({
|
||||
* @param Person person
|
||||
*/
|
||||
fetchInfoForPerson({ dispatch }, person) {
|
||||
dispatch('fetchHouseholdForPerson', person)
|
||||
if (null !== person.current_household_id) {
|
||||
dispatch('fetchHouseholdForPerson', person)
|
||||
}
|
||||
dispatch('fetchCoursesByPerson', person)
|
||||
dispatch('fetchRelationshipByPerson', person)
|
||||
},
|
||||
@@ -226,7 +227,7 @@ const store = createStore({
|
||||
arrows: 'from',
|
||||
color: 'orange',
|
||||
font: { color: 'darkorange' },
|
||||
label: visMessages.fr.visgraph.concerned,
|
||||
//label: visMessages.fr.visgraph.concerned,
|
||||
})
|
||||
if (!getters.isPersonLoaded(p.person.id)) {
|
||||
console.log(' person is not loaded', p.person.id)
|
||||
@@ -277,9 +278,11 @@ const store = createStore({
|
||||
to: `person_${r.toPerson.id}`,
|
||||
id: 'r' + r.id + '_p' + r.fromPerson.id + '_p' + r.toPerson.id,
|
||||
arrows: 'to',
|
||||
color: 'lightblue', dashes: true,
|
||||
color: 'lightblue',
|
||||
font: { color: '#33839d' },
|
||||
dashes: true,
|
||||
label: getRelationshipLabel(r, false),
|
||||
title: getRelationshipTitle(r),
|
||||
})
|
||||
for (let person of [r.fromPerson, r.toPerson]) {
|
||||
if (!getters.isPersonLoaded(person.id)) {
|
||||
|
Reference in New Issue
Block a user