constructor(x, y, scope, dir, bitWidth) {
        // Data member initializations
        this.x = x;
        this.y = y;
        this.hover = false;
        if (this.x === undefined || this.y === undefined) {
            this.x = simulationArea.mouseX;
            this.y = simulationArea.mouseY;
            this.newElement = true;
            this.hover = true;
        }
        this.deleteNodesWhenDeleted = true; // FOR NOW - TO CHECK LATER
        this.nodeList = [];
        this.clicked = false;

        this.oldx = x;
        this.oldy = y;

        // The following attributes help in setting the touch area bound. They are the distances from the center.
        // Note they are all positive distances from center. They will automatically be rotated when direction is changed.
        // To stop the rotation when direction is changed, check overrideDirectionRotation attribute.
        this.leftDimensionX = 10;
        this.rightDimensionX = 10;
        this.upDimensionY = 10;
        this.downDimensionY = 10;

        this.label = '';
        this.scope = scope;
        this.baseSetup();

        this.bitWidth = bitWidth || parseInt(prompt('Enter bitWidth'), 10) || 1;
        this.direction = dir;
        this.directionFixed = false;
        this.labelDirectionFixed = false;
        this.labelDirection = oppositeDirection[dir];
        this.orientationFixed = true;
        this.fixedBitWidth = false;

        scheduleUpdate();

        this.queueProperties = {
            inQueue: false,
            time: undefined,
            index: undefined,
        };

        if (this.canShowInSubcircuit) {
        this.subcircuitMetadata = {
            showInSubcircuit: false, // if canShowInSubcircuit == true, showInSubcircuit determines wheter the user has added the element in the subcircuit
            showLabelInSubcircuit: true, // determines whether the label of the element is to be showin the subcircuit
            labelDirection: this.labelDirection, // determines the direction of the label of the element in the subcircuit
            // coordinates of the element in the subcircuit relative to the subcircuit
            x : 0,
            y : 0
        }
    }
    }
Base class for circuit elements.
@param {number} x - x coordinate of the element
@param {number} y - y coordinate of the element
@param {Scope} scope - The circuit on which circuit element is being drawn
@param {string} dir - The direction of circuit element
@param {number} bitWidth - the number of bits per node.
@category circuitElement