@kevinburke/flot 5.1.2 → 5.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- /*! @kevinburke/flot v5.1.2 | MIT License | https://github.com/kevinburke/flot */
1
+ /*! @kevinburke/flot v5.1.4 | MIT License | https://github.com/kevinburke/flot */
2
2
  (function (jquery_flot_js, helpers_js) {
3
3
  'use strict';
4
4
 
@@ -204,4 +204,4 @@
204
204
  version: '1.0'
205
205
  });
206
206
 
207
- })(jquery_flot_js, helpers_js);
207
+ })(Flot, Flot.helpers);
@@ -1,2 +1,2 @@
1
- !function(e,t){"use strict";e.plugins.push({init:function(e){var i={x:-1,y:-1,locked:!1,highlighted:!1};function o(t){i.locked||-1!==i.x&&(i.x=-1,e.triggerRedrawOverlay())}function r(t){var o=e.offset();if(i.locked){var r=Math.max(0,Math.min(t.pageX-o.left,e.width())),h=Math.max(0,Math.min(t.pageY-o.top,e.height()));r>i.x-4&&r<i.x+4&&h>i.y-4&&h<i.y+4?i.highlighted||(i.highlighted=!0,e.triggerRedrawOverlay()):i.highlighted&&(i.highlighted=!1,e.triggerRedrawOverlay())}else e.getSelection&&e.getSelection()?i.x=-1:(i.x=Math.max(0,Math.min(t.pageX-o.left,e.width())),i.y=Math.max(0,Math.min(t.pageY-o.top,e.height())),e.triggerRedrawOverlay())}e.setCrosshair=function(t){if(t){var o=e.p2c(t);i.x=Math.max(0,Math.min(o.left,e.width())),i.y=Math.max(0,Math.min(o.top,e.height()))}else i.x=-1;e.triggerRedrawOverlay()},e.clearCrosshair=e.setCrosshair,e.lockCrosshair=function(t){t&&e.setCrosshair(t),i.locked=!0},e.unlockCrosshair=function(){i.locked=!1,i.rect=null},e.hooks.bindEvents.push(function(e,i){e.getOptions().crosshair.mode&&(t.bind(i,"mouseout",o),t.bind(i,"mousemove",r))}),e.hooks.drawOverlay.push(function(e,t){var o=e.getOptions().crosshair;if(o.mode){var r=e.getPlotOffset();if(t.save(),t.translate(r.left,r.top),-1!==i.x){var h=e.getOptions().crosshair.lineWidth%2?.5:0;if(t.strokeStyle=o.color,t.lineWidth=o.lineWidth,t.lineJoin="round",t.beginPath(),-1!==o.mode.indexOf("x")){var a=Math.floor(i.x)+h;t.moveTo(a,0),t.lineTo(a,e.height())}if(-1!==o.mode.indexOf("y")){var n=Math.floor(i.y)+h;t.moveTo(0,n),t.lineTo(e.width(),n)}i.locked&&(i.highlighted?t.fillStyle="orange":t.fillStyle=o.color,t.fillRect(Math.floor(i.x)+h-4,Math.floor(i.y)+h-4,8,8)),t.stroke()}t.restore()}}),e.hooks.shutdown.push(function(e,i){t.unbind(i,"mouseout",o),t.unbind(i,"mousemove",r)})},options:{crosshair:{mode:null,color:"rgba(170, 0, 0, 0.80)",lineWidth:1}},name:"crosshair",version:"1.0"})}(jquery_flot_js,helpers_js);
1
+ !function(e,t){"use strict";e.plugins.push({init:function(e){var i={x:-1,y:-1,locked:!1,highlighted:!1};function o(t){i.locked||-1!==i.x&&(i.x=-1,e.triggerRedrawOverlay())}function r(t){var o=e.offset();if(i.locked){var r=Math.max(0,Math.min(t.pageX-o.left,e.width())),h=Math.max(0,Math.min(t.pageY-o.top,e.height()));r>i.x-4&&r<i.x+4&&h>i.y-4&&h<i.y+4?i.highlighted||(i.highlighted=!0,e.triggerRedrawOverlay()):i.highlighted&&(i.highlighted=!1,e.triggerRedrawOverlay())}else e.getSelection&&e.getSelection()?i.x=-1:(i.x=Math.max(0,Math.min(t.pageX-o.left,e.width())),i.y=Math.max(0,Math.min(t.pageY-o.top,e.height())),e.triggerRedrawOverlay())}e.setCrosshair=function(t){if(t){var o=e.p2c(t);i.x=Math.max(0,Math.min(o.left,e.width())),i.y=Math.max(0,Math.min(o.top,e.height()))}else i.x=-1;e.triggerRedrawOverlay()},e.clearCrosshair=e.setCrosshair,e.lockCrosshair=function(t){t&&e.setCrosshair(t),i.locked=!0},e.unlockCrosshair=function(){i.locked=!1,i.rect=null},e.hooks.bindEvents.push(function(e,i){e.getOptions().crosshair.mode&&(t.bind(i,"mouseout",o),t.bind(i,"mousemove",r))}),e.hooks.drawOverlay.push(function(e,t){var o=e.getOptions().crosshair;if(o.mode){var r=e.getPlotOffset();if(t.save(),t.translate(r.left,r.top),-1!==i.x){var h=e.getOptions().crosshair.lineWidth%2?.5:0;if(t.strokeStyle=o.color,t.lineWidth=o.lineWidth,t.lineJoin="round",t.beginPath(),-1!==o.mode.indexOf("x")){var a=Math.floor(i.x)+h;t.moveTo(a,0),t.lineTo(a,e.height())}if(-1!==o.mode.indexOf("y")){var l=Math.floor(i.y)+h;t.moveTo(0,l),t.lineTo(e.width(),l)}i.locked&&(i.highlighted?t.fillStyle="orange":t.fillStyle=o.color,t.fillRect(Math.floor(i.x)+h-4,Math.floor(i.y)+h-4,8,8)),t.stroke()}t.restore()}}),e.hooks.shutdown.push(function(e,i){t.unbind(i,"mouseout",o),t.unbind(i,"mousemove",r)})},options:{crosshair:{mode:null,color:"rgba(170, 0, 0, 0.80)",lineWidth:1}},name:"crosshair",version:"1.0"})}(Flot,Flot.helpers);
2
2
  //# sourceMappingURL=jquery.flot.crosshair.min.js.map
