Skip to content
Permalink
Browse files

Fixed chrome tooltips

  • Loading branch information
csw11004 committed Sep 4, 2015
1 parent be8e06e commit 04490e92ddd7bce53925bfd3dfd9dd0a2db80d53
Showing with 29 additions and 25 deletions.
  1. +17 −13 VQI_GenomeBrowser.js
  2. +12 −12 dynamic_loading.php
@@ -403,10 +403,16 @@ function VQI_GenomeBrowser(id, serviceURL) {

zoom.translate([panLimit(), 0]);

svg.selectAll("g.scalable").attr("transform", "translate(" + zoom.translate()[0] + ",0)scale(" + zoom.scale() + ",1)");
//svg.selectAll("g.scalable").attr("transform", "translate(" + zoom.translate()[0] + ",0)scale(" + zoom.scale() + ",1)");

//slow, scales elements individually, draws at large zooms
//svg.selectAll("g.scalable").selectAll("*").attr("transform", "translate(" + zoom.translate()[0]+",0)scale(" + zoom.scale() + ",1)");
svg.selectAll("g.scalable").selectAll("rect")
.attr("width", function (d) {
return xScale(d[indexArray.end]) - xScale(d[indexArray.start])
})
.attr("x", function (d) {
return xScale(d[indexArray.start])
});


xAxisSelection.call(xAxis);
@@ -839,16 +845,19 @@ function VQI_GenomeBrowser(id, serviceURL) {
return type == "cpg" ? 40 : type == "shore" ? 20 : 15
})
.attr("width", function (d) {
return fullXScale(d[indexArray.end]) - fullXScale(d[indexArray.start])
return xScale(d[indexArray.end]) - xScale(d[indexArray.start])
})
.attr("x", function (d) {
return fullXScale(d[indexArray.start])
return xScale(d[indexArray.start])
})
.attr("y", function (d) {
var type = d[indexArray.type];
var offset = type == "cpg" ? -20 : type == "shore" ? -10 : -7.5;
return offset;//height / 2 + margin + offset
})
.on("mouseenter", function(){console.log("mouseenter")})
.on("mouseleave", function(){console.log("mouseleave")})


addTooltip(trackScalableGroup.selectAll("rect")
.filter(function (d) {
@@ -950,12 +959,12 @@ function VQI_GenomeBrowser(id, serviceURL) {
return d;
})
.attr("x", function (d) {
return fullXScale(d[0]);
return fullXScale(d[indexArray.start]);
})
.attr("y", -10)
.attr("height", 20)
.attr("width", function (d) {
return fullXScale(d[1]) - fullXScale(d[0]);
return fullXScale(d[indexArray.end]) - fullXScale(d[indexArray.start]);
})
.style("fill-opacity", ".8")
.style("stroke", "black")
@@ -1003,15 +1012,10 @@ function VQI_GenomeBrowser(id, serviceURL) {
content: {
text: function(event, api) {
var min,max;
if(type === "exon"){
min = d[0];
max = d[1];
}
else
{

min = d[indexArray.start];
max = d[indexArray.end];
}

$.ajax({
url: serviceURL,
type: 'POST',
@@ -152,21 +152,21 @@ function mergeExonsArray($exons, $scale){
$resArray = [];
$mergedExon = $exons[0];
for ($i=1; $i < count($exons); $i++) {
if ($exons[$i][0] - $mergedExon[1] > 1/$scale){
if ($exons[$i][1] - $mergedExon[2] > 1/$scale){
array_push($resArray, $mergedExon);
$mergedExon[0] = $exons[$i][0];
$mergedExon[1] = $exons[$i][1];
$mergedExon[2] = $exons[$i][2];
}
else{
if ($exons[$i][1] > $mergedExon[1]){
$mergedExon[1] = $exons[$i][1];
if ($exons[$i][2] > $mergedExon[2]){
$mergedExon[2] = $exons[$i][2];
}
}
}
$LastElement = end($resArray);
reset($resArray);
if ($mergedExon[1] != $LastElement[1] || count($resArray) == 0){
if ($mergedExon[2] != $LastElement[2] || count($resArray) == 0){
array_push($resArray, $mergedExon);
}
@@ -179,35 +179,35 @@ function mergeExons($geneStart, $geneEnd, $Exstart, $Exend, $start,$end, $scale)
if ($geneEnd-$geneStart < 1/$scale){
return [[$ExStartArray[0],max($ExEndArray)]];
return [["", $ExStartArray[0],max($ExEndArray)]];
}
else{
$resArray = [];
if(count($ExStartArray) > 1){
$mergedExon = [$ExStartArray[0],$ExEndArray[0]];
$mergedExon = ["", $ExStartArray[0],$ExEndArray[0]];
for ($i=1; $i < count($ExStartArray); $i++) {
if ($ExStartArray[$i] - $ExEndArray[$i-1] > 1/$scale){
array_push($resArray, $mergedExon);
$mergedExon[0] = $ExStartArray[$i];
$mergedExon[1] = $ExEndArray[$i];
$mergedExon[1] = $ExStartArray[$i];
$mergedExon[2] = $ExEndArray[$i];
}
else{
if ($ExEndArray[$i] > $ExEndArray[$i-1]){
$mergedExon[1] = $ExEndArray[$i];
$mergedExon[2] = $ExEndArray[$i];
}
}
}
$LastElement = end($resArray);
reset($resArray);
if ($mergedExon[1] != $LastElement[1]){
if ($mergedExon[2] != $LastElement[2]){
array_push($resArray, $mergedExon);
}
}
else{
array_push($resArray, [$ExStartArray[0],$ExEndArray[0]]);
array_push($resArray, ["", $ExStartArray[0],$ExEndArray[0]]);
}
return $resArray;

0 comments on commit 04490e9

Please sign in to comment.
You can’t perform that action at this time.