diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/App.vue index c72c3689f..5bd654bd5 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/App.vue @@ -80,10 +80,10 @@ export default { }, created() { - eventHub.$on('add-switch', this.addSwitch) + eventHub.on('add-relationship-link', this.addRelationshipLink) }, unmounted() { - eventHub.$off('add-switch', this.addSwitch) + eventHub.off('add-relationship-link', this.addRelationshipLink) }, mounted() { console.log('=== mounted: init graph') @@ -124,8 +124,8 @@ export default { console.log('** click on node **') window.network.on('click', callback) }, - addSwitch(edgeData) { - console.log('==> addSwitch <=======================', edgeData) + addRelationshipLink(edgeData) { + console.log('==> addRelationshipLink <=======================', edgeData) }, } /* 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 a5d2a8daa..086608e19 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/vis-network.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/vis-network.js @@ -1,5 +1,5 @@ import { visMessages } from './i18n' -import {createApp} from "vue" +import { TinyEmitter } from "tiny-emitter"; /** * Vis-network initial data/configuration script @@ -8,10 +8,8 @@ import {createApp} from "vue" * cfr. https://github.com/almende/vis/issues/2524#issuecomment-307108271 */ -console.log('@@@@@@@ eventHub App @@@@@@@@@@') -window.eventHub = createApp() -console.log('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') - +console.log('@@@ init eventHub App @@@') +window.eventHub = new TinyEmitter() window.network = {} @@ -26,7 +24,7 @@ window.options = { showButton: true }, */ - physics:{ + physics: { enabled: true, barnesHut: { theta: 0.5, @@ -104,7 +102,7 @@ window.options = { addEdge: function(edgeData, callback) { console.log('addEdge', edgeData) callback(edgeData) - eventHub.$emit('add-switch', edgeData) + eventHub.emit('add-relationship-link', edgeData) }, editEdge: function(edgeData, callback) { console.log('editNode', edgeData)