Commits

Kanwei Li  committed 15ace61

trackster: Fix border and error not lining up at right place

  • Participants
  • Parent commits d427df9

Comments (0)

Files changed (2)

File lib/galaxy/visualization/tracks/data_providers.py

 from pysam import csamtools, ctabix
 
 MAX_VALS = 5000 # only display first MAX_VALS features
-ERROR_MAX_VALS = "Only the first " + str(MAX_VALS) + " %s in this tile are displayed."
+ERROR_MAX_VALS = "Only the first " + str(MAX_VALS) + " %s in the region denoted by the red line are displayed."
 
 # Return None instead of NaN to pass jQuery 1.4's strict JSON
 def float_nan(n):

File static/scripts/trackster.js

                 var data = result.data;
                 // if ( (data.length && data.length < 4) ||
                 //      (this.view.high - this.view.low > MIN_SQUISH_VIEW_WIDTH) ) {
-		        if ( this.view.high - this.view.low > MIN_SQUISH_VIEW_WIDTH ) {
+                if ( this.view.high - this.view.low > MIN_SQUISH_VIEW_WIDTH ) {
                     mode = "Squish";
                 } else {
                     mode = "Pack";
         // If there is a message, draw it on canvas so that it moves around with canvas, and make the border red
         // to indicate region where message is applicable
         if (result.message) {
-            $(canvas).css({
-                "border-top": "1px solid red"
-            });
-
             ctx.fillStyle = "red";
             ctx.textAlign = "left";
             var old_base = ctx.textBaseline;
             ctx.textBaseline = "top";
-            ctx.fillText(result.message, left_offset, 0);
+            ctx.fillRect(left_offset, 0, canvas.width - left_offset, 1);
+            ctx.fillText(result.message, left_offset, 2);
             ctx.textBaseline = old_base;
 
             // If there's no data, return.