Browse Source

fixed error with non dragged nodes

master
nglk 4 years ago
parent
commit
d425b542d9
  1. 3
      wells/static/css/style.css
  2. 28
      wells/static/js/d3_map.js

3
wells/static/css/style.css

@ -32,8 +32,9 @@ body {
right: 0px; right: 0px;
bottom: 0px; bottom: 0px;
left: 0px; left: 0px;
opacity: 0.6; opacity: 0.4;
filter: blur(20px); filter: blur(20px);
opacity:
} }
/*Main areas*/ /*Main areas*/
.map_area { .map_area {

28
wells/static/js/d3_map.js

@ -47,16 +47,6 @@ d3.json("/static/js/group1.json", function(error, json) {
.attr("dy", ".35em") .attr("dy", ".35em")
.text(function(d) { return d.name }); .text(function(d) { return d.name });
// // let drag = d3.behavior.drag();
// var drag = d3.behavior.drag()
// .on("drag", function() {
// var x = d3.event.x;
// var y = d3.event.y;
// d3.select(this).attr("transform", "translate(" + x + "," + y + ")");
// });
//
//
var divVideo = d3.select("body").append("div").style("opacity", 1); var divVideo = d3.select("body").append("div").style("opacity", 1);
var divBio = d3.select("body").append("div").style("opacity", 1); var divBio = d3.select("body").append("div").style("opacity", 1);
@ -68,21 +58,9 @@ var divBio = d3.select("body").append("div").style("opacity", 1);
d3.select(this).style("cursor", "pointer"); d3.select(this).style("cursor", "pointer");
}}) }})
.on("click", function(i){ .on("click", function(i){
// $(document).ready(function() {
// var a = 3;
// var dragOpts = {
// cursor: "move",
// cursor: "grab",
// distance: "0",
// };
// $('.draggable').draggable(
// {
// start: function(event, ui) { $(this).css("z-index", a++); }
// });
// });
// popup video // popup video
divVideo.transition().duration(100); divVideo.transition().duration(100);
divVideo.html("<div id='showvideo' class='draggable'><span onclick=this.parentElement.style.display='none';pauseAllVideos("+i.id+"); class='topleft'> &nbsp; &times&nbsp;</span><iframe id='video"+i.id+"' width='300' height='150' src='"+i.url+"' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture' allowfullscreen></iframe></div>"); divVideo.html("<div id='showvideo'><span onclick=this.parentElement.style.display='none';pauseAllVideos("+i.id+"); class='topleft'> &nbsp; &times&nbsp;</span><iframe id='video"+i.id+"' width='300' height='150' src='"+i.url+"' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture' allowfullscreen></iframe></div>");
divBio.transition().duration(100); divBio.transition().duration(100);
divBio.html("<div id='showbio'><span onclick=this.parentElement.style.display='none' class='topleft'> &nbsp; &times&nbsp;</span><div id='bio"+i.id+"'>"+i.bio+"</div>"); divBio.html("<div id='showbio'><span onclick=this.parentElement.style.display='none' class='topleft'> &nbsp; &times&nbsp;</span><div id='bio"+i.id+"'>"+i.bio+"</div>");
// draggable // draggable
@ -93,7 +71,8 @@ var divBio = d3.select("body").append("div").style("opacity", 1);
// rest pop up // rest pop up
popup(i.id,i.time); popup(i.id,i.time);
}) })
.on("dblclick",connectedNodes); .on("dblclick",connectedNodes)
.call(force.drag);
@ -106,7 +85,6 @@ var divBio = d3.select("body").append("div").style("opacity", 1);
node.attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; }); node.attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; });
}); });

Loading…
Cancel
Save