From d425b542d9f6edf2ab3dcc968fdf6570b632bd36 Mon Sep 17 00:00:00 2001 From: nglk Date: Tue, 15 Dec 2020 19:31:34 +0100 Subject: [PATCH] fixed error with non dragged nodes --- wells/static/css/style.css | 3 ++- wells/static/js/d3_map.js | 28 +++------------------------- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/wells/static/css/style.css b/wells/static/css/style.css index bdaa076..42dc229 100644 --- a/wells/static/css/style.css +++ b/wells/static/css/style.css @@ -32,8 +32,9 @@ body { right: 0px; bottom: 0px; left: 0px; - opacity: 0.6; + opacity: 0.4; filter: blur(20px); + opacity: } /*Main areas*/ .map_area { diff --git a/wells/static/js/d3_map.js b/wells/static/js/d3_map.js index a7348f4..d210bce 100644 --- a/wells/static/js/d3_map.js +++ b/wells/static/js/d3_map.js @@ -47,16 +47,6 @@ d3.json("/static/js/group1.json", function(error, json) { .attr("dy", ".35em") .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 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"); }}) .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 divVideo.transition().duration(100); - divVideo.html("
  × 
"); + divVideo.html("
  × 
"); divBio.transition().duration(100); divBio.html("
  × 
"+i.bio+"
"); // draggable @@ -93,7 +71,8 @@ var divBio = d3.select("body").append("div").style("opacity", 1); // rest pop up 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 + ")"; }); - });