@@ -1,5 +1,5 @@
1
- /*! @kevinburke/flot v5.1.2 | MIT License | https://github.com/kevinburke/flot */
2
- (function (exports, jquery_flot_js) {
1
+ /*! @kevinburke/flot v5.1.4 | MIT License | https://github.com/kevinburke/flot */
2
+ (function ($, jquery_flot_js) {
3
3
  'use strict';
4
4
 
5
5
  /* Flot plugin for plotting images.
@@ -254,8 +254,8 @@
254
254
  version: '1.1'
255
255
  });
256
256
 
257
- exports.image = image;
257
+ // Expose the image helpers as $.plot.image so example code can call
258
+ // $.plot.image.loadDataImages(...) / $.plot.image.load(...).
259
+ $.plot.image = image;
258
260
 
259
- return exports;
260
-
261
- })({}, jquery_flot_js);
261
+ })(jQuery, Flot);
@@ -1,2 +1,2 @@
1
- !function(a,i){"use strict";var n={};function e(a,i,n){var e=a.getPlotOffset();if(n.images&&n.images.show)for(var o=n.datapoints.points,r=n.datapoints.pointsize,t=0;t<o.length;t+=r){var s,m=o[t],h=o[t+1],u=o[t+2],c=o[t+3],f=o[t+4],g=n.xaxis,p=n.yaxis;if(!(!m||m.width<=0||m.height<=0||(h>c&&(s=c,c=h,h=s),u>f&&(s=f,f=u,u=s),"center"===n.images.anchor&&(h-=s=.5*(c-h)/(m.width-1),c+=s,u-=s=.5*(f-u)/(m.height-1),f+=s),h===c||u===f||h>=g.max||c<=g.min||u>=p.max||f<=p.min))){var l=0,d=0,x=m.width,w=m.height;h<g.min&&(l+=(x-l)*(g.min-h)/(c-h),h=g.min),c>g.max&&(x+=(x-l)*(g.max-c)/(c-h),c=g.max),u<p.min&&(w+=(d-w)*(p.min-u)/(f-u),u=p.min),f>p.max&&(d+=(d-w)*(p.max-f)/(f-u),f=p.max),(h=g.p2c(h))>(c=g.p2c(c))&&(s=c,c=h,h=s),(u=p.p2c(u))>(f=p.p2c(f))&&(s=f,f=u,u=s),s=i.globalAlpha,i.globalAlpha*=n.images.alpha,i.drawImage(m,l,d,x-l,w-d,h+e.left,u+e.top,c-h,f-u),i.globalAlpha=s}}}function o(a,i,n,e){i.images.show&&(e.format=[{required:!0},{x:!0,number:!0,required:!0},{y:!0,number:!0,required:!0},{x:!0,number:!0,required:!0},{y:!0,number:!0,required:!0}])}n.loadDataImages=function(a,i,e){var o=[],r=[],t=i.series.images.show;a.forEach(function(a){(t||a.images.show)&&(a.data&&(a=a.data),a.forEach(function(a){"string"==typeof a[0]&&(o.push(a[0]),r.push(a))}))}),n.load(o,function(a){r.forEach(function(i){var n=i[0];a[n]&&(i[0]=a[n])}),e()})},n.load=function(a,i){var n=a.length,e={};0===n&&i({}),a.forEach(function(a){var o=function(){--n,e[a]=this,0===n&&i(e)},r=document.createElement("img");r.onload=o,r.onerror=o,r.src=a})},i.plugins.push({init:function(a){a.hooks.processRawData.push(o),a.hooks.drawSeries.push(e)},options:{series:{images:{show:!1,alpha:1,anchor:"corner"}}},name:"image",version:"1.1"})}(0,jquery_flot_js);
1
+ !function(a,i){"use strict";var e={};function n(a,i,e){var n=a.getPlotOffset();if(e.images&&e.images.show)for(var o=e.datapoints.points,r=e.datapoints.pointsize,t=0;t<o.length;t+=r){var s,m=o[t],h=o[t+1],u=o[t+2],c=o[t+3],f=o[t+4],g=e.xaxis,p=e.yaxis;if(!(!m||m.width<=0||m.height<=0||(h>c&&(s=c,c=h,h=s),u>f&&(s=f,f=u,u=s),"center"===e.images.anchor&&(h-=s=.5*(c-h)/(m.width-1),c+=s,u-=s=.5*(f-u)/(m.height-1),f+=s),h===c||u===f||h>=g.max||c<=g.min||u>=p.max||f<=p.min))){var l=0,d=0,x=m.width,w=m.height;h<g.min&&(l+=(x-l)*(g.min-h)/(c-h),h=g.min),c>g.max&&(x+=(x-l)*(g.max-c)/(c-h),c=g.max),u<p.min&&(w+=(d-w)*(p.min-u)/(f-u),u=p.min),f>p.max&&(d+=(d-w)*(p.max-f)/(f-u),f=p.max),(h=g.p2c(h))>(c=g.p2c(c))&&(s=c,c=h,h=s),(u=p.p2c(u))>(f=p.p2c(f))&&(s=f,f=u,u=s),s=i.globalAlpha,i.globalAlpha*=e.images.alpha,i.drawImage(m,l,d,x-l,w-d,h+n.left,u+n.top,c-h,f-u),i.globalAlpha=s}}}function o(a,i,e,n){i.images.show&&(n.format=[{required:!0},{x:!0,number:!0,required:!0},{y:!0,number:!0,required:!0},{x:!0,number:!0,required:!0},{y:!0,number:!0,required:!0}])}e.loadDataImages=function(a,i,n){var o=[],r=[],t=i.series.images.show;a.forEach(function(a){(t||a.images.show)&&(a.data&&(a=a.data),a.forEach(function(a){"string"==typeof a[0]&&(o.push(a[0]),r.push(a))}))}),e.load(o,function(a){r.forEach(function(i){var e=i[0];a[e]&&(i[0]=a[e])}),n()})},e.load=function(a,i){var e=a.length,n={};0===e&&i({}),a.forEach(function(a){var o=function(){--e,n[a]=this,0===e&&i(n)},r=document.createElement("img");r.onload=o,r.onerror=o,r.src=a})},i.plugins.push({init:function(a){a.hooks.processRawData.push(o),a.hooks.drawSeries.push(n)},options:{series:{images:{show:!1,alpha:1,anchor:"corner"}}},name:"image",version:"1.1"}),a.plot.image=e}(jQuery,Flot);
2
2
  //# sourceMappingURL=jquery.flot.image.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"jquery.flot.image.min.js","sources":["../../source/jquery.flot.image.js"],"sourcesContent":["/* Flot plugin for plotting images.\n\nCopyright (c) 2007-2014 IOLA and Ole Laursen.\nLicensed under the MIT license.\n\nThe data syntax is [ [ image, x1, y1, x2, y2 ], ... ] where (x1, y1) and\n(x2, y2) are where you intend the two opposite corners of the image to end up\nin the plot. Image must be a fully loaded Javascript image (you can make one\nwith new Image()). If the image is not complete, it's skipped when plotting.\n\nThere are two helpers included for retrieving images. The easiest work the way\nthat you put in URLs instead of images in the data, like this:\n\n [ \"myimage.png\", 0, 0, 10, 10 ]\n\nThen call $.plot.image.loadData( data, options, callback ) where data and\noptions are the same as you pass in to $.plot. This loads the images, replaces\nthe URLs in the data with the corresponding images and calls \"callback\" when\nall images are loaded (or failed loading). In the callback, you can then call\n$.plot with the data set. See the included example.\n\nA more low-level helper, $.plot.image.load(urls, callback) is also included.\nGiven a list of URLs, it calls callback with an object mapping from URL to\nImage object when all images are loaded or have failed loading.\n\nThe plugin supports these options:\n\n series: {\n images: {\n show: boolean\n anchor: \"corner\" or \"center\"\n alpha: [ 0, 1 ]\n }\n }\n\nThey can be specified for a specific series:\n\n $.plot( $(\"#placeholder\"), [{\n data: [ ... ],\n images: { ... }\n ])\n\nNote that because the data format is different from usual data points, you\ncan't use images with anything else in a specific data series.\n\nSetting \"anchor\" to \"center\" causes the pixels in the image to be anchored at\nthe corner pixel centers inside of at the pixel corners, effectively letting\nhalf a pixel stick out to each side in the plot.\n\nA possible future direction could be support for tiling for large images (like\nGoogle Maps).\n\n*/\n\nimport { plugins } from './jquery.flot.js';\n\n var options = {\n series: {\n images: {\n show: false,\n alpha: 1,\n anchor: \"corner\" // or \"center\"\n }\n }\n };\n\n export var image = {};\n\n image.loadDataImages = function (series, options, callback) {\n var urls = [], points = [];\n\n var defaultShow = options.series.images.show;\n\n series.forEach(function (s) {\n if (!(defaultShow || s.images.show)) {\n return;\n }\n\n if (s.data) {\n s = s.data;\n }\n\n s.forEach(function (p) {\n if (typeof p[0] === \"string\") {\n urls.push(p[0]);\n points.push(p);\n }\n });\n });\n\n image.load(urls, function (loadedImages) {\n points.forEach(function (p) {\n var url = p[0];\n if (loadedImages[url]) {\n p[0] = loadedImages[url];\n }\n });\n\n callback();\n });\n }\n\n image.load = function (urls, callback) {\n var missing = urls.length, loaded = {};\n if (missing === 0) {\n callback({});\n }\n\n urls.forEach(function (url) {\n var handler = function () {\n --missing;\n loaded[url] = this;\n\n if (missing === 0) {\n callback(loaded);\n }\n };\n\n var img = document.createElement('img');\n img.onload = handler;\n img.onerror = handler;\n img.src = url;\n });\n };\n\n function drawSeries(plot, ctx, series) {\n var plotOffset = plot.getPlotOffset();\n\n if (!series.images || !series.images.show) {\n return;\n }\n\n var points = series.datapoints.points,\n ps = series.datapoints.pointsize;\n\n for (var i = 0; i < points.length; i += ps) {\n var img = points[i],\n x1 = points[i + 1], y1 = points[i + 2],\n x2 = points[i + 3], y2 = points[i + 4],\n xaxis = series.xaxis, yaxis = series.yaxis,\n tmp;\n\n // actually we should check img.complete, but it\n // appears to be a somewhat unreliable indicator in\n // IE6 (false even after load event)\n if (!img || img.width <= 0 || img.height <= 0) {\n continue;\n }\n\n if (x1 > x2) {\n tmp = x2;\n x2 = x1;\n x1 = tmp;\n }\n if (y1 > y2) {\n tmp = y2;\n y2 = y1;\n y1 = tmp;\n }\n\n // if the anchor is at the center of the pixel, expand the\n // image by 1/2 pixel in each direction\n if (series.images.anchor === \"center\") {\n tmp = 0.5 * (x2 - x1) / (img.width - 1);\n x1 -= tmp;\n x2 += tmp;\n tmp = 0.5 * (y2 - y1) / (img.height - 1);\n y1 -= tmp;\n y2 += tmp;\n }\n\n // clip\n if (x1 === x2 || y1 === y2 ||\n x1 >= xaxis.max || x2 <= xaxis.min ||\n y1 >= yaxis.max || y2 <= yaxis.min) {\n continue;\n }\n\n var sx1 = 0, sy1 = 0, sx2 = img.width, sy2 = img.height;\n if (x1 < xaxis.min) {\n sx1 += (sx2 - sx1) * (xaxis.min - x1) / (x2 - x1);\n x1 = xaxis.min;\n }\n\n if (x2 > xaxis.max) {\n sx2 += (sx2 - sx1) * (xaxis.max - x2) / (x2 - x1);\n x2 = xaxis.max;\n }\n\n if (y1 < yaxis.min) {\n sy2 += (sy1 - sy2) * (yaxis.min - y1) / (y2 - y1);\n y1 = yaxis.min;\n }\n\n if (y2 > yaxis.max) {\n sy1 += (sy1 - sy2) * (yaxis.max - y2) / (y2 - y1);\n y2 = yaxis.max;\n }\n\n x1 = xaxis.p2c(x1);\n x2 = xaxis.p2c(x2);\n y1 = yaxis.p2c(y1);\n y2 = yaxis.p2c(y2);\n\n // the transformation may have swapped us\n if (x1 > x2) {\n tmp = x2;\n x2 = x1;\n x1 = tmp;\n }\n if (y1 > y2) {\n tmp = y2;\n y2 = y1;\n y1 = tmp;\n }\n\n tmp = ctx.globalAlpha;\n ctx.globalAlpha *= series.images.alpha;\n ctx.drawImage(img,\n sx1, sy1, sx2 - sx1, sy2 - sy1,\n x1 + plotOffset.left, y1 + plotOffset.top,\n x2 - x1, y2 - y1);\n ctx.globalAlpha = tmp;\n }\n }\n\n function processRawData(plot, series, data, datapoints) {\n if (!series.images.show) {\n return;\n }\n\n // format is Image, x1, y1, x2, y2 (opposite corners)\n datapoints.format = [\n { required: true },\n { x: true, number: true, required: true },\n { y: true, number: true, required: true },\n { x: true, number: true, required: true },\n { y: true, number: true, required: true }\n ];\n }\n\n function init(plot) {\n plot.hooks.processRawData.push(processRawData);\n plot.hooks.drawSeries.push(drawSeries);\n }\n\n plugins.push({\n init: init,\n options: options,\n name: 'image',\n version: '1.1'\n });\n"],"names":["image","drawSeries","plot","ctx","series","plotOffset","getPlotOffset","images","show","points","datapoints","ps","pointsize","i","length","tmp","img","x1","y1","x2","y2","xaxis","yaxis","width","height","anchor","max","min","sx1","sy1","sx2","sy2","p2c","globalAlpha","alpha","drawImage","left","top","processRawData","data","format","required","x","number","y","loadDataImages","options","callback","urls","defaultShow","forEach","s","p","push","load","loadedImages","url","missing","loaded","handler","this","document","createElement","onload","onerror","src","plugins","init","hooks","name","version"],"mappings":"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"}
1
+ {"version":3,"file":"jquery.flot.image.min.js","sources":["../../source/jquery.flot.image.js"],"sourcesContent":["/* Flot plugin for plotting images.\n\nCopyright (c) 2007-2014 IOLA and Ole Laursen.\nLicensed under the MIT license.\n\nThe data syntax is [ [ image, x1, y1, x2, y2 ], ... ] where (x1, y1) and\n(x2, y2) are where you intend the two opposite corners of the image to end up\nin the plot. Image must be a fully loaded Javascript image (you can make one\nwith new Image()). If the image is not complete, it's skipped when plotting.\n\nThere are two helpers included for retrieving images. The easiest work the way\nthat you put in URLs instead of images in the data, like this:\n\n [ \"myimage.png\", 0, 0, 10, 10 ]\n\nThen call $.plot.image.loadData( data, options, callback ) where data and\noptions are the same as you pass in to $.plot. This loads the images, replaces\nthe URLs in the data with the corresponding images and calls \"callback\" when\nall images are loaded (or failed loading). In the callback, you can then call\n$.plot with the data set. See the included example.\n\nA more low-level helper, $.plot.image.load(urls, callback) is also included.\nGiven a list of URLs, it calls callback with an object mapping from URL to\nImage object when all images are loaded or have failed loading.\n\nThe plugin supports these options:\n\n series: {\n images: {\n show: boolean\n anchor: \"corner\" or \"center\"\n alpha: [ 0, 1 ]\n }\n }\n\nThey can be specified for a specific series:\n\n $.plot( $(\"#placeholder\"), [{\n data: [ ... ],\n images: { ... }\n ])\n\nNote that because the data format is different from usual data points, you\ncan't use images with anything else in a specific data series.\n\nSetting \"anchor\" to \"center\" causes the pixels in the image to be anchored at\nthe corner pixel centers inside of at the pixel corners, effectively letting\nhalf a pixel stick out to each side in the plot.\n\nA possible future direction could be support for tiling for large images (like\nGoogle Maps).\n\n*/\n\nimport $ from 'jquery';\nimport { plugins } from './jquery.flot.js';\n\n var options = {\n series: {\n images: {\n show: false,\n alpha: 1,\n anchor: \"corner\" // or \"center\"\n }\n }\n };\n\n var image = {};\n\n image.loadDataImages = function (series, options, callback) {\n var urls = [], points = [];\n\n var defaultShow = options.series.images.show;\n\n series.forEach(function (s) {\n if (!(defaultShow || s.images.show)) {\n return;\n }\n\n if (s.data) {\n s = s.data;\n }\n\n s.forEach(function (p) {\n if (typeof p[0] === \"string\") {\n urls.push(p[0]);\n points.push(p);\n }\n });\n });\n\n image.load(urls, function (loadedImages) {\n points.forEach(function (p) {\n var url = p[0];\n if (loadedImages[url]) {\n p[0] = loadedImages[url];\n }\n });\n\n callback();\n });\n }\n\n image.load = function (urls, callback) {\n var missing = urls.length, loaded = {};\n if (missing === 0) {\n callback({});\n }\n\n urls.forEach(function (url) {\n var handler = function () {\n --missing;\n loaded[url] = this;\n\n if (missing === 0) {\n callback(loaded);\n }\n };\n\n var img = document.createElement('img');\n img.onload = handler;\n img.onerror = handler;\n img.src = url;\n });\n };\n\n function drawSeries(plot, ctx, series) {\n var plotOffset = plot.getPlotOffset();\n\n if (!series.images || !series.images.show) {\n return;\n }\n\n var points = series.datapoints.points,\n ps = series.datapoints.pointsize;\n\n for (var i = 0; i < points.length; i += ps) {\n var img = points[i],\n x1 = points[i + 1], y1 = points[i + 2],\n x2 = points[i + 3], y2 = points[i + 4],\n xaxis = series.xaxis, yaxis = series.yaxis,\n tmp;\n\n // actually we should check img.complete, but it\n // appears to be a somewhat unreliable indicator in\n // IE6 (false even after load event)\n if (!img || img.width <= 0 || img.height <= 0) {\n continue;\n }\n\n if (x1 > x2) {\n tmp = x2;\n x2 = x1;\n x1 = tmp;\n }\n if (y1 > y2) {\n tmp = y2;\n y2 = y1;\n y1 = tmp;\n }\n\n // if the anchor is at the center of the pixel, expand the\n // image by 1/2 pixel in each direction\n if (series.images.anchor === \"center\") {\n tmp = 0.5 * (x2 - x1) / (img.width - 1);\n x1 -= tmp;\n x2 += tmp;\n tmp = 0.5 * (y2 - y1) / (img.height - 1);\n y1 -= tmp;\n y2 += tmp;\n }\n\n // clip\n if (x1 === x2 || y1 === y2 ||\n x1 >= xaxis.max || x2 <= xaxis.min ||\n y1 >= yaxis.max || y2 <= yaxis.min) {\n continue;\n }\n\n var sx1 = 0, sy1 = 0, sx2 = img.width, sy2 = img.height;\n if (x1 < xaxis.min) {\n sx1 += (sx2 - sx1) * (xaxis.min - x1) / (x2 - x1);\n x1 = xaxis.min;\n }\n\n if (x2 > xaxis.max) {\n sx2 += (sx2 - sx1) * (xaxis.max - x2) / (x2 - x1);\n x2 = xaxis.max;\n }\n\n if (y1 < yaxis.min) {\n sy2 += (sy1 - sy2) * (yaxis.min - y1) / (y2 - y1);\n y1 = yaxis.min;\n }\n\n if (y2 > yaxis.max) {\n sy1 += (sy1 - sy2) * (yaxis.max - y2) / (y2 - y1);\n y2 = yaxis.max;\n }\n\n x1 = xaxis.p2c(x1);\n x2 = xaxis.p2c(x2);\n y1 = yaxis.p2c(y1);\n y2 = yaxis.p2c(y2);\n\n // the transformation may have swapped us\n if (x1 > x2) {\n tmp = x2;\n x2 = x1;\n x1 = tmp;\n }\n if (y1 > y2) {\n tmp = y2;\n y2 = y1;\n y1 = tmp;\n }\n\n tmp = ctx.globalAlpha;\n ctx.globalAlpha *= series.images.alpha;\n ctx.drawImage(img,\n sx1, sy1, sx2 - sx1, sy2 - sy1,\n x1 + plotOffset.left, y1 + plotOffset.top,\n x2 - x1, y2 - y1);\n ctx.globalAlpha = tmp;\n }\n }\n\n function processRawData(plot, series, data, datapoints) {\n if (!series.images.show) {\n return;\n }\n\n // format is Image, x1, y1, x2, y2 (opposite corners)\n datapoints.format = [\n { required: true },\n { x: true, number: true, required: true },\n { y: true, number: true, required: true },\n { x: true, number: true, required: true },\n { y: true, number: true, required: true }\n ];\n }\n\n function init(plot) {\n plot.hooks.processRawData.push(processRawData);\n plot.hooks.drawSeries.push(drawSeries);\n }\n\n plugins.push({\n init: init,\n options: options,\n name: 'image',\n version: '1.1'\n });\n\n // Expose the image helpers as $.plot.image so example code can call\n // $.plot.image.loadDataImages(...) / $.plot.image.load(...).\n $.plot.image = image;\n"],"names":["image","drawSeries","plot","ctx","series","plotOffset","getPlotOffset","images","show","points","datapoints","ps","pointsize","i","length","tmp","img","x1","y1","x2","y2","xaxis","yaxis","width","height","anchor","max","min","sx1","sy1","sx2","sy2","p2c","globalAlpha","alpha","drawImage","left","top","processRawData","data","format","required","x","number","y","loadDataImages","options","callback","urls","defaultShow","forEach","s","p","push","load","loadedImages","url","missing","loaded","handler","this","document","createElement","onload","onerror","src","plugins","init","hooks","name","version","$"],"mappings":"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"}
@@ -1,4 +1,4 @@
1
- /*! @kevinburke/flot v5.1.2 | MIT License | https://github.com/kevinburke/flot */
1
+ /*! @kevinburke/flot v5.1.4 | MIT License | https://github.com/kevinburke/flot */
2
2
  (function (jquery_flot_js, helpers_js) {
3
3
  'use strict';
4
4
 
@@ -820,4 +820,4 @@
820
820
  version: "1.1"
821
821
  });
822
822
 
823
- })(jquery_flot_js, helpers_js);
823
+ })(Flot, Flot.helpers);
@@ -1,2 +1,2 @@
1
- !function(e,t){"use strict";var i={series:{pie:{show:!1,radius:"auto",innerRadius:0,startAngle:1.5,tilt:1,shadow:{left:5,top:15,alpha:.02},offset:{top:0,left:"auto"},stroke:{color:"#fff",width:1},label:{show:"auto",formatter:function(e,t){return"<div style='font-size:x-small;text-align:center;padding:2px;color:"+t.color+";'>"+e+"<br/>"+Math.round(t.percent)+"%</div>"},radius:1,background:{color:null,opacity:0},threshold:0},combine:{threshold:-1,color:null,label:"Other"},highlight:{opacity:.5}}}};e.plugins.push({init:function(e){var i=null,s=null,r=null,a=null,l=null,n=null,o=!1,p=null,h=[];function c(t){var i=e.getOptions();if(i.series.pie.innerRadius>0){t.save();var s=i.series.pie.innerRadius>1?i.series.pie.innerRadius:a*i.series.pie.innerRadius;t.globalCompositeOperation="destination-out",t.beginPath(),t.fillStyle=i.series.pie.stroke.color,t.arc(0,0,s,0,2*Math.PI,!1),t.fill(),t.closePath(),t.restore(),t.save(),t.beginPath(),t.strokeStyle=i.series.pie.stroke.color,t.arc(0,0,s,0,2*Math.PI,!1),t.stroke(),t.closePath(),t.restore()}}function u(e,t){for(var i=!1,s=-1,r=e.length,a=r-1;++s<r;a=s)(e[s][1]<=t[1]&&t[1]<e[a][1]||e[a][1]<=t[1]&&t[1]<e[s][1])&&t[0]<(e[a][0]-e[s][0])*(t[1]-e[s][1])/(e[a][1]-e[s][1])+e[s][0]&&(i=!i);return i}function g(e){f("plothover",e)}function d(e){f("plotclick",e)}function f(i,r){var o=e.getOptions(),c=e.offset(),g=function(t,i){for(var s,r,o=e.getData(),h=e.getOptions(),c=h.series.pie.radius>1?h.series.pie.radius:a*h.series.pie.radius,g=0;g<o.length;++g){var d=o[g];if(d.pie.show){if(p.save(),p.beginPath(),p.moveTo(0,0),p.arc(0,0,c,d.startAngle,d.startAngle+d.angle/2,!1),p.arc(0,0,c,d.startAngle+d.angle/2,d.startAngle+d.angle,!1),p.closePath(),s=t-l,r=i-n,p.isPointInPath){if(p.isPointInPath(t-l,i-n))return p.restore(),{datapoint:[d.percent,d.data],dataIndex:0,series:d,seriesIndex:g}}else if(u([[0,0],[c*Math.cos(d.startAngle),c*Math.sin(d.startAngle)],[c*Math.cos(d.startAngle+d.angle/4),c*Math.sin(d.startAngle+d.angle/4)],[c*Math.cos(d.startAngle+d.angle/2),c*Math.sin(d.startAngle+d.angle/2)],[c*Math.cos(d.startAngle+d.angle/1.5),c*Math.sin(d.startAngle+d.angle/1.5)],[c*Math.cos(d.startAngle+d.angle),c*Math.sin(d.startAngle+d.angle)]],[s,r]))return p.restore(),{datapoint:[d.percent,d.data],dataIndex:0,series:d,seriesIndex:g};p.restore()}}return null}(parseInt(String(r.pageX-c.left)),parseInt(String(r.pageY-c.top)));if(o.grid.autoHighlight)for(var d=0;d<h.length;++d){var f=h[d];f.auto!==i||g&&f.series===g.series||b(f.series)}g&&function(t,i){var s=v(t);-1===s?(h.push({series:t,auto:i}),e.triggerRedrawOverlay()):i||(h[s].auto=!1)}(g.series,i);var m={pageX:r.pageX,pageY:r.pageY};t.trigger(s,i,[m,g])}function b(t){null==t&&(h=[],e.triggerRedrawOverlay());var i=v(t);-1!==i&&(h.splice(i,1),e.triggerRedrawOverlay())}function v(e){for(var t=0;t<h.length;++t)if(h[t].series===e)return t;return-1}e.hooks.processOptions.push(function(e,t){t.series.pie.show&&(t.grid.show=!1,"auto"===t.series.pie.label.show&&(t.legend.show?t.series.pie.label.show=!1:t.series.pie.label.show=!0),"auto"===t.series.pie.radius&&(t.series.pie.label.show?t.series.pie.radius=3/4:t.series.pie.radius=1),t.series.pie.tilt>1?t.series.pie.tilt=1:t.series.pie.tilt<0&&(t.series.pie.tilt=0))}),e.hooks.bindEvents.push(function(e,i){var s=e.getOptions();s.series.pie.show&&(s.grid.hoverable&&(t.unbind(i,"mousemove"),t.bind(i,"mousemove",g),t.bind(i,"mouseleave",g)),s.grid.clickable&&(t.unbind(i,"click"),t.bind(i,"click",d)))}),e.hooks.shutdown.push(function(e,i){t.unbind(i,"mousemove",g),t.unbind(i,"mouseleave",g),t.unbind(i,"click",d),h=[]}),e.hooks.processDatapoints.push(function(e,a,l,n){e.getOptions().series.pie.show&&function(e){o||(o=!0,i=e.getCanvas(),s=i.parentElement,r=e.getOptions(),e.setData(function(e){var i,s,a=0,l=0,n=0,o=r.series.pie.combine.color,p=[];for(i=0;i<e.length;++i)s=e[i].data,Array.isArray(s)&&1===s.length&&(s=s[0]),Array.isArray(s)?!isNaN(parseFloat(s[1]))&&isFinite(s[1])?s[1]=+s[1]:s[1]=0:s=!isNaN(parseFloat(s))&&isFinite(s)?[1,+s]:[1,0],e[i].data=[s];for(i=0;i<e.length;++i)a+=e[i].data[0][1];for(i=0;i<e.length;++i)(s=e[i].data[0][1])/a<=r.series.pie.combine.threshold&&(l+=s,n++,o||(o=e[i].color));for(i=0;i<e.length;++i)s=e[i].data[0][1],(n<2||s/a>r.series.pie.combine.threshold)&&p.push(t.extend(e[i],{data:[[1,s]],color:e[i].color,label:e[i].label,angle:s*Math.PI*2/a,percent:s/(a/100)}));return n>1&&p.push({data:[[1,l]],color:o,label:r.series.pie.combine.label,angle:l*Math.PI*2/a,percent:l/(a/100)}),p}(e.getData())))}(e)}),e.hooks.drawOverlay.push(function(e,t){e.getOptions().series.pie.show&&function(e,t){var i=e.getOptions(),s=i.series.pie.radius>1?i.series.pie.radius:a*i.series.pie.radius;t.save(),t.translate(l,n),t.scale(1,i.series.pie.tilt);for(var r=0;r<h.length;++r)o(h[r].series);function o(e){e.angle<=0||isNaN(e.angle)||(t.fillStyle="rgba(255, 255, 255, "+i.series.pie.highlight.opacity+")",t.beginPath(),Math.abs(e.angle-2*Math.PI)>1e-9&&t.moveTo(0,0),t.arc(0,0,s,e.startAngle,e.startAngle+e.angle/2,!1),t.arc(0,0,s,e.startAngle+e.angle/2,e.startAngle+e.angle,!1),t.closePath(),t.fill())}c(t),t.restore()}(e,t)}),e.hooks.draw.push(function(e,i){e.getOptions().series.pie.show&&function(e,i){if(s){var h=t.width(e.getPlaceholder()),u=t.height(e.getPlaceholder()),g=s.querySelector(".legend"),d=g&&g.firstElementChild?g.firstElementChild.clientWidth:0;p=i,o=!1,a=Math.min(h,u/r.series.pie.tilt)/2,n=u/2+r.series.pie.offset.top,l=h/2,"auto"===r.series.pie.offset.left?(r.legend.position.match("w")?l+=d/2:l-=d/2,l<a?l=a:l>h-a&&(l=h-a)):l+=r.series.pie.offset.left;var f=e.getData(),b=0;do{b>0&&(a*=.95),b+=1,m(),r.series.pie.tilt<=.8&&w()}while(!y()&&b<10);if(b>=10){m();var v=document.createElement("div");v.className="error",v.textContent="Could not draw pie with labels contained inside canvas",s.insertBefore(v,s.firstChild)}e.setSeries&&e.insertLegend&&(e.setSeries(f),e.insertLegend())}function m(){p.clearRect(0,0,h,u);for(var e=s.querySelectorAll(".pieLabel, .pieLabelBackground"),t=0;t<e.length;t++)e[t].remove()}function w(){var e=r.series.pie.shadow.left,t=r.series.pie.shadow.top,i=r.series.pie.shadow.alpha,s=r.series.pie.radius>1?r.series.pie.radius:a*r.series.pie.radius;if(!(s>=h/2-e||s*r.series.pie.tilt>=u/2-t||s<=10)){p.save(),p.translate(e,t),p.globalAlpha=i,p.fillStyle="#000",p.translate(l,n),p.scale(1,r.series.pie.tilt);for(var o=1;o<=10;o++)p.beginPath(),p.arc(0,0,s,0,2*Math.PI,!1),p.fill(),s-=o;p.restore()}}function y(){var e,t=Math.PI*r.series.pie.startAngle,i=r.series.pie.radius>1?r.series.pie.radius:a*r.series.pie.radius;p.save(),p.translate(l,n),p.scale(1,r.series.pie.tilt),p.save();var o=t;for(e=0;e<f.length;++e)f[e].startAngle=o,g(f[e].angle,f[e].color,!0);if(p.restore(),r.series.pie.stroke.width>0){for(p.save(),p.lineWidth=r.series.pie.stroke.width,o=t,e=0;e<f.length;++e)g(f[e].angle,r.series.pie.stroke.color,!1);p.restore()}return c(p),p.restore(),!r.series.pie.label.show||function(){for(var e=t,i=r.series.pie.label.radius>1?r.series.pie.label.radius:a*r.series.pie.label.radius,o=0;o<f.length;++o){if(f[o].percent>=100*r.series.pie.label.threshold&&!p(f[o],e,o))return!1;e+=f[o].angle}return!0;function p(e,t,a){if(0===e.data[0][1])return!0;var o,p=r.legend.labelFormatter,c=r.series.pie.label.formatter;o=p?p(e.label,e):e.label,c&&(o=c(o,e));var g=(t+e.angle+t)/2,d=l+Math.round(Math.cos(g)*i),f=n+Math.round(Math.sin(g)*i)*r.series.pie.tilt,b=document.createElement("span");b.className="pieLabel",b.id="pieLabel"+a,b.style.position="absolute",b.style.top=f+"px",b.style.left=d+"px",b.innerHTML=o,s.appendChild(b);var v=s.querySelector("#pieLabel"+a),m=f-v.clientHeight/2,w=d-v.clientWidth/2;if(v.style.top=m+"px",v.style.left=w+"px",0-m>0||0-w>0||u-(m+v.clientHeight)<0||h-(w+v.clientWidth)<0)return!1;if(0!==r.series.pie.label.background.opacity){var y=r.series.pie.label.background.color;null==y&&(y=e.color);var k=document.createElement("div");k.className="pieLabelBackground",k.style.cssText="position:absolute;width:"+v.clientWidth+"px;height:"+v.clientHeight+"px;top:"+m+"px;left:"+w+"px;background-color:"+y+";",k.style.opacity=r.series.pie.label.background.opacity,v.parentNode.insertBefore(k,v)}return!0}}();function g(e,t,s){e<=0||isNaN(e)||(s?p.fillStyle=t:(p.strokeStyle=t,p.lineJoin="round"),p.beginPath(),Math.abs(e-2*Math.PI)>1e-9&&p.moveTo(0,0),p.arc(0,0,i,o,o+e/2,!1),p.arc(0,0,i,o+e/2,o+e,!1),p.closePath(),o+=e,s?p.fill():p.stroke())}}}(e,i)})},options:i,name:"pie",version:"1.1"})}(jquery_flot_js,helpers_js);
1
+ !function(e,t){"use strict";var i={series:{pie:{show:!1,radius:"auto",innerRadius:0,startAngle:1.5,tilt:1,shadow:{left:5,top:15,alpha:.02},offset:{top:0,left:"auto"},stroke:{color:"#fff",width:1},label:{show:"auto",formatter:function(e,t){return"<div style='font-size:x-small;text-align:center;padding:2px;color:"+t.color+";'>"+e+"<br/>"+Math.round(t.percent)+"%</div>"},radius:1,background:{color:null,opacity:0},threshold:0},combine:{threshold:-1,color:null,label:"Other"},highlight:{opacity:.5}}}};e.plugins.push({init:function(e){var i=null,s=null,r=null,a=null,l=null,n=null,o=!1,p=null,h=[];function c(t){var i=e.getOptions();if(i.series.pie.innerRadius>0){t.save();var s=i.series.pie.innerRadius>1?i.series.pie.innerRadius:a*i.series.pie.innerRadius;t.globalCompositeOperation="destination-out",t.beginPath(),t.fillStyle=i.series.pie.stroke.color,t.arc(0,0,s,0,2*Math.PI,!1),t.fill(),t.closePath(),t.restore(),t.save(),t.beginPath(),t.strokeStyle=i.series.pie.stroke.color,t.arc(0,0,s,0,2*Math.PI,!1),t.stroke(),t.closePath(),t.restore()}}function u(e,t){for(var i=!1,s=-1,r=e.length,a=r-1;++s<r;a=s)(e[s][1]<=t[1]&&t[1]<e[a][1]||e[a][1]<=t[1]&&t[1]<e[s][1])&&t[0]<(e[a][0]-e[s][0])*(t[1]-e[s][1])/(e[a][1]-e[s][1])+e[s][0]&&(i=!i);return i}function g(e){f("plothover",e)}function d(e){f("plotclick",e)}function f(i,r){var o=e.getOptions(),c=e.offset(),g=function(t,i){for(var s,r,o=e.getData(),h=e.getOptions(),c=h.series.pie.radius>1?h.series.pie.radius:a*h.series.pie.radius,g=0;g<o.length;++g){var d=o[g];if(d.pie.show){if(p.save(),p.beginPath(),p.moveTo(0,0),p.arc(0,0,c,d.startAngle,d.startAngle+d.angle/2,!1),p.arc(0,0,c,d.startAngle+d.angle/2,d.startAngle+d.angle,!1),p.closePath(),s=t-l,r=i-n,p.isPointInPath){if(p.isPointInPath(t-l,i-n))return p.restore(),{datapoint:[d.percent,d.data],dataIndex:0,series:d,seriesIndex:g}}else if(u([[0,0],[c*Math.cos(d.startAngle),c*Math.sin(d.startAngle)],[c*Math.cos(d.startAngle+d.angle/4),c*Math.sin(d.startAngle+d.angle/4)],[c*Math.cos(d.startAngle+d.angle/2),c*Math.sin(d.startAngle+d.angle/2)],[c*Math.cos(d.startAngle+d.angle/1.5),c*Math.sin(d.startAngle+d.angle/1.5)],[c*Math.cos(d.startAngle+d.angle),c*Math.sin(d.startAngle+d.angle)]],[s,r]))return p.restore(),{datapoint:[d.percent,d.data],dataIndex:0,series:d,seriesIndex:g};p.restore()}}return null}(parseInt(String(r.pageX-c.left)),parseInt(String(r.pageY-c.top)));if(o.grid.autoHighlight)for(var d=0;d<h.length;++d){var f=h[d];f.auto!==i||g&&f.series===g.series||b(f.series)}g&&function(t,i){var s=v(t);-1===s?(h.push({series:t,auto:i}),e.triggerRedrawOverlay()):i||(h[s].auto=!1)}(g.series,i);var m={pageX:r.pageX,pageY:r.pageY};t.trigger(s,i,[m,g])}function b(t){null==t&&(h=[],e.triggerRedrawOverlay());var i=v(t);-1!==i&&(h.splice(i,1),e.triggerRedrawOverlay())}function v(e){for(var t=0;t<h.length;++t)if(h[t].series===e)return t;return-1}e.hooks.processOptions.push(function(e,t){t.series.pie.show&&(t.grid.show=!1,"auto"===t.series.pie.label.show&&(t.legend.show?t.series.pie.label.show=!1:t.series.pie.label.show=!0),"auto"===t.series.pie.radius&&(t.series.pie.label.show?t.series.pie.radius=3/4:t.series.pie.radius=1),t.series.pie.tilt>1?t.series.pie.tilt=1:t.series.pie.tilt<0&&(t.series.pie.tilt=0))}),e.hooks.bindEvents.push(function(e,i){var s=e.getOptions();s.series.pie.show&&(s.grid.hoverable&&(t.unbind(i,"mousemove"),t.bind(i,"mousemove",g),t.bind(i,"mouseleave",g)),s.grid.clickable&&(t.unbind(i,"click"),t.bind(i,"click",d)))}),e.hooks.shutdown.push(function(e,i){t.unbind(i,"mousemove",g),t.unbind(i,"mouseleave",g),t.unbind(i,"click",d),h=[]}),e.hooks.processDatapoints.push(function(e,a,l,n){e.getOptions().series.pie.show&&function(e){o||(o=!0,i=e.getCanvas(),s=i.parentElement,r=e.getOptions(),e.setData(function(e){var i,s,a=0,l=0,n=0,o=r.series.pie.combine.color,p=[];for(i=0;i<e.length;++i)s=e[i].data,Array.isArray(s)&&1===s.length&&(s=s[0]),Array.isArray(s)?!isNaN(parseFloat(s[1]))&&isFinite(s[1])?s[1]=+s[1]:s[1]=0:s=!isNaN(parseFloat(s))&&isFinite(s)?[1,+s]:[1,0],e[i].data=[s];for(i=0;i<e.length;++i)a+=e[i].data[0][1];for(i=0;i<e.length;++i)(s=e[i].data[0][1])/a<=r.series.pie.combine.threshold&&(l+=s,n++,o||(o=e[i].color));for(i=0;i<e.length;++i)s=e[i].data[0][1],(n<2||s/a>r.series.pie.combine.threshold)&&p.push(t.extend(e[i],{data:[[1,s]],color:e[i].color,label:e[i].label,angle:s*Math.PI*2/a,percent:s/(a/100)}));return n>1&&p.push({data:[[1,l]],color:o,label:r.series.pie.combine.label,angle:l*Math.PI*2/a,percent:l/(a/100)}),p}(e.getData())))}(e)}),e.hooks.drawOverlay.push(function(e,t){e.getOptions().series.pie.show&&function(e,t){var i=e.getOptions(),s=i.series.pie.radius>1?i.series.pie.radius:a*i.series.pie.radius;t.save(),t.translate(l,n),t.scale(1,i.series.pie.tilt);for(var r=0;r<h.length;++r)o(h[r].series);function o(e){e.angle<=0||isNaN(e.angle)||(t.fillStyle="rgba(255, 255, 255, "+i.series.pie.highlight.opacity+")",t.beginPath(),Math.abs(e.angle-2*Math.PI)>1e-9&&t.moveTo(0,0),t.arc(0,0,s,e.startAngle,e.startAngle+e.angle/2,!1),t.arc(0,0,s,e.startAngle+e.angle/2,e.startAngle+e.angle,!1),t.closePath(),t.fill())}c(t),t.restore()}(e,t)}),e.hooks.draw.push(function(e,i){e.getOptions().series.pie.show&&function(e,i){if(s){var h=t.width(e.getPlaceholder()),u=t.height(e.getPlaceholder()),g=s.querySelector(".legend"),d=g&&g.firstElementChild?g.firstElementChild.clientWidth:0;p=i,o=!1,a=Math.min(h,u/r.series.pie.tilt)/2,n=u/2+r.series.pie.offset.top,l=h/2,"auto"===r.series.pie.offset.left?(r.legend.position.match("w")?l+=d/2:l-=d/2,l<a?l=a:l>h-a&&(l=h-a)):l+=r.series.pie.offset.left;var f=e.getData(),b=0;do{b>0&&(a*=.95),b+=1,m(),r.series.pie.tilt<=.8&&w()}while(!y()&&b<10);if(b>=10){m();var v=document.createElement("div");v.className="error",v.textContent="Could not draw pie with labels contained inside canvas",s.insertBefore(v,s.firstChild)}e.setSeries&&e.insertLegend&&(e.setSeries(f),e.insertLegend())}function m(){p.clearRect(0,0,h,u);for(var e=s.querySelectorAll(".pieLabel, .pieLabelBackground"),t=0;t<e.length;t++)e[t].remove()}function w(){var e=r.series.pie.shadow.left,t=r.series.pie.shadow.top,i=r.series.pie.shadow.alpha,s=r.series.pie.radius>1?r.series.pie.radius:a*r.series.pie.radius;if(!(s>=h/2-e||s*r.series.pie.tilt>=u/2-t||s<=10)){p.save(),p.translate(e,t),p.globalAlpha=i,p.fillStyle="#000",p.translate(l,n),p.scale(1,r.series.pie.tilt);for(var o=1;o<=10;o++)p.beginPath(),p.arc(0,0,s,0,2*Math.PI,!1),p.fill(),s-=o;p.restore()}}function y(){var e,t=Math.PI*r.series.pie.startAngle,i=r.series.pie.radius>1?r.series.pie.radius:a*r.series.pie.radius;p.save(),p.translate(l,n),p.scale(1,r.series.pie.tilt),p.save();var o=t;for(e=0;e<f.length;++e)f[e].startAngle=o,g(f[e].angle,f[e].color,!0);if(p.restore(),r.series.pie.stroke.width>0){for(p.save(),p.lineWidth=r.series.pie.stroke.width,o=t,e=0;e<f.length;++e)g(f[e].angle,r.series.pie.stroke.color,!1);p.restore()}return c(p),p.restore(),!r.series.pie.label.show||function(){for(var e=t,i=r.series.pie.label.radius>1?r.series.pie.label.radius:a*r.series.pie.label.radius,o=0;o<f.length;++o){if(f[o].percent>=100*r.series.pie.label.threshold&&!p(f[o],e,o))return!1;e+=f[o].angle}return!0;function p(e,t,a){if(0===e.data[0][1])return!0;var o,p=r.legend.labelFormatter,c=r.series.pie.label.formatter;o=p?p(e.label,e):e.label,c&&(o=c(o,e));var g=(t+e.angle+t)/2,d=l+Math.round(Math.cos(g)*i),f=n+Math.round(Math.sin(g)*i)*r.series.pie.tilt,b=document.createElement("span");b.className="pieLabel",b.id="pieLabel"+a,b.style.position="absolute",b.style.top=f+"px",b.style.left=d+"px",b.innerHTML=o,s.appendChild(b);var v=s.querySelector("#pieLabel"+a),m=f-v.clientHeight/2,w=d-v.clientWidth/2;if(v.style.top=m+"px",v.style.left=w+"px",0-m>0||0-w>0||u-(m+v.clientHeight)<0||h-(w+v.clientWidth)<0)return!1;if(0!==r.series.pie.label.background.opacity){var y=r.series.pie.label.background.color;null==y&&(y=e.color);var k=document.createElement("div");k.className="pieLabelBackground",k.style.cssText="position:absolute;width:"+v.clientWidth+"px;height:"+v.clientHeight+"px;top:"+m+"px;left:"+w+"px;background-color:"+y+";",k.style.opacity=r.series.pie.label.background.opacity,v.parentNode.insertBefore(k,v)}return!0}}();function g(e,t,s){e<=0||isNaN(e)||(s?p.fillStyle=t:(p.strokeStyle=t,p.lineJoin="round"),p.beginPath(),Math.abs(e-2*Math.PI)>1e-9&&p.moveTo(0,0),p.arc(0,0,i,o,o+e/2,!1),p.arc(0,0,i,o+e/2,o+e,!1),p.closePath(),o+=e,s?p.fill():p.stroke())}}}(e,i)})},options:i,name:"pie",version:"1.1"})}(Flot,Flot.helpers);
2
2
  //# sourceMappingURL=jquery.flot.pie.min.js.map
@@ -1,4 +1,4 @@
1
- /*! @kevinburke/flot v5.1.2 | MIT License | https://github.com/kevinburke/flot */
1
+ /*! @kevinburke/flot v5.1.4 | MIT License | https://github.com/kevinburke/flot */
2
2
  (function (jquery_flot_js) {
3
3
  'use strict';
4
4
 
@@ -59,4 +59,4 @@
59
59
  version: '1.0'
60
60
  });
61
61
 
62
- })(jquery_flot_js);
62
+ })(Flot);
@@ -1,2 +1,2 @@
1
- !function(e){"use strict";e.plugins.push({init:function(e){var n=null;function i(){var n=e.getPlaceholder();0!==n.clientWidth&&0!==n.clientHeight&&(e.resize(),e.setupGrid(),e.draw())}e.hooks.bindEvents.push(function(e,t){var s=e.getPlaceholder();(n=new ResizeObserver(function(e){i()})).observe(s)}),e.hooks.shutdown.push(function(e,i){n&&(n.disconnect(),n=null)})},options:{},name:"resize",version:"1.0"})}(jquery_flot_js);
1
+ !function(){"use strict";Flot.plugins.push({init:function(n){var e=null;function i(){var e=n.getPlaceholder();0!==e.clientWidth&&0!==e.clientHeight&&(n.resize(),n.setupGrid(),n.draw())}n.hooks.bindEvents.push(function(n,t){var o=n.getPlaceholder();(e=new ResizeObserver(function(n){i()})).observe(o)}),n.hooks.shutdown.push(function(n,i){e&&(e.disconnect(),e=null)})},options:{},name:"resize",version:"1.0"})}();
2
2
  //# sourceMappingURL=jquery.flot.resize.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"jquery.flot.resize.min.js","sources":["../../source/jquery.flot.resize.js"],"sourcesContent":["/* Flot plugin for automatically redrawing plots as the placeholder resizes.\n\nCopyright (c) 2007-2014 IOLA and Ole Laursen.\nLicensed under the MIT license.\n\nIt works by listening for changes on the placeholder div using ResizeObserver.\nIf the size changes, it will redraw the plot.\n\nThere are no options. If you need to disable the plugin for some plots, you\ncan just fix the size of their placeholders.\n\n*/\n\nimport { plugins } from './jquery.flot.js';\n\n var options = { }; // no options\n\n function init(plot) {\n var observer = null;\n\n function onResize() {\n var placeholder = plot.getPlaceholder();\n\n // somebody might have hidden us and we can't plot\n // when we don't have the dimensions\n if (placeholder.clientWidth === 0 || placeholder.clientHeight === 0) return;\n\n plot.resize();\n plot.setupGrid();\n plot.draw();\n }\n\n function bindEvents(plot, eventHolder) {\n var placeholder = plot.getPlaceholder();\n observer = new ResizeObserver(function(entries) {\n onResize();\n });\n observer.observe(placeholder);\n }\n\n function shutdown(plot, eventHolder) {\n if (observer) {\n observer.disconnect();\n observer = null;\n }\n }\n\n plot.hooks.bindEvents.push(bindEvents);\n plot.hooks.shutdown.push(shutdown);\n }\n\n plugins.push({\n init: init,\n options: options,\n name: 'resize',\n version: '1.0'\n });\n"],"names":["plugins","push","init","plot","observer","onResize","placeholder","getPlaceholder","clientWidth","clientHeight","resize","setupGrid","draw","hooks","bindEvents","eventHolder","ResizeObserver","entries","observe","shutdown","disconnect","options","name","version"],"mappings":"0BAmDIA,EAAAA,QAAQC,KAAK,CACTC,KAnCJ,SAAcC,GACV,IAAIC,EAAW,KAEf,SAASC,IACL,IAAIC,EAAcH,EAAKI,iBAIS,IAA5BD,EAAYE,aAAkD,IAA7BF,EAAYG,eAEjDN,EAAKO,SACLP,EAAKQ,YACLR,EAAKS,OACT,CAiBAT,EAAKU,MAAMC,WAAWb,KAftB,SAAoBE,EAAMY,GACtB,IAAIT,EAAcH,EAAKI,kBACvBH,EAAW,IAAIY,eAAe,SAASC,GACnCZ,GACJ,IACSa,QAAQZ,EACrB,GAUAH,EAAKU,MAAMM,SAASlB,KARpB,SAAkBE,EAAMY,GAChBX,IACAA,EAASgB,aACThB,EAAW,KAEnB,EAIJ,EAIIiB,QAtCU,CAAA,EAuCVC,KAAM,SACNC,QAAS"}
