From 869e442c2c515bb01ab614beee93a890db4aa105 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Mon, 1 Nov 2021 09:49:55 +0100 Subject: [PATCH] visgraph: add hover interaction --- .../Resources/public/vuejs/VisGraph/store.js | 4 ++-- .../Resources/public/vuejs/VisGraph/vis-network.js | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/store.js index 80e4d0768..066b7c1dc 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/store.js @@ -294,7 +294,7 @@ const store = createStore({ arrows: 'to', color: 'lightblue', font: { color: '#33839d' }, - dashes: true, + dashes: true, //physics: false, label: getRelationshipLabel(r, false), title: getRelationshipTitle(r), }) @@ -316,7 +316,7 @@ const store = createStore({ commit('addPerson', adapt2vis(person, { folded: true })) console.log('********* fetch infos for missing', person.id, '******') - dispatch('fetchInfoForPerson', person) + //dispatch('fetchInfoForPerson', person) }, } }) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/vis-network.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/vis-network.js index fca3c0876..15d9fafdd 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/vis-network.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/vis-network.js @@ -69,6 +69,16 @@ window.options = { adaptiveTimestep: true, wind: { x: 0, y: 0 } }, + interaction: { + hover: true, + keyboard: { + enabled: true, + speed: {x: 3, y: 3, zoom: 0.02}, + bindToWindow: false + }, + multiselect: true, + navigationButtons: false + }, manipulation: { enabled: true, initiallyActive: true, @@ -115,7 +125,6 @@ window.options = { } }, nodes: { - //physics: true, borderWidth: 1, borderWidthSelected: 3, font: { @@ -123,7 +132,6 @@ window.options = { } }, edges: { - //physics: true, font: { color: '#b0b0b0', size: 9,