UNPKG

2.96 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 * https://naver.github.io/billboard.js/
7 *
8 * @version 3.2.2
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("bb",["d3-selection"],e):"object"==typeof exports?exports.bb=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(){"use strict";var e=[,function(e){e.exports=t}],n={};function i(t){var r=n[t];if(void 0!==r)return r.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,i),o.exports}i.d=function(t,e){for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var r={};return function(){function t(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function e(t,n){return e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(t,n)}i.d(r,{default:function(){return u}});var n=i(1),o=function(){function t(t){void 0===t&&(t={}),this.$$=void 0,this.options=void 0,this.options=t}var e=t.prototype;return e.$beforeInit=function(){},e.$init=function(){},e.$afterInit=function(){},e.$redraw=function(){},e.$willDestroy=function(){var t=this;Object.keys(this).forEach((function(e){t[e]=null,delete t[e]}))},t}();o.version="3.2.1";var u=function(i){var r,o;function u(e){var n=i.call(this,e)||this;return n.$$=void 0,t(n)||t(n)}o=i,(r=u).prototype=Object.create(o.prototype),r.prototype.constructor=r,e(r,o);var s=u.prototype;return s.$init=function(){var t=this.$$;t.findClosest=this.findClosest.bind(this),t.getBubbleR=this.getBubbleR.bind(this),t.pointExpandedR=this.pointExpandedR.bind(this)},s.pointExpandedR=function(t){var e=this.getBubbleR(t),n=this.options.expandScale,i=void 0===n?1:n;return u.raiseFocusedBubbleLayer(t),this.changeCursorPoint(),e*i},u.raiseFocusedBubbleLayer=function(t){t.raise&&(0,n.select)(t.node().parentNode.parentNode).raise()},s.changeCursorPoint=function(){this.$$.$el.svg.select(".bb-event-rect").style("cursor","pointer")},s.findClosest=function(t,e){var n=this,i=this.$$;return t.filter((function(t){return t&&!i.isBarType(t.id)})).reduce((function(t,r){return i.dist(r,e)<n.getBubbleR(r)?r:t}),0)},s.getBubbleR=function(t){var e=this,n=this.options,i=n.minR,r=n.maxR,o=this.getZData(t);if(!o)return i;var u=this.$$.data.targets.reduce((function(t,n){var i=t[0],r=t[1],o=e.getZData(n.values[0]);return[Math.min(i,o),Math.max(r,o)]}),[1e4,0]),s=u[0],a=u[1],c=s>0&&a===s?0:o/a;return Math.abs(c)*(r-i)+i},s.getZData=function(t){return this.$$.isBubbleZType(t)?this.$$.getBubbleZData(t.value,"z"):t.value},u}(o);u.version="0.0.1"}(),r=r.default}()}));
\No newline at end of file