[Pkg-javascript-commits] [flot] 01/05: Imported Upstream version 0.8.2+dfsg

Marcelo Jorge Vieira metal at moszumanska.debian.org
Sun Feb 9 20:47:39 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 32fb0fbf278fd235cca92d5744eb70c07a745274
Author: Marcelo Jorge Vieira <metal at alucinados.com>
Date:   Sun Feb 9 16:08:36 2014 -0200

    Imported Upstream version 0.8.2+dfsg
---
 API.md                          | 40 +++++++++++++++++--
 CONTRIBUTING.md                 | 67 ++++++++++++++++----------------
 NEWS.md                         | 85 +++++++++++++++++++++++++++++++++++++++++
 README.md                       |  2 +-
 component.json                  |  2 +-
 examples/interacting/index.html | 42 ++++++++------------
 flot.jquery.json                |  2 +-
 jquery.colorhelpers.js          |  5 ++-
 jquery.flot.pie.js              | 12 +++---
 package.json                    |  2 +-
 10 files changed, 183 insertions(+), 76 deletions(-)

diff --git a/API.md b/API.md
index 5027b51..e08b44c 100644
--- a/API.md
+++ b/API.md
@@ -1,5 +1,26 @@
 # Flot Reference #
 
+**Table of Contents**
+
+[Introduction](#introduction)
+| [Data Format](#data-format)
+| [Plot Options](#plot-options)
+| [Customizing the legend](#customizing-the-legend)
+| [Customizing the axes](#customizing-the-axes)
+| [Multiple axes](#multiple-axes)
+| [Time series data](#time-series-data)
+| [Customizing the data series](#customizing-the-data-series)
+| [Customizing the grid](#customizing-the-grid)
+| [Specifying gradients](#specifying-gradients)
+| [Plot Methods](#plot-methods)
+| [Hooks](#hooks)
+| [Plugins](#plugins)
+| [Version number](#version-number)
+
+---
+
+## Introduction ##
+
 Consider a call to the plot function:
 
 ```js
@@ -523,7 +544,7 @@ You can see a timestamp like this
 alert((new Date()).getTime())
 ```
 
-There are different schools of thought when it comes to diplay of
+There are different schools of thought when it comes to display of
 timestamps. Many will want the timestamps to be displayed according to
 a certain time zone, usually the time zone in which the data has been
 produced. Some want the localized experience, where the timestamps are
@@ -553,6 +574,19 @@ In Python you can get it with something like:
 ```python
 calendar.timegm(datetime_object.timetuple()) * 1000
 ```
+In Ruby you can get it using the `#to_i` method on the
+[`Time`](http://apidock.com/ruby/Time/to_i) object. If you're using the
+`active_support` gem (default for Ruby on Rails applications) `#to_i` is also
+available on the `DateTime` and `ActiveSupport::TimeWithZone` objects. You
+simply need to multiply the result by 1000:
+
+```ruby
+Time.now.to_i * 1000     # => 1383582043000
+# ActiveSupport examples:
+DateTime.now.to_i * 1000 # => 1383582043000
+ActiveSupport::TimeZone.new('Asia/Shanghai').now.to_i * 1000
+# => 1383582043000
+```
 
 In .NET you can get it with something like:
 
@@ -1433,7 +1467,7 @@ hooks in the plugins bundled with Flot.
     case a plot is overwritten by a new plot. If you're writing a
     plugin that adds extra DOM elements or event handlers, you should
     add a callback to clean up after you. Take a look at the section in
-    PLUGINS.txt for more info.
+    the [PLUGINS](PLUGINS.md) document for more info.
 
    
 ## Plugins ##
@@ -1455,7 +1489,7 @@ from the "option" attribute of the plugin. The init function gets a
 reference to the plot object created and uses this to register hooks
 and add new public methods if needed.
 
-See the PLUGINS.txt file for details on how to write a plugin. As the
+See the [PLUGINS](PLUGINS.md) document for details on how to write a plugin. As the
 above description hints, it's actually pretty easy.
 
 
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index eef971b..3e6e43a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -8,9 +8,8 @@ work for us, and a faster and better response.
 Issues are not a way to ask general questions about Flot. If you see unexpected
 behavior but are not 100% certain that it is a bug, please try posting to the
 [forum](http://groups.google.com/group/flot-graphs) first, and confirm that
-what you see is really a Flot problem before creating a new issue for it.
-
-When reporting a bug, please include a working demonstration of the problem, if
+what you see is really a Flot problem before creating a new issue for it.  When
+reporting a bug, please include a working demonstration of the problem, if
 possible, or at least a clear description of the options you're using and the
 environment (browser and version, jQuery version, other libraries) that you're
 running under.
@@ -21,23 +20,23 @@ love to hear them! Please submit each suggestion as a separate new issue.
 If you would like to work on an existing issue, please make sure it is not
 already assigned to someone else. If an issue is assigned to someone, that
 person has already started working on it. So, pick unassigned issues to prevent
-duplicated efforts.
+duplicated effort.
 
 ### Pull Requests ###
 
 To make merging as easy as possible, please keep these rules in mind:
 
- 1. Divide larger changes into a series of small, logical commits with
-	descriptive messages.
-
- 2. Format your code according to the style guidelines below.
+ 1. Submit new features or architectural changes to the *<version>-work*
+    branch for the next major release.  Submit bug fixes to the master branch.
 
- 3. Submit new features or architectural changes to the <version>-work branch
-    for the next major release.  Submit bug fixes to the master branch.
+ 2. Divide larger changes into a series of small, logical commits with
+    descriptive messages.
 
- 4. Rebase, if necessary, before submitting your pull request, to reduce the
+ 3. Rebase, if necessary, before submitting your pull request, to reduce the
     work we need to do to merge it.
 
+ 4. Format your code according to the style guidelines below.
+
 ### Flot Style Guidelines ###
 
 Flot follows the [jQuery Core Style Guidelines](http://docs.jquery.com/JQuery_Core_Style_Guidelines),
@@ -45,38 +44,38 @@ with the following updates and exceptions:
 
 #### Spacing ####
 
-Do not add horizontal space around parameter lists, loop definitions, or
-array/object indices. For example:
+Use four-space indents, no tabs.  Do not add horizontal space around parameter
+lists, loop definitions, or array/object indices. For example:
 
 ```js
-	for ( var i = 0; i < data.length; i++ ) {	// This block is wrong!
-		if ( data[ i ] > 1 ) {
-			data[ i ] = 2;
-		}
-	}
-
-	for (var i = 0; i < data.length; i++) {		// This block is correct!
-		if (data[i] > 1) {
-			data[i] = 2;
-		}
-	}
+    for ( var i = 0; i < data.length; i++ ) {  // This block is wrong!
+        if ( data[ i ] > 1 ) {
+            data[ i ] = 2;
+        }
+    }
+
+    for (var i = 0; i < data.length; i++) {  // This block is correct!
+        if (data[i] > 1) {
+            data[i] = 2;
+        }
+    }
 ```
 
 #### Comments ####
 
-Use // for all comments except the header at the top of a file or inline
-include.
+Use [jsDoc](http://usejsdoc.org) comments for all file and function headers.
+Use // for all inline and block comments, regardless of length.
 
 All // comment blocks should have an empty line above *and* below them. For
 example:
 
 ```js
-	var a = 5;
+    var a = 5;
 
-	// We're going to loop here
-	// TODO: Make this loop faster, better, stronger!
+    // We're going to loop here
+    // TODO: Make this loop faster, better, stronger!
 
-	for (var x = 0; x < 10; x++) {}
+    for (var x = 0; x < 10; x++) {}
 ```
 
 #### Wrapping ####
@@ -91,9 +90,9 @@ Statements containing complex logic should not be wrapped arbitrarily if they
 do not exceed 80 characters. For example:
 
 ```js
-	if (a == 1 &&		// This block is wrong!
-		b == 2 &&
-		c == 3) {}
+    if (a == 1 &&    // This block is wrong!
+        b == 2 &&
+        c == 3) {}
 
-	if (a == 1 && b == 2 && c == 3) {}		// This block is correct!
+    if (a == 1 && b == 2 && c == 3) {}  // This block is correct!
 ```
diff --git a/NEWS.md b/NEWS.md
index da6ecb4..a99b65e 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,88 @@
+## Flot 0.8.2 ##
+
+### Changes ###
+
+ - Added a plot.destroy method as a way to free memory when emptying the plot
+   placeholder and then re-using it for some other purpose.
+   (patch by Thodoris Greasidis, issue #1129, pull request #1130)
+
+ - Added a table of contents and PLUGINS link to the API documentation.
+   (patches by Brian Peiris, pull requests #1064 and #1127)
+
+ - Added Ruby code examples for time conversion.
+   (patch by Mike Połtyn, pull request #1182)
+
+ - Minor improvements to API.md and README.md.
+   (patches by Patrik Ragnarsson, pull requests #1085 and #1086)
+
+ - Updated inlined jQuery Resize to the latest version to fix errors.
+   (reported by Matthew Sabol and sloker, issues #997 ad #1081)
+
+### Bug fixes ###
+
+ - Fixed an unexpected change in behavior that resulted in duplicate tick
+   labels when using a plugin, like flot-tickrotor, that overrode tick labels.
+   (patch by Mark Cote, pull request #1091)
+
+ - Fixed a regression from 0.7 where axis labels were given the wrong width,
+   causing them to overlap at certain scales and ignore the labelWidth option.
+   (patch by Benjamin Gram, pull request #1177)
+
+ - Fixed a bug where the second axis in an xaxes/yaxes array incorrectly had
+   its 'innermost' property set to false or undefined, even if it was on the
+   other side of the plot from the first axis. This resulted in the axis bar
+   being visible when it shouldn't have been, which was especially obvious
+   when the grid had a left/right border width of zero.
+   (reported by Teq1, fix researched by ryleyb, issue #1056)
+
+ - Fixed an error when using a placeholder that has no font-size property.
+   (patch by Craig Oldford, pull request #1135)
+
+ - Fixed a regression from 0.7 where nulls at the end of a series were ignored
+   for purposes of determing the range of the x-axis.
+   (reported by Munsifali Rashid, issue #1095)
+
+ - If a font size is provided, base the default lineHeight on that size rather
+   that the font size of the plot placeholder, which may be very different.
+   (reported by Daniel Hoffmann Bernardes, issue #1131, pull request #1199)
+
+ - Fix broken highlighting for right-aligned bars.
+   (reported by BeWiBu and Mihai Stanciu, issues #975 and #1093, with further
+   assistance by Eric Byers, pull request #1120)
+
+ - Prevent white circles from sometimes showing up inside of pie charts.
+   (reported by Pierre Dubois and Jack Klink, issues #1128 and #1073)
+
+ - Label formatting no longer breaks when a page contains multiple pie charts.
+   (reported by Brend Wanders, issue #1055)
+
+ - When using multiple axes on opposite sides of the plot, the innermost axis
+   coming later in the list no longer has its bar drawn incorrectly.
+   (reported by ryleyb, issue #1056)
+
+ - When removing series labels and redrawing the plot, the legend now updates
+   correctly even when using an external container.
+   (patch by Luis Silva, issue #1159, pull request #1160)
+
+ - The pie plugin no longer ignores the value of the left offset option.
+   (reported by melanker, issue #1136)
+
+ - Fixed a regression from 0.7, where extra padding was added unnecessarily to
+   sides of the plot where there was no last tick label.
+   (reported by sknob001, issue #1048, pull request #1200)
+
+ - Fixed incorrect tooltip behavior in the interacting example.
+   (patch by cleroux, issue #686, pull request #1074)
+
+ - Fixed an error in CSS color extraction with elements outside the DOM.
+   (patch by execjosh, pull request #1084)
+
+ - Fixed :not selector error when using jQuery without Sizzle.
+   (patch by Anthony Ryan, pull request #1180)
+
+ - Worked around a browser issue that caused bars to appear un-filled.
+   (reported by irbian, issue #915)
+
 ## Flot 0.8.1 ##
 
 ### Bug fixes ###
diff --git a/README.md b/README.md
index 4de7bde..a8f7064 100644
--- a/README.md
+++ b/README.md
@@ -107,4 +107,4 @@ examples/axes-time-zones/index.html.
 [excanvas]: http://code.google.com/p/explorercanvas/
 [flashcanvas]: http://code.google.com/p/flashcanvas/
 [timezone-js]: https://github.com/mde/timezone-js
-[olson]: ftp://ftp.iana.org/tz/
+[olson]: http://ftp.iana.org/time-zones
diff --git a/component.json b/component.json
index 6f1dbb5..f3dabc5 100644
--- a/component.json
+++ b/component.json
@@ -1,6 +1,6 @@
 {
 	"name": "Flot",
-	"version": "0.8.1",
+	"version": "0.8.2",
 	"main": "jquery.flot.js",
 	"dependencies": {
 		"jquery": ">= 1.2.6"
diff --git a/examples/interacting/index.html b/examples/interacting/index.html
index 19136df..982aa2f 100644
--- a/examples/interacting/index.html
+++ b/examples/interacting/index.html
@@ -41,20 +41,15 @@
 			}
 		});
 
-		function showTooltip(x, y, contents) {
-			$("<div id='tooltip'>" + contents + "</div>").css({
-				position: "absolute",
-				display: "none",
-				top: y + 5,
-				left: x + 5,
-				border: "1px solid #fdd",
-				padding: "2px",
-				"background-color": "#fee",
-				opacity: 0.80
-			}).appendTo("body").fadeIn(200);
-		}
+		$("<div id='tooltip'></div>").css({
+			position: "absolute",
+			display: "none",
+			border: "1px solid #fdd",
+			padding: "2px",
+			"background-color": "#fee",
+			opacity: 0.80
+		}).appendTo("body");
 
-		var previousPoint = null;
 		$("#placeholder").bind("plothover", function (event, pos, item) {
 
 			if ($("#enablePosition:checked").length > 0) {
@@ -64,20 +59,14 @@
 
 			if ($("#enableTooltip:checked").length > 0) {
 				if (item) {
-					if (previousPoint != item.dataIndex) {
-
-						previousPoint = item.dataIndex;
-
-						$("#tooltip").remove();
-						var x = item.datapoint[0].toFixed(2),
+					var x = item.datapoint[0].toFixed(2),
 						y = item.datapoint[1].toFixed(2);
 
-						showTooltip(item.pageX, item.pageY,
-						    item.series.label + " of " + x + " = " + y);
-					}
+					$("#tooltip").html(item.series.label + " of " + x + " = " + y)
+						.css({top: item.pageY+5, left: item.pageX+5})
+						.fadeIn(200);
 				} else {
-					$("#tooltip").remove();
-					previousPoint = null;            
+					$("#tooltip").hide();
 				}
 			}
 		});
@@ -97,7 +86,6 @@
 	</script>
 </head>
 <body>
-
 	<div id="header">
 		<h2>Interactivity</h2>
 	</div>
@@ -111,14 +99,14 @@
 		<p>One of the goals of Flot is to support user interactions. Try pointing and clicking on the points.</p>
 
 		<p>
-			<label><input id="enablePosition" type="checkbox"></input>Show mouse position</label>
+			<label><input id="enablePosition" type="checkbox" checked="checked"></input>Show mouse position</label>
 			<span id="hoverdata"></span>
 			<span id="clickdata"></span>
 		</p>
 
 		<p>A tooltip is easy to build with a bit of jQuery code and the data returned from the plot.</p>
 
-		<p><label><input id="enableTooltip" type="checkbox"></input>Enable tooltip</label></p>
+		<p><label><input id="enableTooltip" type="checkbox" checked="checked"></input>Enable tooltip</label></p>
 
 	</div>
 
diff --git a/flot.jquery.json b/flot.jquery.json
index b418f6e..5cf7509 100644
--- a/flot.jquery.json
+++ b/flot.jquery.json
@@ -1,6 +1,6 @@
 {
 	"name": "flot",
-	"version": "0.8.1",
+	"version": "0.8.2",
 	"title": "Flot",
 	"author": {
 		"name": "Ole Laursen",
diff --git a/jquery.colorhelpers.js b/jquery.colorhelpers.js
index d3524d7..b2f6dc4 100644
--- a/jquery.colorhelpers.js
+++ b/jquery.colorhelpers.js
@@ -74,14 +74,15 @@
     // if it's "transparent"
     $.color.extract = function (elem, css) {
         var c;
+
         do {
             c = elem.css(css).toLowerCase();
             // keep going until we find an element that has color, or
-            // we hit the body
+            // we hit the body or root (have no parent)
             if (c != '' && c != 'transparent')
                 break;
             elem = elem.parent();
-        } while (!$.nodeName(elem.get(0), "body"));
+        } while (elem.length && !$.nodeName(elem.get(0), "body"));
 
         // catch Safari's way of signalling transparent
         if (c == "rgba(0, 0, 0, 0)")
diff --git a/jquery.flot.pie.js b/jquery.flot.pie.js
index 6553c8e..9915863 100644
--- a/jquery.flot.pie.js
+++ b/jquery.flot.pie.js
@@ -69,6 +69,7 @@ More detail and specific examples can be found in the included HTML file.
 
 		var canvas = null,
 			target = null,
+			options = null,
 			maxRadius = null,
 			centerLeft = null,
 			centerTop = null,
@@ -293,16 +294,15 @@ More detail and specific examples can be found in the included HTML file.
 				} else {
 					centerLeft -= legendWidth / 2;
 				}
+				if (centerLeft < maxRadius) {
+					centerLeft = maxRadius;
+				} else if (centerLeft > canvasWidth - maxRadius) {
+					centerLeft = canvasWidth - maxRadius;
+				}
 			} else {
 				centerLeft += options.series.pie.offset.left;
 			}
 
-			if (centerLeft < maxRadius) {
-				centerLeft = maxRadius;
-			} else if (centerLeft > canvasWidth - maxRadius) {
-				centerLeft = canvasWidth - maxRadius;
-			}
-
 			var slices = plot.getData(),
 				attempts = 0;
 
diff --git a/package.json b/package.json
index 09a1032..023af9f 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
 	"name": "Flot",
-	"version": "0.8.1",
+	"version": "0.8.2",
 	"main": "jquery.flot.js",
 	"scripts": {
 		"test": "make test"

-- 
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