-
Notifications
You must be signed in to change notification settings - Fork 35
/
debug.html
124 lines (106 loc) · 5.59 KB
/
debug.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>debug: 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/CircularBuffer.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/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>
<!-- Cards -->
<script src="src/modules/card.js"></script>
<script src="src/modules/card-view.js"></script>
<script src="src/modules/menucard.js"></script>
<script src="src/modules/menucard-view.js"></script>
<script src="src/modules/node-inspect-view.js"></script>
<script src="src/modules/edge-inspect-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/menu.js"></script>
<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>
<script src="src/plugins/search.js"></script>
<!-- Style -->
<!-- Fonts -->
<link rel="stylesheet" href="themes/default/font-proximanova.css">
<link rel="stylesheet" href="themes/default/font-awesome.css">
<!-- Theme -->
<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/card.css">
<link rel="stylesheet" href="themes/default/modules/jqui.css">
<link rel="stylesheet" href="themes/default/modules/search.css">
</head>
<body >
<div id="graph1" style="position:absolute; overflow:auto; top:0px; right:0px; bottom:0px; left:0px; border: 1px solid black;"></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:61, y:90, state:{select:"April"}, w:122, h:248}, {id:2, label:"test", type:"test", x:270, y:83, state:{select:"April"}, w:122, h:254}, {id:3, label:"subgraph", type:"dataflow-subgraph", x:453, y:78, w:134, h:111, 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"}, {id:"96", label:"out", type:"dataflow-output", x:947, y:120, 'output-type':"all"}, {id:"97", label:"out", type:"dataflow-output", x:947, y:120, 'output-type':"all"}, {id:"98", 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:626, y:74, state:{select:"April"}, w:130, h:251}], edges:[{source:{node:1, port:"output"}, target:{node:2, port:"input"}, route:0}, {source:{node:2, port:"output"}, target:{node:3, port:"1"}, route:1}, {source:{node:3, port:"99"}, target:{node:4, port:"input"}, route:2}, {source:{node:2, port:"output"}, target:{node:3, port:3}, route:3}]}
);
g.trigger("change");
// Populate some fake log events
setInterval(function () {
dataflow.graph.get('edges').at(1).get('log').push({
type: 'begingroup',
data: 'random'
});
dataflow.graph.get('edges').at(1).get('log').push({
type: 'data',
data: Math.random()
});
dataflow.graph.get('edges').at(1).get('log').push({
type: 'endgroup',
data: 'random'
});
}, 500);
// Set one port to decline multiple connections
dataflow.graph.get('nodes').at(2).inputs.at(1).set('multiple', false);
window.d = $(".dataflow").data("dataflow");
});
</script>
</body>
</html>