function load(data) {
    // If project is new and no data is there, then just set project name
    if (!data) {
        setProjectName(__projectName);
        return;
    }

    var { projectId } = data;
    setProjectName(data.name);

    globalScope = undefined;
    resetScopeList(); // Remove default scope
    $('.circuits').remove(); // Delete default scope

    // Load all  according to the dependency order
    for (let i = 0; i < data.scopes.length; i++) {

        var isVerilogCircuit = false;
        var isMainCircuit = false;
        if(data.scopes[i].verilogMetadata) {
            isVerilogCircuit = data.scopes[i].verilogMetadata.isVerilogCircuit;
            isMainCircuit = data.scopes[i].verilogMetadata.isMainCircuit;
        }
        // Create new circuit
        const scope = newCircuit(data.scopes[i].name || 'Untitled', data.scopes[i].id, isVerilogCircuit, isMainCircuit);

        // Load circuit data
        loadScope(scope, data.scopes[i]);

        // Focus circuit
        globalScope = scope;

        // Center circuit
        if (embed) { globalScope.centerFocus(true); } else { globalScope.centerFocus(false); }

        // update and backup circuit once
        update(globalScope, true);

        // Updating restricted element list initially on loading
        updateRestrictedElementsInScope();

        scheduleBackup();
    }

    // Restore clock
    simulationArea.changeClockTime(data.timePeriod || 500);
    simulationArea.clockEnabled = data.clockEnabled === undefined ? true : data.clockEnabled;


    if (!embed) { showProperties(simulationArea.lastSelected); }

    // Reorder tabs according to the saved order
    if (data.orderedTabs) {
        var unorderedTabs = $('.circuits').detach();
        var plusButton = $('#tabsBar').children().detach();
        for (const tab of data.orderedTabs) { $('#tabsBar').append(unorderedTabs.filter(`#${tab}`)); }
        $('#tabsBar').append(plusButton); 
    }

    // Switch to last focussedCircuit
    if (data.focussedCircuit) 
        switchCircuit(data.focussedCircuit);

    // Update the testbench UI
    updateTestbenchUI();

    updateSimulationSet(true);
    updateCanvasSet(true);
    gridUpdateSet(true);
    // Reset Timing
    if(!embed)
        plotArea.reset();
    scheduleUpdate(1);
}
loads a saved project
@param {JSON} data - the json data of the
@category data
@exports load