@kevinburke/flot 5.1.1 → 5.1.3
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.
- package/CHANGELOG.md +62 -0
- package/dist/flot.js +47 -28
- package/dist/flot.min.js +1 -1
- package/dist/flot.min.js.map +1 -1
- package/dist/flot.mjs +47 -28
- package/dist/jquery.flot.js +94 -31
- package/dist/jquery.flot.min.js +1 -1
- package/dist/jquery.flot.min.js.map +1 -1
- package/dist/plugins/jquery.flot.crosshair.js +2 -2
- package/dist/plugins/jquery.flot.crosshair.min.js +1 -1
- package/dist/plugins/jquery.flot.image.js +6 -6
- package/dist/plugins/jquery.flot.image.min.js +1 -1
- package/dist/plugins/jquery.flot.image.min.js.map +1 -1
- package/dist/plugins/jquery.flot.pie.js +4 -4
- package/dist/plugins/jquery.flot.pie.min.js +1 -1
- package/dist/plugins/jquery.flot.pie.min.js.map +1 -1
- package/dist/plugins/jquery.flot.resize.js +2 -2
- package/dist/plugins/jquery.flot.resize.min.js +1 -1
- package/dist/plugins/jquery.flot.resize.min.js.map +1 -1
- package/dist/plugins/jquery.flot.threshold.js +2 -2
- package/dist/plugins/jquery.flot.threshold.min.js +1 -1
- package/package.json +1 -1
- package/source/globals.d.ts +5 -0
- package/source/helpers.js +16 -4
- package/source/jquery-adapter.js +27 -2
- package/source/jquery.canvaswrapper.js +8 -4
- package/source/jquery.flot.browser.js +1 -1
- package/source/jquery.flot.composeImages.js +1 -1
- package/source/jquery.flot.hover.js +4 -4
- package/source/jquery.flot.image.js +6 -1
- package/source/jquery.flot.js +1 -1
- package/source/jquery.flot.legend.js +1 -1
- package/source/jquery.flot.navigate.js +1 -1
- package/source/jquery.flot.pie.js +2 -2
- package/source/jquery.flot.selection.js +3 -2
- package/source/jquery.flot.time.js +3 -3
- package/source/jquery.flot.touch.js +6 -1
- package/source/jquery.flot.touchNavigate.js +5 -3
- package/types/jquery.d.ts +2 -1
- package/source/jquery.js +0 -9473
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @kevinburke/flot v5.1.
|
|
1
|
+
/*! @kevinburke/flot v5.1.3 | 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
|
-
})(
|
|
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
|
|
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
|
-
(function (
|
|
1
|
+
/*! @kevinburke/flot v5.1.3 | 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
|
-
|
|
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
|
-
|
|
260
|
-
|
|
261
|
-
})({}, jquery_flot_js);
|
|
261
|
+
})(jQuery, Flot);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(a,i){"use strict";var
|
|
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":"4BAwDI,IAUWA,EAAQ,CAAA,EA2DnB,SAASC,EAAWC,EAAMC,E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O,GACvB9C,EAAOyC,QAAQ,SAAUE,GACrB,IAAII,EAAMJ,EAAE,GACRG,EAAaC,KACbJ,EAAE,GAAKG,EAAaC,GAE5B,GAEAT,GACJ,EACJ,EAEA/C,EAAMsD,KAAO,SAAUN,EAAMD,GACzB,IAAIU,EAAUT,EAAKlC,OAAQ4C,EAAS,CAAA,EACpB,IAAZD,GACAV,EAAS,CAAA,GAGbC,EAAKE,QAAQ,SAAUM,GACnB,IAAIG,EAAU,aACRF,EACFC,EAAOF,GAAOI,KAEE,IAAZH,GACAV,EAASW,EAEjB,EAEI1C,EAAM6C,SAASC,cAAc,OACjC9C,EAAI+C,OAASJ,EACb3C,EAAIgD,QAAUL,EACd3C,EAAIiD,IAAMT,CACd,EACJ,EA2HAU,EAAAA,QAAQb,KAAK,CACTc,KANJ,SAAcjE,GACVA,EAAKkE,MAAM9B,eAAee,KAAKf,GAC/BpC,EAAKkE,MAAMnE,WAAWoD,KAAKpD,EAC/B,EAII6C,QAhMU,CACV1C,OAAQ,CACJG,OAAQ,CACJC,MAAM,EACN0B,MAAO,EACPT,OAAQ,YA4LhB4C,KAAM,QACNC,QAAS"}
|
|
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":"4BAyDI,IAUIA,EAAQ,CAAA,EA2DZ,SAASC,EAAWC,EAAMC,EAAKC,GAC3B,IAAIC,EAAaH,EAAKI,gBAEtB,GAAKF,EAAOG,QAAWH,EAAOG,OAAOC,KAOrC,IAHA,IAAIC,EAASL,EAAOM,WAAWD,OAC3BE,EAAKP,EAAOM,WAAWE,UAElBC,EAAI,EAAGA,EAAIJ,EAAOK,OAAQD,GAAKF,EAAI,CACxC,IAIII,EAJAC,EAAMP,EAAOI,GACbI,EAAKR,EAAOI,EAAI,GAAIK,EAAKT,EAAOI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,EAAU,aACRF,EACFC,EAAOF,GAAOI,KAEE,IAAZH,GACAV,EAASW,EAEjB,EAEI1C,EAAM6C,SAASC,cAAc,OACjC9C,EAAI+C,OAASJ,EACb3C,EAAIgD,QAAUL,EACd3C,EAAIiD,IAAMT,CACd,EACJ,EA2HAU,EAAAA,QAAQb,KAAK,CACTc,KANJ,SAAcjE,GACVA,EAAKkE,MAAM9B,eAAee,KAAKf,GAC/BpC,EAAKkE,MAAMnE,WAAWoD,KAAKpD,EAC/B,EAII6C,QAhMU,CACV1C,OAAQ,CACJG,OAAQ,CACJC,MAAM,EACN0B,MAAO,EACPT,OAAQ,YA4LhB4C,KAAM,QACNC,QAAS,QAKbC,EAAErE,KAAKF,MAAQA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @kevinburke/flot v5.1.
|
|
1
|
+
/*! @kevinburke/flot v5.1.3 | MIT License | https://github.com/kevinburke/flot */
|
|
2
2
|
(function (jquery_flot_js, helpers_js) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -662,8 +662,8 @@
|
|
|
662
662
|
// event fires before processDatapoints has run.
|
|
663
663
|
var options = plot.getOptions();
|
|
664
664
|
var offset = plot.offset();
|
|
665
|
-
var canvasX = parseInt(e.pageX - offset.left);
|
|
666
|
-
var canvasY = parseInt(e.pageY - offset.top);
|
|
665
|
+
var canvasX = parseInt(String(e.pageX - offset.left));
|
|
666
|
+
var canvasY = parseInt(String(e.pageY - offset.top));
|
|
667
667
|
var item = findNearbySlice(canvasX, canvasY);
|
|
668
668
|
|
|
669
669
|
if (options.grid.autoHighlight) {
|
|
@@ -820,4 +820,4 @@
|
|
|
820
820
|
version: "1.1"
|
|
821
821
|
});
|
|
822
822
|
|
|
823
|
-
})(
|
|
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(r.pageX-c.left),parseInt(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"})}(
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jquery.flot.pie.min.js","sources":["../../source/jquery.flot.pie.js"],"sourcesContent":["/* Flot plugin for rendering pie charts.\n\nCopyright (c) 2007-2014 IOLA and Ole Laursen.\nLicensed under the MIT license.\n\nThe plugin assumes that each series has a single data value, and that each\nvalue is a positive integer or zero. Negative numbers don't make sense for a\npie chart, and have unpredictable results. The values do NOT need to be\npassed in as percentages; the plugin will calculate the total and per-slice\npercentages internally.\n\n* Created by Brian Medendorp\n\n* Updated with contributions from btburnett3, Anthony Aragues and Xavi Ivars\n\nThe plugin supports these options:\n\n series: {\n pie: {\n show: true/false\n radius: 0-1 for percentage of fullsize, or a specified pixel length, or 'auto'\n innerRadius: 0-1 for percentage of fullsize or a specified pixel length, for creating a donut effect\n startAngle: 0-2 factor of PI used for starting angle (in radians) i.e 3/2 starts at the top, 0 and 2 have the same result\n tilt: 0-1 for percentage to tilt the pie, where 1 is no tilt, and 0 is completely flat (nothing will show)\n offset: {\n top: integer value to move the pie up or down\n left: integer value to move the pie left or right, or 'auto'\n },\n stroke: {\n color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#FFF')\n width: integer pixel width of the stroke\n },\n label: {\n show: true/false, or 'auto'\n formatter: a user-defined function that modifies the text/style of the label text\n radius: 0-1 for percentage of fullsize, or a specified pixel length\n background: {\n color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#000')\n opacity: 0-1\n },\n threshold: 0-1 for the percentage value at which to hide labels (if they're too small)\n },\n combine: {\n threshold: 0-1 for the percentage value at which to combine slices (if they're too small)\n color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#CCC'), if null, the plugin will automatically use the color of the first slice to be combined\n label: any text value of what the combined slice should be labeled\n }\n highlight: {\n opacity: 0-1\n }\n }\n }\n\nMore detail and specific examples can be found in the included HTML file.\n\n*/\n\nimport { plugins } from './jquery.flot.js';\nimport { extend, bind, unbind, trigger, width, height } from './helpers.js';\n\n // Maximum redraw attempts when fitting labels within the plot\n\n var REDRAW_ATTEMPTS = 10;\n\n // Factor by which to shrink the pie when fitting labels within the plot\n\n var REDRAW_SHRINK = 0.95;\n\n function init(plot) {\n var canvas = null,\n target = null,\n options = null,\n maxRadius = null,\n centerLeft = null,\n centerTop = null,\n processed = false,\n ctx = null;\n\n // interactive variables\n\n var highlights = [];\n\n // add hook to determine if pie plugin in enabled, and then perform necessary operations\n\n plot.hooks.processOptions.push(function(plot, options) {\n if (options.series.pie.show) {\n options.grid.show = false;\n\n // set labels.show\n\n if (options.series.pie.label.show === \"auto\") {\n if (options.legend.show) {\n options.series.pie.label.show = false;\n } else {\n options.series.pie.label.show = true;\n }\n }\n\n // set radius\n\n if (options.series.pie.radius === \"auto\") {\n if (options.series.pie.label.show) {\n options.series.pie.radius = 3 / 4;\n } else {\n options.series.pie.radius = 1;\n }\n }\n\n // ensure sane tilt\n\n if (options.series.pie.tilt > 1) {\n options.series.pie.tilt = 1;\n } else if (options.series.pie.tilt < 0) {\n options.series.pie.tilt = 0;\n }\n }\n });\n\n plot.hooks.bindEvents.push(function(plot, eventHolder) {\n var options = plot.getOptions();\n if (options.series.pie.show) {\n if (options.grid.hoverable) {\n unbind(eventHolder, \"mousemove\");\n bind(eventHolder, \"mousemove\", onMouseMove);\n bind(eventHolder, \"mouseleave\", onMouseMove);\n }\n if (options.grid.clickable) {\n unbind(eventHolder, \"click\");\n bind(eventHolder, \"click\", onClick);\n }\n }\n });\n\n plot.hooks.shutdown.push(function (plot, eventHolder) {\n unbind(eventHolder, \"mousemove\", onMouseMove);\n unbind(eventHolder, \"mouseleave\", onMouseMove);\n unbind(eventHolder, \"click\", onClick);\n highlights = [];\n });\n\n plot.hooks.processDatapoints.push(function(plot, series, data, datapoints) {\n var options = plot.getOptions();\n if (options.series.pie.show) {\n processDatapoints(plot, series, datapoints);\n }\n });\n\n plot.hooks.drawOverlay.push(function(plot, octx) {\n var options = plot.getOptions();\n if (options.series.pie.show) {\n drawOverlay(plot, octx);\n }\n });\n\n plot.hooks.draw.push(function(plot, newCtx) {\n var options = plot.getOptions();\n if (options.series.pie.show) {\n draw(plot, newCtx);\n }\n });\n\n function processDatapoints(plot, series, datapoints) {\n if (!processed) {\n processed = true;\n canvas = plot.getCanvas();\n target = canvas.parentElement;\n options = plot.getOptions();\n plot.setData(combine(plot.getData()));\n }\n }\n\n function combine(data) {\n var total = 0,\n combined = 0,\n numCombined = 0,\n color = options.series.pie.combine.color,\n newdata = [],\n i,\n value;\n\n // Fix up the raw data from Flot, ensuring the data is numeric\n\n for (i = 0; i < data.length; ++i) {\n value = data[i].data;\n\n // If the data is an array, we'll assume that it's a standard\n // Flot x-y pair, and are concerned only with the second value.\n\n // Note how we use the original array, rather than creating a\n // new one; this is more efficient and preserves any extra data\n // that the user may have stored in higher indexes.\n\n if (Array.isArray(value) && value.length === 1) {\n value = value[0];\n }\n\n if (Array.isArray(value)) {\n // Equivalent to $.isNumeric() but compatible with jQuery < 1.7\n if (!isNaN(parseFloat(value[1])) && isFinite(value[1])) {\n value[1] = +value[1];\n } else {\n value[1] = 0;\n }\n } else if (!isNaN(parseFloat(value)) && isFinite(value)) {\n value = [1, +value];\n } else {\n value = [1, 0];\n }\n\n data[i].data = [value];\n }\n\n // Sum up all the slices, so we can calculate percentages for each\n\n for (i = 0; i < data.length; ++i) {\n total += data[i].data[0][1];\n }\n\n // Count the number of slices with percentages below the combine\n // threshold; if it turns out to be just one, we won't combine.\n\n for (i = 0; i < data.length; ++i) {\n value = data[i].data[0][1];\n if (value / total <= options.series.pie.combine.threshold) {\n combined += value;\n numCombined++;\n if (!color) {\n color = data[i].color;\n }\n }\n }\n\n for (i = 0; i < data.length; ++i) {\n value = data[i].data[0][1];\n if (numCombined < 2 || value / total > options.series.pie.combine.threshold) {\n newdata.push(\n extend(data[i], { /* extend to allow keeping all other original data values\n and using them e.g. in labelFormatter. */\n data: [[1, value]],\n color: data[i].color,\n label: data[i].label,\n angle: value * Math.PI * 2 / total,\n percent: value / (total / 100)\n })\n );\n }\n }\n\n if (numCombined > 1) {\n newdata.push({\n data: [[1, combined]],\n color: color,\n label: options.series.pie.combine.label,\n angle: combined * Math.PI * 2 / total,\n percent: combined / (total / 100)\n });\n }\n\n return newdata;\n }\n\n function draw(plot, newCtx) {\n if (!target) {\n return; // if no series were passed\n }\n\n var canvasWidth = width(plot.getPlaceholder()),\n canvasHeight = height(plot.getPlaceholder()),\n legendEl = target.querySelector(\".legend\"),\n legendWidth = legendEl && legendEl.firstElementChild ? legendEl.firstElementChild.clientWidth : 0;\n\n ctx = newCtx;\n\n // WARNING: HACK! REWRITE THIS CODE AS SOON AS POSSIBLE!\n\n // When combining smaller slices into an 'other' slice, we need to\n // add a new series. Since Flot gives plugins no way to modify the\n // list of series, the pie plugin uses a hack where the first call\n // to processDatapoints results in a call to setData with the new\n // list of series, then subsequent processDatapoints do nothing.\n\n // The plugin-global 'processed' flag is used to control this hack;\n // it starts out false, and is set to true after the first call to\n // processDatapoints.\n\n // Unfortunately this turns future setData calls into no-ops; they\n // call processDatapoints, the flag is true, and nothing happens.\n\n // To fix this we'll set the flag back to false here in draw, when\n // all series have been processed, so the next sequence of calls to\n // processDatapoints once again starts out with a slice-combine.\n // This is really a hack; in 0.9 we need to give plugins a proper\n // way to modify series before any processing begins.\n\n processed = false;\n\n // calculate maximum radius and center point\n maxRadius = Math.min(canvasWidth, canvasHeight / options.series.pie.tilt) / 2;\n centerTop = canvasHeight / 2 + options.series.pie.offset.top;\n centerLeft = canvasWidth / 2;\n\n if (options.series.pie.offset.left === \"auto\") {\n if (options.legend.position.match(\"w\")) {\n centerLeft += legendWidth / 2;\n } else {\n centerLeft -= legendWidth / 2;\n }\n if (centerLeft < maxRadius) {\n centerLeft = maxRadius;\n } else if (centerLeft > canvasWidth - maxRadius) {\n centerLeft = canvasWidth - maxRadius;\n }\n } else {\n centerLeft += options.series.pie.offset.left;\n }\n\n var slices = plot.getData(),\n attempts = 0;\n\n // Keep shrinking the pie's radius until drawPie returns true,\n // indicating that all the labels fit, or we try too many times.\n do {\n if (attempts > 0) {\n maxRadius *= REDRAW_SHRINK;\n }\n attempts += 1;\n clear();\n if (options.series.pie.tilt <= 0.8) {\n drawShadow();\n }\n } while (!drawPie() && attempts < REDRAW_ATTEMPTS)\n\n if (attempts >= REDRAW_ATTEMPTS) {\n clear();\n var errorDiv = document.createElement('div');\n errorDiv.className = 'error';\n errorDiv.textContent = 'Could not draw pie with labels contained inside canvas';\n target.insertBefore(errorDiv, target.firstChild);\n }\n\n if (plot.setSeries && plot.insertLegend) {\n plot.setSeries(slices);\n plot.insertLegend();\n }\n\n // we're actually done at this point, just defining internal functions at this point\n function clear() {\n ctx.clearRect(0, 0, canvasWidth, canvasHeight);\n var labels = target.querySelectorAll(\".pieLabel, .pieLabelBackground\");\n for (var li = 0; li < labels.length; li++) {\n labels[li].remove();\n }\n }\n\n function drawShadow() {\n var shadowLeft = options.series.pie.shadow.left;\n var shadowTop = options.series.pie.shadow.top;\n var edge = 10;\n var alpha = options.series.pie.shadow.alpha;\n var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;\n\n if (radius >= canvasWidth / 2 - shadowLeft || radius * options.series.pie.tilt >= canvasHeight / 2 - shadowTop || radius <= edge) {\n return; // shadow would be outside canvas, so don't draw it\n }\n\n ctx.save();\n ctx.translate(shadowLeft, shadowTop);\n ctx.globalAlpha = alpha;\n ctx.fillStyle = \"#000\";\n\n // center and rotate to starting position\n ctx.translate(centerLeft, centerTop);\n ctx.scale(1, options.series.pie.tilt);\n\n //radius -= edge;\n for (var i = 1; i <= edge; i++) {\n ctx.beginPath();\n ctx.arc(0, 0, radius, 0, Math.PI * 2, false);\n ctx.fill();\n radius -= i;\n }\n\n ctx.restore();\n }\n\n function drawPie() {\n var startAngle = Math.PI * options.series.pie.startAngle;\n var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;\n var i;\n // center and rotate to starting position\n\n ctx.save();\n ctx.translate(centerLeft, centerTop);\n ctx.scale(1, options.series.pie.tilt);\n //ctx.rotate(startAngle); // start at top; -- This doesn't work properly in Opera\n\n // draw slices\n ctx.save();\n\n var currentAngle = startAngle;\n for (i = 0; i < slices.length; ++i) {\n slices[i].startAngle = currentAngle;\n drawSlice(slices[i].angle, slices[i].color, true);\n }\n\n ctx.restore();\n\n // draw slice outlines\n if (options.series.pie.stroke.width > 0) {\n ctx.save();\n ctx.lineWidth = options.series.pie.stroke.width;\n currentAngle = startAngle;\n for (i = 0; i < slices.length; ++i) {\n drawSlice(slices[i].angle, options.series.pie.stroke.color, false);\n }\n\n ctx.restore();\n }\n\n // draw donut hole\n drawDonutHole(ctx);\n\n ctx.restore();\n\n // Draw the labels, returning true if they fit within the plot\n if (options.series.pie.label.show) {\n return drawLabels();\n } else return true;\n\n function drawSlice(angle, color, fill) {\n if (angle <= 0 || isNaN(angle)) {\n return;\n }\n\n if (fill) {\n ctx.fillStyle = color;\n } else {\n ctx.strokeStyle = color;\n ctx.lineJoin = \"round\";\n }\n\n ctx.beginPath();\n if (Math.abs(angle - Math.PI * 2) > 0.000000001) {\n ctx.moveTo(0, 0); // Center of the pie\n }\n\n //ctx.arc(0, 0, radius, 0, angle, false); // This doesn't work properly in Opera\n ctx.arc(0, 0, radius, currentAngle, currentAngle + angle / 2, false);\n ctx.arc(0, 0, radius, currentAngle + angle / 2, currentAngle + angle, false);\n ctx.closePath();\n //ctx.rotate(angle); // This doesn't work properly in Opera\n currentAngle += angle;\n\n if (fill) {\n ctx.fill();\n } else {\n ctx.stroke();\n }\n }\n\n function drawLabels() {\n var currentAngle = startAngle;\n var radius = options.series.pie.label.radius > 1 ? options.series.pie.label.radius : maxRadius * options.series.pie.label.radius;\n\n for (var i = 0; i < slices.length; ++i) {\n if (slices[i].percent >= options.series.pie.label.threshold * 100) {\n if (!drawLabel(slices[i], currentAngle, i)) {\n return false;\n }\n }\n currentAngle += slices[i].angle;\n }\n\n return true;\n\n function drawLabel(slice, startAngle, index) {\n if (slice.data[0][1] === 0) {\n return true;\n }\n\n // format label text\n var lf = options.legend.labelFormatter, text, plf = options.series.pie.label.formatter;\n\n if (lf) {\n text = lf(slice.label, slice);\n } else {\n text = slice.label;\n }\n\n if (plf) {\n text = plf(text, slice);\n }\n\n var halfAngle = ((startAngle + slice.angle) + startAngle) / 2;\n var x = centerLeft + Math.round(Math.cos(halfAngle) * radius);\n var y = centerTop + Math.round(Math.sin(halfAngle) * radius) * options.series.pie.tilt;\n\n var labelSpan = document.createElement('span');\n labelSpan.className = 'pieLabel';\n labelSpan.id = 'pieLabel' + index;\n labelSpan.style.position = 'absolute';\n labelSpan.style.top = y + 'px';\n labelSpan.style.left = x + 'px';\n labelSpan.innerHTML = text;\n target.appendChild(labelSpan);\n\n var label = target.querySelector(\"#pieLabel\" + index);\n var labelTop = (y - label.clientHeight / 2);\n var labelLeft = (x - label.clientWidth / 2);\n\n label.style.top = labelTop + 'px';\n label.style.left = labelLeft + 'px';\n\n // check to make sure that the label is not outside the canvas\n if (0 - labelTop > 0 || 0 - labelLeft > 0 || canvasHeight - (labelTop + label.clientHeight) < 0 || canvasWidth - (labelLeft + label.clientWidth) < 0) {\n return false;\n }\n\n if (options.series.pie.label.background.opacity !== 0) {\n // put in the transparent background separately to avoid blended labels and label boxes\n var c = options.series.pie.label.background.color;\n if (c == null) {\n c = slice.color;\n }\n\n var bgDiv = document.createElement('div');\n bgDiv.className = 'pieLabelBackground';\n bgDiv.style.cssText = 'position:absolute;width:' + label.clientWidth + 'px;height:' + label.clientHeight + 'px;top:' + labelTop + 'px;left:' + labelLeft + 'px;background-color:' + c + ';';\n bgDiv.style.opacity = options.series.pie.label.background.opacity;\n label.parentNode.insertBefore(bgDiv, label);\n }\n\n return true;\n } // end individual label function\n } // end drawLabels function\n } // end drawPie function\n } // end draw function\n\n // Placed here because it needs to be accessed from multiple locations\n\n function drawDonutHole(layer) {\n // The closure-scoped `options` is set by the processDatapoints\n // hook on first draw, but drawDonutHole can be reached from\n // paths that fire before that hook, leaving `options` null.\n // Read it eagerly. Upstream flot/flot#1559.\n var options = plot.getOptions();\n if (options.series.pie.innerRadius > 0) {\n // subtract the center\n layer.save();\n var innerRadius = options.series.pie.innerRadius > 1 ? options.series.pie.innerRadius : maxRadius * options.series.pie.innerRadius;\n layer.globalCompositeOperation = \"destination-out\"; // this does not work with excanvas, but it will fall back to using the stroke color\n layer.beginPath();\n layer.fillStyle = options.series.pie.stroke.color;\n layer.arc(0, 0, innerRadius, 0, Math.PI * 2, false);\n layer.fill();\n layer.closePath();\n layer.restore();\n\n // add inner stroke\n layer.save();\n layer.beginPath();\n layer.strokeStyle = options.series.pie.stroke.color;\n layer.arc(0, 0, innerRadius, 0, Math.PI * 2, false);\n layer.stroke();\n layer.closePath();\n layer.restore();\n\n // TODO: add extra shadow inside hole (with a mask) if the pie is tilted.\n }\n }\n\n //-- Additional Interactive related functions --\n\n function isPointInPoly(poly, pt) {\n for (var c = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i) {\n ((poly[i][1] <= pt[1] && pt[1] < poly[j][1]) ||\n (poly[j][1] <= pt[1] && pt[1] < poly[i][1])) &&\n (pt[0] < (poly[j][0] - poly[i][0]) * (pt[1] - poly[i][1]) / (poly[j][1] - poly[i][1]) + poly[i][0]) &&\n (c = !c);\n }\n return c;\n }\n\n function findNearbySlice(mouseX, mouseY) {\n var slices = plot.getData(),\n options = plot.getOptions(),\n radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius,\n x, y;\n\n for (var i = 0; i < slices.length; ++i) {\n var s = slices[i];\n if (s.pie.show) {\n ctx.save();\n ctx.beginPath();\n ctx.moveTo(0, 0); // Center of the pie\n //ctx.scale(1, options.series.pie.tilt); // this actually seems to break everything when here.\n ctx.arc(0, 0, radius, s.startAngle, s.startAngle + s.angle / 2, false);\n ctx.arc(0, 0, radius, s.startAngle + s.angle / 2, s.startAngle + s.angle, false);\n ctx.closePath();\n x = mouseX - centerLeft;\n y = mouseY - centerTop;\n\n if (ctx.isPointInPath) {\n if (ctx.isPointInPath(mouseX - centerLeft, mouseY - centerTop)) {\n ctx.restore();\n return {\n datapoint: [s.percent, s.data],\n dataIndex: 0,\n series: s,\n seriesIndex: i\n };\n }\n } else {\n // excanvas for IE doesn;t support isPointInPath, this is a workaround.\n var p1X = radius * Math.cos(s.startAngle),\n p1Y = radius * Math.sin(s.startAngle),\n p2X = radius * Math.cos(s.startAngle + s.angle / 4),\n p2Y = radius * Math.sin(s.startAngle + s.angle / 4),\n p3X = radius * Math.cos(s.startAngle + s.angle / 2),\n p3Y = radius * Math.sin(s.startAngle + s.angle / 2),\n p4X = radius * Math.cos(s.startAngle + s.angle / 1.5),\n p4Y = radius * Math.sin(s.startAngle + s.angle / 1.5),\n p5X = radius * Math.cos(s.startAngle + s.angle),\n p5Y = radius * Math.sin(s.startAngle + s.angle),\n arrPoly = [[0, 0], [p1X, p1Y], [p2X, p2Y], [p3X, p3Y], [p4X, p4Y], [p5X, p5Y]],\n arrPoint = [x, y];\n\n // TODO: perhaps do some mathmatical trickery here with the Y-coordinate to compensate for pie tilt?\n\n if (isPointInPoly(arrPoly, arrPoint)) {\n ctx.restore();\n return {\n datapoint: [s.percent, s.data],\n dataIndex: 0,\n series: s,\n seriesIndex: i\n };\n }\n }\n\n ctx.restore();\n }\n }\n\n return null;\n }\n\n function onMouseMove(e) {\n triggerClickHoverEvent(\"plothover\", e);\n }\n\n function onClick(e) {\n triggerClickHoverEvent(\"plotclick\", e);\n }\n\n // trigger click or hover event (they send the same parameters so we share their code)\n\n function triggerClickHoverEvent(eventname, e) {\n // See drawDonutHole above: read `options` fresh in case the\n // event fires before processDatapoints has run.\n var options = plot.getOptions();\n var offset = plot.offset();\n var canvasX = parseInt(e.pageX - offset.left);\n var canvasY = parseInt(e.pageY - offset.top);\n var item = findNearbySlice(canvasX, canvasY);\n\n if (options.grid.autoHighlight) {\n // clear auto-highlights\n for (var i = 0; i < highlights.length; ++i) {\n var h = highlights[i];\n if (h.auto === eventname && !(item && h.series === item.series)) {\n unhighlight(h.series);\n }\n }\n }\n\n // highlight the slice\n\n if (item) {\n highlight(item.series, eventname);\n }\n\n // trigger any hover bind events\n\n var pos = { pageX: e.pageX, pageY: e.pageY };\n trigger(target, eventname, [pos, item]);\n }\n\n function highlight(s, auto) {\n //if (typeof s == \"number\") {\n // s = series[s];\n //}\n\n var i = indexOfHighlight(s);\n\n if (i === -1) {\n highlights.push({ series: s, auto: auto });\n plot.triggerRedrawOverlay();\n } else if (!auto) {\n highlights[i].auto = false;\n }\n }\n\n function unhighlight(s) {\n if (s == null) {\n highlights = [];\n plot.triggerRedrawOverlay();\n }\n\n //if (typeof s == \"number\") {\n // s = series[s];\n //}\n\n var i = indexOfHighlight(s);\n\n if (i !== -1) {\n highlights.splice(i, 1);\n plot.triggerRedrawOverlay();\n }\n }\n\n function indexOfHighlight(s) {\n for (var i = 0; i < highlights.length; ++i) {\n var h = highlights[i];\n if (h.series === s) {\n return i;\n }\n }\n return -1;\n }\n\n function drawOverlay(plot, octx) {\n var options = plot.getOptions();\n var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;\n\n octx.save();\n octx.translate(centerLeft, centerTop);\n octx.scale(1, options.series.pie.tilt);\n\n for (var i = 0; i < highlights.length; ++i) {\n drawHighlight(highlights[i].series);\n }\n\n drawDonutHole(octx);\n\n octx.restore();\n\n function drawHighlight(series) {\n if (series.angle <= 0 || isNaN(series.angle)) {\n return;\n }\n\n //octx.fillStyle = parseColor(options.series.pie.highlight.color).scale(null, null, null, options.series.pie.highlight.opacity).toString();\n octx.fillStyle = \"rgba(255, 255, 255, \" + options.series.pie.highlight.opacity + \")\"; // this is temporary until we have access to parseColor\n octx.beginPath();\n if (Math.abs(series.angle - Math.PI * 2) > 0.000000001) {\n octx.moveTo(0, 0); // Center of the pie\n }\n octx.arc(0, 0, radius, series.startAngle, series.startAngle + series.angle / 2, false);\n octx.arc(0, 0, radius, series.startAngle + series.angle / 2, series.startAngle + series.angle, false);\n octx.closePath();\n octx.fill();\n }\n }\n } // end init (plugin body)\n\n // define pie specific options and their default values\n var options = {\n series: {\n pie: {\n show: false,\n radius: \"auto\", // actual radius of the visible pie (based on full calculated radius if <=1, or hard pixel value)\n innerRadius: 0, /* for donut */\n startAngle: 3 / 2,\n tilt: 1,\n shadow: {\n left: 5, // shadow left offset\n top: 15, // shadow top offset\n alpha: 0.02 // shadow alpha\n },\n offset: {\n top: 0,\n left: \"auto\"\n },\n stroke: {\n color: \"#fff\",\n width: 1\n },\n label: {\n show: \"auto\",\n formatter: function(label, slice) {\n return \"<div style='font-size:x-small;text-align:center;padding:2px;color:\" + slice.color + \";'>\" + label + \"<br/>\" + Math.round(slice.percent) + \"%</div>\";\n }, // formatter function\n radius: 1, // radius at which to place the labels (based on full calculated radius if <=1, or hard pixel value)\n background: {\n color: null,\n opacity: 0\n },\n threshold: 0 // percentage at which to hide the label (i.e. the slice is too narrow)\n },\n combine: {\n threshold: -1, // percentage at which to combine little slices into one larger slice\n color: null, // color to give the new slice (auto-generated if null)\n label: \"Other\" // label to give the new slice\n },\n highlight: {\n //color: \"#fff\", // will add this functionality once parseColor is available\n opacity: 0.5\n }\n }\n }\n };\n\n plugins.push({\n init: init,\n options: options,\n name: \"pie\",\n version: \"1.1\"\n });\n"],"names":["options","series","pie","show","radius","innerRadius","startAngle","tilt","shadow","left","top","alpha","offset","stroke","color","width","label","formatter","slice","Math","round","percent","background","opacity","threshold","combine","highlight","plugins","push","init","plot","canvas","target","maxRadius","centerLeft","centerTop","processed","ctx","highlights","drawDonutHole","layer","getOptions","save","globalCompositeOperation","beginPath","fillStyle","arc","PI","fill","closePath","restore","strokeStyle","isPointInPoly","poly","pt","c","i","l","length","j","onMouseMove","e","triggerClickHoverEvent","onClick","eventname","item","mouseX","mouseY","x","y","slices","getData","s","moveTo","angle","isPointInPath","datapoint","data","dataIndex","seriesIndex","cos","sin","findNearbySlice","parseInt","pageX","pageY","grid","autoHighlight","h","auto","unhighlight","indexOfHighlight","triggerRedrawOverlay","pos","trigger","splice","hooks","processOptions","legend","bindEvents","eventHolder","hoverable","unbind","bind","clickable","shutdown","processDatapoints","datapoints","getCanvas","parentElement","setData","value","total","combined","numCombined","newdata","Array","isArray","isNaN","parseFloat","isFinite","extend","drawOverlay","octx","translate","scale","drawHighlight","abs","draw","newCtx","canvasWidth","getPlaceholder","canvasHeight","height","legendEl","querySelector","legendWidth","firstElementChild","clientWidth","min","position","match","attempts","clear","drawShadow","drawPie","errorDiv","document","createElement","className","textContent","insertBefore","firstChild","setSeries","insertLegend","clearRect","labels","querySelectorAll","li","remove","shadowLeft","shadowTop","globalAlpha","currentAngle","drawSlice","lineWidth","drawLabel","index","text","lf","labelFormatter","plf","halfAngle","labelSpan","id","style","innerHTML","appendChild","labelTop","clientHeight","labelLeft","bgDiv","cssText","parentN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EAAG,GAIlBpC,EAAIS,IAAI,EAAG,EAAG1C,EAAQ+J,EAAcA,EAAezF,EAAQ,GAAG,GAC9DrC,EAAIS,IAAI,EAAG,EAAG1C,EAAQ+J,EAAezF,EAAQ,EAAGyF,EAAezF,GAAO,GACtErC,EAAIY,YAEJkH,GAAgBzF,EAEZ1B,EACAX,EAAIW,OAEJX,EAAIxB,SAEZ,CA6EJ,CACJ,CA3XQmH,CAAKlG,EAAMmG,EAEnB,EA6lBJ,EAmDIjI,QAASA,EACT0L,KAAM,MACNC,QAAS"}
|
|
1
|
+
{"version":3,"file":"jquery.flot.pie.min.js","sources":["../../source/jquery.flot.pie.js"],"sourcesContent":["/* Flot plugin for rendering pie charts.\n\nCopyright (c) 2007-2014 IOLA and Ole Laursen.\nLicensed under the MIT license.\n\nThe plugin assumes that each series has a single data value, and that each\nvalue is a positive integer or zero. Negative numbers don't make sense for a\npie chart, and have unpredictable results. The values do NOT need to be\npassed in as percentages; the plugin will calculate the total and per-slice\npercentages internally.\n\n* Created by Brian Medendorp\n\n* Updated with contributions from btburnett3, Anthony Aragues and Xavi Ivars\n\nThe plugin supports these options:\n\n series: {\n pie: {\n show: true/false\n radius: 0-1 for percentage of fullsize, or a specified pixel length, or 'auto'\n innerRadius: 0-1 for percentage of fullsize or a specified pixel length, for creating a donut effect\n startAngle: 0-2 factor of PI used for starting angle (in radians) i.e 3/2 starts at the top, 0 and 2 have the same result\n tilt: 0-1 for percentage to tilt the pie, where 1 is no tilt, and 0 is completely flat (nothing will show)\n offset: {\n top: integer value to move the pie up or down\n left: integer value to move the pie left or right, or 'auto'\n },\n stroke: {\n color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#FFF')\n width: integer pixel width of the stroke\n },\n label: {\n show: true/false, or 'auto'\n formatter: a user-defined function that modifies the text/style of the label text\n radius: 0-1 for percentage of fullsize, or a specified pixel length\n background: {\n color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#000')\n opacity: 0-1\n },\n threshold: 0-1 for the percentage value at which to hide labels (if they're too small)\n },\n combine: {\n threshold: 0-1 for the percentage value at which to combine slices (if they're too small)\n color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#CCC'), if null, the plugin will automatically use the color of the first slice to be combined\n label: any text value of what the combined slice should be labeled\n }\n highlight: {\n opacity: 0-1\n }\n }\n }\n\nMore detail and specific examples can be found in the included HTML file.\n\n*/\n\nimport { plugins } from './jquery.flot.js';\nimport { extend, bind, unbind, trigger, width, height } from './helpers.js';\n\n // Maximum redraw attempts when fitting labels within the plot\n\n var REDRAW_ATTEMPTS = 10;\n\n // Factor by which to shrink the pie when fitting labels within the plot\n\n var REDRAW_SHRINK = 0.95;\n\n function init(plot) {\n var canvas = null,\n target = null,\n options = null,\n maxRadius = null,\n centerLeft = null,\n centerTop = null,\n processed = false,\n ctx = null;\n\n // interactive variables\n\n var highlights = [];\n\n // add hook to determine if pie plugin in enabled, and then perform necessary operations\n\n plot.hooks.processOptions.push(function(plot, options) {\n if (options.series.pie.show) {\n options.grid.show = false;\n\n // set labels.show\n\n if (options.series.pie.label.show === \"auto\") {\n if (options.legend.show) {\n options.series.pie.label.show = false;\n } else {\n options.series.pie.label.show = true;\n }\n }\n\n // set radius\n\n if (options.series.pie.radius === \"auto\") {\n if (options.series.pie.label.show) {\n options.series.pie.radius = 3 / 4;\n } else {\n options.series.pie.radius = 1;\n }\n }\n\n // ensure sane tilt\n\n if (options.series.pie.tilt > 1) {\n options.series.pie.tilt = 1;\n } else if (options.series.pie.tilt < 0) {\n options.series.pie.tilt = 0;\n }\n }\n });\n\n plot.hooks.bindEvents.push(function(plot, eventHolder) {\n var options = plot.getOptions();\n if (options.series.pie.show) {\n if (options.grid.hoverable) {\n unbind(eventHolder, \"mousemove\");\n bind(eventHolder, \"mousemove\", onMouseMove);\n bind(eventHolder, \"mouseleave\", onMouseMove);\n }\n if (options.grid.clickable) {\n unbind(eventHolder, \"click\");\n bind(eventHolder, \"click\", onClick);\n }\n }\n });\n\n plot.hooks.shutdown.push(function (plot, eventHolder) {\n unbind(eventHolder, \"mousemove\", onMouseMove);\n unbind(eventHolder, \"mouseleave\", onMouseMove);\n unbind(eventHolder, \"click\", onClick);\n highlights = [];\n });\n\n plot.hooks.processDatapoints.push(function(plot, series, data, datapoints) {\n var options = plot.getOptions();\n if (options.series.pie.show) {\n processDatapoints(plot, series, datapoints);\n }\n });\n\n plot.hooks.drawOverlay.push(function(plot, octx) {\n var options = plot.getOptions();\n if (options.series.pie.show) {\n drawOverlay(plot, octx);\n }\n });\n\n plot.hooks.draw.push(function(plot, newCtx) {\n var options = plot.getOptions();\n if (options.series.pie.show) {\n draw(plot, newCtx);\n }\n });\n\n function processDatapoints(plot, series, datapoints) {\n if (!processed) {\n processed = true;\n canvas = plot.getCanvas();\n target = canvas.parentElement;\n options = plot.getOptions();\n plot.setData(combine(plot.getData()));\n }\n }\n\n function combine(data) {\n var total = 0,\n combined = 0,\n numCombined = 0,\n color = options.series.pie.combine.color,\n newdata = [],\n i,\n value;\n\n // Fix up the raw data from Flot, ensuring the data is numeric\n\n for (i = 0; i < data.length; ++i) {\n value = data[i].data;\n\n // If the data is an array, we'll assume that it's a standard\n // Flot x-y pair, and are concerned only with the second value.\n\n // Note how we use the original array, rather than creating a\n // new one; this is more efficient and preserves any extra data\n // that the user may have stored in higher indexes.\n\n if (Array.isArray(value) && value.length === 1) {\n value = value[0];\n }\n\n if (Array.isArray(value)) {\n // Equivalent to $.isNumeric() but compatible with jQuery < 1.7\n if (!isNaN(parseFloat(value[1])) && isFinite(value[1])) {\n value[1] = +value[1];\n } else {\n value[1] = 0;\n }\n } else if (!isNaN(parseFloat(value)) && isFinite(value)) {\n value = [1, +value];\n } else {\n value = [1, 0];\n }\n\n data[i].data = [value];\n }\n\n // Sum up all the slices, so we can calculate percentages for each\n\n for (i = 0; i < data.length; ++i) {\n total += data[i].data[0][1];\n }\n\n // Count the number of slices with percentages below the combine\n // threshold; if it turns out to be just one, we won't combine.\n\n for (i = 0; i < data.length; ++i) {\n value = data[i].data[0][1];\n if (value / total <= options.series.pie.combine.threshold) {\n combined += value;\n numCombined++;\n if (!color) {\n color = data[i].color;\n }\n }\n }\n\n for (i = 0; i < data.length; ++i) {\n value = data[i].data[0][1];\n if (numCombined < 2 || value / total > options.series.pie.combine.threshold) {\n newdata.push(\n extend(data[i], { /* extend to allow keeping all other original data values\n and using them e.g. in labelFormatter. */\n data: [[1, value]],\n color: data[i].color,\n label: data[i].label,\n angle: value * Math.PI * 2 / total,\n percent: value / (total / 100)\n })\n );\n }\n }\n\n if (numCombined > 1) {\n newdata.push({\n data: [[1, combined]],\n color: color,\n label: options.series.pie.combine.label,\n angle: combined * Math.PI * 2 / total,\n percent: combined / (total / 100)\n });\n }\n\n return newdata;\n }\n\n function draw(plot, newCtx) {\n if (!target) {\n return; // if no series were passed\n }\n\n var canvasWidth = width(plot.getPlaceholder()),\n canvasHeight = height(plot.getPlaceholder()),\n legendEl = target.querySelector(\".legend\"),\n legendWidth = legendEl && legendEl.firstElementChild ? legendEl.firstElementChild.clientWidth : 0;\n\n ctx = newCtx;\n\n // WARNING: HACK! REWRITE THIS CODE AS SOON AS POSSIBLE!\n\n // When combining smaller slices into an 'other' slice, we need to\n // add a new series. Since Flot gives plugins no way to modify the\n // list of series, the pie plugin uses a hack where the first call\n // to processDatapoints results in a call to setData with the new\n // list of series, then subsequent processDatapoints do nothing.\n\n // The plugin-global 'processed' flag is used to control this hack;\n // it starts out false, and is set to true after the first call to\n // processDatapoints.\n\n // Unfortunately this turns future setData calls into no-ops; they\n // call processDatapoints, the flag is true, and nothing happens.\n\n // To fix this we'll set the flag back to false here in draw, when\n // all series have been processed, so the next sequence of calls to\n // processDatapoints once again starts out with a slice-combine.\n // This is really a hack; in 0.9 we need to give plugins a proper\n // way to modify series before any processing begins.\n\n processed = false;\n\n // calculate maximum radius and center point\n maxRadius = Math.min(canvasWidth, canvasHeight / options.series.pie.tilt) / 2;\n centerTop = canvasHeight / 2 + options.series.pie.offset.top;\n centerLeft = canvasWidth / 2;\n\n if (options.series.pie.offset.left === \"auto\") {\n if (options.legend.position.match(\"w\")) {\n centerLeft += legendWidth / 2;\n } else {\n centerLeft -= legendWidth / 2;\n }\n if (centerLeft < maxRadius) {\n centerLeft = maxRadius;\n } else if (centerLeft > canvasWidth - maxRadius) {\n centerLeft = canvasWidth - maxRadius;\n }\n } else {\n centerLeft += options.series.pie.offset.left;\n }\n\n var slices = plot.getData(),\n attempts = 0;\n\n // Keep shrinking the pie's radius until drawPie returns true,\n // indicating that all the labels fit, or we try too many times.\n do {\n if (attempts > 0) {\n maxRadius *= REDRAW_SHRINK;\n }\n attempts += 1;\n clear();\n if (options.series.pie.tilt <= 0.8) {\n drawShadow();\n }\n } while (!drawPie() && attempts < REDRAW_ATTEMPTS)\n\n if (attempts >= REDRAW_ATTEMPTS) {\n clear();\n var errorDiv = document.createElement('div');\n errorDiv.className = 'error';\n errorDiv.textContent = 'Could not draw pie with labels contained inside canvas';\n target.insertBefore(errorDiv, target.firstChild);\n }\n\n if (plot.setSeries && plot.insertLegend) {\n plot.setSeries(slices);\n plot.insertLegend();\n }\n\n // we're actually done at this point, just defining internal functions at this point\n function clear() {\n ctx.clearRect(0, 0, canvasWidth, canvasHeight);\n var labels = target.querySelectorAll(\".pieLabel, .pieLabelBackground\");\n for (var li = 0; li < labels.length; li++) {\n labels[li].remove();\n }\n }\n\n function drawShadow() {\n var shadowLeft = options.series.pie.shadow.left;\n var shadowTop = options.series.pie.shadow.top;\n var edge = 10;\n var alpha = options.series.pie.shadow.alpha;\n var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;\n\n if (radius >= canvasWidth / 2 - shadowLeft || radius * options.series.pie.tilt >= canvasHeight / 2 - shadowTop || radius <= edge) {\n return; // shadow would be outside canvas, so don't draw it\n }\n\n ctx.save();\n ctx.translate(shadowLeft, shadowTop);\n ctx.globalAlpha = alpha;\n ctx.fillStyle = \"#000\";\n\n // center and rotate to starting position\n ctx.translate(centerLeft, centerTop);\n ctx.scale(1, options.series.pie.tilt);\n\n //radius -= edge;\n for (var i = 1; i <= edge; i++) {\n ctx.beginPath();\n ctx.arc(0, 0, radius, 0, Math.PI * 2, false);\n ctx.fill();\n radius -= i;\n }\n\n ctx.restore();\n }\n\n function drawPie() {\n var startAngle = Math.PI * options.series.pie.startAngle;\n var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;\n var i;\n // center and rotate to starting position\n\n ctx.save();\n ctx.translate(centerLeft, centerTop);\n ctx.scale(1, options.series.pie.tilt);\n //ctx.rotate(startAngle); // start at top; -- This doesn't work properly in Opera\n\n // draw slices\n ctx.save();\n\n var currentAngle = startAngle;\n for (i = 0; i < slices.length; ++i) {\n slices[i].startAngle = currentAngle;\n drawSlice(slices[i].angle, slices[i].color, true);\n }\n\n ctx.restore();\n\n // draw slice outlines\n if (options.series.pie.stroke.width > 0) {\n ctx.save();\n ctx.lineWidth = options.series.pie.stroke.width;\n currentAngle = startAngle;\n for (i = 0; i < slices.length; ++i) {\n drawSlice(slices[i].angle, options.series.pie.stroke.color, false);\n }\n\n ctx.restore();\n }\n\n // draw donut hole\n drawDonutHole(ctx);\n\n ctx.restore();\n\n // Draw the labels, returning true if they fit within the plot\n if (options.series.pie.label.show) {\n return drawLabels();\n } else return true;\n\n function drawSlice(angle, color, fill) {\n if (angle <= 0 || isNaN(angle)) {\n return;\n }\n\n if (fill) {\n ctx.fillStyle = color;\n } else {\n ctx.strokeStyle = color;\n ctx.lineJoin = \"round\";\n }\n\n ctx.beginPath();\n if (Math.abs(angle - Math.PI * 2) > 0.000000001) {\n ctx.moveTo(0, 0); // Center of the pie\n }\n\n //ctx.arc(0, 0, radius, 0, angle, false); // This doesn't work properly in Opera\n ctx.arc(0, 0, radius, currentAngle, currentAngle + angle / 2, false);\n ctx.arc(0, 0, radius, currentAngle + angle / 2, currentAngle + angle, false);\n ctx.closePath();\n //ctx.rotate(angle); // This doesn't work properly in Opera\n currentAngle += angle;\n\n if (fill) {\n ctx.fill();\n } else {\n ctx.stroke();\n }\n }\n\n function drawLabels() {\n var currentAngle = startAngle;\n var radius = options.series.pie.label.radius > 1 ? options.series.pie.label.radius : maxRadius * options.series.pie.label.radius;\n\n for (var i = 0; i < slices.length; ++i) {\n if (slices[i].percent >= options.series.pie.label.threshold * 100) {\n if (!drawLabel(slices[i], currentAngle, i)) {\n return false;\n }\n }\n currentAngle += slices[i].angle;\n }\n\n return true;\n\n function drawLabel(slice, startAngle, index) {\n if (slice.data[0][1] === 0) {\n return true;\n }\n\n // format label text\n var lf = options.legend.labelFormatter, text, plf = options.series.pie.label.formatter;\n\n if (lf) {\n text = lf(slice.label, slice);\n } else {\n text = slice.label;\n }\n\n if (plf) {\n text = plf(text, slice);\n }\n\n var halfAngle = ((startAngle + slice.angle) + startAngle) / 2;\n var x = centerLeft + Math.round(Math.cos(halfAngle) * radius);\n var y = centerTop + Math.round(Math.sin(halfAngle) * radius) * options.series.pie.tilt;\n\n var labelSpan = document.createElement('span');\n labelSpan.className = 'pieLabel';\n labelSpan.id = 'pieLabel' + index;\n labelSpan.style.position = 'absolute';\n labelSpan.style.top = y + 'px';\n labelSpan.style.left = x + 'px';\n labelSpan.innerHTML = text;\n target.appendChild(labelSpan);\n\n var label = target.querySelector(\"#pieLabel\" + index);\n var labelTop = (y - label.clientHeight / 2);\n var labelLeft = (x - label.clientWidth / 2);\n\n label.style.top = labelTop + 'px';\n label.style.left = labelLeft + 'px';\n\n // check to make sure that the label is not outside the canvas\n if (0 - labelTop > 0 || 0 - labelLeft > 0 || canvasHeight - (labelTop + label.clientHeight) < 0 || canvasWidth - (labelLeft + label.clientWidth) < 0) {\n return false;\n }\n\n if (options.series.pie.label.background.opacity !== 0) {\n // put in the transparent background separately to avoid blended labels and label boxes\n var c = options.series.pie.label.background.color;\n if (c == null) {\n c = slice.color;\n }\n\n var bgDiv = document.createElement('div');\n bgDiv.className = 'pieLabelBackground';\n bgDiv.style.cssText = 'position:absolute;width:' + label.clientWidth + 'px;height:' + label.clientHeight + 'px;top:' + labelTop + 'px;left:' + labelLeft + 'px;background-color:' + c + ';';\n bgDiv.style.opacity = options.series.pie.label.background.opacity;\n label.parentNode.insertBefore(bgDiv, label);\n }\n\n return true;\n } // end individual label function\n } // end drawLabels function\n } // end drawPie function\n } // end draw function\n\n // Placed here because it needs to be accessed from multiple locations\n\n function drawDonutHole(layer) {\n // The closure-scoped `options` is set by the processDatapoints\n // hook on first draw, but drawDonutHole can be reached from\n // paths that fire before that hook, leaving `options` null.\n // Read it eagerly. Upstream flot/flot#1559.\n var options = plot.getOptions();\n if (options.series.pie.innerRadius > 0) {\n // subtract the center\n layer.save();\n var innerRadius = options.series.pie.innerRadius > 1 ? options.series.pie.innerRadius : maxRadius * options.series.pie.innerRadius;\n layer.globalCompositeOperation = \"destination-out\"; // this does not work with excanvas, but it will fall back to using the stroke color\n layer.beginPath();\n layer.fillStyle = options.series.pie.stroke.color;\n layer.arc(0, 0, innerRadius, 0, Math.PI * 2, false);\n layer.fill();\n layer.closePath();\n layer.restore();\n\n // add inner stroke\n layer.save();\n layer.beginPath();\n layer.strokeStyle = options.series.pie.stroke.color;\n layer.arc(0, 0, innerRadius, 0, Math.PI * 2, false);\n layer.stroke();\n layer.closePath();\n layer.restore();\n\n // TODO: add extra shadow inside hole (with a mask) if the pie is tilted.\n }\n }\n\n //-- Additional Interactive related functions --\n\n function isPointInPoly(poly, pt) {\n for (var c = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i) {\n ((poly[i][1] <= pt[1] && pt[1] < poly[j][1]) ||\n (poly[j][1] <= pt[1] && pt[1] < poly[i][1])) &&\n (pt[0] < (poly[j][0] - poly[i][0]) * (pt[1] - poly[i][1]) / (poly[j][1] - poly[i][1]) + poly[i][0]) &&\n (c = !c);\n }\n return c;\n }\n\n function findNearbySlice(mouseX, mouseY) {\n var slices = plot.getData(),\n options = plot.getOptions(),\n radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius,\n x, y;\n\n for (var i = 0; i < slices.length; ++i) {\n var s = slices[i];\n if (s.pie.show) {\n ctx.save();\n ctx.beginPath();\n ctx.moveTo(0, 0); // Center of the pie\n //ctx.scale(1, options.series.pie.tilt); // this actually seems to break everything when here.\n ctx.arc(0, 0, radius, s.startAngle, s.startAngle + s.angle / 2, false);\n ctx.arc(0, 0, radius, s.startAngle + s.angle / 2, s.startAngle + s.angle, false);\n ctx.closePath();\n x = mouseX - centerLeft;\n y = mouseY - centerTop;\n\n if (ctx.isPointInPath) {\n if (ctx.isPointInPath(mouseX - centerLeft, mouseY - centerTop)) {\n ctx.restore();\n return {\n datapoint: [s.percent, s.data],\n dataIndex: 0,\n series: s,\n seriesIndex: i\n };\n }\n } else {\n // excanvas for IE doesn;t support isPointInPath, this is a workaround.\n var p1X = radius * Math.cos(s.startAngle),\n p1Y = radius * Math.sin(s.startAngle),\n p2X = radius * Math.cos(s.startAngle + s.angle / 4),\n p2Y = radius * Math.sin(s.startAngle + s.angle / 4),\n p3X = radius * Math.cos(s.startAngle + s.angle / 2),\n p3Y = radius * Math.sin(s.startAngle + s.angle / 2),\n p4X = radius * Math.cos(s.startAngle + s.angle / 1.5),\n p4Y = radius * Math.sin(s.startAngle + s.angle / 1.5),\n p5X = radius * Math.cos(s.startAngle + s.angle),\n p5Y = radius * Math.sin(s.startAngle + s.angle),\n arrPoly = [[0, 0], [p1X, p1Y], [p2X, p2Y], [p3X, p3Y], [p4X, p4Y], [p5X, p5Y]],\n arrPoint = [x, y];\n\n // TODO: perhaps do some mathmatical trickery here with the Y-coordinate to compensate for pie tilt?\n\n if (isPointInPoly(arrPoly, arrPoint)) {\n ctx.restore();\n return {\n datapoint: [s.percent, s.data],\n dataIndex: 0,\n series: s,\n seriesIndex: i\n };\n }\n }\n\n ctx.restore();\n }\n }\n\n return null;\n }\n\n function onMouseMove(e) {\n triggerClickHoverEvent(\"plothover\", e);\n }\n\n function onClick(e) {\n triggerClickHoverEvent(\"plotclick\", e);\n }\n\n // trigger click or hover event (they send the same parameters so we share their code)\n\n function triggerClickHoverEvent(eventname, e) {\n // See drawDonutHole above: read `options` fresh in case the\n // event fires before processDatapoints has run.\n var options = plot.getOptions();\n var offset = plot.offset();\n var canvasX = parseInt(String(e.pageX - offset.left));\n var canvasY = parseInt(String(e.pageY - offset.top));\n var item = findNearbySlice(canvasX, canvasY);\n\n if (options.grid.autoHighlight) {\n // clear auto-highlights\n for (var i = 0; i < highlights.length; ++i) {\n var h = highlights[i];\n if (h.auto === eventname && !(item && h.series === item.series)) {\n unhighlight(h.series);\n }\n }\n }\n\n // highlight the slice\n\n if (item) {\n highlight(item.series, eventname);\n }\n\n // trigger any hover bind events\n\n var pos = { pageX: e.pageX, pageY: e.pageY };\n trigger(target, eventname, [pos, item]);\n }\n\n function highlight(s, auto) {\n //if (typeof s == \"number\") {\n // s = series[s];\n //}\n\n var i = indexOfHighlight(s);\n\n if (i === -1) {\n highlights.push({ series: s, auto: auto });\n plot.triggerRedrawOverlay();\n } else if (!auto) {\n highlights[i].auto = false;\n }\n }\n\n function unhighlight(s) {\n if (s == null) {\n highlights = [];\n plot.triggerRedrawOverlay();\n }\n\n //if (typeof s == \"number\") {\n // s = series[s];\n //}\n\n var i = indexOfHighlight(s);\n\n if (i !== -1) {\n highlights.splice(i, 1);\n plot.triggerRedrawOverlay();\n }\n }\n\n function indexOfHighlight(s) {\n for (var i = 0; i < highlights.length; ++i) {\n var h = highlights[i];\n if (h.series === s) {\n return i;\n }\n }\n return -1;\n }\n\n function drawOverlay(plot, octx) {\n var options = plot.getOptions();\n var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;\n\n octx.save();\n octx.translate(centerLeft, centerTop);\n octx.scale(1, options.series.pie.tilt);\n\n for (var i = 0; i < highlights.length; ++i) {\n drawHighlight(highlights[i].series);\n }\n\n drawDonutHole(octx);\n\n octx.restore();\n\n function drawHighlight(series) {\n if (series.angle <= 0 || isNaN(series.angle)) {\n return;\n }\n\n //octx.fillStyle = parseColor(options.series.pie.highlight.color).scale(null, null, null, options.series.pie.highlight.opacity).toString();\n octx.fillStyle = \"rgba(255, 255, 255, \" + options.series.pie.highlight.opacity + \")\"; // this is temporary until we have access to parseColor\n octx.beginPath();\n if (Math.abs(series.angle - Math.PI * 2) > 0.000000001) {\n octx.moveTo(0, 0); // Center of the pie\n }\n octx.arc(0, 0, radius, series.startAngle, series.startAngle + series.angle / 2, false);\n octx.arc(0, 0, radius, series.startAngle + series.angle / 2, series.startAngle + series.angle, false);\n octx.closePath();\n octx.fill();\n }\n }\n } // end init (plugin body)\n\n // define pie specific options and their default values\n var options = {\n series: {\n pie: {\n show: false,\n radius: \"auto\", // actual radius of the visible pie (based on full calculated radius if <=1, or hard pixel value)\n innerRadius: 0, /* for donut */\n startAngle: 3 / 2,\n tilt: 1,\n shadow: {\n left: 5, // shadow left offset\n top: 15, // shadow top offset\n alpha: 0.02 // shadow alpha\n },\n offset: {\n top: 0,\n left: \"auto\"\n },\n stroke: {\n color: \"#fff\",\n width: 1\n },\n label: {\n show: \"auto\",\n formatter: function(label, slice) {\n return \"<div style='font-size:x-small;text-align:center;padding:2px;color:\" + slice.color + \";'>\" + label + \"<br/>\" + Math.round(slice.percent) + \"%</div>\";\n }, // formatter function\n radius: 1, // radius at which to place the labels (based on full calculated radius if <=1, or hard pixel value)\n background: {\n color: null,\n opacity: 0\n },\n threshold: 0 // percentage at which to hide the label (i.e. the slice is too narrow)\n },\n combine: {\n threshold: -1, // percentage at which to combine little slices into one larger slice\n color: null, // color to give the new slice (auto-generated if null)\n label: \"Other\" // label to give the new slice\n },\n highlight: {\n //color: \"#fff\", // will add this functionality once parseColor is available\n opacity: 0.5\n }\n }\n }\n };\n\n plugins.push({\n init: init,\n options: options,\n name: \"pie\",\n version: \"1.1\"\n });\n"],"names":["options","series","pie","show","radius","innerRadius","startAngle","tilt","shadow","left","top","alpha","offset","stroke","color","width","label","formatter","slice","Math","round","percent","background","opacity","threshold","combine","highlight","plugins","push","init","plot","canvas","target","maxRadius","centerLeft","centerTop","processed","ctx","highlights","drawDonutHole","layer","getOptions","save","globalCompositeOperation","beginPath","fillStyle","arc","PI","fill","closePath","restore","strokeStyle","isPointInPoly","poly","pt","c","i","l","length","j","onMouseMove","e","triggerClickHoverEvent","onClick","eventname","item","mouseX","mouseY","x","y","slices","getData","s","moveTo","angle","isPointInPath","datapoint","data","dataIndex","seriesIndex","cos","sin","findNearbySlice","parseInt","String","pageX","pageY","grid","autoHighlight","h","auto","unhighlight","indexOfHighlight","triggerRedrawOverlay","pos","trigger","splice","hooks","processOptions","legend","bindEvents","eventHolder","hoverable","unbind","bind","clickable","shutdown","processDatapoints","datapoints","getCanvas","parentElement","setData","value","total","combined","numCombined","newdata","Array","isArray","isNaN","parseFloat","isFinite","extend","drawOverlay","octx","translate","scale","drawHighlight","abs","draw","newCtx","canvasWidth","getPlaceholder","canvasHeight","height","legendEl","querySelector","legendWidth","firstElementChild","clientWidth","min","position","match","attempts","clear","drawShadow","drawPie","errorDiv","document","createElement","className","textContent","insertBefore","firstChild","setSeries","insertLegend","clearRect","labels","querySelectorAll","li","remove","shadowLeft","shadowTop","globalAlpha","currentAngle","drawSlice","lineWidth","drawLabel","index","text","lf","labelFormatter","plf","halfAngle","labelSpan","id","style","innerHTML","appendChild","labelTop","clientHeight","labelLeft","bgDiv","cssText","parentNode","drawLabels","lineJoin","name","version"],"mappings":"4BA+vBI,IAAIA,EAAU,CACVC,OAAQ,CACJC,IAAK,CACDC,MAAM,EACNC,OAAQ,OACRC,YAAa,EACbC,WAAY,IACZC,KAAM,EACNC,OAAQ,CACJC,KAAM,EACNC,IAAK,GACLC,MAAO,KAEXC,OAAQ,CACJF,IAAK,EACLD,KAAM,QAEVI,OAAQ,CACJC,MAAO,OACPC,MAAO,GAEXC,MAAO,CACHb,KAAM,OACNc,UAAW,SAASD,EAAOE,GACvB,MAAO,qEAAuEA,EAAMJ,MAAQ,MAAQE,EAAQ,QAAUG,KAA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
|
|
1
|
-
/*! @kevinburke/flot v5.1.
|
|
1
|
+
/*! @kevinburke/flot v5.1.3 | 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
|
-
})(
|
|
62
|
+
})(Flot);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(
|
|
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":"
|
|
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.
|
|
1
|
+
/*! @kevinburke/flot v5.1.3 | 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
|
-
})(
|
|
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,
|
|
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
package/source/globals.d.ts
CHANGED
package/source/helpers.js
CHANGED
|
@@ -47,6 +47,9 @@ export function extend(deep, target) {
|
|
|
47
47
|
var keys = Object.keys(src);
|
|
48
48
|
for (var k = 0; k < keys.length; k++) {
|
|
49
49
|
var key = keys[k];
|
|
50
|
+
if (key === '__proto__' || key === 'constructor') {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
50
53
|
var val = src[key];
|
|
51
54
|
if (val === undefined) {
|
|
52
55
|
continue;
|
|
@@ -115,10 +118,11 @@ export function removeData(el, key) {
|
|
|
115
118
|
}
|
|
116
119
|
}
|
|
117
120
|
|
|
118
|
-
//
|
|
119
|
-
//
|
|
120
|
-
//
|
|
121
|
-
|
|
121
|
+
// Default trigger: dispatches a native CustomEvent with extra args stashed
|
|
122
|
+
// on `event.detail` (an array). The jQuery adapter overrides this via
|
|
123
|
+
// setTrigger so handlers bound with $(el).on(type, fn) receive the extra
|
|
124
|
+
// args as positional parameters, matching upstream flot/flot behavior.
|
|
125
|
+
var triggerImpl = function(el, type, args) {
|
|
122
126
|
var event = new CustomEvent(type, {
|
|
123
127
|
detail: args || [],
|
|
124
128
|
bubbles: true,
|
|
@@ -126,6 +130,14 @@ export function trigger(el, type, args) {
|
|
|
126
130
|
});
|
|
127
131
|
el.dispatchEvent(event);
|
|
128
132
|
return event;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export function trigger(el, type, args) {
|
|
136
|
+
return triggerImpl(el, type, args);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function setTrigger(fn) {
|
|
140
|
+
triggerImpl = fn;
|
|
129
141
|
}
|
|
130
142
|
|
|
131
143
|
// Bind an event listener, tracking it so unbindAll can remove it later.
|