From 50f6be42b1bbc76a95c8c7e43df0328e864fc415 Mon Sep 17 00:00:00 2001 From: hebehh Date: Fri, 10 Nov 2023 22:29:52 +0800 Subject: [PATCH 1/2] Reset highlight by clicking on canvas (select menu = True) --- pyvis/templates/template.html | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pyvis/templates/template.html b/pyvis/templates/template.html index 483a3e1..ae379a0 100644 --- a/pyvis/templates/template.html +++ b/pyvis/templates/template.html @@ -456,14 +456,10 @@

{{heading}}

network = new vis.Network(container, data, options); - {% if neighborhood_highlight %} + {% if neighborhood_highlight or select_menu %} network.on("click", neighbourhoodHighlight); {% endif %} - {% if select_menu %} - network.on("selectNode", neighbourhoodHighlight); - {% endif %} - {% if tooltip_link %} // make a custom popup var popup = document.createElement("div"); From b4f5d7952f3967d622b51ba0745eb338ab885bf3 Mon Sep 17 00:00:00 2001 From: hebehh Date: Fri, 10 Nov 2023 22:33:46 +0800 Subject: [PATCH 2/2] add global highlightActive variable --- pyvis/templates/template.html | 1 + 1 file changed, 1 insertion(+) diff --git a/pyvis/templates/template.html b/pyvis/templates/template.html index ae379a0..53712a3 100644 --- a/pyvis/templates/template.html +++ b/pyvis/templates/template.html @@ -265,6 +265,7 @@

{{heading}}

var network; var container; var options, data; + var highlightActive = false; var filter = { item : '', property : '',