1
+ {"version":3,"file":"jquery.flot.resize.min.js","sources":["../../source/jquery.flot.resize.js"],"sourcesContent":["/* Flot plugin for automatically redrawing plots as the placeholder resizes.\n\nCopyright (c) 2007-2014 IOLA and Ole Laursen.\nLicensed under the MIT license.\n\nIt works by listening for changes on the placeholder div using ResizeObserver.\nIf the size changes, it will redraw the plot.\n\nThere are no options. If you need to disable the plugin for some plots, you\ncan just fix the size of their placeholders.\n\n*/\n\nimport { plugins } from './jquery.flot.js';\n\n var options = { }; // no options\n\n function init(plot) {\n var observer = null;\n\n function onResize() {\n var placeholder = plot.getPlaceholder();\n\n // somebody might have hidden us and we can't plot\n // when we don't have the dimensions\n if (placeholder.clientWidth === 0 || placeholder.clientHeight === 0) return;\n\n plot.resize();\n plot.setupGrid();\n plot.draw();\n }\n\n function bindEvents(plot, eventHolder) {\n var placeholder = plot.getPlaceholder();\n observer = new ResizeObserver(function(entries) {\n onResize();\n });\n observer.observe(placeholder);\n }\n\n function shutdown(plot, eventHolder) {\n if (observer) {\n observer.disconnect();\n observer = null;\n }\n }\n\n plot.hooks.bindEvents.push(bindEvents);\n plot.hooks.shutdown.push(shutdown);\n }\n\n plugins.push({\n init: init,\n options: options,\n name: 'resize',\n version: '1.0'\n });\n"],"names":["plugins","push","init","plot","observer","onResize","placeholder","getPlaceholder","clientWidth","clientHeight","resize","setupGrid","draw","hooks","bindEvents","eventHolder","ResizeObserver","entries","observe","shutdown","disconnect","options","name","version"],"mappings":"8BAmDIA,QAAQC,KAAK,CACTC,KAnCJ,SAAcC,GACV,IAAIC,EAAW,KAEf,SAASC,IACL,IAAIC,EAAcH,EAAKI,iBAIS,IAA5BD,EAAYE,aAAkD,IAA7BF,EAAYG,eAEjDN,EAAKO,SACLP,EAAKQ,YACLR,EAAKS,OACT,CAiBAT,EAAKU,MAAMC,WAAWb,KAftB,SAAoBE,EAAMY,GACtB,IAAIT,EAAcH,EAAKI,kBACvBH,EAAW,IAAIY,eAAe,SAASC,GACnCZ,GACJ,IACSa,QAAQZ,EACrB,GAUAH,EAAKU,MAAMM,SAASlB,KARpB,SAAkBE,EAAMY,GAChBX,IACAA,EAASgB,aACThB,EAAW,KAEnB,EAIJ,EAIIiB,QAtCU,CAAA,EAuCVC,KAAM,SACNC,QAAS"}
@@ -1,4 +1,4 @@
1
- /*! @kevinburke/flot v5.1.2 | MIT License | https://github.com/kevinburke/flot */
1
+ /*! @kevinburke/flot v5.1.4 | MIT License | https://github.com/kevinburke/flot */
2
2
  (function (jquery_flot_js, helpers_js) {
3
3
  'use strict';
4
4
 
@@ -145,4 +145,4 @@
145
145
  version: '1.2'
146
146
  });
