commit f01a1530a3d7248dcb30954cf50a90526a3d3698
Author: Vít Mazín <n5ver@seznam.cz>
Date:   Wed Jun 5 15:52:58 2019 +0200

    Improved filtering deletion (refs #7559)

diff --git a/sources/imiger-core/src/main/webapp/js/components/filterModalWindow.js b/sources/imiger-core/src/main/webapp/js/components/filterModalWindow.js
index 2235c12..4a05de0 100644
--- a/sources/imiger-core/src/main/webapp/js/components/filterModalWindow.js
+++ b/sources/imiger-core/src/main/webapp/js/components/filterModalWindow.js
@@ -403,10 +403,27 @@ class FilterModalWindow extends ModalWindow {
 	_onFilterFormReset() {
 		this._onBaseFilterChange('nodeType');
 
-		let nodeList = app.nodeList;
-		let edgeList = app.edgeList;
-		nodeList.filter(node => node._rootElement.style.display === 'none').forEach(node => node._rootElement.style.display = '');
-		edgeList.filter(edge => edge._rootElement.style.display === 'none').forEach(edge => edge._rootElement.style.display = '');
+		this.resetFilter();
+	}
+
+	resetFilter() {
+		var n = app.nodeList;
+		var v = app.vertexList;
+		var e = app.edgeList;
+		app.deletedNodeList.forEach(node =>{
+			n.push(node);
+		});
+		app.deletedVertexList.forEach(vertex => {
+			v.push(vertex);
+		});
+		app.deletedEdgeList.forEach(edge => {
+			e.push(edge);
+		});
+		n.filter(node => node._rootElement.style.display === 'none').forEach(node => node._rootElement.style.display = '');
+		e.filter(edge => edge._rootElement.style.display === 'none').forEach(edge => edge._rootElement.style.display = '');
+		app.deletedEdgeList = [];
+		app.deletedVertexList = [];
+		app.deletedNodeList = [];
 	}
 
 	_displayFilter(formData) {
@@ -483,7 +500,6 @@ class FilterModalWindow extends ModalWindow {
 		}
 
 		nodeFilter.run(app.nodeList).forEach(node => {
-			//node.isFound = true;
 			node._rootElement.style.display = 'none';
 			app.edgeList.forEach(edge => {
 				if(edge.from.id === node.id || edge.to.id === node.id) {
@@ -491,6 +507,36 @@ class FilterModalWindow extends ModalWindow {
 				}
 			});
 		});
+
+		var newNodeList = [];
+		var newVertexList = [];
+		var newEdgeList = [];
+
+		app.nodeList.forEach(node => {
+			if(node._rootElement.style.display !== 'none') {
+				newNodeList.push(node);
+			} else {
+				app.deletedNodeList.push(node);
+			}
+		});
+		app.vertexList.forEach(vertex => {
+			if(vertex._rootElement.style.display !== 'none') {
+				newVertexList.push(vertex);
+			} else {
+				app.deletedVertexList.push(vertex);
+			}
+		});
+		app.edgeList.forEach(edge => {
+			if(edge._rootElement.style.display !== 'none') {
+				newEdgeList.push(edge);
+			} else {
+				app.deletedEdgeList.push(edge);
+			}
+		});
+
+		app.nodeList = newNodeList;
+		app.vertexList = newVertexList;
+		app.edgeList = newEdgeList;
 	}
 
 	setDateBounds(minDate, maxDate) {
diff --git a/sources/imiger-core/src/main/webapp/js/components/navbar.js b/sources/imiger-core/src/main/webapp/js/components/navbar.js
index db20a3c..cec280d 100644
--- a/sources/imiger-core/src/main/webapp/js/components/navbar.js
+++ b/sources/imiger-core/src/main/webapp/js/components/navbar.js
@@ -11,7 +11,6 @@ class Navbar {
 			this._createSeparatorListItem(),
 
 			this._createSearchListItem(),
-			this._createSeparatorListItem(),
 
 			this._createFilterListItem(),
 			this._createSeparatorListItem(),
@@ -187,9 +186,7 @@ class Navbar {
 
 		function resetSearch() {
 			let nodeList = app.nodeList;
-			let edgeList = app.edgeList;
-			nodeList.filter(node => node._rootElement.style.display === 'none').forEach(node => node._rootElement.style.display = '');
-			edgeList.filter(edge => edge._rootElement.style.display === 'none').forEach(edge => edge._rootElement.style.display = '');
+			nodeList.filter(node => node.isFound === true).forEach(node => node.isFound = false);
 
 			searchInput.value = '';
 			searchCounter.innerText = 0;
@@ -207,7 +204,7 @@ class Navbar {
 		const filterButton = DOM.h('button', {
 			class: 'filter',
 			id: 'filterButton',
-			innerText: 'Filter nodes',
+			innerText: 'Select nodes',
 			onClick: () => app.filterModalWindowComponent.open(),
 		});
 
diff --git a/sources/imiger-core/src/main/webapp/js/services/filters/VertexArchetypeFilter.js b/sources/imiger-core/src/main/webapp/js/services/filters/VertexArchetypeFilter.js
index 52e23a8..b8cad25 100644
--- a/sources/imiger-core/src/main/webapp/js/services/filters/VertexArchetypeFilter.js
+++ b/sources/imiger-core/src/main/webapp/js/services/filters/VertexArchetypeFilter.js
@@ -34,13 +34,13 @@ class VertexArchetypeFilter extends AbstractFilter {
 		switch (this._operation) {
 			case EnumFilterOperation.EQ:
 				filterFn = vertex => {
-					return filterValues.indexOf(vertex.archetype) < 0; //> -1
+					return filterValues.indexOf(vertex.archetype) > -1;
 				};
 				break;
 
 			case EnumFilterOperation.NEQ:
 				filterFn = vertex => {
-					return filterValues.indexOf(vertex.archetype) > -1; //< 0
+					return filterValues.indexOf(vertex.archetype) < 0;
 				};
 				break;
 
diff --git a/sources/imiger-core/src/main/webapp/js/services/filters/VertexAttributeFilter.js b/sources/imiger-core/src/main/webapp/js/services/filters/VertexAttributeFilter.js
index 311c2b7..f74736f 100644
--- a/sources/imiger-core/src/main/webapp/js/services/filters/VertexAttributeFilter.js
+++ b/sources/imiger-core/src/main/webapp/js/services/filters/VertexAttributeFilter.js
@@ -184,7 +184,7 @@ class VertexAttributeFilter extends AbstractFilter {
 			filterFn = vertex => {
 				const attribute = vertex.attributes.find(attribute => attribute[0] === filterAttributeName);
 				const attributeValue = parseFloat(attribute[1]);
-				return (attributeValue >= filterValueFrom) && (attributeValue <= filterValueTo);
+				return (attributeValue < filterValueFrom) || (attributeValue > filterValueTo);
 			};
 
 		} else {
diff --git a/sources/imiger-core/src/main/webapp/js/showGraphApp.js b/sources/imiger-core/src/main/webapp/js/showGraphApp.js
index 8157a10..e53e310 100644
--- a/sources/imiger-core/src/main/webapp/js/showGraphApp.js
+++ b/sources/imiger-core/src/main/webapp/js/showGraphApp.js
@@ -30,6 +30,11 @@ class ShowGraphApp extends App {
 		/** @prop {Node} activeNode */
 		this.activeNode = null;
 
+		this.deletedNodeList = [];
+		this.deletedVertexList = [];
+		this.deletedEdgeList = [];
+
+
 		/** @prop {Diagram} diagram */
 		this.diagram = null;
 
