billboard.js 3.7.0-next.1 → 3.7.0-next.2
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/dist/billboard.css +6 -1
- package/dist/billboard.js +1196 -699
- package/dist/billboard.min.css +2 -2
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +2180 -1057
- package/dist/billboard.pkgd.min.js +4 -3
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.js +29 -22
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +29 -22
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +15 -13
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +15 -13
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +219 -158
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +270 -238
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +321 -295
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +258 -231
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +464 -445
- package/dist/theme/datalab.css +6 -1
- package/dist/theme/datalab.min.css +2 -2
- package/dist/theme/graph.css +6 -1
- package/dist/theme/graph.min.css +2 -2
- package/dist/theme/insight.css +6 -1
- package/dist/theme/insight.min.css +2 -2
- package/dist-esm/billboard.js +577 -180
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +3 -5
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +10 -9
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +10 -9
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +4 -8
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +3 -5
- package/package.json +17 -16
- package/src/Chart/api/legend.ts +1 -0
- package/src/Chart/api/load.ts +1 -0
- package/src/Chart/api/tooltip.ts +11 -2
- package/src/ChartInternal/ChartInternal.ts +35 -25
- package/src/ChartInternal/data/IData.ts +8 -0
- package/src/ChartInternal/data/convert.helper.ts +35 -21
- package/src/ChartInternal/data/data.ts +5 -3
- package/src/ChartInternal/data/load.ts +3 -0
- package/src/ChartInternal/interactions/interaction.ts +42 -33
- package/src/ChartInternal/internals/class.ts +3 -4
- package/src/ChartInternal/internals/clip.ts +13 -10
- package/src/ChartInternal/internals/legend.ts +3 -2
- package/src/ChartInternal/internals/redraw.ts +12 -5
- package/src/ChartInternal/internals/scale.ts +7 -2
- package/src/ChartInternal/internals/size.ts +41 -26
- package/src/ChartInternal/internals/text.ts +60 -32
- package/src/ChartInternal/internals/tooltip.ts +12 -8
- package/src/ChartInternal/internals/transform.ts +2 -2
- package/src/ChartInternal/internals/type.ts +6 -1
- package/src/ChartInternal/shape/bar.ts +1 -1
- package/src/ChartInternal/shape/radar.ts +2 -2
- package/src/ChartInternal/shape/shape.ts +10 -5
- package/src/ChartInternal/shape/treemap.ts +293 -0
- package/src/config/Options/data/data.ts +6 -3
- package/src/config/Options/shape/arc.ts +1 -1
- package/src/config/Options/shape/pie.ts +1 -1
- package/src/config/Options/shape/polar.ts +1 -1
- package/src/config/Options/shape/radar.ts +1 -1
- package/src/config/Options/shape/spline.ts +1 -1
- package/src/config/Options/shape/treemap.ts +53 -0
- package/src/config/Store/State.ts +1 -0
- package/src/config/classes.ts +7 -0
- package/src/config/const.ts +4 -2
- package/src/config/resolver/shape.ts +9 -1
- package/src/index.esm.ts +2 -1
- package/src/scss/billboard.scss +6 -0
- package/src/scss/theme/datalab.scss +6 -0
- package/src/scss/theme/graph.scss +6 -0
- package/src/scss/theme/insight.scss +6 -0
- package/types/bb.d.ts +1 -0
- package/types/index.d.ts +1 -0
- package/types/options.d.ts +4 -1
- package/types/options.shape.d.ts +31 -0
- package/types/types.d.ts +2 -1
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.7.0-next.
|
|
8
|
+
* @version 3.7.0-next.2
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
12
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3-selection"),require("d3-brush")):"function"==typeof define&&define.amd?define("bb",["d3-selection","d3-brush"],e):"object"==typeof exports?exports.bb=e(require("d3-selection"),require("d3-brush")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.tableview=e(t.d3,t.d3))}(this,(function(t,e){return function(){"use strict";var n=[,function(e){e.exports=t},,function(t){t.exports=e}],i={};function o(t){var e=i[t];if(void 0!==e)return e.exports;var r=i[t]={exports:{}};return n[t](r,r.exports,o),r.exports}o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var r={};return function(){function t(e){return t="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(e)}function e(e){var n=function(e,n){if("object"!==t(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var o=i.call(e,n||"default");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===t(n)?n:String(n)}function n(t,n,i){return(n=e(n))in t?Object.defineProperty(t,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[n]=i,t}function i(t,e){if(t!==e)throw new TypeError("Cannot instantiate an arrow function")}function c(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function a(t,e){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},a(t,e)}o.d(r,{default:function(){return D}});var s=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){i(this,t),this[e]=null,delete this[e]}.bind(this))},t}();s.version="3.7.0-next.
|
|
12
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3-selection"),require("d3-brush")):"function"==typeof define&&define.amd?define("bb",["d3-selection","d3-brush"],e):"object"==typeof exports?exports.bb=e(require("d3-selection"),require("d3-brush")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.tableview=e(t.d3,t.d3))}(this,(function(t,e){return function(){"use strict";var n=[,function(e){e.exports=t},,function(t){t.exports=e}],i={};function o(t){var e=i[t];if(void 0!==e)return e.exports;var r=i[t]={exports:{}};return n[t](r,r.exports,o),r.exports}o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var r={};return function(){function t(e){return t="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(e)}function e(e){var n=function(e,n){if("object"!==t(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var o=i.call(e,n||"default");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===t(n)?n:String(n)}function n(t,n,i){return(n=e(n))in t?Object.defineProperty(t,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[n]=i,t}function i(t,e){if(t!==e)throw new TypeError("Cannot instantiate an arrow function")}function c(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function a(t,e){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},a(t,e)}o.d(r,{default:function(){return D}});var s=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){i(this,t),this[e]=null,delete this[e]}.bind(this))},t}();s.version="3.7.0-next.2";var u=function(){return{selector:void 0,categoryTitle:"Category",categoryFormat:function(t){var e=t;return this.$$.axis.isCategorized()?e=this.$$.categoryName(t):this.$$.axis.isTimeSeries()&&(e=t.toLocaleDateString()),e},class:void 0,style:!0,title:void 0,updateOnToggle:!0}},l="__tableview-style__",f="bb-tableview",b=".bb-tableview {\n\t\tborder-collapse:collapse;\n\t\tborder-spacing:0;\n\t\tbackground:#fff;\n\t\tmin-width:100%;\n\t\tmargin-top:10px;\n\t\tfont-family:sans-serif;\n\t\tfont-size:.9em;\n\t}\n\t.bb-tableview tr:hover {\n\t\tbackground:#eef7ff;\n\t}\n\t.bb-tableview thead tr {\n\t\tbackground:#f8f8f8;\n\t}\n\t.bb-tableview caption,.bb-tableview td,.bb-tableview th {\n\t\ttext-align: center;\n\t\tborder:1px solid silver;\n\t\tpadding:.5em;\n\t}\n\t.bb-tableview caption {\n\t\tfont-size:1.1em;\n\t\tfont-weight:700;\n\t\tmargin-bottom: -1px;\n\t}",d="<caption>{=title}</caption>\n\t\t<thead><tr>{=thead}</tr></thead>\n\t\t<tbody>{=tbody}</tbody>",h='<th scope="col">{=title}</th>',v='<th scope="row">{=value}</th>',p="<td>{=value}</td>",g=(o(1),o(3),void 0),y=function(){return i(this,g),"object"==typeof globalThis&&null!==globalThis&&globalThis.Object===Object&&globalThis||"object"==typeof global&&null!==global&&global.Object===Object&&global||"object"==typeof self&&null!==self&&self.Object===Object&&self||Function("return this")()}.bind(void 0)();y.requestIdleCallback=y.requestIdleCallback||function(t){return i(this,g),setTimeout(t,1)}.bind(void 0),y.requestAnimationFrame=y.requestAnimationFrame||function(t){return i(this,g),setTimeout(t,1)}.bind(void 0);var m=null==y?void 0:y.document,w=void 0;(function(t){return i(this,w),t||0===t}).bind(void 0),function(t){return i(this,w),"function"==typeof t}.bind(void 0);var O=function(t){return i(this,w),"string"==typeof t}.bind(void 0),j=function(t){return i(this,w),"number"==typeof t}.bind(void 0),E=function(t){return i(this,w),void 0===t}.bind(void 0),T=function(t){return i(this,w),void 0!==t}.bind(void 0),$=(function(t){return i(this,w),"boolean"==typeof t}.bind(void 0),function(t){return i(this,w),10*Math.ceil(t/10)}.bind(void 0),function(t){return i(this,w),Math.ceil(t)+.5}.bind(void 0),function(t){return i(this,w),t[1]-t[0]}.bind(void 0),function(t){return i(this,w),"object"==typeof t}.bind(void 0)),x=function(t){return i(this,w),E(t)||null===t||O(t)&&0===t.length||$(t)&&!(t instanceof Date)&&0===Object.keys(t).length||j(t)&&isNaN(t)}.bind(void 0),S=(function(t){return i(this,w),!x(t)}.bind(void 0),function(t){return i(this,w),Array.isArray(t)}.bind(void 0)),P=function(t){return i(this,w),t&&!(null!=t&&t.nodeType)&&$(t)&&!S(t)}.bind(void 0);(function(t){return i(this,w),t.charAt(0).toUpperCase()+t.slice(1)}).bind(void 0);(function(t){return i(this,w),[].slice.call(t)}).bind(void 0);function C(t){for(var e=this,n=arguments.length,o=Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];if(!o.length||1===o.length&&!o[0])return t;var c=o.shift();return P(t)&&P(c)&&Object.keys(c).forEach(function(n){i(this,e);var o=c[n];P(o)?(t[n]||(t[n]={}),t[n]=C(t[n],o)):t[n]=S(o)?o.concat():o}.bind(this)),C.apply(void 0,[t].concat(o))}(function(t,e,n){void 0===n&&(n=1),i(this,w);for(var o=[],r=0|Math.max(0,Math.ceil((e-t)/n)),c=t;c<r;c++)o.push(t+c*n);return o}).bind(void 0),function(){var t=this;i(this,w);var e=function(){return i(this,t),{bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0}}.bind(this);try{return new MouseEvent("t"),function(n,o,r){void 0===r&&(r=e()),i(this,t),n.dispatchEvent(new MouseEvent(o,r))}.bind(this)}catch(n){return function(n,o,r){void 0===r&&(r=e()),i(this,t);var c=m.createEvent("MouseEvent");c.initMouseEvent(o,r.bubbles,r.cancelable,y,0,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),n.dispatchEvent(c)}.bind(this)}}.bind(void 0)(),function(t,e,n){i(this,w);var o=new Touch(C({identifier:Date.now(),target:t,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},n));t.dispatchEvent(new TouchEvent(e,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[o],targetTouches:[],changedTouches:[o]}))}.bind(void 0);function k(t,e){var n=t;for(var i in e)n=n.replace(new RegExp("{="+i+"}","g"),e[i]);return n}function M(t){var e,n,o,r=this,c=this.config,a=function(){i(this,r);var t=n.shift();return t&&e&&$(e)&&t in e?(e=e[t],a()):t?void 0:e}.bind(this);Object.keys(c).forEach(function(s){i(this,r),e=t,n=s.split("_"),o=a(),T(o)&&(c[s]=o)}.bind(this)),this.api&&(this.state.orgConfig=t)}function _(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function q(t){for(var e,i=1;i<arguments.length;i++)e=null!=arguments[i]?arguments[i]:{},i%2?_(Object(e),!0).forEach((function(i){n(t,i,e[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):_(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}));return t}var D=function(t){var e,n;function o(e){var n=t.call(this,e)||this;return n.config=void 0,n.element=void 0,n.config=new u,c(n)||c(n)}n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,a(e,n);var r=o.prototype;return r.$beforeInit=function(){M.call(this,this.options)},r.$init=function(){var t,e=this.config,n=e.class,i=e.selector,o=e.style,r=document.querySelector(i||"."+(n||f));if(!r){var c=this.$$.$el.chart.node();r=document.createElement("table"),c.parentNode.insertBefore(r,c.nextSibling)}if("TABLE"!==r.tagName){var a=document.createElement("table");r.appendChild(a),r=a}if(o&&!document.getElementById(l)){var s=document.createElement("style");s.id=l,s.innerHTML=b,(document.head||document.getElementsByTagName("head")[0]).appendChild(s)}(t=r.classList).add.apply(t,[o&&f,n].filter(Boolean)),this.element=r},r.generateTable=function(){var t=this,e=this.$$,n=this.config,o=this.element,r=e.filterTargetsToShow(e.data.targets),c=k(h,{title:r.length?this.config.categoryTitle:""}),a="",s=[];r.forEach(function(e){var n=this;i(this,t),c+=k(h,{title:e.id}),e.values.forEach(function(t,e){i(this,n),s[e]||(s[e]=[t.x]),s[e].push(t.value)}.bind(this))}.bind(this)),s.forEach(function(e){var o=this;i(this,t),a+="<tr>"+e.map(function(t,e){return i(this,o),k(e?p:v,{value:0===e?n.categoryFormat.bind(this)(t):j(t)?t.toLocaleString():""})}.bind(this)).join("")+"</tr>"}.bind(this));var u=k(d,q(q({},n),{},{title:n.title||e.config.title_text||"",thead:c,tbody:a})).replace(/<[^>]+><\/[^>]+>/g,"");o.innerHTML=u},r.$redraw=function(){var t=this.$$.state;t.resizing||!this.config.updateOnToggle&&t.toggling||this.generateTable()},r.$willDestroy=function(){if(this.element.parentNode.removeChild(this.element),1===this.$$.charts.length){var t,e=document.getElementById(l);null==e||null==(t=e.parentNode)||t.removeChild(e)}},o}(s)}(),r=r.default}()}));
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.7.0-next.
|
|
8
|
+
* @version 3.7.0-next.2
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -331,7 +331,8 @@ function hasValue(dict, value) {
|
|
|
331
331
|
* @private
|
|
332
332
|
*/
|
|
333
333
|
function callFn(fn, thisArg) {
|
|
334
|
-
|
|
334
|
+
var isFn = isFunction(fn);
|
|
335
|
+
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
335
336
|
args[_key - 2] = arguments[_key];
|
|
336
337
|
}
|
|
337
338
|
isFn && fn.call.apply(fn, [thisArg].concat(args));
|
|
@@ -503,8 +504,9 @@ function getPointer(event, element) {
|
|
|
503
504
|
function getBrushSelection(ctx) {
|
|
504
505
|
var event = ctx.event,
|
|
505
506
|
$el = ctx.$el,
|
|
506
|
-
main = $el.subchart.main || $el.main
|
|
507
|
-
|
|
507
|
+
main = $el.subchart.main || $el.main;
|
|
508
|
+
var selection;
|
|
509
|
+
|
|
508
510
|
// check from event
|
|
509
511
|
if (event && event.type === "brush") {
|
|
510
512
|
selection = event.selection;
|
|
@@ -563,8 +565,8 @@ function findIndex(arr, v, start, end, isRotated) {
|
|
|
563
565
|
if (start > end) {
|
|
564
566
|
return -1;
|
|
565
567
|
}
|
|
566
|
-
var mid = Math.floor((start + end) / 2)
|
|
567
|
-
|
|
568
|
+
var mid = Math.floor((start + end) / 2);
|
|
569
|
+
var _arr$mid = arr[mid],
|
|
568
570
|
x = _arr$mid.x,
|
|
569
571
|
_arr$mid$w = _arr$mid.w,
|
|
570
572
|
w = _arr$mid$w === void 0 ? 0 : _arr$mid$w;
|
|
@@ -602,12 +604,12 @@ function brushEmpty(ctx) {
|
|
|
602
604
|
* @private
|
|
603
605
|
*/
|
|
604
606
|
function deepClone() {
|
|
605
|
-
for (var _this6 = this,
|
|
607
|
+
for (var _this6 = this, _clone = function clone(v) {
|
|
606
608
|
_newArrowCheck(this, _this6);
|
|
607
609
|
if (isObject(v) && v.constructor) {
|
|
608
610
|
var r = new v.constructor();
|
|
609
611
|
for (var k in v) {
|
|
610
|
-
r[k] =
|
|
612
|
+
r[k] = _clone(v[k]);
|
|
611
613
|
}
|
|
612
614
|
return r;
|
|
613
615
|
}
|
|
@@ -617,7 +619,7 @@ function deepClone() {
|
|
|
617
619
|
}
|
|
618
620
|
return objectN.map(function (v) {
|
|
619
621
|
_newArrowCheck(this, _this6);
|
|
620
|
-
return
|
|
622
|
+
return _clone(v);
|
|
621
623
|
}.bind(this)).reduce(function (a, c) {
|
|
622
624
|
_newArrowCheck(this, _this6);
|
|
623
625
|
return _objectSpread(_objectSpread({}, a), c);
|
|
@@ -1094,12 +1096,12 @@ function loadConfig(config) {
|
|
|
1094
1096
|
target,
|
|
1095
1097
|
keys,
|
|
1096
1098
|
read,
|
|
1097
|
-
|
|
1099
|
+
_find = function find() {
|
|
1098
1100
|
_newArrowCheck(this, _this);
|
|
1099
1101
|
var key = keys.shift();
|
|
1100
1102
|
if (key && target && isObjectType(target) && key in target) {
|
|
1101
1103
|
target = target[key];
|
|
1102
|
-
return
|
|
1104
|
+
return _find();
|
|
1103
1105
|
} else if (!key) {
|
|
1104
1106
|
return target;
|
|
1105
1107
|
}
|
|
@@ -1109,7 +1111,7 @@ function loadConfig(config) {
|
|
|
1109
1111
|
_newArrowCheck(this, _this);
|
|
1110
1112
|
target = config;
|
|
1111
1113
|
keys = key.split("_");
|
|
1112
|
-
read =
|
|
1114
|
+
read = _find();
|
|
1113
1115
|
if (isDefined(read)) {
|
|
1114
1116
|
thisConfig[key] = read;
|
|
1115
1117
|
}
|
|
@@ -1193,7 +1195,7 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
1193
1195
|
};
|
|
1194
1196
|
return Plugin;
|
|
1195
1197
|
}();
|
|
1196
|
-
Plugin.version = "3.7.0-next.
|
|
1198
|
+
Plugin.version = "3.7.0-next.2";
|
|
1197
1199
|
|
|
1198
1200
|
;// CONCATENATED MODULE: ./src/Plugin/textoverlap/Options.ts
|
|
1199
1201
|
/**
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.7.0-next.
|
|
8
|
+
* @version 3.7.0-next.2
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
12
|
-
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("d3-delaunay"),require("d3-polygon"),require("d3-selection"),require("d3-brush")):"function"==typeof define&&define.amd?define("bb",["d3-delaunay","d3-polygon","d3-selection","d3-brush"],n):"object"==typeof exports?exports.bb=n(require("d3-delaunay"),require("d3-polygon"),require("d3-selection"),require("d3-brush")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.textoverlap=n(t.d3,t.d3,t.d3,t.d3))}(this,(function(t,n,e,i){return function(){"use strict";var o={3:function(t){t.exports=i},12:function(n){n.exports=t},13:function(t){t.exports=n},1:function(t){t.exports=e}},r={};function u(t){var n=r[t];if(void 0!==n)return n.exports;var e=r[t]={exports:{}};return o[t](e,e.exports,u),e.exports}u.d=function(t,n){for(var e in n)u.o(n,e)&&!u.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},u.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)};var s={};return function(){function t(t,n){if(t!==n)throw new TypeError("Cannot instantiate an arrow function")}function n(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?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},e(t,n)}u.d(s,{default:function(){return w}});var i=u(12),o=u(13);u(1),u(3);var r=void 0,c=function(){return t(this,r),"object"==typeof globalThis&&null!==globalThis&&globalThis.Object===Object&&globalThis||"object"==typeof global&&null!==global&&global.Object===Object&&global||"object"==typeof self&&null!==self&&self.Object===Object&&self||Function("return this")()}.bind(void 0)();c.requestIdleCallback=c.requestIdleCallback||function(n){return t(this,r),setTimeout(n,1)}.bind(void 0),c.requestAnimationFrame=c.requestAnimationFrame||function(n){return t(this,r),setTimeout(n,1)}.bind(void 0);var a=null==c?void 0:c.document,d=void 0;(function(n){return t(this,d),n||0===n}).bind(void 0),function(n){return t(this,d),"function"==typeof n}.bind(void 0);var l=function(n){return t(this,d),"string"==typeof n}.bind(void 0),f=function(n){return t(this,d),"number"==typeof n}.bind(void 0),h=function(n){return t(this,d),void 0===n}.bind(void 0),b=function(n){return t(this,d),void 0!==n}.bind(void 0),v=(function(n){return t(this,d),"boolean"==typeof n}.bind(void 0),function(n){return t(this,d),10*Math.ceil(n/10)}.bind(void 0),function(n){return t(this,d),Math.ceil(n)+.5}.bind(void 0),function(n){return t(this,d),n[1]-n[0]}.bind(void 0),function(n){return t(this,d),"object"==typeof n}.bind(void 0)),p=function(n){return t(this,d),h(n)||null===n||l(n)&&0===n.length||v(n)&&!(n instanceof Date)&&0===Object.keys(n).length||f(n)&&isNaN(n)}.bind(void 0),y=(function(n){return t(this,d),!p(n)}.bind(void 0),function(n){return t(this,d),Array.isArray(n)}.bind(void 0)),g=function(n){return t(this,d),n&&!(null!=n&&n.nodeType)&&v(n)&&!y(n)}.bind(void 0);(function(n){return t(this,d),n.charAt(0).toUpperCase()+n.slice(1)}).bind(void 0);(function(n){return t(this,d),[].slice.call(n)}).bind(void 0);function j(n){for(var e=this,i=arguments.length,o=Array(i>1?i-1:0),r=1;r<i;r++)o[r-1]=arguments[r];if(!o.length||1===o.length&&!o[0])return n;var u=o.shift();return g(n)&&g(u)&&Object.keys(u).forEach(function(i){t(this,e);var o=u[i];g(o)?(n[i]||(n[i]={}),n[i]=j(n[i],o)):n[i]=y(o)?o.concat():o}.bind(this)),j.apply(void 0,[n].concat(o))}(function(n,e,i){void 0===i&&(i=1),t(this,d);for(var o=[],r=0|Math.max(0,Math.ceil((e-n)/i)),u=n;u<r;u++)o.push(n+u*i);return o}).bind(void 0),function(){var n=this;t(this,d);var e=function(){return t(this,n),{bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0}}.bind(this);try{return new MouseEvent("t"),function(i,o,r){void 0===r&&(r=e()),t(this,n),i.dispatchEvent(new MouseEvent(o,r))}.bind(this)}catch(i){return function(i,o,r){void 0===r&&(r=e()),t(this,n);var u=a.createEvent("MouseEvent");u.initMouseEvent(o,r.bubbles,r.cancelable,c,0,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),i.dispatchEvent(u)}.bind(this)}}.bind(void 0)(),function(n,e,i){t(this,d);var o=new Touch(j({identifier:Date.now(),target:n,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},i));n.dispatchEvent(new TouchEvent(e,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[o],targetTouches:[],changedTouches:[o]}))}.bind(void 0);function m(n){var e,i,o,r=this,u=this.config,s=function(){t(this,r);var n=i.shift();return n&&e&&v(e)&&n in e?(e=e[n],s()):n?void 0:e}.bind(this);Object.keys(u).forEach(function(c){t(this,r),e=n,i=c.split("_"),o=s(),b(o)&&(u[c]=o)}.bind(this)),this.api&&(this.state.orgConfig=n)}var x=function(){function n(t){void 0===t&&(t={}),this.$$=void 0,this.options=void 0,this.options=t}var e=n.prototype;return e.$beforeInit=function(){},e.$init=function(){},e.$afterInit=function(){},e.$redraw=function(){},e.$willDestroy=function(){var n=this;Object.keys(this).forEach(function(e){t(this,n),this[e]=null,delete this[e]}.bind(this))},n}();x.version="3.7.0-next.
|
|
12
|
+
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("d3-delaunay"),require("d3-polygon"),require("d3-selection"),require("d3-brush")):"function"==typeof define&&define.amd?define("bb",["d3-delaunay","d3-polygon","d3-selection","d3-brush"],n):"object"==typeof exports?exports.bb=n(require("d3-delaunay"),require("d3-polygon"),require("d3-selection"),require("d3-brush")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.textoverlap=n(t.d3,t.d3,t.d3,t.d3))}(this,(function(t,n,e,i){return function(){"use strict";var o={3:function(t){t.exports=i},12:function(n){n.exports=t},13:function(t){t.exports=n},1:function(t){t.exports=e}},r={};function u(t){var n=r[t];if(void 0!==n)return n.exports;var e=r[t]={exports:{}};return o[t](e,e.exports,u),e.exports}u.d=function(t,n){for(var e in n)u.o(n,e)&&!u.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},u.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)};var s={};return function(){function t(t,n){if(t!==n)throw new TypeError("Cannot instantiate an arrow function")}function n(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?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},e(t,n)}u.d(s,{default:function(){return w}});var i=u(12),o=u(13);u(1),u(3);var r=void 0,c=function(){return t(this,r),"object"==typeof globalThis&&null!==globalThis&&globalThis.Object===Object&&globalThis||"object"==typeof global&&null!==global&&global.Object===Object&&global||"object"==typeof self&&null!==self&&self.Object===Object&&self||Function("return this")()}.bind(void 0)();c.requestIdleCallback=c.requestIdleCallback||function(n){return t(this,r),setTimeout(n,1)}.bind(void 0),c.requestAnimationFrame=c.requestAnimationFrame||function(n){return t(this,r),setTimeout(n,1)}.bind(void 0);var a=null==c?void 0:c.document,d=void 0;(function(n){return t(this,d),n||0===n}).bind(void 0),function(n){return t(this,d),"function"==typeof n}.bind(void 0);var l=function(n){return t(this,d),"string"==typeof n}.bind(void 0),f=function(n){return t(this,d),"number"==typeof n}.bind(void 0),h=function(n){return t(this,d),void 0===n}.bind(void 0),b=function(n){return t(this,d),void 0!==n}.bind(void 0),v=(function(n){return t(this,d),"boolean"==typeof n}.bind(void 0),function(n){return t(this,d),10*Math.ceil(n/10)}.bind(void 0),function(n){return t(this,d),Math.ceil(n)+.5}.bind(void 0),function(n){return t(this,d),n[1]-n[0]}.bind(void 0),function(n){return t(this,d),"object"==typeof n}.bind(void 0)),p=function(n){return t(this,d),h(n)||null===n||l(n)&&0===n.length||v(n)&&!(n instanceof Date)&&0===Object.keys(n).length||f(n)&&isNaN(n)}.bind(void 0),y=(function(n){return t(this,d),!p(n)}.bind(void 0),function(n){return t(this,d),Array.isArray(n)}.bind(void 0)),g=function(n){return t(this,d),n&&!(null!=n&&n.nodeType)&&v(n)&&!y(n)}.bind(void 0);(function(n){return t(this,d),n.charAt(0).toUpperCase()+n.slice(1)}).bind(void 0);(function(n){return t(this,d),[].slice.call(n)}).bind(void 0);function j(n){for(var e=this,i=arguments.length,o=Array(i>1?i-1:0),r=1;r<i;r++)o[r-1]=arguments[r];if(!o.length||1===o.length&&!o[0])return n;var u=o.shift();return g(n)&&g(u)&&Object.keys(u).forEach(function(i){t(this,e);var o=u[i];g(o)?(n[i]||(n[i]={}),n[i]=j(n[i],o)):n[i]=y(o)?o.concat():o}.bind(this)),j.apply(void 0,[n].concat(o))}(function(n,e,i){void 0===i&&(i=1),t(this,d);for(var o=[],r=0|Math.max(0,Math.ceil((e-n)/i)),u=n;u<r;u++)o.push(n+u*i);return o}).bind(void 0),function(){var n=this;t(this,d);var e=function(){return t(this,n),{bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0}}.bind(this);try{return new MouseEvent("t"),function(i,o,r){void 0===r&&(r=e()),t(this,n),i.dispatchEvent(new MouseEvent(o,r))}.bind(this)}catch(i){return function(i,o,r){void 0===r&&(r=e()),t(this,n);var u=a.createEvent("MouseEvent");u.initMouseEvent(o,r.bubbles,r.cancelable,c,0,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),i.dispatchEvent(u)}.bind(this)}}.bind(void 0)(),function(n,e,i){t(this,d);var o=new Touch(j({identifier:Date.now(),target:n,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},i));n.dispatchEvent(new TouchEvent(e,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[o],targetTouches:[],changedTouches:[o]}))}.bind(void 0);function m(n){var e,i,o,r=this,u=this.config,s=function(){t(this,r);var n=i.shift();return n&&e&&v(e)&&n in e?(e=e[n],s()):n?void 0:e}.bind(this);Object.keys(u).forEach(function(c){t(this,r),e=n,i=c.split("_"),o=s(),b(o)&&(u[c]=o)}.bind(this)),this.api&&(this.state.orgConfig=n)}var x=function(){function n(t){void 0===t&&(t={}),this.$$=void 0,this.options=void 0,this.options=t}var e=n.prototype;return e.$beforeInit=function(){},e.$init=function(){},e.$afterInit=function(){},e.$redraw=function(){},e.$willDestroy=function(){var n=this;Object.keys(this).forEach(function(e){t(this,n),this[e]=null,delete this[e]}.bind(this))},n}();x.version="3.7.0-next.2";var O=function(){return{selector:void 0,extent:1,area:0}},w=function(r){var u,s;function c(t){var e=r.call(this,t)||this;return e.config=void 0,e.config=new O,n(e)||n(e)}s=r,(u=c).prototype=Object.create(s.prototype),u.prototype.constructor=u,e(u,s);var a=c.prototype;return a.$init=function(){m.call(this,this.options)},a.$redraw=function(){var t=this.$$.$el,n=this.config.selector,e=n?t.main.selectAll(n):t.text;e.empty()||this.preventLabelOverlap(e)},a.generateVoronoi=function(n){var e=this,o=this.$$.scale,r=["x","y"].map(function(n){return t(this,e),o[n].domain()}.bind(this)),u=r[0],s=r[1],c=[s[0],u[1]];return u[1]=c[0],s[0]=c[1],i.Delaunay.from(n).voronoi([].concat(u,s))},a.preventLabelOverlap=function(n){var e=this,i=this.config,r=i.extent,u=i.area,s=n.data().map(function(n){return t(this,e),[n.index,n.value]}.bind(this)),c=this.generateVoronoi(s),a=0;n.each((function(){var t=c.cellPolygon(a);if(t&&this){var n=s[a],e=n[0],i=n[1],d=(0,o.polygonCentroid)(t),l=d[0],f=d[1],h=Math.abs((0,o.polygonArea)(t)),b=Math.round(Math.atan2(f-i,l-e)/Math.PI*2),v=r*(0===b?1:-1),p=-1===b?-r:r+5,y=1===Math.abs(b)?"middle":0===b?"start":"end";this.style.display=h<u?"none":"",this.setAttribute("text-anchor",y),this.setAttribute("dy","0."+(1===b?71:35)+"em"),this.setAttribute("transform","translate("+v+", "+p+")")}a++}))},c}(x)}(),s=s.default}()}));
|