147
147
 
148
- })(jquery_flot_js, helpers_js);
148
+ })(Flot, Flot.helpers);
@@ -1,2 +1,2 @@
1
- !function(o,s){"use strict";o.plugins.push({init:function(o){function t(o,t,n,l,e){var h,r,i,u,p,a=n.pointsize,f=s.extend({},t);f.datapoints={points:[],pointsize:a,format:n.format},f.label=null,f.color=e,f.threshold=null,f.originSeries=t,f.data=[];var d,c=n.points,g=t.lines.show,v=[],b=[];for(h=0;h<c.length;h+=a){if(r=c[h],p=u,u=(i=c[h+1])<l?v:b,g&&void 0!==p&&p!==u&&null!==r&&h>0&&null!=c[h-a]){var w=r+(l-i)*(r-c[h-a])/(i-c[h-a+1]);for(p.push(w),p.push(l),d=2;d<a;++d)p.push(c[h+d]);for(u.push(null),u.push(null),d=2;d<a;++d)u.push(c[h+d]);for(u.push(w),u.push(l),d=2;d<a;++d)u.push(c[h+d])}for(u.push(r),u.push(i),d=2;d<a;++d)u.push(c[h+d])}if(n.points=b,f.datapoints.points=v,f.datapoints.points.length>0){var j=o.getData().indexOf(t);o.getData().splice(j+1,0,f)}}o.hooks.processDatapoints.push(function(o,s,n){s.threshold&&(s.threshold instanceof Array?(s.threshold.sort(function(o,s){return o.below-s.below}),s.threshold.forEach(function(l){t(o,s,n,l.below,l.color)})):t(o,s,n,s.threshold.below,s.threshold.color))})},options:{series:{threshold:null}},name:"threshold",version:"1.2"})}(jquery_flot_js,helpers_js);
1
+ !function(o,s){"use strict";o.plugins.push({init:function(o){function t(o,t,n,l,h){var e,i,r,p,u,a=n.pointsize,f=s.extend({},t);f.datapoints={points:[],pointsize:a,format:n.format},f.label=null,f.color=h,f.threshold=null,f.originSeries=t,f.data=[];var d,c=n.points,g=t.lines.show,v=[],b=[];for(e=0;e<c.length;e+=a){if(i=c[e],u=p,p=(r=c[e+1])<l?v:b,g&&void 0!==u&&u!==p&&null!==i&&e>0&&null!=c[e-a]){var w=i+(l-r)*(i-c[e-a])/(r-c[e-a+1]);for(u.push(w),u.push(l),d=2;d<a;++d)u.push(c[e+d]);for(p.push(null),p.push(null),d=2;d<a;++d)p.push(c[e+d]);for(p.push(w),p.push(l),d=2;d<a;++d)p.push(c[e+d])}for(p.push(i),p.push(r),d=2;d<a;++d)p.push(c[e+d])}if(n.points=b,f.datapoints.points=v,f.datapoints.points.length>0){var m=o.getData().indexOf(t);o.getData().splice(m+1,0,f)}}o.hooks.processDatapoints.push(function(o,s,n){s.threshold&&(s.threshold instanceof Array?(s.threshold.sort(function(o,s){return o.below-s.below}),s.threshold.forEach(function(l){t(o,s,n,l.below,l.color)})):t(o,s,n,s.threshold.below,s.threshold.color))})},options:{series:{threshold:null}},name:"threshold",version:"1.2"})}(Flot,Flot.helpers);
2
2
  //# sourceMappingURL=jquery.flot.threshold.min.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevinburke/flot",
