commit 73ef4efbb8ac83129d56cd8d3e372f18c749c0b3
Author: Pavel Fidranský <fidransky@outlook.com>
Date:   Sat Nov 10 16:42:12 2018 +0100

    Node uses NodeSymbolList to store its currently displayed symbols

diff --git a/sources/src/main/webapp/js/components/group.js b/sources/src/main/webapp/js/components/group.js
index e08e711..d812788 100644
--- a/sources/src/main/webapp/js/components/group.js
+++ b/sources/src/main/webapp/js/components/group.js
@@ -219,6 +219,7 @@ class Group extends Node {
 	 * @returns {SVGElement} SVG DOM element.
 	 */
 	_renderIncluded() {
+		// root
 		this._rootElement = DOM.s('svg', {
 			class: 'node group',
 			x: this.position.x,
@@ -283,16 +284,10 @@ class Group extends Node {
 					y2: 15,
 				}),
 			]),
+			// symbol list
+			this._symbolListComponent.render(),
 		]);
 
-		// symbol list
-		this._symbolListComponent = new NodeSymbolList;
-		this._rootElement.appendChild(this._symbolListComponent.render());
-
-		this._symbolList.forEach(symbol => {
-			this._symbolListComponent.appendChild(symbol);
-		});
-
 		return this._rootElement;
 	}
 
diff --git a/sources/src/main/webapp/js/components/node.js b/sources/src/main/webapp/js/components/node.js
index 1866e5e..9ebd55a 100644
--- a/sources/src/main/webapp/js/components/node.js
+++ b/sources/src/main/webapp/js/components/node.js
@@ -16,6 +16,9 @@ class Node {
 		/** @prop {function} removeFromSidebarList Hook function used to remove the node from the sidebar list it is located in before it is moved to the viewport. */
 		this.removeFromSidebarList = Utils.noop;
 
+		// components
+		this._symbolListComponent = new NodeSymbolList;
+
 		this._position = null;
 		this._size = null;
 		this._proxy = null;
@@ -31,7 +34,6 @@ class Node {
 		this._isArchetypeNeighboursHighlighted = false;
 		this._isNeighbourIconsDisplayed = false;
 
-		this._symbolList = [];
 		this._relatedArchetypeMap = {};
 	}
 
@@ -40,11 +42,9 @@ class Node {
 	 * @param {array} symbol Node symbol to be added.
 	 */
 	addSymbol(symbol) {
-		this._symbolList.push(symbol);
-
 		if (this.isExcluded) return;
 
-		this._symbolListComponent.appendChild(symbol);
+		this._symbolListComponent.add(symbol);
 	}
 
 	/**
@@ -52,11 +52,9 @@ class Node {
 	 * @param {array} symbol Node symbol to be removed.
 	 */
 	removeSymbol(symbol) {
-		this._symbolList.splice(this._symbolList.indexOf(symbol), 1);
-
 		if (this.isExcluded) return;
 
-		this._symbolListComponent.removeChild(symbol);
+		this._symbolListComponent.remove(symbol);
 	}
 
 	/**
diff --git a/sources/src/main/webapp/js/components/nodeSymbolList.js b/sources/src/main/webapp/js/components/nodeSymbolList.js
index 1791c9c..7eea96a 100644
--- a/sources/src/main/webapp/js/components/nodeSymbolList.js
+++ b/sources/src/main/webapp/js/components/nodeSymbolList.js
@@ -7,6 +7,8 @@ class NodeSymbolList {
 	 * @constructor
 	 */
 	constructor() {
+		this._symbolList = [];
+
 		this._width = 20;
 		this._height = 20;
 	}
@@ -29,7 +31,9 @@ class NodeSymbolList {
 	 * @public
 	 * @param {array} symbol Symbol to be added to the list.
 	 */
-	appendChild(symbol) {
+	add(symbol) {
+		this._symbolList.push(symbol);
+
 		this._rootElement.appendChild(DOM.s('g', {
 			class: 'neighbour-node-symbol ' + symbol[2],
 		}, [
@@ -56,7 +60,9 @@ class NodeSymbolList {
 	 * @public
 	 * @param {array} symbol Symbol to be removed from the list.
 	 */
-	removeChild(symbol) {
+	remove(symbol) {
+		this._symbolList.splice(this._symbolList.indexOf(symbol), 1);
+
 		let symbolGroup = this._rootElement.querySelector('.' + symbol[2]);
 
 		symbolGroup.remove();
diff --git a/sources/src/main/webapp/js/components/vertex.js b/sources/src/main/webapp/js/components/vertex.js
index 6618e03..6ef7821 100644
--- a/sources/src/main/webapp/js/components/vertex.js
+++ b/sources/src/main/webapp/js/components/vertex.js
@@ -218,6 +218,7 @@ class Vertex extends Node {
 	 * @returns {SVGElement} SVG DOM element.
 	 */
 	_renderIncluded() {
+		// root
 		this._rootElement = DOM.s('svg', {
 			class: 'node vertex',
 			x: this.position.x,
@@ -250,16 +251,10 @@ class Vertex extends Node {
 			}, [
 				DOM.t(this.name),
 			]),
+			// symbol list
+			this._symbolListComponent.render(),
 		]);
 
-		// symbol list
-		this._symbolListComponent = new NodeSymbolList;
-		this._rootElement.appendChild(this._symbolListComponent.render());
-
-		this._symbolList.forEach(symbol => {
-			this._symbolListComponent.appendChild(symbol);
-		});
-
 		// related archetype icons
 		const relatedArchetypeListContainer = DOM.s('g', {
 			transform: `translate(${this.size.width}, 0)`,
