From: karim hamidou Date: Tue, 27 Nov 2012 17:06:35 +0000 (+0100) Subject: design changes X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=e5d86b4c0766932e10d6693fbf3007d51e961c98;p=Projet_IC05.git design changes --- diff --git a/js/css/main.css b/js/css/main.css index 6547247..32b1ad6 100755 --- a/js/css/main.css +++ b/js/css/main.css @@ -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; } @@ -29,5 +53,11 @@ } .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 index 0000000..8c6bb56 Binary files /dev/null and b/js/imgs/background.png differ diff --git a/js/index.html b/js/index.html index dd99489..591404a 100755 --- a/js/index.html +++ b/js/index.html @@ -21,10 +21,26 @@

You are using an outdated browser. Upgrade your browser today or install Google Chrome Frame to better experience this site.

+

Les élections, tweetées

+
+
+ +

+ Légende : +

+ +

+ [] Utilisateur
+ [] Site web
+

+

+ Survolez un noeud pour obtenir des détails. +

+
diff --git a/js/js/main.js b/js/js/main.js index e30b902..4b5bee6 100755 --- a/js/js/main.js +++ b/js/js/main.js @@ -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 index 0000000..0636de0 Binary files /dev/null and b/js/palette differ diff --git a/palette b/palette new file mode 100644 index 0000000..c9c91bb Binary files /dev/null and b/palette differ