GoalModelEditor/FrontEnd/public/js/projectEdit/graph.js
/**
 * Renders window.jsonData into a motivational model into graphContainer.
 */
Renders window.jsonData into a motivational model into graphContainer.
Renders window . jsonData into a motivational model into graphContainer .
function renderGraph(container) {
    saveJSON();
    console.log("Logging: renderGraph() called.");
    graph.removeCells(graph.getChildVertices(graph.getDefaultParent()));
    graph.removeCells(graph.getChildEdges(graph.getDefaultParent()));
    rootGoal = null;
    emotionsGlob = {};
    negativesGlob = {};
    qualitiesGlob = {};
    stakeholdersGlob = {};
    if (!mxClient.isBrowserSupported()) {
        console.log("Logging: browser not supported");
        mxUtils.error("Browser not supported!", 200, false);
        return;
    }
    mxEvent.disableContextMenu(container);
    var clusters = window.jsonData.GoalModelProject.Clusters;
    graph.getModel().beginUpdate(); 
    for (var i = 0; i < clusters.length; i++) {
        var goals = clusters[i].ClusterGoals;
        renderGoals(goals, graph, null);
    }
    layoutFunctions(graph);
    associateNonFunctions(graph);
    graph.getModel().endUpdate(); 
}
function renderGraph ( container ) { saveJSON ( ) ; console . log ( "Logging: renderGraph() called." ) ; graph . removeCells ( graph . getChildVertices ( graph . getDefaultParent ( ) ) ) ; graph . removeCells ( graph . getChildEdges ( graph . getDefaultParent ( ) ) ) ; rootGoal = null ; emotionsGlob = { } ; negativesGlob = { } ; qualitiesGlob = { } ; stakeholdersGlob = { } ; if ( ! mxClient . isBrowserSupported ( ) ) { console . log ( "Logging: browser not supported" ) ; mxUtils . error ( "Browser not supported!" , 200 , false ) ; return ; } mxEvent . disableContextMenu ( container ) ; var clusters = window . jsonData . GoalModelProject . Clusters ; graph . getModel ( ) . beginUpdate ( ) ; for ( var i = 0 ; i < clusters . length ; i ++ ) { var goals = clusters [ i ] . ClusterGoals ; renderGoals ( goals , graph , null ) ; } layoutFunctions ( graph ) ; associateNonFunctions ( graph ) ; graph . getModel ( ) . endUpdate ( ) ; }
Renders window.jsonData into a motivational model into graphContainer.
Renders window . jsonData into a motivational model into graphContainer .
// reset - remove any existing graph if render is called // reset the accumulators for non-functional goals // check that browser is supported // disable context menu // grab the clusters from window.jsonData // render the graph // start transaction // grab goal hierarchy from the cluster // ... then call render // end transaction