]> khamidou — GitHub mirrors - Projet_IC05.git/commitdiff
design changes
authorkarim hamidou <khamidou@gmail.com>
Tue, 27 Nov 2012 17:06:35 +0000 (18:06 +0100)
committerkarim hamidou <khamidou@gmail.com>
Tue, 27 Nov 2012 17:06:35 +0000 (18:06 +0100)
js/css/main.css
js/imgs/background.png [new file with mode: 0755]
js/index.html
js/js/main.js
js/palette [new file with mode: 0644]
palette [new file with mode: 0644]

index 65472471f817ca8eb4545b4d146adb98b911593f..32b1ad679259ae29b223daa0c63bd138dcd03366 100755 (executable)
@@ -1,26 +1,50 @@
-#graphWrapper {
+@import url(http://fonts.googleapis.com/css?family=PT+Sans:700);
+
+body {
+    background-color: #242424;
+    font-family: 'Pt Sans', sans-serif;
     width: 960px;
     margin: 0 auto;
-    margin-top: 20px;
+    color: #FDDB62;
+    background-image: url('../imgs/background.png');
+}
+
+h2.title {
+    margin-bottom: 5px;
+    border-bottom: 1px solid #F57343;
 }
 
-#graphWrapper #sigmaCanvas {
-    height: 400px;
-    width: 940px;
-    background-color: #333;
+#graphWrapper {
+    float: left;
+    width: 760px;
+    margin: 0 auto;
+    background-color: #303030;
 }
 
 #graphWrapper #scale {
 
 }
 
+#legend {
+    float: left;
+    width: 192px;
+    padding-left: 5px;
+    height: 505px;
+//    background: -webkit-linear-gradient( 0deg, #242424, #303030 3%, #474747 85%, #242424 90%);
+//    background: -webkit-linear-gradient( 0deg, #242424, #303030 3%, #242424 95%);
+}
+
+.legend-title {
+    font-size: 18px;
+    margin-bottom: 10px;
+}
+
 .d3-link {
     stroke: #ccc;
     stroke-opacity: .6;
 }
 
 .circle {
-    color: blue;
     background-color: blue;
 }
 
 }
 
 .fully_visible {
-    stroke: black;
+    stroke: none;
+    fill: #F57343;
+}
+
+.nodetext {
+    /* fill: #F57343; */
+    fill: #FDDB62;
 }
diff --git a/js/imgs/background.png b/js/imgs/background.png
new file mode 100755 (executable)
index 0000000..8c6bb56
Binary files /dev/null and b/js/imgs/background.png differ
index dd994897f8a9caf1a7d82323d423194fce94ca41..591404aa958fe82982db8caa59da9eddd39e3a85 100755 (executable)
             <p class="chromeframe">You are using an outdated browser. <a href="http://browsehappy.com/">Upgrade your browser today</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to better experience this site.</p>
         <![endif]-->
 
+        <h2 class="title">Les élections, tweetées</h2>
+
         <div id="graphWrapper">
             <div id="graphCanvas"></div>
             <div id="scale"></div>
         </div>
+        <div id="legend">
+            
+            <p>
+                <span class="legend-title">Légende :</span>
+            </p>
+
+            <p>
+                [] Utilisateur<br>
+                [] Site web<br>
+            </p>
+            <p>
+                Survolez un noeud pour obtenir des détails.
+            </p>
+        </div>
         <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
         <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.8.2.min.js"><\/script>')</script>
         <script src="js/plugins.js"></script>
