Creating a diagram

As an alternative to surface and graph, you can create a Diagram widget. Load the ibm_ilog.diagram.widget module that contains the Diagram widget, and create the diagram directly in markup. The getGraph method of the Diagram widget gets the graph created internally by the widget.
To create the Diagram widget:
  • Use the following code:
    JavaScript
    dojo.require("ibm_ilog.diagram.widget.Diagram");
            
            var diag, graph;
            
            var setup = function() {
                diag = dijit.byId('diagram');
                graph = diag.getGraph();
            };
    
            dojo.addOnLoad(setup);
    Markup
    <div id="diagram" dojoType='ibm_ilog.diagram.widget.Diagram' style="width:700px;height:600px"></div>