constructor(x, y, type, parent, bitWidth = undefined, label = '') {
        // Should never raise, but just in case
        if (isNaN(x) || isNaN(y)) {
            this.delete();
            showError('Fatal error occurred');
            return;
        }

        forceResetNodesSet(true);

        this.objectType = 'Node';
        this.subcircuitOverride = false;
        this.id = `node${uniqueIdCounter}`;
        uniqueIdCounter++;
        this.parent = parent;
        if (type != NODE_INTERMEDIATE && this.parent.nodeList !== undefined) { this.parent.nodeList.push(this); }

        if (bitWidth == undefined) {
            this.bitWidth = parent.bitWidth;
        } else {
            this.bitWidth = bitWidth;
        }
        this.label = label;
        this.prevx = undefined;
        this.prevy = undefined;
        this.leftx = x;
        this.lefty = y;
        this.x = x;
        this.y = y;

        this.type = type;
        this.connections = new Array();
        this.value = undefined;
        /**
        * @type {boolean}
        * Only relevant for NODE_OUTPUT
        * whether the value to the output node
        * was given to it by its parent
        */
        this.isValueUpstream = false;
        this.radius = 5;
        this.clicked = false;
        this.hover = false;
        this.wasClicked = false;
        this.scope = this.parent.scope;
        this.scope.timeStamp = new Date().getTime();
        /**
        * @type {string}
        * value of this.prev is
        * 'a' : whenever a node is not being dragged this.prev is 'a'
        * 'x' : when node is being dragged horizontally
        * 'y' : when node is being dragged vertically
        */
        this.prev = 'a';
        this.count = 0;
        this.highlighted = false;

        // This fn is called during rotations and setup
        this.refresh();

        if (this.type == NODE_INTERMEDIATE) { this.parent.scope.nodes.push(this); }

        this.parent.scope.allNodes.push(this);

        this.queueProperties = {
            inQueue: false,
            time: undefined,
            index: undefined,
        };
    }
This class is responsible for all the Nodes.Nodes are connected using Wires
Nodes are of 3 types;
NODE_INPUT = 0;
NODE_OUTPUT = 1;
NODE_INTERMEDIATE = 2;
Input and output nodes belong to some CircuitElement(it's parent)
@param {number} x - x coord of Node
@param {number} y - y coord of Node
@param {number} type - type of node
@param {CircuitElement} parent - parent element
@param {?number} bitWidth - the bits of node in input and output nodes
@param {string=} label - label for a node
@category node