UNPKG

6.17 kBJavaScriptView Raw
1/*!
2 * Copyright (c) 2017 ~ present NAVER Corp.
3 * billboard.js project is licensed under the MIT license
4 *
5 * billboard.js, JavaScript chart library
6 * http://naver.github.io/billboard.js/
7 *
8 * @version 1.12.1
9 * @requires billboard.js
10 * @summary billboard.js plugin
11 */
12!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3-selection")):"function"==typeof define&&define.amd?define("bubblecompare",["d3-selection"],e):"object"==typeof exports?exports.bubblecompare=e(require("d3-selection")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.bubblecompare=e(t.d3))}(this,(function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return b}));var r=n(20),o=n(1),u=n(2),i=n(3),c=n(6),a=n(5),f=n(22),s=n(7),l=n(8),b=function(t){function e(t){var n;return Object(o.a)(this,e),n=Object(i.a)(this,Object(c.a)(e).call(this,t)),Object(i.a)(n,Object(a.a)(n))}return Object(f.a)(e,t),Object(u.a)(e,[{key:"$init",value:function(){var t=this.$$;t.findClosest=this.findClosest.bind(this),t.getBubbleR=this.getBubbleR.bind(this),t.pointExpandedR=this.pointExpandedR.bind(this)}},{key:"pointExpandedR",value:function(t){var n=this.getBubbleR(t),r=this.options.expandScale,o=void 0===r?1:r;return e.raiseFocusedBubbleLayer(t),this.changeCursorPoint(),n*o}},{key:"changeCursorPoint",value:function(){this.$$.svg.select(".bb-event-rect").style("cursor","pointer")}},{key:"findClosest",value:function(t,e){var n=this,r=this.$$;return t.filter((function(t){return t&&!r.isBarType(t.id)})).reduce((function(t,o){return r.dist(o,e)<n.getBubbleR(o)?o:t}),0)}},{key:"getBubbleR",value:function(t){var e=this,n=this.options,o=n.minR,u=n.maxR,i=this.getZData(t);if(!i)return o;var c=this.$$.data.targets.reduce((function(t,n){var o=Object(r.a)(t,2),u=o[0],i=o[1],c=e.getZData(n.values[0]);return[Math.min(u,c),Math.max(i,c)]}),[1e4,0]),a=Object(r.a)(c,2),f=a[0],s=a[1],l=f>0&&s===f?0:i/s;return Math.abs(l)*(u-o)+o}},{key:"getZData",value:function(t){return this.$$.isBubbleZType(t)?this.$$.getBubbleZData(t.value,"z"):t.value}}],[{key:"raiseFocusedBubbleLayer",value:function(t){t.raise&&Object(l.select)(t.node().parentNode.parentNode).raise()}}]),e}(n(9).a);Object(s.a)(b,"version","0.0.1")},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}n.d(e,"a",(function(){return o}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(4),o=n(5);function u(t,e){return!e||"object"!==Object(r.a)(e)&&"function"!=typeof e?Object(o.a)(t):e}},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,"a",(function(){return r}))},function(e,n){e.exports=t},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(1),o=n(2),u=n(7),i=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,t),this.options=e}return Object(o.a)(t,[{key:"$beforeInit",value:function(){}},{key:"$init",value:function(){}},{key:"$afterInit",value:function(){}},{key:"$redraw",value:function(){}},{key:"$willDestroy",value:function(){var t=this;Object.keys(this).forEach((function(e){t[e]=null,delete t[e]}))}}]),t}();Object(u.a)(i,"version","1.12.1")},,,,,,,,,,,function(t,e,n){"use strict";function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var n=[],r=!0,o=!1,u=void 0;try{for(var i,c=t[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!e||n.length!==e);r=!0);}catch(t){o=!0,u=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw u}}return n}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}n.d(e,"a",(function(){return r}))},,function(t,e,n){"use strict";function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}n.d(e,"a",(function(){return o}))}]).default}));
\No newline at end of file