Mxgraph notes 1

1. mxgraph graphics memory

// Check xml graphics
 document.body.appendChild(mxUtils.button('View XML', function()
  {
      var encoder = new mxCodec();
      var node = encoder.encode(graph.getModel());
      mxUtils.popup(mxUtils.getPrettyXml(node), true);           
 }));        
// echo the xml page on            
were doc = mxUtils.parseXml (XML);
var codec = new mxCodec(doc);
codec.decode(doc.documentElement, graph.getModel());

 

2. Thumbnails

var outln = new mxOutline(graph, outline);

  

 

3. Double-click prohibited

graph.dblClick = function (evt, cell) {
	var model = graph.getModel();
	if (model.isVertex(cell)) {
		return false;
	}
}					    

  

 

Guess you like

Origin www.cnblogs.com/ljyqd/p/11089622.html