From: karim hamidou Date: Mon, 12 Nov 2012 17:39:55 +0000 (+0100) Subject: flip-flopping between frameworks. X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=41050ba4692f2554b6ea04147d6f6773f9830af0;p=Projet_IC05.git flip-flopping between frameworks. --- diff --git a/js/index.html b/js/index.html index a375e22..dd99489 100644 --- a/js/index.html +++ b/js/index.html @@ -12,7 +12,9 @@ + +
-
+
diff --git a/js/js/main.js b/js/js/main.js index 2bf5e68..230ed75 100644 --- a/js/js/main.js +++ b/js/js/main.js @@ -1,19 +1,38 @@ $(document).ready(function() { - var sigRoot = document.getElementById("sigmaCanvas"); - var sigInst = sigma.init(sigRoot); - + //var sigRoot = document.getElementById("sigmaCanvas"); + var paper = Raphael(document.getElementById("graphCanvas"), 960, 600); + c = paper.circle(320, 240, 30) + c.attr({"fill" : "#ccc"}); + c.animate({"opacity": 0}, 1000); + /* + sigInst = sigma.init(sigRoot); + */ + + var nodeList = []; + + /* for(var i = 0; i < 90; i++) { color = 'rgb('+Math.round(Math.random()*256)+','+ Math.round(Math.random()*256)+','+ Math.round(Math.random()*256)+')'; - sigInst.addNode(i, { color: "#fff", size: 2, x: Math.random(), y: Math.random(), color: color}); + sigInst.addNode(i, { color: "#fff", size: 2, x: Math.random(), y: Math.random(), color: color, hidden: true}); + nodeList.push(i); } + */ + /* + for(var i = 0; i < 10; i++) { + var index_1 = Math.round(Math.random()*90); + var index_2 = Math.round(Math.random()*90); + sigInst.addEdge(index_1 * index_2, index_1, index_2); + } + */ + /* sigInst.graphProperties({ minNodeSize: 1, maxNodeSize: 10 }); sigInst.draw(); - + */ harry({ container: "scale", width: 940, @@ -23,9 +42,11 @@ $(document).ready(function() { labels:{ x:1, y:[0,50,100], - color:"#ddd", - ypos:"right" + color:"#000", + ypos:"center" }, + + labels : false, // FIXME: disable label or ask for patch mode:"curve:stack", fill:"solid", linewidth:3, @@ -35,11 +56,27 @@ $(document).ready(function() { linewidth:0, circle:"#fff" }, + mouseover : { + text: plotterMouseoverHandler + }, legends:{ - background:"#444", + background:"#ccc", color:"#fff", border:"#fff" }, bg:"black" }); }); + +function plotterMouseoverHandler(n, v, l, x, y) { + sigInst.iterNodes(function(n) { + if(x % 10 == n.id % 10) { + n.hidden = false; + } else { + n.hidden = true; + } + + }); + + sigInst.draw(); +}