[Pkg-javascript-commits] [flot] 07/08: Updating some files manually

Marcelo Jorge Vieira metal at moszumanska.debian.org
Mon Nov 24 12:15:02 UTC 2014


This is an automated email from the git hooks/post-receive script.

metal pushed a commit to branch master
in repository flot.

commit e3e30bceac6563ab1720f4cd0ca52b690c4bba44
Author: Marcelo Jorge Vieira <metal at alucinados.com>
Date:   Mon Nov 24 10:05:39 2014 -0200

    Updating some files manually
---
 debian/jquery.flot.js          | 101 +++++++++++++++++++++++++++--------------
 debian/jquery.flot.navigate.js |   6 +--
 debian/jquery.flot.resize.js   |   2 +-
 3 files changed, 70 insertions(+), 39 deletions(-)

diff --git a/debian/jquery.flot.js b/debian/jquery.flot.js
index 2bcb66e..cd2cfe7 100644
--- a/debian/jquery.flot.js
+++ b/debian/jquery.flot.js
@@ -1,6 +1,6 @@
-/* Javascript plotting library for jQuery, version 0.8.2.
+/* Javascript plotting library for jQuery, version 0.8.3.
 
-Copyright (c) 2007-2013 IOLA and Ole Laursen.
+Copyright (c) 2007-2014 IOLA and Ole Laursen.
 Licensed under the MIT license.
 
 */
@@ -12,6 +12,22 @@ Licensed under the MIT license.
 
 	var hasOwnProperty = Object.prototype.hasOwnProperty;
 
+    // A shim to provide 'detach' to jQuery versions prior to 1.4.  Using a DOM
+    // operation produces the same effect as detach, i.e. removing the element
+    // without touching its jQuery data.
+
+    // Do not merge this into Flot 0.9, since it requires jQuery 1.4.4+.
+
+    if (!$.fn.detach) {
+        $.fn.detach = function() {
+            return this.each(function() {
+                if (this.parentNode) {
+                    this.parentNode.removeChild( this );
+                }
+            });
+        };
+    }
+
 	///////////////////////////////////////////////////////////////////////////
 	// The Canvas object is a wrapper around an HTML5 <canvas> tag.
 	//
@@ -788,10 +804,24 @@ Licensed under the MIT license.
             if (options.x2axis) {
                 options.xaxes[1] = $.extend(true, {}, options.xaxis, options.x2axis);
                 options.xaxes[1].position = "top";
+                // Override the inherit to allow the axis to auto-scale
+                if (options.x2axis.min == null) {
+                    options.xaxes[1].min = null;
+                }
+                if (options.x2axis.max == null) {
+                    options.xaxes[1].max = null;
+                }
             }
             if (options.y2axis) {
                 options.yaxes[1] = $.extend(true, {}, options.yaxis, options.y2axis);
                 options.yaxes[1].position = "right";
+                // Override the inherit to allow the axis to auto-scale
+                if (options.y2axis.min == null) {
+                    options.yaxes[1].min = null;
+                }
+                if (options.y2axis.max == null) {
+                    options.yaxes[1].max = null;
+                }
             }
             if (options.grid.coloredAreas)
                 options.grid.markings = options.grid.coloredAreas;
