billboard.js 3.2.0-next.6 → 3.3.0-next.1
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 +8 -8
- package/dist/billboard.js +294 -126
- package/dist/billboard.min.css +2 -2
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +5500 -3359
- package/dist/billboard.pkgd.min.js +3 -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 +17 -12
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +17 -12
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +19 -14
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +17 -12
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +5043 -3261
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +5067 -3280
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +5069 -3282
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +5062 -3275
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +5061 -3274
- package/dist/theme/datalab.css +6 -4
- package/dist/theme/datalab.min.css +2 -2
- package/dist/theme/graph.css +6 -4
- package/dist/theme/graph.min.css +2 -2
- package/dist/theme/insight.css +6 -4
- package/dist/theme/insight.min.css +2 -2
- package/dist-esm/billboard.js +602 -464
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +6 -6
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +15 -15
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +6 -6
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +4 -4
- package/package.json +55 -56
- package/src/ChartInternal/Axis/Axis.ts +2 -2
- package/src/ChartInternal/ChartInternal.ts +11 -2
- package/src/ChartInternal/data/convert.ts +1 -1
- package/src/ChartInternal/data/data.ts +28 -11
- package/src/ChartInternal/interactions/zoom.ts +1 -1
- package/src/ChartInternal/internals/domain.ts +31 -31
- package/src/ChartInternal/internals/legend.ts +2 -1
- package/src/ChartInternal/internals/redraw.ts +2 -2
- package/src/ChartInternal/internals/scale.ts +3 -2
- package/src/ChartInternal/internals/size.ts +32 -1
- package/src/ChartInternal/internals/text.ts +4 -4
- package/src/ChartInternal/internals/tooltip.ts +4 -0
- package/src/ChartInternal/shape/arc.ts +2 -6
- package/src/ChartInternal/shape/bar.ts +87 -34
- package/src/ChartInternal/shape/shape.ts +33 -2
- package/src/Plugin/tableview/index.ts +1 -1
- package/src/config/Options/axis/x.ts +2 -2
- package/src/config/Options/common/main.ts +11 -1
- package/src/config/Options/data/data.ts +25 -3
- package/src/config/Options/shape/bar.ts +1 -2
- package/src/module/util.ts +19 -20
- package/src/scss/billboard.scss +3 -13
- package/src/scss/theme/datalab.scss +3 -7
- package/src/scss/theme/graph.scss +3 -2
- package/src/scss/theme/insight.scss +3 -2
- package/types/options.d.ts +11 -4
- package/types/types.d.ts +9 -6
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.3.0-next.1
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -192,7 +192,7 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
192
192
|
return Plugin;
|
|
193
193
|
}();
|
|
194
194
|
|
|
195
|
-
Plugin.version = "3.2.
|
|
195
|
+
Plugin.version = "3.2.2";
|
|
196
196
|
|
|
197
197
|
;// CONCATENATED MODULE: ./src/Plugin/bubblecompare/index.ts
|
|
198
198
|
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.3.0-next.1
|
|
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")):"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.
|
|
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.2";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}()}));
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.3.0-next.1
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -312,7 +312,7 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
312
312
|
return Plugin;
|
|
313
313
|
}();
|
|
314
314
|
|
|
315
|
-
Plugin.version = "3.2.
|
|
315
|
+
Plugin.version = "3.2.2";
|
|
316
316
|
|
|
317
317
|
;// CONCATENATED MODULE: ./src/Plugin/sparkline/Options.ts
|
|
318
318
|
/**
|
|
@@ -398,9 +398,9 @@ var doc = win == null ? void 0 : win.document;
|
|
|
398
398
|
;// CONCATENATED MODULE: ./src/module/util.ts
|
|
399
399
|
|
|
400
400
|
|
|
401
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
401
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
402
402
|
|
|
403
|
-
function _objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = arguments[i]
|
|
403
|
+
function _objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
404
404
|
|
|
405
405
|
/**
|
|
406
406
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
@@ -490,18 +490,19 @@ function hasValue(dict, value) {
|
|
|
490
490
|
/**
|
|
491
491
|
* Call function with arguments
|
|
492
492
|
* @param {Function} fn Function to be called
|
|
493
|
-
* @param {*}
|
|
493
|
+
* @param {*} thisArg "this" value for fn
|
|
494
|
+
* @param {*} args Arguments for fn
|
|
494
495
|
* @returns {boolean} true: fn is function, false: fn is not function
|
|
495
496
|
* @private
|
|
496
497
|
*/
|
|
497
498
|
|
|
498
499
|
|
|
499
|
-
function callFn(fn) {
|
|
500
|
-
for (var isFn = isFunction(fn), _len = arguments.length, args = Array(_len >
|
|
501
|
-
args[_key -
|
|
500
|
+
function callFn(fn, thisArg) {
|
|
501
|
+
for (var isFn = isFunction(fn), _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
502
|
+
args[_key - 2] = arguments[_key];
|
|
502
503
|
}
|
|
503
504
|
|
|
504
|
-
isFn && fn.call.apply(fn, args);
|
|
505
|
+
isFn && fn.call.apply(fn, [thisArg].concat(args));
|
|
505
506
|
return isFn;
|
|
506
507
|
}
|
|
507
508
|
/**
|
|
@@ -657,9 +658,13 @@ function getPathBox(path) {
|
|
|
657
658
|
|
|
658
659
|
|
|
659
660
|
function getPointer(event, element) {
|
|
660
|
-
var
|
|
661
|
-
|
|
662
|
-
|
|
661
|
+
var _ref,
|
|
662
|
+
touches = event && ((_ref = event.touches || event.sourceEvent && event.sourceEvent.touches) == null ? void 0 : _ref[0]),
|
|
663
|
+
pointer = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.pointer)(touches || event, element);
|
|
664
|
+
|
|
665
|
+
return pointer.map(function (v) {
|
|
666
|
+
return isNaN(v) ? 0 : v;
|
|
667
|
+
});
|
|
663
668
|
}
|
|
664
669
|
/**
|
|
665
670
|
* Return brush selection array
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.3.0-next.1
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
12
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("d3-selection"),require("d3-brush")):"function"==typeof define&&define.amd?define("bb",["d3-selection","d3-brush"],t):"object"==typeof exports?exports.bb=t(require("d3-selection"),require("d3-brush")):(e.bb=e.bb||{},e.bb.plugin=e.bb.plugin||{},e.bb.plugin.sparkline=t(e.d3,e.d3))}(this,(function(e,t){return function(){"use strict";var n=[,function(t){t.exports=e},,function(e){e.exports=t}],i={};function o(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return n[e](r,r.exports,o),r.exports}o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var r={};return function(){function e(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}o.d(r,{default:function(){return f}});var n="bb-target",i=function(){function e(e){void 0===e&&(e={}),this.$$=void 0,this.options=void 0,this.options=e}var t=e.prototype;return t.$beforeInit=function(){},t.$init=function(){},t.$afterInit=function(){},t.$redraw=function(){},t.$willDestroy=function(){var e=this;Object.keys(this).forEach((function(t){e[t]=null,delete e[t]}))},e}();i.version="3.2.
|
|
12
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("d3-selection"),require("d3-brush")):"function"==typeof define&&define.amd?define("bb",["d3-selection","d3-brush"],t):"object"==typeof exports?exports.bb=t(require("d3-selection"),require("d3-brush")):(e.bb=e.bb||{},e.bb.plugin=e.bb.plugin||{},e.bb.plugin.sparkline=t(e.d3,e.d3))}(this,(function(e,t){return function(){"use strict";var n=[,function(t){t.exports=e},,function(e){e.exports=t}],i={};function o(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return n[e](r,r.exports,o),r.exports}o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var r={};return function(){function e(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}o.d(r,{default:function(){return f}});var n="bb-target",i=function(){function e(e){void 0===e&&(e={}),this.$$=void 0,this.options=void 0,this.options=e}var t=e.prototype;return t.$beforeInit=function(){},t.$init=function(){},t.$afterInit=function(){},t.$redraw=function(){},t.$willDestroy=function(){var e=this;Object.keys(this).forEach((function(t){e[t]=null,delete e[t]}))},e}();i.version="3.2.2";var l=function(){return{selector:void 0}};o(1),o(3);var s="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")();s.requestIdleCallback=s.requestIdleCallback||function(e){return setTimeout(e,1)},s.cancelIdleCallback=s.cancelIdleCallback||function(e){return clearTimeout(e)};var c=null==s?void 0:s.document;var a=function(e){return void 0!==e},u=function(e){return"object"==typeof e};!function(){try{new MouseEvent("t")}catch(e){return function(e,t,n){void 0===n&&(n={bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});var i=c.createEvent("MouseEvent");i.initMouseEvent(t,n.bubbles,n.cancelable,s,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),e.dispatchEvent(i)}}}();function d(e){var t,n,i,o=this.config,r=function(){var e=n.shift();return e&&t&&u(t)&&e in t?(t=t[e],r()):e?void 0:t};Object.keys(o).forEach((function(l){t=e,n=l.split("_"),i=r(),a(i)&&(o[l]=i)}))}var f=function(i){var o,r;function s(t){var n=i.call(this,t)||this;return n.config=void 0,n.element=void 0,n.config=new l,e(n)||e(n)}r=i,(o=s).prototype=Object.create(r.prototype),o.prototype.constructor=o,t(o,r);var c=s.prototype;return c.$beforeInit=function(){d.call(this,this.options),this.validate(),this.element=[].slice.call(document.querySelectorAll(this.config.selector)),this.overrideInternals(),this.overrideOptions(),this.overHandler=this.overHandler.bind(this),this.moveHandler=this.moveHandler.bind(this),this.outHandler=this.outHandler.bind(this)},c.validate=function(){var e=this.$$,t=this.config,n="";if(t.selector&&document.querySelector(t.selector)||(n="No holder elements found from given selector option."),(e.hasType("bubble")||e.hasType("scatter")||e.hasArcType(e.data.targets))&&(n="Contains non supported chart types."),n)throw new Error("[Sparkline plugin] "+n)},c.overrideInternals=function(){var e=this.$$,t=e.getBarW,n=e.getIndices;e.getIndices=function(e,t,i){return"getShapeX"===i?{}:n.call(this,e,t)},e.getBarW=function(e,n){return t.call(this,e,n,1)}},c.overrideOptions=function(){var e=this.$$.config;e.legend_show=!1,e.resize_auto=!1,e.axis_x_show=!1,e.axis_x_padding={left:15,right:15,unit:"px"},e.axis_y_show=!1,e.axis_y_padding=5,e.tooltip_position||(e.tooltip_position=function(e,t,n){var i=this.internal.state.event,o=i.pageY-1.35*n,r=i.pageX-t/2;return o<0&&(o=0),r<0&&(r=0),{top:o,left:r}})},c.$init=function(){var e=this.$$.$el;e.chart.style("width","0").style("height","0").style("pointer-events","none"),document.body.appendChild(e.tooltip.node())},c.$afterInit=function(){this.$$.$el.svg.attr("style",null).style("width","0").style("height","0"),this.bindEvents(!0)},c.bindEvents=function(e){var t=this;if(void 0===e&&(e=!0),this.$$.config.interaction_enabled){var n=(e?"add":"remove")+"EventListener";this.element.forEach((function(e){var i=e.querySelector("svg");i[n]("mouseover",t.overHandler),i[n]("mousemove",t.moveHandler),i[n]("mouseout",t.outHandler)}))}},c.overHandler=function(e){this.$$.state.eventReceiver.rect=e.target.getBoundingClientRect()},c.moveHandler=function(e){var t,n,i,o=this.$$,r=o.getDataIndexFromEvent(e),l=null==(t=o.api.data(e.target.__id))?void 0:t[0],s=null==(n=l)||null==(i=n.values)?void 0:i[r];s&&!s.name&&(s.name=s.id),o.state.event=e,o.setExpand(r,l.id,!0),o.showTooltip([s],e.target)},c.outHandler=function(e){var t=this.$$;t.state.event=e,t.unexpandCircles(),t.hideTooltip()},c.$redraw=function(){var e,t=this.$$,i=t.$el,o=this.element,r=t.api.data(),l=null==(e=i.chart.html().match(/<svg[^>]*>/))?void 0:e[0];if(o.length<r.length){for(var s=i.chart.node(),c=r.length-o.length;c>0;c--)s.parentNode.insertBefore(o[0].cloneNode(),s.nextSibling);this.element=document.querySelectorAll(this.config.selector),o=this.element}r.map((function(e){return e.id})).forEach((function(e,t){var r="."+n+"-"+e,s=i.main.selectAll(r),c=o[t].querySelector("svg");c||(o[t].innerHTML=l+"</svg>",(c=o[t].querySelector("svg")).__id=e),c.querySelector(r)||s.style("opacity",null),s.style("fill","none").style("opacity",null),c.innerHTML="",c.appendChild(s.node())}))},c.$willDestroy=function(){this.bindEvents(!1),this.element.forEach((function(e){e.innerHTML=""}))},s}(i);f.version="0.0.1"}(),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.
|
|
8
|
+
* @version 3.3.0-next.1
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -319,9 +319,9 @@ var doc = win == null ? void 0 : win.document;
|
|
|
319
319
|
;// CONCATENATED MODULE: ./src/module/util.ts
|
|
320
320
|
|
|
321
321
|
|
|
322
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
322
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
323
323
|
|
|
324
|
-
function _objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = arguments[i]
|
|
324
|
+
function _objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
325
325
|
|
|
326
326
|
/**
|
|
327
327
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
@@ -411,18 +411,19 @@ function hasValue(dict, value) {
|
|
|
411
411
|
/**
|
|
412
412
|
* Call function with arguments
|
|
413
413
|
* @param {Function} fn Function to be called
|
|
414
|
-
* @param {*}
|
|
414
|
+
* @param {*} thisArg "this" value for fn
|
|
415
|
+
* @param {*} args Arguments for fn
|
|
415
416
|
* @returns {boolean} true: fn is function, false: fn is not function
|
|
416
417
|
* @private
|
|
417
418
|
*/
|
|
418
419
|
|
|
419
420
|
|
|
420
|
-
function callFn(fn) {
|
|
421
|
-
for (var isFn = isFunction(fn), _len = arguments.length, args = Array(_len >
|
|
422
|
-
args[_key -
|
|
421
|
+
function callFn(fn, thisArg) {
|
|
422
|
+
for (var isFn = isFunction(fn), _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
423
|
+
args[_key - 2] = arguments[_key];
|
|
423
424
|
}
|
|
424
425
|
|
|
425
|
-
isFn && fn.call.apply(fn, args);
|
|
426
|
+
isFn && fn.call.apply(fn, [thisArg].concat(args));
|
|
426
427
|
return isFn;
|
|
427
428
|
}
|
|
428
429
|
/**
|
|
@@ -578,9 +579,13 @@ function getPathBox(path) {
|
|
|
578
579
|
|
|
579
580
|
|
|
580
581
|
function getPointer(event, element) {
|
|
581
|
-
var
|
|
582
|
-
|
|
583
|
-
|
|
582
|
+
var _ref,
|
|
583
|
+
touches = event && ((_ref = event.touches || event.sourceEvent && event.sourceEvent.touches) == null ? void 0 : _ref[0]),
|
|
584
|
+
pointer = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.pointer)(touches || event, element);
|
|
585
|
+
|
|
586
|
+
return pointer.map(function (v) {
|
|
587
|
+
return isNaN(v) ? 0 : v;
|
|
588
|
+
});
|
|
584
589
|
}
|
|
585
590
|
/**
|
|
586
591
|
* Return brush selection array
|
|
@@ -1242,7 +1247,7 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
1242
1247
|
return Plugin;
|
|
1243
1248
|
}();
|
|
1244
1249
|
|
|
1245
|
-
Plugin.version = "3.2.
|
|
1250
|
+
Plugin.version = "3.2.2";
|
|
1246
1251
|
|
|
1247
1252
|
;// CONCATENATED MODULE: ./src/Plugin/stanford/Options.ts
|
|
1248
1253
|
/**
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.3.0-next.1
|
|
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-interpolate"),require("d3-color"),require("d3-scale"),require("d3-selection"),require("d3-brush"),require("d3-axis"),require("d3-format")):"function"==typeof define&&define.amd?define("bb",["d3-interpolate","d3-color","d3-scale","d3-selection","d3-brush","d3-axis","d3-format"],e):"object"==typeof exports?exports.bb=e(require("d3-interpolate"),require("d3-color"),require("d3-scale"),require("d3-selection"),require("d3-brush"),require("d3-axis"),require("d3-format")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.stanford=e(t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3))}(this,(function(t,e,n,o,r,i,a){return function(){"use strict";var s=[,function(t){t.exports=o},,function(t){t.exports=r},,function(e){e.exports=t},function(t){t.exports=e},function(t){t.exports=n},function(t){t.exports=i},function(t){t.exports=a}],c={};function l(t){var e=c[t];if(void 0!==e)return e.exports;var n=c[t]={exports:{}};return s[t](n,n.exports,l),n.exports}l.d=function(t,e){for(var n in e)l.o(e,n)&&!l.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},l.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var u={};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)}l.d(u,{default:function(){return F}});var n=l(5),o=l(6),r=l(7),i="bb-tooltip",a="bb-tooltip-name";l(1),l(3);var s="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")();s.requestIdleCallback=s.requestIdleCallback||function(t){return setTimeout(t,1)},s.cancelIdleCallback=s.cancelIdleCallback||function(t){return clearTimeout(t)};var c=null==s?void 0:s.document;var d=function(t){return"function"==typeof t},f=function(t){return"string"==typeof t},p=function(t){return"number"==typeof t},h=function(t){return void 0!==t},g=function(t){return"object"==typeof t},v=function(t){return void 0===t||null===t||f(t)&&0===t.length||g(t)&&!(t instanceof Date)&&0===Object.keys(t).length||p(t)&&isNaN(t)};!function(){try{new MouseEvent("t")}catch(t){return function(t,e,n){void 0===n&&(n={bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});var o=c.createEvent("MouseEvent");o.initMouseEvent(e,n.bubbles,n.cancelable,s,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),t.dispatchEvent(o)}}}();function b(t){var e;if(t instanceof Date)e=t;else if(f(t)){var n=this.config;e=this.format.dataTime(n.data_xFormat)(t)}else p(t)&&!isNaN(t)&&(e=new Date(+t));return e&&!isNaN(+e)||console&&console.error&&console.error("Failed to parse x '"+t+"' to Date object"),e}function x(t){var e,n,o,r=this.config,i=function(){var t=n.shift();return t&&e&&g(e)&&t in e?(e=e[t],i()):t?void 0:e};Object.keys(r).forEach((function(a){e=t,n=a.split("_"),o=i(),h(o)&&(r[a]=o)}))}var y=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}();y.version="3.2.0-next.5";var m=function(){return{colors:void 0,epochs:[],lines:[],scale_min:void 0,scale_max:void 0,scale_width:20,scale_format:void 0,padding_top:0,padding_right:0,padding_bottom:0,padding_left:0,regions:[]}},S="bb-colorscale",w="bb-stanford-elements",_="bb-stanford-line",$="bb-stanford-lines",C="bb-stanford-region",E="bb-stanford-regions";function j(t,e){return t.epochs<e.epochs?-1:t.epochs>e.epochs?1:0}function M(t){for(var e,n=function(t){for(var e,n,o=0,r=0,i=t.length,a=i-1;r<i;a=r,r++)e=t[r],n=t[a],o+=e.x*n.y,o-=e.y*n.x;return o/2}(t),o=0,r=0,i=0,a=t.length,s=a-1;i<a;s=i,i++){var c=t[i],l=t[s];e=c.x*l.y-l.x*c.y,o+=(c.x+l.x)*e,r+=(c.y+l.y)*e}return{x:o/(e=6*n),y:r/e}}var q=function(){function t(t){this.owner=void 0,this.owner=t;var e=t.$$.$el.main.select(".bb-chart").append("g").attr("class",w);e.append("g").attr("class",$),e.append("g").attr("class",E)}var e=t.prototype;return e.updateStanfordLines=function(t){var e=this.owner.$$,n=e.config,o=e.$el.main,r=n.axis_rotated,i=this.xvCustom.bind(e),a=this.yvCustom.bind(e),s=o.select("."+$).style("shape-rendering","geometricprecision").selectAll("."+_).data(this.owner.config.lines);s.exit().transition().duration(t).style("opacity","0").remove();var c=s.enter().append("g");c.append("line").style("opacity","0"),c.merge(s).attr("class",(function(t){return _+(t.class?" "+t.class:"")})).select("line").transition().duration(t).attr("x1",(function(t){return r?a(t,"y1"):i(t,"x1")})).attr("x2",(function(t){return r?a(t,"y2"):i(t,"x2")})).attr("y1",(function(t){return r?i(t,"x1"):a(t,"y1")})).attr("y2",(function(t){return r?i(t,"x2"):a(t,"y2")})).transition().style("opacity",null)},e.updateStanfordRegions=function(t){var e=this.owner.$$,n=e.config,o=e.$el.main,r=n.axis_rotated,i=this.xvCustom.bind(e),a=this.yvCustom.bind(e),s=this.owner.countEpochsInRegion.bind(e),c=o.select("."+E).selectAll("."+C).data(this.owner.config.regions);c.exit().transition().duration(t).style("opacity","0").remove();var l=c.enter().append("g");l.append("polygon").style("opacity","0"),l.append("text").attr("transform",r?"rotate(-90)":"").style("opacity","0"),(c=l.merge(c)).attr("class",(function(t){return C+(t.class?" "+t.class:"")})).select("polygon").transition().duration(t).attr("points",(function(t){return t.points.map((function(t){return[r?a(t,"y"):i(t,"x"),r?i(t,"x"):a(t,"y")].join(",")})).join(" ")})).transition().style("opacity",(function(t){return(t.opacity?t.opacity:.2)+""})),c.select("text").transition().duration(t).attr("x",(function(t){return r?a(M(t.points),"y"):i(M(t.points),"x")})).attr("y",(function(t){return r?i(M(t.points),"x"):a(M(t.points),"y")})).text((function(t){if(t.text){var e=s(t.points),n=e.value,o=e.percentage;return t.text(n,o)}return""})).attr("text-anchor","middle").attr("dominant-baseline","middle").transition().style("opacity",null)},e.updateStanfordElements=function(t){void 0===t&&(t=0),this.updateStanfordLines(t),this.updateStanfordRegions(t)},e.xvCustom=function(t,e){var n=this,o=n.axis,r=n.config,i=e?t[e]:n.getBaseValue(t);return o.isTimeSeries()?i=b.call(n,i):o.isCategorized()&&f(i)&&(i=r.axis_x_categories.indexOf(t.value)),Math.ceil(n.scale.x(i))},e.yvCustom=function(t,e){var n=this,o=t.axis&&"y2"===t.axis?n.scale.y2:n.scale.y,r=e?t[e]:n.getBaseValue(t);return Math.ceil(o(r))},t}(),O=l(8),k=l(9),N=function(){function t(t){this.owner=void 0,this.colorScale=void 0,this.owner=t}var e=t.prototype;return e.drawColorScale=function(){var t=this.owner,e=t.$$,n=t.config,o=e.data.targets[0],i=e.state.height-n.padding_bottom-n.padding_top,a=n.scale_width,s=function(t,e,n){void 0===n&&(n=1);for(var o=[],r=0|Math.max(0,Math.ceil((e-t)/n)),i=t;i<r;i++)o.push(t+i*n);return o}(n.padding_bottom,i,5),c=(0,r.scaleSequential)(o.colors).domain([s[s.length-1],s[0]]);this.colorScale&&this.colorScale.remove(),this.colorScale=e.$el.svg.append("g").attr("width",50).attr("height",i).attr("class",S),this.colorScale.append("g").attr("transform","translate(0, "+n.padding_top+")").selectAll("bars").data(s).enter().append("rect").attr("y",(function(t,e){return 5*e})).attr("x",0).attr("width",a).attr("height",5).attr("fill",(function(t){return c(t)}));var l=(0,r.scaleLog)().domain([o.minEpochs,o.maxEpochs]).range([s[0]+n.padding_top+s[s.length-1]+5-1,s[0]+n.padding_top]),u=(0,O.axisRight)(l),f=n.scale_format;"pow10"===f?u.tickValues([1,10,100,1e3,1e4,1e5,1e6,1e7]):d(f)?u.tickFormat(f):u.tickFormat((0,k.format)("d"));var p=this.colorScale.append("g").attr("class","legend axis").attr("transform","translate("+a+",0)").call(u);"pow10"===f&&p.selectAll(".tick text").text(null).filter((function(t){return t/Math.pow(10,Math.ceil(Math.log(t)/Math.LN10-1e-12))==1})).text(10).append("tspan").attr("dy","-.7em").text((function(t){return Math.round(Math.log(t)/Math.LN10)})),this.colorScale.attr("transform","translate("+(e.state.current.width-this.xForColorScale())+", 0)")},e.xForColorScale=function(){return this.owner.config.padding_right+this.colorScale.node().getBBox().width},e.getColorScalePadding=function(){return this.xForColorScale()+this.owner.config.padding_left+20},t}(),F=function(s){var c,l;function u(e){var n=s.call(this,e)||this;return n.config=void 0,n.colorScale=void 0,n.elements=void 0,n.config=new m,t(n)||t(n)}l=s,(c=u).prototype=Object.create(l.prototype),c.prototype.constructor=c,e(c,l);var p=u.prototype;return p.$beforeInit=function(){var t=this,e=this.$$;e.config.data_xSort=!1,e.isMultipleX=function(){return!0},e.showGridFocus=function(){},e.labelishData=function(t){return t.values},e.opacityForCircle=function(){return 1};var n=e.getCurrentPaddingRight.bind(e);e.getCurrentPaddingRight=function(){return n()+(t.colorScale?t.colorScale.getColorScalePadding():0)}},p.$init=function(){var t=this.$$;x.call(this,this.options),t.color=this.getStanfordPointColor.bind(t),this.colorScale=new N(this),this.elements=new q(this),this.convertData(),this.initStanfordData(),this.setStanfordTooltip(),this.colorScale.drawColorScale(),this.$redraw()},p.$redraw=function(t){var e,n;null==(e=this.colorScale)||e.drawColorScale(),null==(n=this.elements)||n.updateStanfordElements(t)},p.getOptions=function(){return new m},p.convertData=function(){var t=this.$$.data.targets,e=this.options.epochs;t.forEach((function(t){t.values.forEach((function(t,n){t.epochs=e[n]})),t.minEpochs=void 0,t.maxEpochs=void 0,t.colors=void 0,t.colorscale=void 0}))},p.xvCustom=function(t,e){var n=this,o=n.axis,r=n.config,i=e?t[e]:n.getBaseValue(t);return o.isTimeSeries()?i=b.call(n,i):o.isCategorized()&&f(i)&&(i=r.axis_x_categories.indexOf(t.value)),Math.ceil(n.scale.x(i))},p.yvCustom=function(t,e){var n=this.scale,o=t.axis&&"y2"===t.axis?n.y2:n.y,r=e?t[e]:this.getBaseValue(t);return Math.ceil(o(r))},p.initStanfordData=function(){var t=this.config,e=this.$$.data.targets[0];e.values.sort(j);var i=e.values.map((function(t){return t.epochs}));e.minEpochs=isNaN(t.scale_min)?Math.min.apply(Math,i):t.scale_min,e.maxEpochs=isNaN(t.scale_max)?Math.max.apply(Math,i):t.scale_max,e.colors=d(t.colors)?t.colors:(0,n.interpolateHslLong)((0,o.hsl)(250,1,.5),(0,o.hsl)(0,1,.5)),e.colorscale=(0,r.scaleSequentialLog)(e.colors).domain([e.minEpochs,e.maxEpochs])},p.getStanfordPointColor=function(t){return this.data.targets[0].colorscale(t.epochs)},p.setStanfordTooltip=function(){var t=this.$$.config;v(t.tooltip_contents)&&(t.tooltip_contents=function(e,n,o,r){var s='<table class="'+i+'"><tbody>';return e.forEach((function(e){s+="<tr>\n\t\t\t\t\t\t\t<th>"+n(t.data_x)+'</th>\n\t\t\t\t\t\t\t<th class="value">'+o(e.x)+"</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>"+n(e.id)+'</th>\n\t\t\t\t\t\t\t<th class="value">'+o(e.value)+'</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class="'+a+"-"+e.id+'">\n\t\t\t\t\t\t\t<td class="name"><span style="background-color:'+r(e)+'"></span>'+n("Epochs")+'</td>\n\t\t\t\t\t\t\t<td class="value">'+o(e.epochs)+"</td>\n\t\t\t\t\t\t</tr>"})),s+"</tbody></table>"})},p.countEpochsInRegion=function(t){var e=this.data.targets[0],n=e.values.reduce((function(t,e){return t+ +e.epochs}),0),o=e.values.reduce((function(e,n){return function(t,e){for(var n=t.x,o=t.value,r=!1,i=0,a=e.length-1;i<e.length;a=i++){var s=e[i].x,c=e[i].y,l=e[a].x,u=e[a].y;c>o!=u>o&&n<(l-s)*(o-c)/(u-c)+s&&(r=!r)}return r}(n,t)?e+ +n.epochs:e}),0);return{value:o,percentage:0!==o?+(o/n*100).toFixed(1):0}},u}(y)}(),u=u.default}()}));
|
|
12
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3-interpolate"),require("d3-color"),require("d3-scale"),require("d3-selection"),require("d3-brush"),require("d3-axis"),require("d3-format")):"function"==typeof define&&define.amd?define("bb",["d3-interpolate","d3-color","d3-scale","d3-selection","d3-brush","d3-axis","d3-format"],e):"object"==typeof exports?exports.bb=e(require("d3-interpolate"),require("d3-color"),require("d3-scale"),require("d3-selection"),require("d3-brush"),require("d3-axis"),require("d3-format")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.stanford=e(t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3))}(this,(function(t,e,n,o,r,i,a){return function(){"use strict";var s=[,function(t){t.exports=o},,function(t){t.exports=r},,function(e){e.exports=t},function(t){t.exports=e},function(t){t.exports=n},function(t){t.exports=i},function(t){t.exports=a}],c={};function l(t){var e=c[t];if(void 0!==e)return e.exports;var n=c[t]={exports:{}};return s[t](n,n.exports,l),n.exports}l.d=function(t,e){for(var n in e)l.o(e,n)&&!l.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},l.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var u={};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)}l.d(u,{default:function(){return F}});var n=l(5),o=l(6),r=l(7),i="bb-tooltip",a="bb-tooltip-name";l(1),l(3);var s="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")();s.requestIdleCallback=s.requestIdleCallback||function(t){return setTimeout(t,1)},s.cancelIdleCallback=s.cancelIdleCallback||function(t){return clearTimeout(t)};var c=null==s?void 0:s.document;var d=function(t){return"function"==typeof t},f=function(t){return"string"==typeof t},p=function(t){return"number"==typeof t},h=function(t){return void 0!==t},g=function(t){return"object"==typeof t},v=function(t){return void 0===t||null===t||f(t)&&0===t.length||g(t)&&!(t instanceof Date)&&0===Object.keys(t).length||p(t)&&isNaN(t)};!function(){try{new MouseEvent("t")}catch(t){return function(t,e,n){void 0===n&&(n={bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});var o=c.createEvent("MouseEvent");o.initMouseEvent(e,n.bubbles,n.cancelable,s,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),t.dispatchEvent(o)}}}();function b(t){var e;if(t instanceof Date)e=t;else if(f(t)){var n=this.config;e=this.format.dataTime(n.data_xFormat)(t)}else p(t)&&!isNaN(t)&&(e=new Date(+t));return e&&!isNaN(+e)||console&&console.error&&console.error("Failed to parse x '"+t+"' to Date object"),e}function x(t){var e,n,o,r=this.config,i=function(){var t=n.shift();return t&&e&&g(e)&&t in e?(e=e[t],i()):t?void 0:e};Object.keys(r).forEach((function(a){e=t,n=a.split("_"),o=i(),h(o)&&(r[a]=o)}))}var y=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}();y.version="3.2.2";var m=function(){return{colors:void 0,epochs:[],lines:[],scale_min:void 0,scale_max:void 0,scale_width:20,scale_format:void 0,padding_top:0,padding_right:0,padding_bottom:0,padding_left:0,regions:[]}},S="bb-colorscale",w="bb-stanford-elements",_="bb-stanford-line",$="bb-stanford-lines",C="bb-stanford-region",E="bb-stanford-regions";function j(t,e){return t.epochs<e.epochs?-1:t.epochs>e.epochs?1:0}function M(t){for(var e,n=function(t){for(var e,n,o=0,r=0,i=t.length,a=i-1;r<i;a=r,r++)e=t[r],n=t[a],o+=e.x*n.y,o-=e.y*n.x;return o/2}(t),o=0,r=0,i=0,a=t.length,s=a-1;i<a;s=i,i++){var c=t[i],l=t[s];e=c.x*l.y-l.x*c.y,o+=(c.x+l.x)*e,r+=(c.y+l.y)*e}return{x:o/(e=6*n),y:r/e}}var q=function(){function t(t){this.owner=void 0,this.owner=t;var e=t.$$.$el.main.select(".bb-chart").append("g").attr("class",w);e.append("g").attr("class",$),e.append("g").attr("class",E)}var e=t.prototype;return e.updateStanfordLines=function(t){var e=this.owner.$$,n=e.config,o=e.$el.main,r=n.axis_rotated,i=this.xvCustom.bind(e),a=this.yvCustom.bind(e),s=o.select("."+$).style("shape-rendering","geometricprecision").selectAll("."+_).data(this.owner.config.lines);s.exit().transition().duration(t).style("opacity","0").remove();var c=s.enter().append("g");c.append("line").style("opacity","0"),c.merge(s).attr("class",(function(t){return _+(t.class?" "+t.class:"")})).select("line").transition().duration(t).attr("x1",(function(t){return r?a(t,"y1"):i(t,"x1")})).attr("x2",(function(t){return r?a(t,"y2"):i(t,"x2")})).attr("y1",(function(t){return r?i(t,"x1"):a(t,"y1")})).attr("y2",(function(t){return r?i(t,"x2"):a(t,"y2")})).transition().style("opacity",null)},e.updateStanfordRegions=function(t){var e=this.owner.$$,n=e.config,o=e.$el.main,r=n.axis_rotated,i=this.xvCustom.bind(e),a=this.yvCustom.bind(e),s=this.owner.countEpochsInRegion.bind(e),c=o.select("."+E).selectAll("."+C).data(this.owner.config.regions);c.exit().transition().duration(t).style("opacity","0").remove();var l=c.enter().append("g");l.append("polygon").style("opacity","0"),l.append("text").attr("transform",r?"rotate(-90)":"").style("opacity","0"),(c=l.merge(c)).attr("class",(function(t){return C+(t.class?" "+t.class:"")})).select("polygon").transition().duration(t).attr("points",(function(t){return t.points.map((function(t){return[r?a(t,"y"):i(t,"x"),r?i(t,"x"):a(t,"y")].join(",")})).join(" ")})).transition().style("opacity",(function(t){return(t.opacity?t.opacity:.2)+""})),c.select("text").transition().duration(t).attr("x",(function(t){return r?a(M(t.points),"y"):i(M(t.points),"x")})).attr("y",(function(t){return r?i(M(t.points),"x"):a(M(t.points),"y")})).text((function(t){if(t.text){var e=s(t.points),n=e.value,o=e.percentage;return t.text(n,o)}return""})).attr("text-anchor","middle").attr("dominant-baseline","middle").transition().style("opacity",null)},e.updateStanfordElements=function(t){void 0===t&&(t=0),this.updateStanfordLines(t),this.updateStanfordRegions(t)},e.xvCustom=function(t,e){var n=this,o=n.axis,r=n.config,i=e?t[e]:n.getBaseValue(t);return o.isTimeSeries()?i=b.call(n,i):o.isCategorized()&&f(i)&&(i=r.axis_x_categories.indexOf(t.value)),Math.ceil(n.scale.x(i))},e.yvCustom=function(t,e){var n=this,o=t.axis&&"y2"===t.axis?n.scale.y2:n.scale.y,r=e?t[e]:n.getBaseValue(t);return Math.ceil(o(r))},t}(),O=l(8),k=l(9),N=function(){function t(t){this.owner=void 0,this.colorScale=void 0,this.owner=t}var e=t.prototype;return e.drawColorScale=function(){var t=this.owner,e=t.$$,n=t.config,o=e.data.targets[0],i=e.state.height-n.padding_bottom-n.padding_top,a=n.scale_width,s=function(t,e,n){void 0===n&&(n=1);for(var o=[],r=0|Math.max(0,Math.ceil((e-t)/n)),i=t;i<r;i++)o.push(t+i*n);return o}(n.padding_bottom,i,5),c=(0,r.scaleSequential)(o.colors).domain([s[s.length-1],s[0]]);this.colorScale&&this.colorScale.remove(),this.colorScale=e.$el.svg.append("g").attr("width",50).attr("height",i).attr("class",S),this.colorScale.append("g").attr("transform","translate(0, "+n.padding_top+")").selectAll("bars").data(s).enter().append("rect").attr("y",(function(t,e){return 5*e})).attr("x",0).attr("width",a).attr("height",5).attr("fill",(function(t){return c(t)}));var l=(0,r.scaleLog)().domain([o.minEpochs,o.maxEpochs]).range([s[0]+n.padding_top+s[s.length-1]+5-1,s[0]+n.padding_top]),u=(0,O.axisRight)(l),f=n.scale_format;"pow10"===f?u.tickValues([1,10,100,1e3,1e4,1e5,1e6,1e7]):d(f)?u.tickFormat(f):u.tickFormat((0,k.format)("d"));var p=this.colorScale.append("g").attr("class","legend axis").attr("transform","translate("+a+",0)").call(u);"pow10"===f&&p.selectAll(".tick text").text(null).filter((function(t){return t/Math.pow(10,Math.ceil(Math.log(t)/Math.LN10-1e-12))==1})).text(10).append("tspan").attr("dy","-.7em").text((function(t){return Math.round(Math.log(t)/Math.LN10)})),this.colorScale.attr("transform","translate("+(e.state.current.width-this.xForColorScale())+", 0)")},e.xForColorScale=function(){return this.owner.config.padding_right+this.colorScale.node().getBBox().width},e.getColorScalePadding=function(){return this.xForColorScale()+this.owner.config.padding_left+20},t}(),F=function(s){var c,l;function u(e){var n=s.call(this,e)||this;return n.config=void 0,n.colorScale=void 0,n.elements=void 0,n.config=new m,t(n)||t(n)}l=s,(c=u).prototype=Object.create(l.prototype),c.prototype.constructor=c,e(c,l);var p=u.prototype;return p.$beforeInit=function(){var t=this,e=this.$$;e.config.data_xSort=!1,e.isMultipleX=function(){return!0},e.showGridFocus=function(){},e.labelishData=function(t){return t.values},e.opacityForCircle=function(){return 1};var n=e.getCurrentPaddingRight.bind(e);e.getCurrentPaddingRight=function(){return n()+(t.colorScale?t.colorScale.getColorScalePadding():0)}},p.$init=function(){var t=this.$$;x.call(this,this.options),t.color=this.getStanfordPointColor.bind(t),this.colorScale=new N(this),this.elements=new q(this),this.convertData(),this.initStanfordData(),this.setStanfordTooltip(),this.colorScale.drawColorScale(),this.$redraw()},p.$redraw=function(t){var e,n;null==(e=this.colorScale)||e.drawColorScale(),null==(n=this.elements)||n.updateStanfordElements(t)},p.getOptions=function(){return new m},p.convertData=function(){var t=this.$$.data.targets,e=this.options.epochs;t.forEach((function(t){t.values.forEach((function(t,n){t.epochs=e[n]})),t.minEpochs=void 0,t.maxEpochs=void 0,t.colors=void 0,t.colorscale=void 0}))},p.xvCustom=function(t,e){var n=this,o=n.axis,r=n.config,i=e?t[e]:n.getBaseValue(t);return o.isTimeSeries()?i=b.call(n,i):o.isCategorized()&&f(i)&&(i=r.axis_x_categories.indexOf(t.value)),Math.ceil(n.scale.x(i))},p.yvCustom=function(t,e){var n=this.scale,o=t.axis&&"y2"===t.axis?n.y2:n.y,r=e?t[e]:this.getBaseValue(t);return Math.ceil(o(r))},p.initStanfordData=function(){var t=this.config,e=this.$$.data.targets[0];e.values.sort(j);var i=e.values.map((function(t){return t.epochs}));e.minEpochs=isNaN(t.scale_min)?Math.min.apply(Math,i):t.scale_min,e.maxEpochs=isNaN(t.scale_max)?Math.max.apply(Math,i):t.scale_max,e.colors=d(t.colors)?t.colors:(0,n.interpolateHslLong)((0,o.hsl)(250,1,.5),(0,o.hsl)(0,1,.5)),e.colorscale=(0,r.scaleSequentialLog)(e.colors).domain([e.minEpochs,e.maxEpochs])},p.getStanfordPointColor=function(t){return this.data.targets[0].colorscale(t.epochs)},p.setStanfordTooltip=function(){var t=this.$$.config;v(t.tooltip_contents)&&(t.tooltip_contents=function(e,n,o,r){var s='<table class="'+i+'"><tbody>';return e.forEach((function(e){s+="<tr>\n\t\t\t\t\t\t\t<th>"+n(t.data_x)+'</th>\n\t\t\t\t\t\t\t<th class="value">'+o(e.x)+"</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>"+n(e.id)+'</th>\n\t\t\t\t\t\t\t<th class="value">'+o(e.value)+'</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class="'+a+"-"+e.id+'">\n\t\t\t\t\t\t\t<td class="name"><span style="background-color:'+r(e)+'"></span>'+n("Epochs")+'</td>\n\t\t\t\t\t\t\t<td class="value">'+o(e.epochs)+"</td>\n\t\t\t\t\t\t</tr>"})),s+"</tbody></table>"})},p.countEpochsInRegion=function(t){var e=this.data.targets[0],n=e.values.reduce((function(t,e){return t+ +e.epochs}),0),o=e.values.reduce((function(e,n){return function(t,e){for(var n=t.x,o=t.value,r=!1,i=0,a=e.length-1;i<e.length;a=i++){var s=e[i].x,c=e[i].y,l=e[a].x,u=e[a].y;c>o!=u>o&&n<(l-s)*(o-c)/(u-c)+s&&(r=!r)}return r}(n,t)?e+ +n.epochs:e}),0);return{value:o,percentage:0!==o?+(o/n*100).toFixed(1):0}},u}(y)}(),u=u.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.
|
|
8
|
+
* @version 3.3.0-next.1
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -212,7 +212,7 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
212
212
|
return Plugin;
|
|
213
213
|
}();
|
|
214
214
|
|
|
215
|
-
Plugin.version = "3.2.
|
|
215
|
+
Plugin.version = "3.2.2";
|
|
216
216
|
|
|
217
217
|
;// CONCATENATED MODULE: ./src/Plugin/tableview/Options.ts
|
|
218
218
|
/**
|
|
@@ -498,9 +498,9 @@ var doc = win == null ? void 0 : win.document;
|
|
|
498
498
|
;// CONCATENATED MODULE: ./src/module/util.ts
|
|
499
499
|
|
|
500
500
|
|
|
501
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
501
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
502
502
|
|
|
503
|
-
function _objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = arguments[i]
|
|
503
|
+
function _objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
504
504
|
|
|
505
505
|
/**
|
|
506
506
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
@@ -590,18 +590,19 @@ function hasValue(dict, value) {
|
|
|
590
590
|
/**
|
|
591
591
|
* Call function with arguments
|
|
592
592
|
* @param {Function} fn Function to be called
|
|
593
|
-
* @param {*}
|
|
593
|
+
* @param {*} thisArg "this" value for fn
|
|
594
|
+
* @param {*} args Arguments for fn
|
|
594
595
|
* @returns {boolean} true: fn is function, false: fn is not function
|
|
595
596
|
* @private
|
|
596
597
|
*/
|
|
597
598
|
|
|
598
599
|
|
|
599
|
-
function callFn(fn) {
|
|
600
|
-
for (var isFn = isFunction(fn), _len = arguments.length, args = Array(_len >
|
|
601
|
-
args[_key -
|
|
600
|
+
function callFn(fn, thisArg) {
|
|
601
|
+
for (var isFn = isFunction(fn), _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
602
|
+
args[_key - 2] = arguments[_key];
|
|
602
603
|
}
|
|
603
604
|
|
|
604
|
-
isFn && fn.call.apply(fn, args);
|
|
605
|
+
isFn && fn.call.apply(fn, [thisArg].concat(args));
|
|
605
606
|
return isFn;
|
|
606
607
|
}
|
|
607
608
|
/**
|
|
@@ -757,9 +758,13 @@ function getPathBox(path) {
|
|
|
757
758
|
|
|
758
759
|
|
|
759
760
|
function getPointer(event, element) {
|
|
760
|
-
var
|
|
761
|
-
|
|
762
|
-
|
|
761
|
+
var _ref,
|
|
762
|
+
touches = event && ((_ref = event.touches || event.sourceEvent && event.sourceEvent.touches) == null ? void 0 : _ref[0]),
|
|
763
|
+
pointer = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.pointer)(touches || event, element);
|
|
764
|
+
|
|
765
|
+
return pointer.map(function (v) {
|
|
766
|
+
return isNaN(v) ? 0 : v;
|
|
767
|
+
});
|
|
763
768
|
}
|
|
764
769
|
/**
|
|
765
770
|
* Return brush selection array
|
|
@@ -1343,9 +1348,9 @@ function loadConfig(config) {
|
|
|
1343
1348
|
|
|
1344
1349
|
|
|
1345
1350
|
|
|
1346
|
-
function tableview_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
1351
|
+
function tableview_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1347
1352
|
|
|
1348
|
-
function tableview_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = arguments[i]
|
|
1353
|
+
function tableview_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = null != arguments[i] ? arguments[i] : {}; i % 2 ? tableview_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : tableview_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1349
1354
|
|
|
1350
1355
|
/**
|
|
1351
1356
|
* Copyright (c) 2021 ~ present NAVER Corp.
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.3.0-next.1
|
|
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}],r={};function o(t){var e=r[t];if(void 0!==e)return e.exports;var i=r[t]={exports:{}};return n[t](i,i.exports,o),i.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 i={};return function(){function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function n(t,e){return n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(t,e)}o.d(i,{default:function(){return $}});var r=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}();r.version="3.2.
|
|
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}],r={};function o(t){var e=r[t];if(void 0!==e)return e.exports;var i=r[t]={exports:{}};return n[t](i,i.exports,o),i.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 i={};return function(){function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function n(t,e){return n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(t,e)}o.d(i,{default:function(){return $}});var r=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}();r.version="3.2.2";var c=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__",a="bb-tableview",u=".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}",s="<caption>{=title}</caption>\n\t\t<thead><tr>{=thead}</tr></thead>\n\t\t<tbody>{=tbody}</tbody>",f='<th scope="col">{=title}</th>',b='<th scope="row">{=value}</th>',d="<td>{=value}</td>",p=(o(1),o(3),"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")());p.requestIdleCallback=p.requestIdleCallback||function(t){return setTimeout(t,1)},p.cancelIdleCallback=p.cancelIdleCallback||function(t){return clearTimeout(t)};var h=null==p?void 0:p.document;var v=function(t){return"number"==typeof t},g=function(t){return void 0!==t},y=function(t){return"object"==typeof t};!function(){try{new MouseEvent("t")}catch(t){return function(t,e,n){void 0===n&&(n={bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});var r=h.createEvent("MouseEvent");r.initMouseEvent(e,n.bubbles,n.cancelable,p,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),t.dispatchEvent(r)}}}();function m(t,e){var n=t;for(var r in e)n=n.replace(new RegExp("{="+r+"}","g"),e[r]);return n}function O(t){var e,n,r,o=this.config,i=function(){var t=n.shift();return t&&e&&y(e)&&t in e?(e=e[t],i()):t?void 0:e};Object.keys(o).forEach((function(c){e=t,n=c.split("_"),r=i(),g(r)&&(o[c]=r)}))}function j(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function w(e){for(var n,r=1;r<arguments.length;r++)n=null!=arguments[r]?arguments[r]:{},r%2?j(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}));return e}var $=function(t){var r,o;function i(n){var r=t.call(this,n)||this;return r.config=void 0,r.element=void 0,r.config=new c,e(r)||e(r)}o=t,(r=i).prototype=Object.create(o.prototype),r.prototype.constructor=r,n(r,o);var p=i.prototype;return p.$beforeInit=function(){O.call(this,this.options)},p.$init=function(){var t,e=this.config,n=e.class,r=e.selector,o=e.style,i=document.querySelector(r||"."+(n||a));if(!i){var c=this.$$.$el.chart.node();i=document.createElement("table"),c.parentNode.insertBefore(i,c.nextSibling)}if("TABLE"!==i.tagName){var s=document.createElement("table");i.appendChild(s),i=s}if(o&&!document.getElementById(l)){var f=document.createElement("style");f.id=l,f.innerHTML=u,(document.head||document.getElementsByTagName("head")[0]).appendChild(f)}(t=i.classList).add.apply(t,[o&&a,n].filter(Boolean)),this.element=i},p.generateTable=function(){var t=this,e=this.$$,n=this.config,r=this.element,o=e.filterTargetsToShow(e.data.targets),i=m(f,{title:o.length?this.config.categoryTitle:""}),c="",l=[];o.forEach((function(t){i+=m(f,{title:t.id}),t.values.forEach((function(t,e){l[e]||(l[e]=[t.x]),l[e].push(t.value)}))})),l.forEach((function(e){c+="<tr>"+e.map((function(e,r){return m(r?d:b,{value:0===r?n.categoryFormat.bind(t)(e):v(e)?e.toLocaleString():""})})).join("")+"</tr>"}));var a=m(s,w(w({},n),{},{title:n.title||e.config.title_text||"",thead:i,tbody:c})).replace(/<[^>]+><\/[^>]+>/g,"");r.innerHTML=a},p.$redraw=function(){var t=this.$$.state;t.resizing||!this.config.updateOnToggle&&t.toggling||this.generateTable()},p.$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)}},i}(r)}(),i=i.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.
|
|
8
|
+
* @version 3.3.0-next.1
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -301,9 +301,9 @@ var doc = win == null ? void 0 : win.document;
|
|
|
301
301
|
;// CONCATENATED MODULE: ./src/module/util.ts
|
|
302
302
|
|
|
303
303
|
|
|
304
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
304
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
305
305
|
|
|
306
|
-
function _objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = arguments[i]
|
|
306
|
+
function _objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
307
307
|
|
|
308
308
|
/**
|
|
309
309
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
@@ -393,18 +393,19 @@ function hasValue(dict, value) {
|
|
|
393
393
|
/**
|
|
394
394
|
* Call function with arguments
|
|
395
395
|
* @param {Function} fn Function to be called
|
|
396
|
-
* @param {*}
|
|
396
|
+
* @param {*} thisArg "this" value for fn
|
|
397
|
+
* @param {*} args Arguments for fn
|
|
397
398
|
* @returns {boolean} true: fn is function, false: fn is not function
|
|
398
399
|
* @private
|
|
399
400
|
*/
|
|
400
401
|
|
|
401
402
|
|
|
402
|
-
function callFn(fn) {
|
|
403
|
-
for (var isFn = isFunction(fn), _len = arguments.length, args = Array(_len >
|
|
404
|
-
args[_key -
|
|
403
|
+
function callFn(fn, thisArg) {
|
|
404
|
+
for (var isFn = isFunction(fn), _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
405
|
+
args[_key - 2] = arguments[_key];
|
|
405
406
|
}
|
|
406
407
|
|
|
407
|
-
isFn && fn.call.apply(fn, args);
|
|
408
|
+
isFn && fn.call.apply(fn, [thisArg].concat(args));
|
|
408
409
|
return isFn;
|
|
409
410
|
}
|
|
410
411
|
/**
|
|
@@ -560,9 +561,13 @@ function getPathBox(path) {
|
|
|
560
561
|
|
|
561
562
|
|
|
562
563
|
function getPointer(event, element) {
|
|
563
|
-
var
|
|
564
|
-
|
|
565
|
-
|
|
564
|
+
var _ref,
|
|
565
|
+
touches = event && ((_ref = event.touches || event.sourceEvent && event.sourceEvent.touches) == null ? void 0 : _ref[0]),
|
|
566
|
+
pointer = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.pointer)(touches || event, element);
|
|
567
|
+
|
|
568
|
+
return pointer.map(function (v) {
|
|
569
|
+
return isNaN(v) ? 0 : v;
|
|
570
|
+
});
|
|
566
571
|
}
|
|
567
572
|
/**
|
|
568
573
|
* Return brush selection array
|
|
@@ -1224,7 +1229,7 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
1224
1229
|
return Plugin;
|
|
1225
1230
|
}();
|
|
1226
1231
|
|
|
1227
|
-
Plugin.version = "3.2.
|
|
1232
|
+
Plugin.version = "3.2.2";
|
|
1228
1233
|
|
|
1229
1234
|
;// CONCATENATED MODULE: ./src/Plugin/textoverlap/Options.ts
|
|
1230
1235
|
/**
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.3.0-next.1
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
12
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(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"],t):"object"==typeof exports?exports.bb=t(require("d3-delaunay"),require("d3-polygon"),require("d3-selection"),require("d3-brush")):(e.bb=e.bb||{},e.bb.plugin=e.bb.plugin||{},e.bb.plugin.textoverlap=t(e.d3,e.d3,e.d3,e.d3))}(this,(function(e,t,n,o){return function(){"use strict";var r={3:function(e){e.exports=o},12:function(t){t.exports=e},13:function(e){e.exports=t},1:function(e){e.exports=n}},i={};function c(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}};return r[e](n,n.exports,c),n.exports}c.d=function(e,t){for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var u={};return function(){function e(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}c.d(u,{default:function(){return d}});var n=c(12),o=c(13);c(1),c(3);var 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")();r.requestIdleCallback=r.requestIdleCallback||function(e){return setTimeout(e,1)},r.cancelIdleCallback=r.cancelIdleCallback||function(e){return clearTimeout(e)};var i=null==r?void 0:r.document;var a=function(e){return void 0!==e},l=function(e){return"object"==typeof e};!function(){try{new MouseEvent("t")}catch(e){return function(e,t,n){void 0===n&&(n={bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});var o=i.createEvent("MouseEvent");o.initMouseEvent(t,n.bubbles,n.cancelable,r,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),e.dispatchEvent(o)}}}();function s(e){var t,n,o,r=this.config,i=function(){var e=n.shift();return e&&t&&l(t)&&e in t?(t=t[e],i()):e?void 0:t};Object.keys(r).forEach((function(c){t=e,n=c.split("_"),o=i(),a(o)&&(r[c]=o)}))}var f=function(){function e(e){void 0===e&&(e={}),this.$$=void 0,this.options=void 0,this.options=e}var t=e.prototype;return t.$beforeInit=function(){},t.$init=function(){},t.$afterInit=function(){},t.$redraw=function(){},t.$willDestroy=function(){var e=this;Object.keys(this).forEach((function(t){e[t]=null,delete e[t]}))},e}();f.version="3.2.
|
|
12
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(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"],t):"object"==typeof exports?exports.bb=t(require("d3-delaunay"),require("d3-polygon"),require("d3-selection"),require("d3-brush")):(e.bb=e.bb||{},e.bb.plugin=e.bb.plugin||{},e.bb.plugin.textoverlap=t(e.d3,e.d3,e.d3,e.d3))}(this,(function(e,t,n,o){return function(){"use strict";var r={3:function(e){e.exports=o},12:function(t){t.exports=e},13:function(e){e.exports=t},1:function(e){e.exports=n}},i={};function c(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}};return r[e](n,n.exports,c),n.exports}c.d=function(e,t){for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var u={};return function(){function e(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}c.d(u,{default:function(){return d}});var n=c(12),o=c(13);c(1),c(3);var 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")();r.requestIdleCallback=r.requestIdleCallback||function(e){return setTimeout(e,1)},r.cancelIdleCallback=r.cancelIdleCallback||function(e){return clearTimeout(e)};var i=null==r?void 0:r.document;var a=function(e){return void 0!==e},l=function(e){return"object"==typeof e};!function(){try{new MouseEvent("t")}catch(e){return function(e,t,n){void 0===n&&(n={bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});var o=i.createEvent("MouseEvent");o.initMouseEvent(t,n.bubbles,n.cancelable,r,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),e.dispatchEvent(o)}}}();function s(e){var t,n,o,r=this.config,i=function(){var e=n.shift();return e&&t&&l(t)&&e in t?(t=t[e],i()):e?void 0:t};Object.keys(r).forEach((function(c){t=e,n=c.split("_"),o=i(),a(o)&&(r[c]=o)}))}var f=function(){function e(e){void 0===e&&(e={}),this.$$=void 0,this.options=void 0,this.options=e}var t=e.prototype;return t.$beforeInit=function(){},t.$init=function(){},t.$afterInit=function(){},t.$redraw=function(){},t.$willDestroy=function(){var e=this;Object.keys(this).forEach((function(t){e[t]=null,delete e[t]}))},e}();f.version="3.2.2";var b=function(){return{selector:void 0,extent:1,area:0}},d=function(r){var i,c;function u(t){var n=r.call(this,t)||this;return n.config=void 0,n.config=new b,e(n)||e(n)}c=r,(i=u).prototype=Object.create(c.prototype),i.prototype.constructor=i,t(i,c);var a=u.prototype;return a.$init=function(){s.call(this,this.options)},a.$redraw=function(){var e=this.$$.$el,t=this.config.selector,n=t?e.main.selectAll(t):e.text;n.empty()||this.preventLabelOverlap(n)},a.generateVoronoi=function(e){var t=this.$$.scale,o=["x","y"].map((function(e){return t[e].domain()})),r=o[0],i=o[1],c=[i[0],r[1]];return r[1]=c[0],i[0]=c[1],n.Delaunay.from(e).voronoi([].concat(r,i))},a.preventLabelOverlap=function(e){var t=this.config,n=t.extent,r=t.area,i=e.data().map((function(e){return[e.index,e.value]})),c=this.generateVoronoi(i),u=0;e.each((function(){var e=c.cellPolygon(u);if(e&&this){var t=i[u],a=t[0],l=t[1],s=(0,o.polygonCentroid)(e),f=s[0],b=s[1],d=Math.abs((0,o.polygonArea)(e)),p=Math.round(Math.atan2(b-l,f-a)/Math.PI*2),v=n*(0===p?1:-1),h=-1===p?-n:n+5,y=1===Math.abs(p)?"middle":0===p?"start":"end";this.style.display=d<r?"none":"",this.setAttribute("text-anchor",y),this.setAttribute("dy","0."+(1===p?71:35)+"em"),this.setAttribute("transform","translate("+v+", "+h+")")}u++}))},u}(f)}(),u=u.default}()}));
|