index e30b9025fea61630936a77e53f9b8f8ff17b4fc4..4b5bee68d05fbfe1ee8532c3e7ea356954368b69 100755 (executable)
@@ -2,47 +2,14 @@ $(document).ready(function() {
     d3.json("miserables.json", setup);
     window.setTimeout(step1, 2000);
     window.setTimeout(step2, 5000);
-
-       harry({
-        container: "scale",
-        width: 940,
-        height: 100,
-        datas:[
-            {values:[51,52,47,6,5,86,95,93,96,22,55,49,21,21,6,49],color:"#fc0"}],
-        labels:{
-                 x:1,
-          y:[0,50,100],
-          color:"#000",
-          ypos:"center"
-        },
-
-        labels : false, // FIXME: disable label or ask for patch
-        mode:"curve:stack",
-        fill:"solid",
-        linewidth:3,
-        autoscale:"top",
-        mouseover:{
-                 radius:4,
-          linewidth:0,
-          circle:"#fff"
-        },
-        mouseover : {
-            text: plotterMouseoverHandler
-        },
-        legends:{
-          background:"#ccc",
-          color:"#fff",
-          border:"#fff"
-                 },
-          bg:"black"
-    });
+    window.setTimeout(step3, 5000);
 });
 
 function plotterMouseoverHandler(n, v, l, x, y) {
 }
 
 function setup() {
-    var w = 960,
+    var w = 760,
         h = 500;
 
     force = d3.layout.force()
@@ -87,25 +54,30 @@ function restart() {
   var nodeEnter = node.enter().append("svg:g")
       .attr("class", "node")
       .call(force.drag);
-               
+  
+  nodeEnter.append("svg:text")
+      .attr("dx", 12)
+      .attr("dy", ".35em")
+      .text(function(d) { return d.id })
+      .transition()
+      .attr("class", "nodetext")
+
+  nodeEnter.append("svg:title")
+      .text("pkpmlkmlkmlk http://reddit.com");
+       
   nodeEnter.append("circle")
       .attr("class", "circle")
       .attr("r", "5")
       .attr("fill", "white")
+      .attr("stroke", "none")
       .attr("x", "-8px")
       .attr("y", "-8px")
       .attr("width", "16px")
       .attr("height", "16px")
       .transition()
-      .duration(4000)
+      .duration(2500)
       .attr("class", "fully_visible")
-      .style("fill", "red");
-
-  nodeEnter.append("svg:text")
-      .attr("class", "nodetext")
-      .attr("dx", 12)
-      .attr("dy", ".35em")
-      .text(function(d) { return d.id });
+      .attr("r", "10")
 
   node.exit().remove();
                
@@ -114,19 +86,65 @@ function restart() {
 
 // Add three nodes and three links.
 function step1() {
-  var a = {id: "aaa"}, b = {id: "bbb"}, c = {id: "ccc"};
+  var a = {id: "aaa"}, b = {id: "bbb", weight: 45}, c = {id: "ccc"};
   nodes.push(a, b, c);
   links.push({source: a, target: b}, {source: a, target: c}, {source: b, target: c});
+
+
+
   restart();
 }
 
 function step2() {
-  var a = {id: "aa"}, b = {id: "bb", weight : 45}, c = {id: "cc"};
-  nodes.push(a, b, c);
+  var a = {id: "aa"}, b = {id: "bb", weight : 45}, c = {id: "cc"}, d = {id: "dd"};
+  nodes.push(a, b, c, d);
   console.log(links);
   links.push({source: a, target: b}, {source: a, target: c}, {source: b, target: c});
   restart();
   console.log(links[3], links[0]);
-  links.push({source: nodes[0], target: a});
+  links.push({source: nodes[0], target: a});  
   restart();
 }
+
+function step3() {
+   nodes.pop(); 
+   restart();
+}
+
+function setupPlotter() {
+/*
+       harry({
+        container: "scale",
+        width: 940,
+        height: 100,
+        datas:[
+            {values:[51,52,47,6,5,86,95,93,96,22,55,49,21,21,6,49],color:"#fc0"}],
+        labels:{
+                 x:1,
+          y:[0,50,100],
+          color:"#000",
+          ypos:"center"
+        },
+
+        labels : false, // FIXME: disable label or ask for patch
+        mode:"curve:stack",
+        fill:"solid",
+        linewidth:3,
+        autoscale:"top",
+        mouseover:{
+                 radius:4,
+          linewidth:0,
+          circle:"#fff"
+        },
+        mouseover : {
+            text: plotterMouseoverHandler
+        },
+        legends:{
+          background:"#ccc",
+          color:"#fff",
+          border:"#fff"
+                 },
+          bg:"black"
+    });
+*/
+}
diff --git a/js/palette b/js/palette
new file mode 100644 (file)
index 0000000..0636de0
Binary files /dev/null and b/js/palette differ
diff --git a/palette b/palette
new file mode 100644 (file)
index 0000000..c9c91bb
Binary files /dev/null and b/palette differ