@@ -1390,7 +1420,7 @@ Licensed under the MIT license.
             // Determine the axis's position in its direction and on its side
 
             $.each(isXAxis ? xaxes : yaxes, function(i, a) {
-                if (a && a.reserveSpace) {
+                if (a && (a.show || a.reserveSpace)) {
                     if (a === axis) {
                         found = true;
                     } else if (a.options.position === pos) {
@@ -1494,17 +1524,12 @@ Licensed under the MIT license.
             // jump as much around with replots
             $.each(allAxes(), function (_, axis) {
                 if (axis.reserveSpace && axis.ticks && axis.ticks.length) {
-                    var lastTick = axis.ticks[axis.ticks.length - 1];
                     if (axis.direction === "x") {
                         margins.left = Math.max(margins.left, axis.labelWidth / 2);
-                        if (lastTick.v <= axis.max) {
-                            margins.right = Math.max(margins.right, axis.labelWidth / 2);
-                        }
+                        margins.right = Math.max(margins.right, axis.labelWidth / 2);
                     } else {
                         margins.bottom = Math.max(margins.bottom, axis.labelHeight / 2);
-                        if (lastTick.v <= axis.max) {
-                            margins.top = Math.max(margins.top, axis.labelHeight / 2);
-                        }
+                        margins.top = Math.max(margins.top, axis.labelHeight / 2);
                     }
                 }
             });
@@ -1538,20 +1563,18 @@ Licensed under the MIT license.
                 }
             }
 
-            // init axes
             $.each(axes, function (_, axis) {
-                axis.show = axis.options.show;
-                if (axis.show == null)
-                    axis.show = axis.used; // by default an axis is visible if it's got data
-
-                axis.reserveSpace = axis.show || axis.options.reserveSpace;
-
+                var axisOpts = axis.options;
+                axis.show = axisOpts.show == null ? axis.used : axisOpts.show;
+                axis.reserveSpace = axisOpts.reserveSpace == null ? axis.show : axisOpts.reserveSpace;
                 setRange(axis);
             });
 
             if (showGrid) {
 
-                var allocatedAxes = $.grep(axes, function (axis) { return axis.reserveSpace; });
+                var allocatedAxes = $.grep(axes, function (axis) {
+                    return axis.show || axis.reserveSpace;
+                });
 
                 $.each(allocatedAxes, function (_, axis) {
                     // make the ticks
@@ -1680,8 +1703,8 @@ Licensed under the MIT license.
             axis.tickDecimals = Math.max(0, maxDec != null ? maxDec : dec);
             axis.tickSize = opts.tickSize || size;
 
-            // Time mode was moved to a plug-in in 0.8, but since so many people use this
-            // we'll add an especially friendly make sure they remembered to include it.
+            // Time mode was moved to a plug-in in 0.8, and since so many people use it
+            // we'll add an especially friendly reminder to make sure they included it.
 
             if (opts.mode == "time" && !axis.tickGenerator) {
                 throw new Error("Time mode requires the flot.time plugin.");
@@ -1937,26 +1960,34 @@ Licensed under the MIT license.
                     yrange.from = Math.max(yrange.from, yrange.axis.min);
                     yrange.to = Math.min(yrange.to, yrange.axis.max);
 
-                    if (xrange.from == xrange.to && yrange.from == yrange.to)
+                    var xequal = xrange.from === xrange.to,
+                        yequal = yrange.from === yrange.to;
+
+                    if (xequal && yequal) {
                         continue;
+                    }
 
                     // then draw
-                    xrange.from = xrange.axis.p2c(xrange.from);
-                    xrange.to = xrange.axis.p2c(xrange.to);
-                    yrange.from = yrange.axis.p2c(yrange.from);
-                    yrange.to = yrange.axis.p2c(yrange.to);
-
-                    if (xrange.from == xrange.to || yrange.from == yrange.to) {
-                        // draw line
+                    xrange.from = Math.floor(xrange.axis.p2c(xrange.from));
+                    xrange.to = Math.floor(xrange.axis.p2c(xrange.to));
+                    yrange.from = Math.floor(yrange.axis.p2c(yrange.from));
+                    yrange.to = Math.floor(yrange.axis.p2c(yrange.to));
+
+                    if (xequal || yequal) {
+                        var lineWidth = m.lineWidth || options.grid.markingsLineWidth,
+                            subPixel = lineWidth % 2 ? 0.5 : 0;
                         ctx.beginPath();
                         ctx.strokeStyle = m.color || options.grid.markingsColor;
-                        ctx.lineWidth = m.lineWidth || options.grid.markingsLineWidth;
-                        ctx.moveTo(xrange.from, yrange.from);
-                        ctx.lineTo(xrange.to, yrange.to);
+                        ctx.lineWidth = lineWidth;
+                        if (xequal) {
+                            ctx.moveTo(xrange.to + subPixel, yrange.from);
+                            ctx.lineTo(xrange.to + subPixel, yrange.to);
+                        } else {
+                            ctx.moveTo(xrange.from, yrange.to + subPixel);
+                            ctx.lineTo(xrange.to, yrange.to + subPixel);                            
+                        }
                         ctx.stroke();
-                    }
-                    else {
-                        // fill area
+                    } else {
                         ctx.fillStyle = m.color || options.grid.markingsColor;
                         ctx.fillRect(xrange.from, yrange.to,
                                      xrange.to - xrange.from,
@@ -3091,7 +3122,7 @@ Licensed under the MIT license.
         return plot;
     };
 
-    $.plot.version = "0.8.2";
+    $.plot.version = "0.8.3";
 
     $.plot.plugins = [];
 
diff --git a/debian/jquery.flot.navigate.js b/debian/jquery.flot.navigate.js
index afa9a3e..4be7b12 100644
--- a/debian/jquery.flot.navigate.js
+++ b/debian/jquery.flot.navigate.js
@@ -1,6 +1,6 @@
 /* Flot plugin for adding the ability to pan and zoom the plot.
 
-Copyright (c) 2007-2013 IOLA and Ole Laursen.
+Copyright (c) 2007-2014 IOLA and Ole Laursen.
 Licensed under the MIT license.
 
 The default behaviour is double click and scrollwheel up/down to zoom in, drag
@@ -234,8 +234,8 @@ can set the default in the options.
 
                 var range = max - min;
                 if (zr &&
-                    ((zr[0] != null && range < zr[0]) ||
-                     (zr[1] != null && range > zr[1])))
+                    ((zr[0] != null && range < zr[0] && amount >1) ||
+                     (zr[1] != null && range > zr[1] && amount <1)))
                     return;
             
                 opts.min = min;
diff --git a/debian/jquery.flot.resize.js b/debian/jquery.flot.resize.js
index 2fa46cf..478b624 100644
--- a/debian/jquery.flot.resize.js
+++ b/debian/jquery.flot.resize.js
@@ -1,6 +1,6 @@
 /* Flot plugin for automatically redrawing plots as the placeholder resizes.
 
-Copyright (c) 2007-2013 IOLA and Ole Laursen.
+Copyright (c) 2007-2014 IOLA and Ole Laursen.
 Licensed under the MIT license.
 
 It works by listening for changes on the placeholder div (through the jQuery

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/flot.git



More information about the Pkg-javascript-commits mailing list