-#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;
}
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()
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();
// 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"
+ });
+*/
+}