From c51678bcc0170d1413db1f5ec04ee21968c3cc47 Mon Sep 17 00:00:00 2001 From: Rogelio Orts Date: Sun, 12 Jan 2020 20:41:50 +0100 Subject: [PATCH] Strict ID comparison to avoid exclude nodes (#81) * Add strict id comparation to avoid exclude nodes * Add strict type comparison for string type --- .gitignore | 2 ++ scripts/graphioGremlin.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 3a46f40..5537fb4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.DS_Store + d3/ font-awesome-4.7.0/ jquery* \ No newline at end of file diff --git a/scripts/graphioGremlin.js b/scripts/graphioGremlin.js index 25f993c..e3f5b89 100644 --- a/scripts/graphioGremlin.js +++ b/scripts/graphioGremlin.js @@ -172,7 +172,7 @@ var graphioGremlin = (function(){ var edge_filter = $('#edge_filter').val(); var communication_method = $('#communication_method').val(); var id = d.id; - if(isNaN(id)){ // Add quotes if id is a string (not a number). + if (typeof id === 'string' || id instanceof String) { // Add quotes if id is a string (not a number). id = '"'+id+'"'; } // Gremlin query @@ -442,7 +442,7 @@ var graphioGremlin = (function(){ // find the element in list with id equal to elem // return its index or null if there is no for (var i=0;i