Permalink
Browse files

Dropping useless dummy lines

  • Loading branch information...
1 parent 8a72d87 commit 473cb85c3f9abb39ea61c37c974ac474264feca7 @Yomguithereal Yomguithereal committed Feb 16, 2016
@@ -19,6 +19,7 @@
<script src="../src/renderers/webgl/sigma.webgl.nodes.def.js"></script>
<script src="../src/renderers/webgl/sigma.webgl.nodes.fast.js"></script>
<script src="../src/renderers/webgl/sigma.webgl.edges.def.js"></script>
+<script src="../src/renderers/webgl/sigma.webgl.edges.shader.js"></script>
<script src="../src/renderers/webgl/sigma.webgl.edges.fast.js"></script>
<script src="../src/renderers/webgl/sigma.webgl.edges.arrow.js"></script>
<script src="../src/renderers/canvas/sigma.canvas.labels.def.js"></script>
@@ -45,6 +46,7 @@
<script src="../src/misc/sigma.misc.bindEvents.js"></script>
<script src="../src/misc/sigma.misc.bindDOMEvents.js"></script>
<script src="../src/misc/sigma.misc.drawHovers.js"></script>
+
<!-- END SIGMA IMPORTS -->
<script src="../plugins/sigma.plugins.dragNodes/sigma.plugins.dragNodes.js"></script>
<div id="container">
@@ -76,13 +78,13 @@
*/
var i,
s,
- N = 100,
- E = 500,
+ N = 1000,
+ E = 5000,
g = {
nodes: [],
edges: []
};
-
+sigma.webgl.edges.def = sigma.webgl.edges.shader;
// Generate a random graph:
for (i = 0; i < N; i++)
g.nodes.push({
@@ -102,7 +104,7 @@
size: Math.random(),
color: '#ccc'
});
-sigma.renderers.def = sigma.renderers.canvas
+// sigma.renderers.def = sigma.renderers.canvas
// Instantiate sigma:
s = new sigma({
graph: g,
@@ -112,16 +114,16 @@
// Initialize the dragNodes plugin:
var dragListener = sigma.plugins.dragNodes(s, s.renderers[0]);
-dragListener.bind('startdrag', function(event) {
- console.log(event);
-});
-dragListener.bind('drag', function(event) {
- console.log(event);
-});
-dragListener.bind('drop', function(event) {
- console.log(event);
-});
-dragListener.bind('dragend', function(event) {
- console.log(event);
-});
-</script>
+// dragListener.bind('startdrag', function(event) {
+// console.log(event);
+// });
+// dragListener.bind('drag', function(event) {
+// console.log(event);
+// });
+// dragListener.bind('drop', function(event) {
+// console.log(event);
+// });
+// dragListener.bind('dragend', function(event) {
+// console.log(event);
+// });
+// </script>
View
@@ -20,6 +20,7 @@
<script src="../src/renderers/webgl/sigma.webgl.nodes.fast.js"></script>
<script src="../src/renderers/webgl/sigma.webgl.edges.def.js"></script>
<script src="../src/renderers/webgl/sigma.webgl.edges.fast.js"></script>
+<script src="../src/renderers/webgl/sigma.webgl.edges.shader.js"></script>
<script src="../src/renderers/webgl/sigma.webgl.edges.arrow.js"></script>
<script src="../src/renderers/canvas/sigma.canvas.labels.def.js"></script>
<script src="../src/renderers/canvas/sigma.canvas.hovers.def.js"></script>
@@ -82,7 +83,7 @@
nodes: [],
edges: []
};
-
+sigma.webgl.edges.def = sigma.webgl.edges.shader;
// Generate the graph:
for (i = 0; i < C; i++)
cs.push({
@@ -127,7 +128,7 @@
graph: g,
container: 'graph-container',
settings: {
- drawEdges: false
+ drawEdges: true
}
});
@@ -38,13 +38,13 @@
// A quick hardcoded rule to prevent people from using this plugin with the
// WebGL renderer (which is impossible at the moment):
- if (
- sigma.renderers.webgl &&
- renderer instanceof sigma.renderers.webgl
- )
- throw new Error(
- 'The sigma.plugins.dragNodes is not compatible with the WebGL renderer'
- );
+ // if (
+ // sigma.renderers.webgl &&
+ // renderer instanceof sigma.renderers.webgl
+ // )
+ // throw new Error(
+ // 'The sigma.plugins.dragNodes is not compatible with the WebGL renderer'
+ // );
// Init variables:
var _self = this,
@@ -60,7 +60,7 @@
_isMouseDown = false,
_isMouseOverCanvas = false,
_drag = false;
-
+
if (renderer instanceof sigma.renderers.svg) {
_mouse = renderer.container.firstChild;
}
@@ -212,7 +212,7 @@
captor: event,
renderer: _renderer
});
-
+
_drag = false;
_node = null;
};
@@ -209,9 +209,6 @@
'void main() {',
// Scale from [[-1 1] [-1 1]] to the container:
- 'vec2 yeah = a_normal;',
- 'float dummy = u_ratio * a_thickness;',
-
'vec2 delta = vec2(a_normal * a_thickness / 2.0);',
'vec2 position = (u_matrix * vec3(a_position + delta, 1)).xy;',
'position = (position / u_resolution * 2.0 - 1.0) * vec2(1, -1);',

0 comments on commit 473cb85

Please sign in to comment.