<?xml version="1.0" encoding="UTF-8"?>
<html>
<head>
<title>WireIt Example, DOT parser prototype</title>
<!-- Libs -->
<link rel="stylesheet" type="text/css" href="../../../../lib/yui/reset-fonts/reset-fonts.css" />
<script type="text/javascript" src="../../../../lib/yui/utilities/utilities.js"></script>
<script type="text/javascript" src="../../../../lib/excanvas.js"></script>
<!-- WireIt -->
<script type="text/javascript" src="../../../../build/wireit-min.js"></script>
<!-- Animations plugin -->
<script type="text/javascript" src="../../../../js/Anim.js"></script>
<!-- Layout plugin -->
<script type="text/javascript" src="../../js/Layout.js"></script>
<script type='text/javascript' src='DotToJson.js'></script>
<link rel="stylesheet" type="text/css" href="../../../../assets/WireIt.css" />
<style>
div.WireIt-Terminal {
background-image: none;
width: 0px;
height: 0px;
}
div.WireIt-Container {
width: 90px
}
</style>
<script>
YAHOO.util.Event.onDOMReady(function() {
YAHOO.util.Connect.asyncRequest('GET', 'sample.dot', {
success: function(o) {
var graph = DotParser.parse(o.responseText);
run(graph);
}
})
});
run = function(graph) {
layer = new WireIt.Layer({});
for(var i = 0 ; i < graph.nodes.length ; i++) {
layer.addContainer({
terminals: [ { offsetPosition: {bottom: 34, left: 25}, editable: false }],
title: graph.nodes[i],
position: [ Math.floor(Math.random()*800)+30, Math.floor(Math.random()*300)+30 ],
close: false
});
}
for(var i = 0 ; i < graph.edges.length ; i++) {
var edge = graph.edges[i];
layer.addWire({
src: {moduleId: graph.nodes.indexOf(edge.node1), terminalId: 0},
tgt: {moduleId: graph.nodes.indexOf(edge.node2), terminalId: 0},
xtype: "WireIt.Wire"
});
}
layer.startDynamicLayout();
};
</script>
</head>
<body>
</body>
</html>
# |
Change |
User |
Description |
Committed |
|
#1
|
16445 |
christiane_renck |
Rename/move file(s) |
|
|
//guest/christiane_renck/MergeQuestJS/main/demos/WireIt/plugins/layout/examples/dotparser/index.html |
#1
|
16444 |
christiane_renck |
Adding MergeQuestJS to the Workshop. |
|
|