3
- "version": "5.1.2",
3
+ "version": "5.1.4",
4
4
  "description": "JavaScript plotting library for engineering and scientific applications.",
5
5
  "type": "module",
6
6
  "main": "./dist/flot.js",
@@ -15,6 +15,11 @@ interface Window {
15
15
  StyleMedia?: unknown;
16
16
  safari?: { pushNotification?: unknown };
17
17
  HTMLElement: typeof HTMLElement;
18
+ Flot?: {
19
+ Canvas?: unknown;
20
+ plugins?: unknown;
21
+ helpers?: unknown;
22
+ };
18
23
  }
19
24
 
20
25
  interface Document {
@@ -35,7 +35,8 @@ import {
35
35
  dateTickGenerator,
36
36
  composeImages,
37
37
  } from './index.js';
38
- import { setTrigger } from './helpers.js';
38
+ import * as helpers from './helpers.js';
39
+ var setTrigger = helpers.setTrigger;
39
40
 
40
41
  // Route flot's internal trigger() through jQuery so plugin handlers bound
41
42
  // via $(el).on(type, fn) see the same data shape as upstream flot/flot.
@@ -55,13 +56,15 @@ setTrigger(function(el, type, args) {
55
56
  $(el).trigger(event);
56
57
  });
57
58
 
58
- // Register $.plot and $.color on the jQuery object.
59
- $.plot = function(placeholder, data, options) {
59
+ function jqueryPlot(placeholder, data, options) {
60
60
  var el = typeof placeholder === 'string'
61
61
  ? document.querySelector(placeholder)
62
62
  : (placeholder instanceof $ ? placeholder[0] : placeholder);
63
63
  return plot(el, data, options);
64
- };
64
+ }
65
+
66
+ // Register $.plot and $.color on the jQuery object.
67
+ $.plot = /** @type {typeof $.plot} */ (/** @type {unknown} */ (jqueryPlot));
65
68
 
66
69
  $.plot.plugins = plugins;
67
70
  $.plot.version = version;
@@ -83,7 +86,9 @@ $.plot.composeImages = composeImages;
83
86
  var origExtract = color.extract;
84
87
  $.color = Object.create(color);
85
88
  $.color.extract = function(elem, cssProp) {
86
- if (elem instanceof $ && elem.length) elem = elem[0];
89
+ if (elem instanceof $) {
90
+ elem = elem[0];
91
+ }
87
92
  return origExtract(elem, cssProp);
88
93
  };
89
94
 
@@ -99,4 +104,9 @@ if (typeof window !== 'undefined') {
99
104
  window.Flot = {};
100
105
  }
101
106
  window.Flot.Canvas = Canvas;
107
+ // Exposed so standalone plugin bundles (dist/plugins/*.js) can resolve
108
+ // their `import { plugins } from './jquery.flot.js'` and
109
+ // `import { ... } from './helpers.js'` to live objects on this global.
110
+ window.Flot.plugins = plugins;
111
+ window.Flot.helpers = helpers;
102
112
  }
@@ -52,6 +52,7 @@ Google Maps).
52
52
 
53
53
  */
54
54
 
55
+ import $ from 'jquery';
55
56
  import { plugins } from './jquery.flot.js';
56
57
 
57
58
  var options = {
@@ -64,7 +65,7 @@ import { plugins } from './jquery.flot.js';
64
65
  }
65
66
  };
66
67
 
67
- export var image = {};
68
+ var image = {};
68
69
 
69
70
  image.loadDataImages = function (series, options, callback) {
70
71
  var urls = [], points = [];
@@ -250,3 +251,7 @@ import { plugins } from './jquery.flot.js';
250
251
  name: 'image',
251
252
  version: '1.1'
252
253
  });
254
+
255
+ // Expose the image helpers as $.plot.image so example code can call
256
+ // $.plot.image.loadDataImages(...) / $.plot.image.load(...).
257
+ $.plot.image = image;