-
Notifications
You must be signed in to change notification settings - Fork 35
/
debug2.html
149 lines (128 loc) · 5.26 KB
/
debug2.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>debug2: Dataflow graph editor</title>
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
<!-- Third-Party Libraries -->
<script src="libs/jquery.js"></script>
<script src="libs/jquery-ui.js"></script>
<script src="libs/jquery.ui.touch-punch.js"></script>
<script src="libs/underscore.js"></script>
<script src="libs/backbone.js"></script>
<script src="libs/hammer.min.js"></script>
<!-- Built-in Libraries -->
<script src="libs/actionbar/js/actionbar.js"></script>
<!-- Dataflow core -->
<script src="src/dataflow.js"></script>
<script src="src/state.js"></script>
<!-- Dataflow Modules -->
<script src="src/modules/graph.js"></script>
<script src="src/modules/node.js"></script>
<script src="src/modules/input.js"></script>
<script src="src/modules/output.js"></script>
<script src="src/modules/edge.js"></script>
<script src="src/modules/card.js"></script>
<script src="src/modules/graph-view.js"></script>
<script src="src/modules/node-view.js"></script>
<script src="src/modules/input-view.js"></script>
<script src="src/modules/output-view.js"></script>
<script src="src/modules/edge-view.js"></script>
<script src="src/modules/card-view.js"></script>
<!-- Nodes (some basics to extend) -->
<script src="src/nodes/base.js"></script>
<script src="src/nodes/base-resizable.js"></script>
<script src="src/nodes/test.js"></script>
<!-- Nodes (subgraph functionality) -->
<script src="src/nodes/dataflow-input.js"></script>
<script src="src/nodes/dataflow-output.js"></script>
<script src="src/nodes/dataflow-subgraph.js"></script>
<!-- Plugins -->
<script src="src/plugins/edit.js"></script>
<script src="src/plugins/library.js"></script>
<script src="src/plugins/view-source.js"></script>
<script src="src/plugins/log.js"></script>
<script src="src/plugins/inspector.js"></script>
<script src="src/plugins/keybinding.js"></script>
<script src="src/plugins/notification.js"></script>
<!-- Style -->
<link rel="stylesheet" href="themes/default/dataflow.css">
<link rel="stylesheet" href="themes/default/modules/node.css">
<link rel="stylesheet" href="themes/default/modules/edge.css">
<link rel="stylesheet" href="themes/default/modules/port.css">
<link rel="stylesheet" href="themes/default/modules/menu.css">
<link rel="stylesheet" href="themes/default/modules/actionbar.css">
<link rel="stylesheet" href="themes/default/modules/jqui.css">
</head>
<body>
<div id="graph1" style="position:absolute; overflow:auto; top:10px; width: 500px; bottom: 10px; left: 10px; border: 1px grey dotted;"></div>
<div id="graph2" style="position:absolute; overflow:auto; top:10px; right: 10px; bottom: 10px; left: 520px; border: 1px grey dotted;"></div>
<!-- Testing -->
<script>
$(function($) {
// Everything should be loaded now
// Test 2 graphs
var dataflow = new window.Dataflow({
appendTo: "#graph1",
debug: "true"
});
// Load test graph
var g = dataflow.loadGraph(
{"nodes":[{"id":1,"label":"test","type":"test","x":178,"y":28,"state":{"select":"April"},"w":213,"h":362},{"id":2,"label":"test","type":"test","x":433,"y":28,"state":{"select":"April"},"w":200,"h":400},{"id":3,"label":"subgraph","type":"dataflow-subgraph","x":679,"y":131,"graph":{"nodes":[{"id":"1","label":"in","type":"dataflow-input","x":180,"y":15,"input-type":"all"},{"id":3,"label":"in2","type":"dataflow-input","x":196,"y":132,"input-type":"all"},{"id":2,"label":"test","type":"test","x":566,"y":74,"state":{"select":"April"},"w":200,"h":400},{"id":"99","label":"out","type":"dataflow-output","x":947,"y":120,"output-type":"all"}],"edges":[{"source":{"node":2,"port":"output"},"target":{"node":"99","port":"data"}},{"source":{"node":"1","port":"data"},"target":{"node":2,"port":"input"}},{"source":{"node":3,"port":"data"},"target":{"node":2,"port":"string"}}]}},{"id":4,"label":"test","type":"test","x":928,"y":33,"state":{"select":"April"},"w":213,"h":362}],"edges":[{"source":{"node":1,"port":"output"},"target":{"node":2,"port":"input"}},{"source":{"node":2,"port":"output"},"target":{"node":3,"port":"1"}},{"source":{"node":3,"port":"99"},"target":{"node":4,"port":"input"}},{"source":{"node":2,"port":"output"},"target":{"node":3,"port":3}}]}
);
g.trigger("change");
// Test 2 graphs
var dataflow2 = new window.Dataflow({
appendTo: "#graph2",
debug: "true",
controls: false,
inputs: false,
editable: false
});
dataflow2.loadGraph(
{
"nodes": [
{
"id": 1,
"label": "test",
"type": "test",
"x": 134,
"y": 28,
"state": {
"select": "April",
"boolean": true
},
"w": 213,
"h": 362
},
{
"id": 2,
"label": "test",
"type": "test",
"x": 431,
"y": 4,
"state": {
"select": "April"
},
"w": 200,
"h": 400
}
],
"edges": [
{
"source": {
"node": 1,
"port": "output"
},
"target": {
"node": 2,
"port": "input"
}
}
]
} );
});
</script>
</body>
</html>