Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Lag reduced when zooming
  • Loading branch information
csw11004 committed Aug 10, 2015
1 parent 6fa59af commit dc3f36b
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions VQI_GenomeBrowser.js
Expand Up @@ -849,9 +849,18 @@ function VQI_GenomeBrowser(id, serviceURL) {
var offset = type == "cpg" ? -20 : type == "shore" ? -10 : -7.5; var offset = type == "cpg" ? -20 : type == "shore" ? -10 : -7.5;
return offset;//height / 2 + margin + offset return offset;//height / 2 + margin + offset
}) })
.each(function(d){
addTooltip($(this), name, d[indexArray.type]); addTooltip($(trackScalableGroup.selectAll("rect")
}) .filter(function (d) {
return d[indexArray.type] == "cpg";})[0]), name, "cpg");

addTooltip($(trackScalableGroup.selectAll("rect")
.filter(function (d) {
return d[indexArray.type] == "shore";})[0]), name, "shore");

addTooltip($(trackScalableGroup.selectAll("rect")
.filter(function (d) {
return d[indexArray.type] == "shelve";})[0]), name, "shelve");
} }


var addBEDTrack = function (data, name, exons) { var addBEDTrack = function (data, name, exons) {
Expand Down Expand Up @@ -911,9 +920,10 @@ function VQI_GenomeBrowser(id, serviceURL) {
}) })
.style("vector-effect", "non-scaling-stroke") .style("vector-effect", "non-scaling-stroke")
.attr("class", "scalable") .attr("class", "scalable")
.each(function(d){
addTooltip($(this), name, "gene") addTooltip($(trackScalableGroup.selectAll("rect")
}) .data(data, function (d) {
return d;})[0]), name, "gene")


if (exons) if (exons)
{ {
Expand Down Expand Up @@ -947,9 +957,11 @@ function VQI_GenomeBrowser(id, serviceURL) {
.style("fill", "black") .style("fill", "black")
.style("vector-effect", "non-scaling-stroke") .style("vector-effect", "non-scaling-stroke")
.attr("class", "scalable") .attr("class", "scalable")
.each(function(d){
addTooltip($(this), name, "exon") addTooltip($(trackScalableGroup.selectAll("rect")
}) .data(exons, function (d) {
return d;})[0]), name, "exon")

} }
} }


Expand Down

0 comments on commit dc3f36b

Please sign in to comment.