Browse Source

color in the node

master
nglk 4 years ago
parent
commit
4428457000
  1. 4
      static/css/style.css
  2. 1
      static/js/d3/-home-angeliki-Documents-2005_Hybrid_Publishing-vvvw-static-js-.txt
  3. 23
      static/js/d3_map.js
  4. 2
      static/js/group1.json

4
static/css/style.css

@ -29,6 +29,10 @@
font: 10px sans-serif; font: 10px sans-serif;
} }
#dadaloglu text {
fill:red;
}
svg{ width:100%; height:200%; } svg{ width:100%; height:200%; }

1
static/js/d3/-home-angeliki-Documents-2005_Hybrid_Publishing-vvvw-static-js-.txt

@ -0,0 +1 @@
/home/angeliki/Documents/2005_Hybrid_Publishing/vvvw/static/js/test.json

23
static/js/d3_map.js

@ -1,13 +1,13 @@
var width = 960, var width = 960,
height = 500 height = 700
var svg = d3.select(".map_area").append("svg") var svg = d3.select(".map_area").append("svg")
.attr("width", width) .attr("width", width)
.attr("height", height); .attr("height", height);
var force = d3.layout.force() var force = d3.layout.force()
.gravity(0.05) .gravity(0.01)
.distance(200) .distance(400)
.charge(-100) .charge(-100)
.size([width, height]); .size([width, height]);
@ -29,6 +29,7 @@ d3.json("/static/js/group1.json", function(error, json) {
.enter().append("g") .enter().append("g")
.attr("class", "node") .attr("class", "node")
.attr("id", function(d){return d.id}) .attr("id", function(d){return d.id})
// .style("fill",function (d) { return 'red'; })
// .on("click", function(d){ // .on("click", function(d){
// scrolldiv(d); // scrolldiv(d);
// play(d); // play(d);
@ -59,8 +60,6 @@ d3.json("/static/js/group1.json", function(error, json) {
}); });
// scripts for mouse events // scripts for mouse events
// popup
// function popup() {
$("#dadaloglu").click(function(){ $("#dadaloglu").click(function(){
$("#showdadaloglu").fadeIn() $("#showdadaloglu").fadeIn()
console.log("around") console.log("around")
@ -80,8 +79,8 @@ d3.json("/static/js/group1.json", function(error, json) {
audio2.currentTime = 50; audio2.currentTime = 50;
// audio2.play(); // audio2.play();
}); });
// };
//pop-up
$(document).click(function (e) { $(document).click(function (e) {
if (!$(e.target).parents().andSelf().is('#dadaloglu')) { if (!$(e.target).parents().andSelf().is('#dadaloglu')) {
$("#showdadaloglu").fadeOut(); $("#showdadaloglu").fadeOut();
@ -94,16 +93,4 @@ d3.json("/static/js/group1.json", function(error, json) {
}; };
}); });
// scroll
// $("#dadaloglu").click(function(){
// var elem = document.getElementById("ele");
// elem.scrollIntoView();
// });
}); });

2
static/js/group1.json

@ -77,7 +77,7 @@
"value": 1 "value": 1
}, },
{ {
"source": 14, "source": 1,
"target": 11, "target": 11,
"value": 1 "value": 1
}, },

Loading…
Cancel
Save