From 2686f91b8256ae678b5934150ad5496930b29dc8 Mon Sep 17 00:00:00 2001 From: "boyan.tonchev" Date: Thu, 30 Nov 2023 11:09:43 +0200 Subject: [PATCH] GDB-9236: User Guides stop on Vis Graph segment and block the workbench ## What - visual graph steps where user have click/doubleclick in user guides are broken; - hierarchy steps where a node is zoomed or focused. ## Why We updated the d3 library. ## How Changed behaviour to work with the new version of d3. --- .../controllers/graphs-visualizations.controller.js | 8 ++++---- .../directives/rdf-class-hierarchy.directive.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/js/angular/graphexplore/controllers/graphs-visualizations.controller.js b/src/js/angular/graphexplore/controllers/graphs-visualizations.controller.js index 05e37b089..5f2299fba 100644 --- a/src/js/angular/graphexplore/controllers/graphs-visualizations.controller.js +++ b/src/js/angular/graphexplore/controllers/graphs-visualizations.controller.js @@ -1531,7 +1531,7 @@ function GraphsVisualizationsCtrl($scope, $rootScope, $repositories, $licenseSer }, 1000); }; - const touchEndEventHandler = function (d) { + const touchEndEventHandler = function () { $timeout.cancel(touchHoldEventTimer); touchHoldEventTimer = null; }; @@ -1738,15 +1738,15 @@ function GraphsVisualizationsCtrl($scope, $rootScope, $repositories, $licenseSer .on('mouseover', showNodeTipAndIcons) .on('mouseout', hideTipForNode) .on("click", clickEventHandler) - .on("touchstart", touchStartEventHandler) + .on("touchstart", (event, d) => touchStartEventHandler(d)) // no need to track move for mouse .on("touchmove", moveEventHandler) .on("touchend", touchEndEventHandler) .on("contextmenu", rightClickHandler) // custom event used when user is following a guide - .on("gdb-expand-node", expandEventHandler) + .on("gdb-expand-node", (event, d) => expandEventHandler(d, 0, event.srcElement.parentNode)) // custom event used when user is following a guide - .on("gdb-show-node-info", showNodeInfo) + .on("gdb-show-node-info", (event, d) => showNodeInfo(d)) .call(drag); const nodeLabels = container.selectAll(".node-wrapper").append("foreignObject") diff --git a/src/js/angular/graphexplore/directives/rdf-class-hierarchy.directive.js b/src/js/angular/graphexplore/directives/rdf-class-hierarchy.directive.js index c034ce903..a2a705b21 100644 --- a/src/js/angular/graphexplore/directives/rdf-class-hierarchy.directive.js +++ b/src/js/angular/graphexplore/directives/rdf-class-hierarchy.directive.js @@ -229,8 +229,8 @@ function classHierarchyDirective($rootScope, $location, GraphDataRestService, $w } }) // custom event used when user is following a guide - .on("gdb-focus", doFocus) - .on("gdb-zoom", zoom); + .on("gdb-focus", (event, d) => doFocus(d)) + .on("gdb-zoom", (event, d) => zoom(d)); if (flattenedClassNames) {