billboard.js 3.7.5 → 3.8.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 +1 -1
- package/dist/billboard.js +468 -268
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +512 -284
- 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 +36 -19
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +35 -19
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +32 -18
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +33 -18
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +45 -17
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +80 -35
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +80 -36
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +77 -35
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +133 -69
- package/dist/theme/datalab.css +1 -1
- package/dist/theme/datalab.min.css +1 -1
- package/dist/theme/graph.css +1 -1
- package/dist/theme/graph.min.css +1 -1
- package/dist/theme/insight.css +1 -1
- package/dist/theme/insight.min.css +1 -1
- package/dist-esm/billboard.js +349 -213
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +10 -11
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +6 -11
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +7 -12
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -7
- package/package.json +28 -28
- package/src/Chart/api/focus.ts +4 -4
- package/src/Chart/api/grid.ts +206 -0
- package/src/Chart/api/load.ts +31 -21
- package/src/Chart/api/regions.ts +28 -24
- package/src/Chart/api/zoom.ts +18 -3
- package/src/ChartInternal/Axis/Axis.ts +1 -0
- package/src/ChartInternal/Axis/AxisRenderer.ts +7 -2
- package/src/ChartInternal/ChartInternal.ts +1 -1
- package/src/ChartInternal/data/convert.ts +6 -3
- package/src/ChartInternal/data/data.ts +19 -15
- package/src/ChartInternal/data/load.ts +19 -4
- package/src/ChartInternal/interactions/eventrect.ts +3 -2
- package/src/ChartInternal/interactions/subchart.ts +3 -2
- package/src/ChartInternal/interactions/zoom.ts +10 -3
- package/src/ChartInternal/internals/clip.ts +3 -2
- package/src/ChartInternal/internals/domain.ts +17 -8
- package/src/ChartInternal/internals/legend.ts +4 -1
- package/src/ChartInternal/internals/redraw.ts +0 -16
- package/src/ChartInternal/internals/region.ts +9 -9
- package/src/ChartInternal/internals/scale.ts +7 -4
- package/src/ChartInternal/internals/size.axis.ts +14 -4
- package/src/ChartInternal/internals/size.ts +41 -18
- package/src/ChartInternal/internals/transform.ts +1 -1
- package/src/ChartInternal/internals/type.ts +10 -0
- package/src/ChartInternal/shape/point.ts +3 -2
- package/src/Plugin/sparkline/index.ts +9 -1
- package/src/config/Options/axis/x.ts +17 -0
- package/src/config/Options/axis/y.ts +2 -1
- package/src/config/Options/axis/y2.ts +2 -1
- package/src/config/Options/common/main.ts +19 -1
- package/src/config/resolver/axis.ts +2 -4
- package/src/module/browser.ts +13 -5
- package/src/module/generator.ts +3 -3
- package/src/module/util.ts +2 -2
- package/types/axis.d.ts +8 -7
- package/types/chart.d.ts +6 -1
- package/types/options.d.ts +7 -4
- package/src/Chart/api/grid.x.ts +0 -90
- package/src/Chart/api/grid.y.ts +0 -92
|
@@ -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.8.0-next.2
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -186,7 +186,7 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
186
186
|
};
|
|
187
187
|
return Plugin;
|
|
188
188
|
}();
|
|
189
|
-
Plugin.version = "3.
|
|
189
|
+
Plugin.version = "3.8.0-next.2";
|
|
190
190
|
|
|
191
191
|
;// CONCATENATED MODULE: ./src/Plugin/bubblecompare/index.ts
|
|
192
192
|
|
|
@@ -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.8.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")):"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,e){if(t!==e)throw new TypeError("Cannot instantiate an arrow function")}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?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},n(t,e)}i.d(r,{default:function(){return u}});var o=i(1),s=function(){function e(t){void 0===t&&(t={}),this.$$=void 0,this.options=void 0,this.options=t}var n=e.prototype;return n.$beforeInit=function(){},n.$init=function(){},n.$afterInit=function(){},n.$redraw=function(){},n.$willDestroy=function(){var e=this;Object.keys(this).forEach(function(n){t(this,e),this[n]=null,delete this[n]}.bind(this))},e}();s.version="3.
|
|
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,e){if(t!==e)throw new TypeError("Cannot instantiate an arrow function")}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?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},n(t,e)}i.d(r,{default:function(){return u}});var o=i(1),s=function(){function e(t){void 0===t&&(t={}),this.$$=void 0,this.options=void 0,this.options=t}var n=e.prototype;return n.$beforeInit=function(){},n.$init=function(){},n.$afterInit=function(){},n.$redraw=function(){},n.$willDestroy=function(){var e=this;Object.keys(this).forEach(function(n){t(this,e),this[n]=null,delete this[n]}.bind(this))},e}();s.version="3.8.0-next.2";var u=function(i){var r,s;function u(t){var n=i.call(this,t)||this;return n.$$=void 0,e(n)||e(n)}s=i,(r=u).prototype=Object.create(s.prototype),r.prototype.constructor=r,n(r,s);var a=u.prototype;return a.$init=function(){var t=this.$$;t.findClosest=this.findClosest.bind(this),t.getBubbleR=this.getBubbleR.bind(this),t.pointExpandedR=this.pointExpandedR.bind(this)},a.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,o.select)(t.node().parentNode.parentNode).raise()},a.changeCursorPoint=function(){this.$$.$el.svg.select(".bb-event-rect").style("cursor","pointer")},a.findClosest=function(e,n){var i=this,r=this.$$;return e.filter(function(e){return t(this,i),e&&!r.isBarType(e.id)}.bind(this)).reduce(function(e,o){return t(this,i),r.dist(o,n)<this.getBubbleR(o)?o:e}.bind(this),0)},a.getBubbleR=function(e){var n=this,i=this.options,r=i.minR,o=i.maxR,s=this.getZData(e);if(!s)return r;var u=this.$$.data.targets.reduce(function(e,i){var r=e[0],o=e[1];t(this,n);var s=this.getZData(i.values[0]);return[Math.min(r,s),Math.max(o,s)]}.bind(this),[1e4,0]),a=u[0],c=u[1],f=a>0&&c===a?0:s/c;return Math.abs(f)*(o-r)+r},a.getZData=function(t){return this.$$.isBubbleZType(t)?this.$$.getBubbleZData(t.value,"z"):t.value},u}(s);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.8.0-next.2
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -400,7 +400,7 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
400
400
|
};
|
|
401
401
|
return Plugin;
|
|
402
402
|
}();
|
|
403
|
-
Plugin.version = "3.
|
|
403
|
+
Plugin.version = "3.8.0-next.2";
|
|
404
404
|
|
|
405
405
|
;// CONCATENATED MODULE: ./src/Plugin/sparkline/Options.ts
|
|
406
406
|
/**
|
|
@@ -449,23 +449,25 @@ var _this = undefined;
|
|
|
449
449
|
/* eslint-disable no-new-func, no-undef */
|
|
450
450
|
|
|
451
451
|
var win = function () {
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
}.bind(undefined)()
|
|
452
|
+
_newArrowCheck(this, _this);
|
|
453
|
+
var root = typeof globalThis === "object" && globalThis !== null && globalThis.Object === Object && globalThis || typeof global === "object" && global !== null && global.Object === Object && global || typeof self === "object" && self !== null && self.Object === Object && self;
|
|
454
|
+
return root || Function("return this")();
|
|
455
|
+
}.bind(undefined)(),
|
|
456
|
+
hasRAF = typeof win.requestAnimationFrame === "function",
|
|
457
|
+
hasRIC = typeof win.requestIdleCallback === "function",
|
|
458
|
+
requestAnimationFrame = hasRAF ? win.requestAnimationFrame : function (cb) {
|
|
459
|
+
_newArrowCheck(this, _this);
|
|
460
|
+
return setTimeout(cb, 1);
|
|
461
|
+
}.bind(undefined),
|
|
462
|
+
cancelAnimationFrame = hasRAF ? win.cancelAnimationFrame : function (id) {
|
|
463
|
+
_newArrowCheck(this, _this);
|
|
464
|
+
return clearTimeout(id);
|
|
465
|
+
}.bind(undefined),
|
|
466
|
+
requestIdleCallback = hasRIC ? win.requestIdleCallback : requestAnimationFrame,
|
|
467
|
+
cancelIdleCallback = hasRIC ? win.cancelIdleCallback : cancelAnimationFrame,
|
|
468
|
+
doc = win == null ? void 0 : win.document;
|
|
456
469
|
/* eslint-enable no-new-func, no-undef */
|
|
457
|
-
|
|
458
470
|
// fallback for non-supported environments
|
|
459
|
-
win.requestIdleCallback = win.requestIdleCallback || function (cb) {
|
|
460
|
-
_newArrowCheck(this, _this);
|
|
461
|
-
return setTimeout(cb, 1);
|
|
462
|
-
}.bind(undefined);
|
|
463
|
-
// win.cancelIdleCallback = win.cancelIdleCallback || (id => clearTimeout(id));
|
|
464
|
-
win.requestAnimationFrame = win.requestAnimationFrame || function (cb) {
|
|
465
|
-
_newArrowCheck(this, _this);
|
|
466
|
-
return setTimeout(cb, 1);
|
|
467
|
-
}.bind(undefined);
|
|
468
|
-
var doc = win == null ? void 0 : win.document;
|
|
469
471
|
;// CONCATENATED MODULE: ./src/module/util.ts
|
|
470
472
|
|
|
471
473
|
|
|
@@ -541,6 +543,18 @@ var isValue = function (v) {
|
|
|
541
543
|
_newArrowCheck(this, util_this);
|
|
542
544
|
return obj && !(obj != null && obj.nodeType) && isObjectType(obj) && !isArray(obj);
|
|
543
545
|
}.bind(undefined);
|
|
546
|
+
/**
|
|
547
|
+
* Check if is array
|
|
548
|
+
* @param {Array} arr Data to be checked
|
|
549
|
+
* @returns {boolean}
|
|
550
|
+
* @private
|
|
551
|
+
*/
|
|
552
|
+
/**
|
|
553
|
+
* Check if is object
|
|
554
|
+
* @param {object} obj Data to be checked
|
|
555
|
+
* @returns {boolean}
|
|
556
|
+
* @private
|
|
557
|
+
*/
|
|
544
558
|
/**
|
|
545
559
|
* Get specified key value from object
|
|
546
560
|
* If default value is given, will return if given key value not found
|
|
@@ -1320,7 +1334,7 @@ function convertInputType(mouse, touch) {
|
|
|
1320
1334
|
function runUntil(fn, conditionFn) {
|
|
1321
1335
|
var _this18 = this;
|
|
1322
1336
|
if (conditionFn() === !1) {
|
|
1323
|
-
|
|
1337
|
+
requestAnimationFrame(function () {
|
|
1324
1338
|
_newArrowCheck(this, _this18);
|
|
1325
1339
|
return runUntil(fn, conditionFn);
|
|
1326
1340
|
}.bind(this));
|
|
@@ -1576,13 +1590,16 @@ var Sparkline = /*#__PURE__*/function (_Plugin) {
|
|
|
1576
1590
|
d.name = d.id;
|
|
1577
1591
|
}
|
|
1578
1592
|
$$.state.event = e;
|
|
1593
|
+
if ($$.config.point_focus_only && d) {
|
|
1594
|
+
$$.showCircleFocus == null ? void 0 : $$.showCircleFocus([d]);
|
|
1595
|
+
}
|
|
1579
1596
|
$$.setExpand(index, data.id, !0);
|
|
1580
1597
|
$$.showTooltip([d], e.target);
|
|
1581
1598
|
};
|
|
1582
1599
|
_proto.outHandler = function outHandler(e) {
|
|
1583
1600
|
var $$ = this.$$;
|
|
1584
1601
|
$$.state.event = e;
|
|
1585
|
-
$$.unexpandCircles();
|
|
1602
|
+
$$.config.point_focus_only ? $$.hideCircleFocus() : $$.unexpandCircles();
|
|
1586
1603
|
$$.hideTooltip();
|
|
1587
1604
|
};
|
|
1588
1605
|
_proto.$redraw = function $redraw() {
|
|
@@ -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.8.0-next.2
|
|
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 r(e){var t=i[e];if(void 0!==t)return t.exports;var o=i[e]={exports:{}};return n[e](o,o.exports,r),o.exports}r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o={};return function(){function e(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}function t(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function n(e,t){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},n(e,t)}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function s(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===i(t)?t:String(t)}function a(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function b(e){for(var t,n=1;n<arguments.length;n++)t=null!=arguments[n]?arguments[n]:{},n%2?c(Object(t),!0).forEach((function(n){a(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):c(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}r.d(o,{default:function(){return T}});var l={button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_"},u=(b(b(b(b(b(b(b(b(b(b(b(b(b(b(b(b(b(b(b(b(b(b(b(b({},l),{arc:"bb-arc",arcLabelLine:"bb-arc-label-line",arcs:"bb-arcs",chartArc:"bb-chart-arc",chartArcs:"bb-chart-arcs",chartArcsBackground:"bb-chart-arcs-background",chartArcsTitle:"bb-chart-arcs-title"}),{area:"bb-area",areas:"bb-areas"}),{axis:"bb-axis",axisX:"bb-axis-x",axisXLabel:"bb-axis-x-label",axisY:"bb-axis-y",axisY2:"bb-axis-y2",axisY2Label:"bb-axis-y2-label",axisYLabel:"bb-axis-y-label"}),{bar:"bb-bar",bars:"bb-bars",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars"}),{candlestick:"bb-candlestick",candlesticks:"bb-candlesticks",chartCandlestick:"bb-chart-candlestick",chartCandlesticks:"bb-chart-candlesticks",valueDown:"bb-value-down",valueUp:"bb-value-up"}),{chartCircles:"bb-chart-circles",circle:"bb-circle",circles:"bb-circles"}),{colorPattern:"bb-color-pattern",colorScale:"bb-colorscale"}),{dragarea:"bb-dragarea",INCLUDED:"_included_"}),{chartArcsGaugeMax:"bb-chart-arcs-gauge-max",chartArcsGaugeMin:"bb-chart-arcs-gauge-min",chartArcsGaugeUnit:"bb-chart-arcs-gauge-unit",chartArcsGaugeTitle:"bb-chart-arcs-gauge-title",gaugeValue:"bb-gauge-value"}),{legend:"bb-legend",legendBackground:"bb-legend-background",legendItem:"bb-legend-item",legendItemEvent:"bb-legend-item-event",legendItemHidden:"bb-legend-item-hidden",legendItemPoint:"bb-legend-item-point",legendItemTile:"bb-legend-item-tile"}),{chartLine:"bb-chart-line",chartLines:"bb-chart-lines",line:"bb-line",lines:"bb-lines"}),{eventRect:"bb-event-rect",eventRects:"bb-event-rects",eventRectsMultiple:"bb-event-rects-multiple",eventRectsSingle:"bb-event-rects-single"}),{focused:"bb-focused",defocused:"bb-defocused",legendItemFocused:"bb-legend-item-focused",xgridFocus:"bb-xgrid-focus",ygridFocus:"bb-ygrid-focus"}),{grid:"bb-grid",gridLines:"bb-grid-lines",xgrid:"bb-xgrid",xgridLine:"bb-xgrid-line",xgridLines:"bb-xgrid-lines",xgrids:"bb-xgrids",ygrid:"bb-ygrid",ygridLine:"bb-ygrid-line",ygridLines:"bb-ygrid-lines",ygrids:"bb-ygrids"}),{chartRadar:"bb-chart-radar",chartRadars:"bb-chart-radars"}),{region:"bb-region",regions:"bb-regions"}),{selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",SELECTED:"_selected_"}),{shape:"bb-shape",shapes:"bb-shapes"}),{brush:"bb-brush",subchart:"bb-subchart"}),{chartText:"bb-chart-text",chartTexts:"bb-chart-texts",text:"bb-text",texts:"bb-texts",title:"bb-title",TextOverlapping:"text-overlapping"}),{tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"}),{treemap:"bb-treemap",chartTreemap:"bb-chart-treemap",chartTreemaps:"bb-chart-treemaps"}),{buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"}),function(){function t(e){void 0===e&&(e={}),this.$$=void 0,this.options=void 0,this.options=e}var n=t.prototype;return n.$beforeInit=function(){},n.$init=function(){},n.$afterInit=function(){},n.$redraw=function(){},n.$willDestroy=function(){var t=this;Object.keys(this).forEach(function(n){e(this,t),this[n]=null,delete this[n]}.bind(this))},t}());u.version="3.7.5";var d=function(){return{selector:void 0}},h=(r(1),r(3),void 0),f=function(){return e(this,h),"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)();f.requestIdleCallback=f.requestIdleCallback||function(t){return e(this,h),setTimeout(t,1)}.bind(void 0),f.requestAnimationFrame=f.requestAnimationFrame||function(t){return e(this,h),setTimeout(t,1)}.bind(void 0);var v=null==f?void 0:f.document,p=void 0;(function(t){return e(this,p),t||0===t}).bind(void 0),function(t){return e(this,p),"function"==typeof t}.bind(void 0);var g=function(t){return e(this,p),"string"==typeof t}.bind(void 0),y=function(t){return e(this,p),"number"==typeof t}.bind(void 0),m=function(t){return e(this,p),void 0===t}.bind(void 0),x=function(t){return e(this,p),void 0!==t}.bind(void 0),O=(function(t){return e(this,p),"boolean"==typeof t}.bind(void 0),function(t){return e(this,p),10*Math.ceil(t/10)}.bind(void 0),function(t){return e(this,p),Math.ceil(t)+.5}.bind(void 0),function(t){return e(this,p),t[1]-t[0]}.bind(void 0),function(t){return e(this,p),"object"==typeof t}.bind(void 0)),j=function(t){return e(this,p),m(t)||null===t||g(t)&&0===t.length||O(t)&&!(t instanceof Date)&&0===Object.keys(t).length||y(t)&&isNaN(t)}.bind(void 0),w=(function(t){return e(this,p),!j(t)}.bind(void 0),function(t){return e(this,p),Array.isArray(t)}.bind(void 0)),$=function(t){return e(this,p),t&&!(null!=t&&t.nodeType)&&O(t)&&!w(t)}.bind(void 0);(function(t){return e(this,p),t.charAt(0).toUpperCase()+t.slice(1)}).bind(void 0);(function(t){return e(this,p),[].slice.call(t)}).bind(void 0);function E(t){for(var n=this,i=arguments.length,r=Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];if(!r.length||1===r.length&&!r[0])return t;var s=r.shift();return $(t)&&$(s)&&Object.keys(s).forEach(function(i){e(this,n);var r=s[i];$(r)?(t[i]||(t[i]={}),t[i]=E(t[i],r)):t[i]=w(r)?r.concat():r}.bind(this)),E.apply(void 0,[t].concat(r))}(function(t,n,i){void 0===i&&(i=1),e(this,p);for(var r=[],o=0|Math.max(0,Math.ceil((n-t)/i)),s=t;s<o;s++)r.push(t+s*i);return r}).bind(void 0),function(){var t=this;e(this,p);var n=function(){return e(this,t),{bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0}}.bind(this);try{return new MouseEvent("t"),function(i,r,o){void 0===o&&(o=n()),e(this,t),i.dispatchEvent(new MouseEvent(r,o))}.bind(this)}catch(i){return function(i,r,o){void 0===o&&(o=n()),e(this,t);var s=v.createEvent("MouseEvent");s.initMouseEvent(r,o.bubbles,o.cancelable,f,0,o.screenX,o.screenY,o.clientX,o.clientY,!1,!1,!1,!1,0,null),i.dispatchEvent(s)}.bind(this)}}.bind(void 0)(),function(t,n,i){e(this,p);var r=new Touch(E({identifier:Date.now(),target:t,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},i));t.dispatchEvent(new TouchEvent(n,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[r],targetTouches:[],changedTouches:[r]}))}.bind(void 0);function _(t){var n,i,r,o=this,s=this.config,a=function(){e(this,o);var t=i.shift();return t&&n&&O(n)&&t in n?(n=n[t],a()):t?void 0:n}.bind(this);Object.keys(s).forEach(function(c){e(this,o),n=t,i=c.split("_"),r=a(),x(r)&&(s[c]=r)}.bind(this)),this.api&&(this.state.orgConfig=t)}var T=function(i){var r,o;function s(e){var n=i.call(this,e)||this;return n.config=void 0,n.element=void 0,n.config=new d,t(n)||t(n)}o=i,(r=s).prototype=Object.create(o.prototype),r.prototype.constructor=r,n(r,o);var a=s.prototype;return a.$beforeInit=function(){_.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)},a.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)},a.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)}},a.overrideOptions=function(){var t=this,n=this.$$.config;if(n.legend_show=!1,n.resize_auto=!1,n.axis_x_show=!1,!1!==n.padding){var i=function(n){return e(this,t),Object.keys(n||{}).length>0}.bind(this);i(n.axis_x_padding)&&(n.axis_x_padding={left:15,right:15,unit:"px"}),i(n.axis_y_padding)&&(n.axis_y_padding=5)}n.axis_y_show=!1,n.tooltip_position||(n.tooltip_position=function(e,t,n){var i=this.internal.state.event,r=i.pageY-1.35*n,o=i.pageX-t/2;return r<0&&(r=0),o<0&&(o=0),{top:r,left:o}})},a.$init=function(){var e,t=this.$$.$el;t.chart.style("width","0").style("height","0").style("pointer-events","none"),(null==(e=t.tooltip)?void 0:e.node())&&document.body.appendChild(t.tooltip.node())},a.$afterInit=function(){this.$$.$el.svg.attr("style",null).style("width","0").style("height","0"),this.bindEvents(!0)},a.bindEvents=function(t){var n=this;void 0===t&&(t=!0);var i=this.$$.config;if(i.interaction_enabled&&i.tooltip_show){var r=(t?"add":"remove")+"EventListener";this.element.forEach(function(t){e(this,n);var i=t.querySelector("svg");i[r]("mouseover",this.overHandler),i[r]("mousemove",this.moveHandler),i[r]("mouseout",this.outHandler)}.bind(this))}},a.overHandler=function(e){this.$$.state.eventReceiver.rect=e.target.getBoundingClientRect()},a.moveHandler=function(e){var t,n,i=this.$$,r=i.getDataIndexFromEvent(e),o=null==(t=i.api.data(e.target.__id))?void 0:t[0],s=null==o||null==(n=o.values)?void 0:n[r];s&&!s.name&&(s.name=s.id),i.state.event=e,i.setExpand(r,o.id,!0),i.showTooltip([s],e.target)},a.outHandler=function(e){var t=this.$$;t.state.event=e,t.unexpandCircles(),t.hideTooltip()},a.$redraw=function(){var t,n=this,i=this.$$,r=i.$el,o=this.element,s=i.api.data(),a=null==(t=r.chart.html().match(/<svg[^>]*>/))?void 0:t[0];if(o.length<s.length){for(var c=r.chart.node(),b=s.length-o.length;b>0;b--)c.parentNode.insertBefore(o[0].cloneNode(),c.nextSibling);this.element=document.querySelectorAll(this.config.selector),o=this.element}s.map(function(t){return e(this,n),t.id}.bind(this)).forEach(function(t,i){e(this,n);var s="."+l.target+"-"+t,c=r.main.selectAll(s),b=o[i].querySelector("svg");b||(o[i].innerHTML=a+"</svg>",(b=o[i].querySelector("svg")).__id=t),b.querySelector(s)||c.style("opacity",null),c.style("fill","none").style("opacity",null),b.innerHTML="",b.appendChild(c.node())}.bind(this))},a.$willDestroy=function(){var t=this;this.bindEvents(!1),this.element.forEach(function(n){e(this,t),n.innerHTML=""}.bind(this))},s}(u);T.version="0.0.1"}(),o=o.default}()}));
|
|
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 r(e){var t=i[e];if(void 0!==t)return t.exports;var o=i[e]={exports:{}};return n[e](o,o.exports,r),o.exports}r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o={};return function(){function e(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}function t(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function n(e,t){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},n(e,t)}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function s(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===i(t)?t:String(t)}function a(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function b(e){for(var t,n=1;n<arguments.length;n++)t=null!=arguments[n]?arguments[n]:{},n%2?c(Object(t),!0).forEach((function(n){a(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):c(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}r.d(o,{default:function(){return A}});var l={button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_"},u=(b(b(b(b(b(b(b(b(b(b(b(b(b(b(b(b(b(b(b(b(b(b(b(b({},l),{arc:"bb-arc",arcLabelLine:"bb-arc-label-line",arcs:"bb-arcs",chartArc:"bb-chart-arc",chartArcs:"bb-chart-arcs",chartArcsBackground:"bb-chart-arcs-background",chartArcsTitle:"bb-chart-arcs-title"}),{area:"bb-area",areas:"bb-areas"}),{axis:"bb-axis",axisX:"bb-axis-x",axisXLabel:"bb-axis-x-label",axisY:"bb-axis-y",axisY2:"bb-axis-y2",axisY2Label:"bb-axis-y2-label",axisYLabel:"bb-axis-y-label"}),{bar:"bb-bar",bars:"bb-bars",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars"}),{candlestick:"bb-candlestick",candlesticks:"bb-candlesticks",chartCandlestick:"bb-chart-candlestick",chartCandlesticks:"bb-chart-candlesticks",valueDown:"bb-value-down",valueUp:"bb-value-up"}),{chartCircles:"bb-chart-circles",circle:"bb-circle",circles:"bb-circles"}),{colorPattern:"bb-color-pattern",colorScale:"bb-colorscale"}),{dragarea:"bb-dragarea",INCLUDED:"_included_"}),{chartArcsGaugeMax:"bb-chart-arcs-gauge-max",chartArcsGaugeMin:"bb-chart-arcs-gauge-min",chartArcsGaugeUnit:"bb-chart-arcs-gauge-unit",chartArcsGaugeTitle:"bb-chart-arcs-gauge-title",gaugeValue:"bb-gauge-value"}),{legend:"bb-legend",legendBackground:"bb-legend-background",legendItem:"bb-legend-item",legendItemEvent:"bb-legend-item-event",legendItemHidden:"bb-legend-item-hidden",legendItemPoint:"bb-legend-item-point",legendItemTile:"bb-legend-item-tile"}),{chartLine:"bb-chart-line",chartLines:"bb-chart-lines",line:"bb-line",lines:"bb-lines"}),{eventRect:"bb-event-rect",eventRects:"bb-event-rects",eventRectsMultiple:"bb-event-rects-multiple",eventRectsSingle:"bb-event-rects-single"}),{focused:"bb-focused",defocused:"bb-defocused",legendItemFocused:"bb-legend-item-focused",xgridFocus:"bb-xgrid-focus",ygridFocus:"bb-ygrid-focus"}),{grid:"bb-grid",gridLines:"bb-grid-lines",xgrid:"bb-xgrid",xgridLine:"bb-xgrid-line",xgridLines:"bb-xgrid-lines",xgrids:"bb-xgrids",ygrid:"bb-ygrid",ygridLine:"bb-ygrid-line",ygridLines:"bb-ygrid-lines",ygrids:"bb-ygrids"}),{chartRadar:"bb-chart-radar",chartRadars:"bb-chart-radars"}),{region:"bb-region",regions:"bb-regions"}),{selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",SELECTED:"_selected_"}),{shape:"bb-shape",shapes:"bb-shapes"}),{brush:"bb-brush",subchart:"bb-subchart"}),{chartText:"bb-chart-text",chartTexts:"bb-chart-texts",text:"bb-text",texts:"bb-texts",title:"bb-title",TextOverlapping:"text-overlapping"}),{tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"}),{treemap:"bb-treemap",chartTreemap:"bb-chart-treemap",chartTreemaps:"bb-chart-treemaps"}),{buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"}),function(){function t(e){void 0===e&&(e={}),this.$$=void 0,this.options=void 0,this.options=e}var n=t.prototype;return n.$beforeInit=function(){},n.$init=function(){},n.$afterInit=function(){},n.$redraw=function(){},n.$willDestroy=function(){var t=this;Object.keys(this).forEach(function(n){e(this,t),this[n]=null,delete this[n]}.bind(this))},t}());u.version="3.8.0-next.2";var d=function(){return{selector:void 0}},h=(r(1),r(3),void 0),f=function(){return e(this,h),"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)(),v="function"==typeof f.requestAnimationFrame,p="function"==typeof f.requestIdleCallback,g=v?f.requestAnimationFrame:function(t){return e(this,h),setTimeout(t,1)}.bind(void 0),y=v?f.cancelAnimationFrame:function(t){return e(this,h),clearTimeout(t)}.bind(void 0),m=(p&&f.requestIdleCallback,p&&f.cancelIdleCallback,null==f?void 0:f.document),x=void 0;(function(t){return e(this,x),t||0===t}).bind(void 0),function(t){return e(this,x),"function"==typeof t}.bind(void 0);var O=function(t){return e(this,x),"string"==typeof t}.bind(void 0),w=function(t){return e(this,x),"number"==typeof t}.bind(void 0),j=function(t){return e(this,x),void 0===t}.bind(void 0),_=function(t){return e(this,x),void 0!==t}.bind(void 0),$=(function(t){return e(this,x),"boolean"==typeof t}.bind(void 0),function(t){return e(this,x),10*Math.ceil(t/10)}.bind(void 0),function(t){return e(this,x),Math.ceil(t)+.5}.bind(void 0),function(t){return e(this,x),t[1]-t[0]}.bind(void 0),function(t){return e(this,x),"object"==typeof t}.bind(void 0)),E=function(t){return e(this,x),j(t)||null===t||O(t)&&0===t.length||$(t)&&!(t instanceof Date)&&0===Object.keys(t).length||w(t)&&isNaN(t)}.bind(void 0),T=(function(t){return e(this,x),!E(t)}.bind(void 0),function(t){return e(this,x),Array.isArray(t)}.bind(void 0)),k=function(t){return e(this,x),t&&!(null!=t&&t.nodeType)&&$(t)&&!T(t)}.bind(void 0);(function(t){return e(this,x),t.charAt(0).toUpperCase()+t.slice(1)}).bind(void 0);(function(t){return e(this,x),[].slice.call(t)}).bind(void 0);function S(t){for(var n=this,i=arguments.length,r=Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];if(!r.length||1===r.length&&!r[0])return t;var s=r.shift();return k(t)&&k(s)&&Object.keys(s).forEach(function(i){e(this,n);var r=s[i];k(r)?(t[i]||(t[i]={}),t[i]=S(t[i],r)):t[i]=T(r)?r.concat():r}.bind(this)),S.apply(void 0,[t].concat(r))}(function(t,n,i){void 0===i&&(i=1),e(this,x);for(var r=[],o=0|Math.max(0,Math.ceil((n-t)/i)),s=t;s<o;s++)r.push(t+s*i);return r}).bind(void 0),function(){var t=this;e(this,x);var n=function(){return e(this,t),{bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0}}.bind(this);try{return new MouseEvent("t"),function(i,r,o){void 0===o&&(o=n()),e(this,t),i.dispatchEvent(new MouseEvent(r,o))}.bind(this)}catch(i){return function(i,r,o){void 0===o&&(o=n()),e(this,t);var s=m.createEvent("MouseEvent");s.initMouseEvent(r,o.bubbles,o.cancelable,f,0,o.screenX,o.screenY,o.clientX,o.clientY,!1,!1,!1,!1,0,null),i.dispatchEvent(s)}.bind(this)}}.bind(void 0)(),function(t,n,i){e(this,x);var r=new Touch(S({identifier:Date.now(),target:t,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},i));t.dispatchEvent(new TouchEvent(n,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[r],targetTouches:[],changedTouches:[r]}))}.bind(void 0);function C(t){var n,i,r,o=this,s=this.config,a=function(){e(this,o);var t=i.shift();return t&&n&&$(n)&&t in n?(n=n[t],a()):t?void 0:n}.bind(this);Object.keys(s).forEach(function(c){e(this,o),n=t,i=c.split("_"),r=a(),_(r)&&(s[c]=r)}.bind(this)),this.api&&(this.state.orgConfig=t)}var A=function(i){var r,o;function s(e){var n=i.call(this,e)||this;return n.config=void 0,n.element=void 0,n.config=new d,t(n)||t(n)}o=i,(r=s).prototype=Object.create(o.prototype),r.prototype.constructor=r,n(r,o);var a=s.prototype;return a.$beforeInit=function(){C.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)},a.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)},a.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)}},a.overrideOptions=function(){var t=this,n=this.$$.config;if(n.legend_show=!1,n.resize_auto=!1,n.axis_x_show=!1,!1!==n.padding){var i=function(n){return e(this,t),Object.keys(n||{}).length>0}.bind(this);i(n.axis_x_padding)&&(n.axis_x_padding={left:15,right:15,unit:"px"}),i(n.axis_y_padding)&&(n.axis_y_padding=5)}n.axis_y_show=!1,n.tooltip_position||(n.tooltip_position=function(e,t,n){var i=this.internal.state.event,r=i.pageY-1.35*n,o=i.pageX-t/2;return r<0&&(r=0),o<0&&(o=0),{top:r,left:o}})},a.$init=function(){var e,t=this.$$.$el;t.chart.style("width","0").style("height","0").style("pointer-events","none"),(null==(e=t.tooltip)?void 0:e.node())&&document.body.appendChild(t.tooltip.node())},a.$afterInit=function(){this.$$.$el.svg.attr("style",null).style("width","0").style("height","0"),this.bindEvents(!0)},a.bindEvents=function(t){var n=this;void 0===t&&(t=!0);var i=this.$$.config;if(i.interaction_enabled&&i.tooltip_show){var r=(t?"add":"remove")+"EventListener";this.element.forEach(function(t){e(this,n);var i=t.querySelector("svg");i[r]("mouseover",this.overHandler),i[r]("mousemove",this.moveHandler),i[r]("mouseout",this.outHandler)}.bind(this))}},a.overHandler=function(e){this.$$.state.eventReceiver.rect=e.target.getBoundingClientRect()},a.moveHandler=function(e){var t,n,i=this.$$,r=i.getDataIndexFromEvent(e),o=null==(t=i.api.data(e.target.__id))?void 0:t[0],s=null==o||null==(n=o.values)?void 0:n[r];s&&!s.name&&(s.name=s.id),i.state.event=e,i.config.point_focus_only&&s&&(null==i.showCircleFocus||i.showCircleFocus([s])),i.setExpand(r,o.id,!0),i.showTooltip([s],e.target)},a.outHandler=function(e){var t=this.$$;t.state.event=e,t.config.point_focus_only?t.hideCircleFocus():t.unexpandCircles(),t.hideTooltip()},a.$redraw=function(){var t,n=this,i=this.$$,r=i.$el,o=this.element,s=i.api.data(),a=null==(t=r.chart.html().match(/<svg[^>]*>/))?void 0:t[0];if(o.length<s.length){for(var c=r.chart.node(),b=s.length-o.length;b>0;b--)c.parentNode.insertBefore(o[0].cloneNode(),c.nextSibling);this.element=document.querySelectorAll(this.config.selector),o=this.element}s.map(function(t){return e(this,n),t.id}.bind(this)).forEach(function(t,i){e(this,n);var s="."+l.target+"-"+t,c=r.main.selectAll(s),b=o[i].querySelector("svg");b||(o[i].innerHTML=a+"</svg>",(b=o[i].querySelector("svg")).__id=t),b.querySelector(s)||c.style("opacity",null),c.style("fill","none").style("opacity",null),b.innerHTML="",b.appendChild(c.node())}.bind(this))},a.$willDestroy=function(){var t=this;this.bindEvents(!1),this.element.forEach(function(n){e(this,t),n.innerHTML=""}.bind(this))},s}(u);A.version="0.0.1"}(),o=o.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.8.0-next.2
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -382,23 +382,25 @@ var _this = undefined;
|
|
|
382
382
|
/* eslint-disable no-new-func, no-undef */
|
|
383
383
|
|
|
384
384
|
var win = function () {
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
}.bind(undefined)()
|
|
385
|
+
_newArrowCheck(this, _this);
|
|
386
|
+
var root = typeof globalThis === "object" && globalThis !== null && globalThis.Object === Object && globalThis || typeof global === "object" && global !== null && global.Object === Object && global || typeof self === "object" && self !== null && self.Object === Object && self;
|
|
387
|
+
return root || Function("return this")();
|
|
388
|
+
}.bind(undefined)(),
|
|
389
|
+
hasRAF = typeof win.requestAnimationFrame === "function",
|
|
390
|
+
hasRIC = typeof win.requestIdleCallback === "function",
|
|
391
|
+
requestAnimationFrame = hasRAF ? win.requestAnimationFrame : function (cb) {
|
|
392
|
+
_newArrowCheck(this, _this);
|
|
393
|
+
return setTimeout(cb, 1);
|
|
394
|
+
}.bind(undefined),
|
|
395
|
+
cancelAnimationFrame = hasRAF ? win.cancelAnimationFrame : function (id) {
|
|
396
|
+
_newArrowCheck(this, _this);
|
|
397
|
+
return clearTimeout(id);
|
|
398
|
+
}.bind(undefined),
|
|
399
|
+
requestIdleCallback = hasRIC ? win.requestIdleCallback : requestAnimationFrame,
|
|
400
|
+
cancelIdleCallback = hasRIC ? win.cancelIdleCallback : cancelAnimationFrame,
|
|
401
|
+
doc = win == null ? void 0 : win.document;
|
|
389
402
|
/* eslint-enable no-new-func, no-undef */
|
|
390
|
-
|
|
391
403
|
// fallback for non-supported environments
|
|
392
|
-
win.requestIdleCallback = win.requestIdleCallback || function (cb) {
|
|
393
|
-
_newArrowCheck(this, _this);
|
|
394
|
-
return setTimeout(cb, 1);
|
|
395
|
-
}.bind(undefined);
|
|
396
|
-
// win.cancelIdleCallback = win.cancelIdleCallback || (id => clearTimeout(id));
|
|
397
|
-
win.requestAnimationFrame = win.requestAnimationFrame || function (cb) {
|
|
398
|
-
_newArrowCheck(this, _this);
|
|
399
|
-
return setTimeout(cb, 1);
|
|
400
|
-
}.bind(undefined);
|
|
401
|
-
var doc = win == null ? void 0 : win.document;
|
|
402
404
|
;// CONCATENATED MODULE: ./src/module/util.ts
|
|
403
405
|
|
|
404
406
|
|
|
@@ -474,6 +476,18 @@ var isValue = function (v) {
|
|
|
474
476
|
_newArrowCheck(this, util_this);
|
|
475
477
|
return obj && !(obj != null && obj.nodeType) && isObjectType(obj) && !isArray(obj);
|
|
476
478
|
}.bind(undefined);
|
|
479
|
+
/**
|
|
480
|
+
* Check if is array
|
|
481
|
+
* @param {Array} arr Data to be checked
|
|
482
|
+
* @returns {boolean}
|
|
483
|
+
* @private
|
|
484
|
+
*/
|
|
485
|
+
/**
|
|
486
|
+
* Check if is object
|
|
487
|
+
* @param {object} obj Data to be checked
|
|
488
|
+
* @returns {boolean}
|
|
489
|
+
* @private
|
|
490
|
+
*/
|
|
477
491
|
/**
|
|
478
492
|
* Get specified key value from object
|
|
479
493
|
* If default value is given, will return if given key value not found
|
|
@@ -1253,7 +1267,7 @@ function convertInputType(mouse, touch) {
|
|
|
1253
1267
|
function runUntil(fn, conditionFn) {
|
|
1254
1268
|
var _this18 = this;
|
|
1255
1269
|
if (conditionFn() === !1) {
|
|
1256
|
-
|
|
1270
|
+
requestAnimationFrame(function () {
|
|
1257
1271
|
_newArrowCheck(this, _this18);
|
|
1258
1272
|
return runUntil(fn, conditionFn);
|
|
1259
1273
|
}.bind(this));
|
|
@@ -1378,7 +1392,7 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
1378
1392
|
};
|
|
1379
1393
|
return Plugin;
|
|
1380
1394
|
}();
|
|
1381
|
-
Plugin.version = "3.
|
|
1395
|
+
Plugin.version = "3.8.0-next.2";
|
|
1382
1396
|
|
|
1383
1397
|
;// CONCATENATED MODULE: ./src/Plugin/stanford/Options.ts
|
|
1384
1398
|
/**
|
|
@@ -1675,6 +1689,8 @@ var Elements = /*#__PURE__*/function () {
|
|
|
1675
1689
|
xvCustom = this.xvCustom.bind($$),
|
|
1676
1690
|
yvCustom = this.yvCustom.bind($$),
|
|
1677
1691
|
stanfordLine = main.select("." + stanford_classes.stanfordLines).style("shape-rendering", "geometricprecision").selectAll("." + stanford_classes.stanfordLine).data(this.owner.config.lines);
|
|
1692
|
+
// Stanford-Lines
|
|
1693
|
+
|
|
1678
1694
|
// exit
|
|
1679
1695
|
stanfordLine.exit().transition().duration(duration).style("opacity", "0").remove();
|
|
1680
1696
|
|
|
@@ -1707,7 +1723,7 @@ var Elements = /*#__PURE__*/function () {
|
|
|
1707
1723
|
xvCustom = this.xvCustom.bind($$),
|
|
1708
1724
|
yvCustom = this.yvCustom.bind($$),
|
|
1709
1725
|
countPointsInRegion = this.owner.countEpochsInRegion.bind($$),
|
|
1710
|
-
stanfordRegion = main.select("." + stanford_classes.stanfordRegions).selectAll("." + stanford_classes.stanfordRegion).data(this.owner.config.regions);
|
|
1726
|
+
stanfordRegion = main.select("." + stanford_classes.stanfordRegions).selectAll("." + stanford_classes.stanfordRegion).data(this.owner.config.regions); // Stanford-Regions
|
|
1711
1727
|
// exit
|
|
1712
1728
|
stanfordRegion.exit().transition().duration(duration).style("opacity", "0").remove();
|
|
1713
1729
|
|
|
@@ -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.8.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-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,i,r,o,a){return function(){"use strict";var s=[,function(t){t.exports=i},,function(t){t.exports=r},,function(e){e.exports=t},function(t){t.exports=e},function(t){t.exports=n},function(t){t.exports=o},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 d={};return function(){function t(t,e){if(t!==e)throw new TypeError("Cannot instantiate an arrow function")}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?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},n(t,e)}l.d(d,{default:function(){return I}});var i=l(5),r=l(6),o=l(7);function a(t){return a="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},a(t)}function s(t){var e=function(t,e){if("object"!==a(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==a(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===a(e)?e:String(e)}function c(t,e,n){return(e=s(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function b(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 u(t){for(var e,n=1;n<arguments.length;n++)e=null!=arguments[n]?arguments[n]:{},n%2?b(Object(e),!0).forEach((function(n){c(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):b(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}));return t}var h={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},f=(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u({},{button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_"}),{arc:"bb-arc",arcLabelLine:"bb-arc-label-line",arcs:"bb-arcs",chartArc:"bb-chart-arc",chartArcs:"bb-chart-arcs",chartArcsBackground:"bb-chart-arcs-background",chartArcsTitle:"bb-chart-arcs-title"}),{area:"bb-area",areas:"bb-areas"}),{axis:"bb-axis",axisX:"bb-axis-x",axisXLabel:"bb-axis-x-label",axisY:"bb-axis-y",axisY2:"bb-axis-y2",axisY2Label:"bb-axis-y2-label",axisYLabel:"bb-axis-y-label"}),{bar:"bb-bar",bars:"bb-bars",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars"}),{candlestick:"bb-candlestick",candlesticks:"bb-candlesticks",chartCandlestick:"bb-chart-candlestick",chartCandlesticks:"bb-chart-candlesticks",valueDown:"bb-value-down",valueUp:"bb-value-up"}),{chartCircles:"bb-chart-circles",circle:"bb-circle",circles:"bb-circles"}),{colorPattern:"bb-color-pattern",colorScale:"bb-colorscale"}),{dragarea:"bb-dragarea",INCLUDED:"_included_"}),{chartArcsGaugeMax:"bb-chart-arcs-gauge-max",chartArcsGaugeMin:"bb-chart-arcs-gauge-min",chartArcsGaugeUnit:"bb-chart-arcs-gauge-unit",chartArcsGaugeTitle:"bb-chart-arcs-gauge-title",gaugeValue:"bb-gauge-value"}),{legend:"bb-legend",legendBackground:"bb-legend-background",legendItem:"bb-legend-item",legendItemEvent:"bb-legend-item-event",legendItemHidden:"bb-legend-item-hidden",legendItemPoint:"bb-legend-item-point",legendItemTile:"bb-legend-item-tile"}),{chartLine:"bb-chart-line",chartLines:"bb-chart-lines",line:"bb-line",lines:"bb-lines"}),{eventRect:"bb-event-rect",eventRects:"bb-event-rects",eventRectsMultiple:"bb-event-rects-multiple",eventRectsSingle:"bb-event-rects-single"}),{focused:"bb-focused",defocused:"bb-defocused",legendItemFocused:"bb-legend-item-focused",xgridFocus:"bb-xgrid-focus",ygridFocus:"bb-ygrid-focus"}),{grid:"bb-grid",gridLines:"bb-grid-lines",xgrid:"bb-xgrid",xgridLine:"bb-xgrid-line",xgridLines:"bb-xgrid-lines",xgrids:"bb-xgrids",ygrid:"bb-ygrid",ygridLine:"bb-ygrid-line",ygridLines:"bb-ygrid-lines",ygrids:"bb-ygrids"}),{chartRadar:"bb-chart-radar",chartRadars:"bb-chart-radars"}),{region:"bb-region",regions:"bb-regions"}),{selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",SELECTED:"_selected_"}),{shape:"bb-shape",shapes:"bb-shapes"}),{brush:"bb-brush",subchart:"bb-subchart"}),{chartText:"bb-chart-text",chartTexts:"bb-chart-texts",text:"bb-text",texts:"bb-texts",title:"bb-title",TextOverlapping:"text-overlapping"}),h),{treemap:"bb-treemap",chartTreemap:"bb-chart-treemap",chartTreemaps:"bb-chart-treemaps"}),{buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"}),l(1),l(3),void 0),p=function(){return t(this,f),"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)();p.requestIdleCallback=p.requestIdleCallback||function(e){return t(this,f),setTimeout(e,1)}.bind(void 0),p.requestAnimationFrame=p.requestAnimationFrame||function(e){return t(this,f),setTimeout(e,1)}.bind(void 0);var g=null==p?void 0:p.document,v=void 0;(function(e){return t(this,v),e||0===e}).bind(void 0);var y=function(e){return t(this,v),"function"==typeof e}.bind(void 0),m=function(e){return t(this,v),"string"==typeof e}.bind(void 0),x=function(e){return t(this,v),"number"==typeof e}.bind(void 0),w=function(e){return t(this,v),void 0===e}.bind(void 0),S=function(e){return t(this,v),void 0!==e}.bind(void 0),_=(function(e){return t(this,v),"boolean"==typeof e}.bind(void 0),function(e){return t(this,v),10*Math.ceil(e/10)}.bind(void 0),function(e){return t(this,v),Math.ceil(e)+.5}.bind(void 0),function(e){return t(this,v),e[1]-e[0]}.bind(void 0),function(e){return t(this,v),"object"==typeof e}.bind(void 0)),E=function(e){return t(this,v),w(e)||null===e||m(e)&&0===e.length||_(e)&&!(e instanceof Date)&&0===Object.keys(e).length||x(e)&&isNaN(e)}.bind(void 0),O=(function(e){return t(this,v),!E(e)}.bind(void 0),function(e){return t(this,v),Array.isArray(e)}.bind(void 0)),j=function(e){return t(this,v),e&&!(null!=e&&e.nodeType)&&_(e)&&!O(e)}.bind(void 0);(function(e){return t(this,v),e.charAt(0).toUpperCase()+e.slice(1)}).bind(void 0);(function(e){return t(this,v),[].slice.call(e)}).bind(void 0);function C(e){for(var n=this,i=arguments.length,r=Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];if(!r.length||1===r.length&&!r[0])return e;var a=r.shift();return j(e)&&j(a)&&Object.keys(a).forEach(function(i){t(this,n);var r=a[i];j(r)?(e[i]||(e[i]={}),e[i]=C(e[i],r)):e[i]=O(r)?r.concat():r}.bind(this)),C.apply(void 0,[e].concat(r))}var $=function(e,n,i){void 0===i&&(i=1),t(this,v);for(var r=[],o=0|Math.max(0,Math.ceil((n-e)/i)),a=e;a<o;a++)r.push(e+a*i);return r}.bind(void 0);(function(){var e=this;t(this,v);var n=function(){return t(this,e),{bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0}}.bind(this);try{return new MouseEvent("t"),function(i,r,o){void 0===o&&(o=n()),t(this,e),i.dispatchEvent(new MouseEvent(r,o))}.bind(this)}catch(i){return function(i,r,o){void 0===o&&(o=n()),t(this,e);var a=g.createEvent("MouseEvent");a.initMouseEvent(r,o.bubbles,o.cancelable,p,0,o.screenX,o.screenY,o.clientX,o.clientY,!1,!1,!1,!1,0,null),i.dispatchEvent(a)}.bind(this)}}).bind(void 0)(),function(e,n,i){t(this,v);var r=new Touch(C({identifier:Date.now(),target:e,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},i));e.dispatchEvent(new TouchEvent(n,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[r],targetTouches:[],changedTouches:[r]}))}.bind(void 0);function M(t){var e;if(t instanceof Date)e=t;else if(m(t)){var n,i=this.config;e=null!=(n=this.format.dataTime(i.data_xFormat)(t))?n:new Date(t)}else x(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 T(e){var n,i,r,o=this,a=this.config,s=function(){t(this,o);var e=i.shift();return e&&n&&_(n)&&e in n?(n=n[e],s()):e?void 0:n}.bind(this);Object.keys(a).forEach(function(c){t(this,o),n=e,i=c.split("_"),r=s(),S(r)&&(a[c]=r)}.bind(this)),this.api&&(this.state.orgConfig=e)}var L=function(){function e(t){void 0===t&&(t={}),this.$$=void 0,this.options=void 0,this.options=t}var n=e.prototype;return n.$beforeInit=function(){},n.$init=function(){},n.$afterInit=function(){},n.$redraw=function(){},n.$willDestroy=function(){var e=this;Object.keys(this).forEach(function(n){t(this,e),this[n]=null,delete this[n]}.bind(this))},e}();L.version="3.7.5";var k=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:[]}},P={colorScale:"bb-colorscale",stanfordElements:"bb-stanford-elements",stanfordLine:"bb-stanford-line",stanfordLines:"bb-stanford-lines",stanfordRegion:"bb-stanford-region",stanfordRegions:"bb-stanford-regions"};function D(t,e){return t.epochs<e.epochs?-1:t.epochs>e.epochs?1:0}function R(t){for(var e,n=function(t){for(var e,n,i=0,r=0,o=t.length,a=o-1;r<o;a=r,r++)e=t[r],n=t[a],i+=e.x*n.y,i-=e.y*n.x;return i/2}(t),i=0,r=0,o=0,a=t.length,s=a-1;o<a;s=o,o++){var c=t[o],l=t[s];e=c.x*l.y-l.x*c.y,i+=(c.x+l.x)*e,r+=(c.y+l.y)*e}return{x:i/(e=6*n),y:r/e}}var q=function(){function e(t){this.owner=void 0,this.owner=t;var e=t.$$.$el.main.select(".bb-chart").append("g").attr("class",P.stanfordElements);e.append("g").attr("class",P.stanfordLines),e.append("g").attr("class",P.stanfordRegions)}var n=e.prototype;return n.updateStanfordLines=function(e){var n=this,i=this.owner.$$,r=i.config,o=i.$el.main,a=r.axis_rotated,s=this.xvCustom.bind(i),c=this.yvCustom.bind(i),l=o.select("."+P.stanfordLines).style("shape-rendering","geometricprecision").selectAll("."+P.stanfordLine).data(this.owner.config.lines);l.exit().transition().duration(e).style("opacity","0").remove();var d=l.enter().append("g");d.append("line").style("opacity","0"),d.merge(l).attr("class",function(e){return t(this,n),P.stanfordLine+(e.class?" "+e.class:"")}.bind(this)).select("line").transition().duration(e).attr("x1",function(e){return t(this,n),a?c(e,"y1"):s(e,"x1")}.bind(this)).attr("x2",function(e){return t(this,n),a?c(e,"y2"):s(e,"x2")}.bind(this)).attr("y1",function(e){return t(this,n),a?s(e,"x1"):c(e,"y1")}.bind(this)).attr("y2",function(e){return t(this,n),a?s(e,"x2"):c(e,"y2")}.bind(this)).transition().style("opacity",null)},n.updateStanfordRegions=function(e){var n=this,i=this.owner.$$,r=i.config,o=i.$el.main,a=r.axis_rotated,s=this.xvCustom.bind(i),c=this.yvCustom.bind(i),l=this.owner.countEpochsInRegion.bind(i),d=o.select("."+P.stanfordRegions).selectAll("."+P.stanfordRegion).data(this.owner.config.regions);d.exit().transition().duration(e).style("opacity","0").remove();var b=d.enter().append("g");b.append("polygon").style("opacity","0"),b.append("text").attr("transform",a?"rotate(-90)":"").style("opacity","0"),(d=b.merge(d)).attr("class",function(e){return t(this,n),P.stanfordRegion+(e.class?" "+e.class:"")}.bind(this)).select("polygon").transition().duration(e).attr("points",function(e){var i=this;return t(this,n),e.points.map(function(e){return t(this,i),[a?c(e,"y"):s(e,"x"),a?s(e,"x"):c(e,"y")].join(",")}.bind(this)).join(" ")}.bind(this)).transition().style("opacity",function(e){return t(this,n),(e.opacity?e.opacity:.2)+""}.bind(this)),d.select("text").transition().duration(e).attr("x",function(e){return t(this,n),a?c(R(e.points),"y"):s(R(e.points),"x")}.bind(this)).attr("y",function(e){return t(this,n),a?s(R(e.points),"x"):c(R(e.points),"y")}.bind(this)).text(function(e){if(t(this,n),e.text){var i=l(e.points),r=i.value,o=i.percentage;return e.text(r,o)}return""}.bind(this)).attr("text-anchor","middle").attr("dominant-baseline","middle").transition().style("opacity",null)},n.updateStanfordElements=function(t){void 0===t&&(t=0),this.updateStanfordLines(t),this.updateStanfordRegions(t)},n.xvCustom=function(t,e){var n=this,i=n.axis,r=n.config,o=e?t[e]:n.getBaseValue(t);return i.isTimeSeries()?o=M.call(n,o):i.isCategorized()&&m(o)&&(o=r.axis_x_categories.indexOf(t.value)),Math.ceil(n.scale.x(o))},n.yvCustom=function(t,e){var n=this,i=t.axis&&"y2"===t.axis?n.scale.y2:n.scale.y,r=e?t[e]:n.getBaseValue(t);return Math.ceil(i(r))},e}(),A=l(8),N=l(9),F=function(){function e(t){this.owner=void 0,this.colorScale=void 0,this.owner=t}var n=e.prototype;return n.drawColorScale=function(){var e=this,n=this.owner,i=n.$$,r=n.config,a=i.data.targets[0],s=i.state.height-r.padding_bottom-r.padding_top,c=r.scale_width,l=$(r.padding_bottom,s,5),d=(0,o.scaleSequential)(a.colors).domain([l[l.length-1],l[0]]);this.colorScale&&this.colorScale.remove(),this.colorScale=i.$el.svg.append("g").attr("width",50).attr("height",s).attr("class",P.colorScale),this.colorScale.append("g").attr("transform","translate(0, "+r.padding_top+")").selectAll("bars").data(l).enter().append("rect").attr("y",function(n,i){return t(this,e),5*i}.bind(this)).attr("x",0).attr("width",c).attr("height",5).attr("fill",function(n){return t(this,e),d(n)}.bind(this));var b=(0,o.scaleSymlog)().domain([a.minEpochs,a.maxEpochs]).range([l[0]+r.padding_top+l[l.length-1]+5-1,l[0]+r.padding_top]),u=(0,A.axisRight)(b),h=r.scale_format;"pow10"===h?u.tickValues([1,10,100,1e3,1e4,1e5,1e6,1e7]):y(h)?u.tickFormat(h):u.tickFormat((0,N.format)("d"));var f=this.colorScale.append("g").attr("class","legend axis").attr("transform","translate("+c+",0)").call(u);"pow10"===h&&f.selectAll(".tick text").text(null).filter(function(n){return t(this,e),n/Math.pow(10,Math.ceil(Math.log(n)/Math.LN10-1e-12))==1}.bind(this)).text(10).append("tspan").attr("dy","-.7em").text(function(n){return t(this,e),Math.round(Math.log(n)/Math.LN10)}.bind(this)),this.colorScale.attr("transform","translate("+(i.state.current.width-this.xForColorScale())+", 0)")},n.xForColorScale=function(){return this.owner.config.padding_right+this.colorScale.node().getBBox().width},n.getColorScalePadding=function(){return this.xForColorScale()+this.owner.config.padding_left+20},e}(),I=function(a){var s,c;function l(t){var n=a.call(this,t)||this;return n.config=void 0,n.colorScale=void 0,n.elements=void 0,n.config=new k,e(n)||e(n)}c=a,(s=l).prototype=Object.create(c.prototype),s.prototype.constructor=s,n(s,c);var d=l.prototype;return d.$beforeInit=function(){var e=this,n=this.$$;n.config.data_xSort=!1,n.isMultipleX=function(){return t(this,e),!0}.bind(this),n.showGridFocus=function(){t(this,e)}.bind(this),n.labelishData=function(n){return t(this,e),n.values}.bind(this),n.opacityForCircle=function(){return t(this,e),1}.bind(this);var i=n.getCurrentPaddingRight.bind(n);n.getCurrentPaddingRight=function(){return t(this,e),i()+(this.colorScale?this.colorScale.getColorScalePadding():0)}.bind(this)},d.$init=function(){var t=this.$$;T.call(this,this.options),t.color=this.getStanfordPointColor.bind(t),this.colorScale=new F(this),this.elements=new q(this),this.convertData(),this.initStanfordData(),this.setStanfordTooltip(),this.colorScale.drawColorScale(),this.$redraw()},d.$redraw=function(t){var e,n;null==(e=this.colorScale)||e.drawColorScale(),null==(n=this.elements)||n.updateStanfordElements(t)},d.getOptions=function(){return new k},d.convertData=function(){var e=this,n=this.$$.data.targets,i=this.options.epochs;n.forEach(function(n){var r=this;t(this,e),n.values.forEach(function(e,n){t(this,r),e.epochs=i[n]}.bind(this)),n.minEpochs=void 0,n.maxEpochs=void 0,n.colors=void 0,n.colorscale=void 0}.bind(this))},d.xvCustom=function(t,e){var n=this,i=n.axis,r=n.config,o=e?t[e]:n.getBaseValue(t);return i.isTimeSeries()?o=M.call(n,o):i.isCategorized()&&m(o)&&(o=r.axis_x_categories.indexOf(t.value)),Math.ceil(n.scale.x(o))},d.yvCustom=function(t,e){var n=this.scale,i=t.axis&&"y2"===t.axis?n.y2:n.y,r=e?t[e]:this.getBaseValue(t);return Math.ceil(i(r))},d.initStanfordData=function(){var e=this,n=this.config,a=this.$$.data.targets[0];a.values.sort(D);var s=a.values.map(function(n){return t(this,e),n.epochs}.bind(this));a.minEpochs=isNaN(n.scale_min)?Math.min.apply(Math,s):n.scale_min,a.maxEpochs=isNaN(n.scale_max)?Math.max.apply(Math,s):n.scale_max,a.colors=y(n.colors)?n.colors:(0,i.interpolateHslLong)((0,r.hsl)(250,1,.5),(0,r.hsl)(0,1,.5)),a.colorscale=(0,o.scaleSequentialLog)(a.colors).domain([a.minEpochs,a.maxEpochs])},d.getStanfordPointColor=function(t){return this.data.targets[0].colorscale(t.epochs)},d.setStanfordTooltip=function(){var e=this.$$.config;E(e.tooltip_contents)&&(e.tooltip_contents=function(n,i,r,o){var a=this,s=e.data_x,c='<table class="'+h.tooltip+'"><tbody>';return n.forEach(function(e){t(this,a);var n=e.id,l=void 0===n?"":n,d=e.value,b=void 0===d?0:d,u=e.epochs,f=void 0===u?0:u,p=e.x;c+="<tr>\n\t\t\t\t\t\t\t<th>"+(s||"")+'</th>\n\t\t\t\t\t\t\t<th class="value">'+i(void 0===p?"":p)+"</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>"+e.id+'</th>\n\t\t\t\t\t\t\t<th class="value">'+r(b)+'</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class="'+h.tooltipName+"-"+l+'">\n\t\t\t\t\t\t\t<td class="name"><span style="background-color:'+o(e)+'"></span>Epochs</td>\n\t\t\t\t\t\t\t<td class="value">'+r(f)+"</td>\n\t\t\t\t\t\t</tr>"}.bind(this)),c+"</tbody></table>"})},d.countEpochsInRegion=function(e){var n=this,i=this.data.targets[0],r=i.values.reduce(function(e,i){return t(this,n),e+ +i.epochs}.bind(this),0),o=i.values.reduce(function(i,r){return t(this,n),function(t,e){for(var n=t.x,i=t.value,r=!1,o=0,a=e.length-1;o<e.length;a=o++){var s=e[o].x,c=e[o].y,l=e[a].x,d=e[a].y;c>i!=d>i&&n<(l-s)*(i-c)/(d-c)+s&&(r=!r)}return r}(r,e)?i+ +r.epochs:i}.bind(this),0);return{value:o,percentage:0!==o?+(o/r*100).toFixed(1):0}},l}(L)}(),d=d.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,i,n,r,o,a){return function(){"use strict";var s=[,function(t){t.exports=n},,function(t){t.exports=r},,function(e){e.exports=t},function(t){t.exports=e},function(t){t.exports=i},function(t){t.exports=o},function(t){t.exports=a}],c={};function l(t){var e=c[t];if(void 0!==e)return e.exports;var i=c[t]={exports:{}};return s[t](i,i.exports,l),i.exports}l.d=function(t,e){for(var i in e)l.o(e,i)&&!l.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},l.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var b={};return function(){function t(t,e){if(t!==e)throw new TypeError("Cannot instantiate an arrow function")}function e(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}l.d(b,{default:function(){return K}});var n=l(5),r=l(6),o=l(7);function a(t){return a="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},a(t)}function s(t){var e=function(t,e){if("object"!==a(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!==a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===a(e)?e:String(e)}function c(t,e,i){return(e=s(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function u(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function d(t){for(var e,i=1;i<arguments.length;i++)e=null!=arguments[i]?arguments[i]:{},i%2?u(Object(e),!0).forEach((function(i){c(t,i,e[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):u(Object(e)).forEach((function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(e,i))}));return t}var h={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},f=(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d({},{button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_"}),{arc:"bb-arc",arcLabelLine:"bb-arc-label-line",arcs:"bb-arcs",chartArc:"bb-chart-arc",chartArcs:"bb-chart-arcs",chartArcsBackground:"bb-chart-arcs-background",chartArcsTitle:"bb-chart-arcs-title"}),{area:"bb-area",areas:"bb-areas"}),{axis:"bb-axis",axisX:"bb-axis-x",axisXLabel:"bb-axis-x-label",axisY:"bb-axis-y",axisY2:"bb-axis-y2",axisY2Label:"bb-axis-y2-label",axisYLabel:"bb-axis-y-label"}),{bar:"bb-bar",bars:"bb-bars",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars"}),{candlestick:"bb-candlestick",candlesticks:"bb-candlesticks",chartCandlestick:"bb-chart-candlestick",chartCandlesticks:"bb-chart-candlesticks",valueDown:"bb-value-down",valueUp:"bb-value-up"}),{chartCircles:"bb-chart-circles",circle:"bb-circle",circles:"bb-circles"}),{colorPattern:"bb-color-pattern",colorScale:"bb-colorscale"}),{dragarea:"bb-dragarea",INCLUDED:"_included_"}),{chartArcsGaugeMax:"bb-chart-arcs-gauge-max",chartArcsGaugeMin:"bb-chart-arcs-gauge-min",chartArcsGaugeUnit:"bb-chart-arcs-gauge-unit",chartArcsGaugeTitle:"bb-chart-arcs-gauge-title",gaugeValue:"bb-gauge-value"}),{legend:"bb-legend",legendBackground:"bb-legend-background",legendItem:"bb-legend-item",legendItemEvent:"bb-legend-item-event",legendItemHidden:"bb-legend-item-hidden",legendItemPoint:"bb-legend-item-point",legendItemTile:"bb-legend-item-tile"}),{chartLine:"bb-chart-line",chartLines:"bb-chart-lines",line:"bb-line",lines:"bb-lines"}),{eventRect:"bb-event-rect",eventRects:"bb-event-rects",eventRectsMultiple:"bb-event-rects-multiple",eventRectsSingle:"bb-event-rects-single"}),{focused:"bb-focused",defocused:"bb-defocused",legendItemFocused:"bb-legend-item-focused",xgridFocus:"bb-xgrid-focus",ygridFocus:"bb-ygrid-focus"}),{grid:"bb-grid",gridLines:"bb-grid-lines",xgrid:"bb-xgrid",xgridLine:"bb-xgrid-line",xgridLines:"bb-xgrid-lines",xgrids:"bb-xgrids",ygrid:"bb-ygrid",ygridLine:"bb-ygrid-line",ygridLines:"bb-ygrid-lines",ygrids:"bb-ygrids"}),{chartRadar:"bb-chart-radar",chartRadars:"bb-chart-radars"}),{region:"bb-region",regions:"bb-regions"}),{selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",SELECTED:"_selected_"}),{shape:"bb-shape",shapes:"bb-shapes"}),{brush:"bb-brush",subchart:"bb-subchart"}),{chartText:"bb-chart-text",chartTexts:"bb-chart-texts",text:"bb-text",texts:"bb-texts",title:"bb-title",TextOverlapping:"text-overlapping"}),h),{treemap:"bb-treemap",chartTreemap:"bb-chart-treemap",chartTreemaps:"bb-chart-treemaps"}),{buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"}),l(1),l(3),void 0),p=function(){return t(this,f),"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)(),g="function"==typeof p.requestAnimationFrame,v="function"==typeof p.requestIdleCallback,y=g?p.requestAnimationFrame:function(e){return t(this,f),setTimeout(e,1)}.bind(void 0),m=g?p.cancelAnimationFrame:function(e){return t(this,f),clearTimeout(e)}.bind(void 0),x=(v&&p.requestIdleCallback,v&&p.cancelIdleCallback,null==p?void 0:p.document),w=void 0;(function(e){return t(this,w),e||0===e}).bind(void 0);var S=function(e){return t(this,w),"function"==typeof e}.bind(void 0),_=function(e){return t(this,w),"string"==typeof e}.bind(void 0),E=function(e){return t(this,w),"number"==typeof e}.bind(void 0),O=function(e){return t(this,w),void 0===e}.bind(void 0),j=function(e){return t(this,w),void 0!==e}.bind(void 0),C=(function(e){return t(this,w),"boolean"==typeof e}.bind(void 0),function(e){return t(this,w),10*Math.ceil(e/10)}.bind(void 0),function(e){return t(this,w),Math.ceil(e)+.5}.bind(void 0),function(e){return t(this,w),e[1]-e[0]}.bind(void 0),function(e){return t(this,w),"object"==typeof e}.bind(void 0)),$=function(e){return t(this,w),O(e)||null===e||_(e)&&0===e.length||C(e)&&!(e instanceof Date)&&0===Object.keys(e).length||E(e)&&isNaN(e)}.bind(void 0),M=(function(e){return t(this,w),!$(e)}.bind(void 0),function(e){return t(this,w),Array.isArray(e)}.bind(void 0)),T=function(e){return t(this,w),e&&!(null!=e&&e.nodeType)&&C(e)&&!M(e)}.bind(void 0);(function(e){return t(this,w),e.charAt(0).toUpperCase()+e.slice(1)}).bind(void 0);(function(e){return t(this,w),[].slice.call(e)}).bind(void 0);function k(e){for(var i=this,n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];if(!r.length||1===r.length&&!r[0])return e;var a=r.shift();return T(e)&&T(a)&&Object.keys(a).forEach(function(n){t(this,i);var r=a[n];T(r)?(e[n]||(e[n]={}),e[n]=k(e[n],r)):e[n]=M(r)?r.concat():r}.bind(this)),k.apply(void 0,[e].concat(r))}var P=function(e,i,n){void 0===n&&(n=1),t(this,w);for(var r=[],o=0|Math.max(0,Math.ceil((i-e)/n)),a=e;a<o;a++)r.push(e+a*n);return r}.bind(void 0);(function(){var e=this;t(this,w);var i=function(){return t(this,e),{bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0}}.bind(this);try{return new MouseEvent("t"),function(n,r,o){void 0===o&&(o=i()),t(this,e),n.dispatchEvent(new MouseEvent(r,o))}.bind(this)}catch(n){return function(n,r,o){void 0===o&&(o=i()),t(this,e);var a=x.createEvent("MouseEvent");a.initMouseEvent(r,o.bubbles,o.cancelable,p,0,o.screenX,o.screenY,o.clientX,o.clientY,!1,!1,!1,!1,0,null),n.dispatchEvent(a)}.bind(this)}}).bind(void 0)(),function(e,i,n){t(this,w);var r=new Touch(k({identifier:Date.now(),target:e,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},n));e.dispatchEvent(new TouchEvent(i,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[r],targetTouches:[],changedTouches:[r]}))}.bind(void 0);function D(t){var e;if(t instanceof Date)e=t;else if(_(t)){var i,n=this.config;e=null!=(i=this.format.dataTime(n.data_xFormat)(t))?i:new Date(t)}else E(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 A(e){var i,n,r,o=this,a=this.config,s=function(){t(this,o);var e=n.shift();return e&&i&&C(i)&&e in i?(i=i[e],s()):e?void 0:i}.bind(this);Object.keys(a).forEach(function(c){t(this,o),i=e,n=c.split("_"),r=s(),j(r)&&(a[c]=r)}.bind(this)),this.api&&(this.state.orgConfig=e)}var q=function(){function e(t){void 0===t&&(t={}),this.$$=void 0,this.options=void 0,this.options=t}var i=e.prototype;return i.$beforeInit=function(){},i.$init=function(){},i.$afterInit=function(){},i.$redraw=function(){},i.$willDestroy=function(){var e=this;Object.keys(this).forEach(function(i){t(this,e),this[i]=null,delete this[i]}.bind(this))},e}();q.version="3.8.0-next.2";var L=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:[]}},F="bb-colorscale",N="bb-stanford-elements",I="bb-stanford-line",R="bb-stanford-lines",B="bb-stanford-region",X="bb-stanford-regions";function Y(t,e){return t.epochs<e.epochs?-1:t.epochs>e.epochs?1:0}function V(t){for(var e,i=function(t){for(var e,i,n=0,r=0,o=t.length,a=o-1;r<o;a=r,r++)e=t[r],i=t[a],n+=e.x*i.y,n-=e.y*i.x;return n/2}(t),n=0,r=0,o=0,a=t.length,s=a-1;o<a;s=o,o++){var c=t[o],l=t[s];e=c.x*l.y-l.x*c.y,n+=(c.x+l.x)*e,r+=(c.y+l.y)*e}return{x:n/(e=6*i),y:r/e}}var z=function(){function e(t){this.owner=void 0,this.owner=t;var e=t.$$.$el.main.select(".bb-chart").append("g").attr("class",N);e.append("g").attr("class",R),e.append("g").attr("class",X)}var i=e.prototype;return i.updateStanfordLines=function(e){var i=this,n=this.owner.$$,r=n.config,o=n.$el.main,a=r.axis_rotated,s=this.xvCustom.bind(n),c=this.yvCustom.bind(n),l=o.select("."+R).style("shape-rendering","geometricprecision").selectAll("."+I).data(this.owner.config.lines);l.exit().transition().duration(e).style("opacity","0").remove();var b=l.enter().append("g");b.append("line").style("opacity","0"),b.merge(l).attr("class",function(e){return t(this,i),I+(e.class?" "+e.class:"")}.bind(this)).select("line").transition().duration(e).attr("x1",function(e){return t(this,i),a?c(e,"y1"):s(e,"x1")}.bind(this)).attr("x2",function(e){return t(this,i),a?c(e,"y2"):s(e,"x2")}.bind(this)).attr("y1",function(e){return t(this,i),a?s(e,"x1"):c(e,"y1")}.bind(this)).attr("y2",function(e){return t(this,i),a?s(e,"x2"):c(e,"y2")}.bind(this)).transition().style("opacity",null)},i.updateStanfordRegions=function(e){var i=this,n=this.owner.$$,r=n.config,o=n.$el.main,a=r.axis_rotated,s=this.xvCustom.bind(n),c=this.yvCustom.bind(n),l=this.owner.countEpochsInRegion.bind(n),b=o.select("."+X).selectAll("."+B).data(this.owner.config.regions);b.exit().transition().duration(e).style("opacity","0").remove();var u=b.enter().append("g");u.append("polygon").style("opacity","0"),u.append("text").attr("transform",a?"rotate(-90)":"").style("opacity","0"),(b=u.merge(b)).attr("class",function(e){return t(this,i),B+(e.class?" "+e.class:"")}.bind(this)).select("polygon").transition().duration(e).attr("points",function(e){var n=this;return t(this,i),e.points.map(function(e){return t(this,n),[a?c(e,"y"):s(e,"x"),a?s(e,"x"):c(e,"y")].join(",")}.bind(this)).join(" ")}.bind(this)).transition().style("opacity",function(e){return t(this,i),(e.opacity?e.opacity:.2)+""}.bind(this)),b.select("text").transition().duration(e).attr("x",function(e){return t(this,i),a?c(V(e.points),"y"):s(V(e.points),"x")}.bind(this)).attr("y",function(e){return t(this,i),a?s(V(e.points),"x"):c(V(e.points),"y")}.bind(this)).text(function(e){if(t(this,i),e.text){var n=l(e.points),r=n.value,o=n.percentage;return e.text(r,o)}return""}.bind(this)).attr("text-anchor","middle").attr("dominant-baseline","middle").transition().style("opacity",null)},i.updateStanfordElements=function(t){void 0===t&&(t=0),this.updateStanfordLines(t),this.updateStanfordRegions(t)},i.xvCustom=function(t,e){var i=this,n=i.axis,r=i.config,o=e?t[e]:i.getBaseValue(t);return n.isTimeSeries()?o=D.call(i,o):n.isCategorized()&&_(o)&&(o=r.axis_x_categories.indexOf(t.value)),Math.ceil(i.scale.x(o))},i.yvCustom=function(t,e){var i=this,n=t.axis&&"y2"===t.axis?i.scale.y2:i.scale.y,r=e?t[e]:i.getBaseValue(t);return Math.ceil(n(r))},e}(),G=l(8),U=l(9),H=function(){function e(t){this.owner=void 0,this.colorScale=void 0,this.owner=t}var i=e.prototype;return i.drawColorScale=function(){var e=this,i=this.owner,n=i.$$,r=i.config,a=n.data.targets[0],s=n.state.height-r.padding_bottom-r.padding_top,c=r.scale_width,l=P(r.padding_bottom,s,5),b=(0,o.scaleSequential)(a.colors).domain([l[l.length-1],l[0]]);this.colorScale&&this.colorScale.remove(),this.colorScale=n.$el.svg.append("g").attr("width",50).attr("height",s).attr("class",F),this.colorScale.append("g").attr("transform","translate(0, "+r.padding_top+")").selectAll("bars").data(l).enter().append("rect").attr("y",function(i,n){return t(this,e),5*n}.bind(this)).attr("x",0).attr("width",c).attr("height",5).attr("fill",function(i){return t(this,e),b(i)}.bind(this));var u=(0,o.scaleSymlog)().domain([a.minEpochs,a.maxEpochs]).range([l[0]+r.padding_top+l[l.length-1]+5-1,l[0]+r.padding_top]),d=(0,G.axisRight)(u),h=r.scale_format;"pow10"===h?d.tickValues([1,10,100,1e3,1e4,1e5,1e6,1e7]):S(h)?d.tickFormat(h):d.tickFormat((0,U.format)("d"));var f=this.colorScale.append("g").attr("class","legend axis").attr("transform","translate("+c+",0)").call(d);"pow10"===h&&f.selectAll(".tick text").text(null).filter(function(i){return t(this,e),i/Math.pow(10,Math.ceil(Math.log(i)/Math.LN10-1e-12))==1}.bind(this)).text(10).append("tspan").attr("dy","-.7em").text(function(i){return t(this,e),Math.round(Math.log(i)/Math.LN10)}.bind(this)),this.colorScale.attr("transform","translate("+(n.state.current.width-this.xForColorScale())+", 0)")},i.xForColorScale=function(){return this.owner.config.padding_right+this.colorScale.node().getBBox().width},i.getColorScalePadding=function(){return this.xForColorScale()+this.owner.config.padding_left+20},e}(),K=function(a){var s,c;function l(t){var i=a.call(this,t)||this;return i.config=void 0,i.colorScale=void 0,i.elements=void 0,i.config=new L,e(i)||e(i)}c=a,(s=l).prototype=Object.create(c.prototype),s.prototype.constructor=s,i(s,c);var b=l.prototype;return b.$beforeInit=function(){var e=this,i=this.$$;i.config.data_xSort=!1,i.isMultipleX=function(){return t(this,e),!0}.bind(this),i.showGridFocus=function(){t(this,e)}.bind(this),i.labelishData=function(i){return t(this,e),i.values}.bind(this),i.opacityForCircle=function(){return t(this,e),1}.bind(this);var n=i.getCurrentPaddingRight.bind(i);i.getCurrentPaddingRight=function(){return t(this,e),n()+(this.colorScale?this.colorScale.getColorScalePadding():0)}.bind(this)},b.$init=function(){var t=this.$$;A.call(this,this.options),t.color=this.getStanfordPointColor.bind(t),this.colorScale=new H(this),this.elements=new z(this),this.convertData(),this.initStanfordData(),this.setStanfordTooltip(),this.colorScale.drawColorScale(),this.$redraw()},b.$redraw=function(t){var e,i;null==(e=this.colorScale)||e.drawColorScale(),null==(i=this.elements)||i.updateStanfordElements(t)},b.getOptions=function(){return new L},b.convertData=function(){var e=this,i=this.$$.data.targets,n=this.options.epochs;i.forEach(function(i){var r=this;t(this,e),i.values.forEach(function(e,i){t(this,r),e.epochs=n[i]}.bind(this)),i.minEpochs=void 0,i.maxEpochs=void 0,i.colors=void 0,i.colorscale=void 0}.bind(this))},b.xvCustom=function(t,e){var i=this,n=i.axis,r=i.config,o=e?t[e]:i.getBaseValue(t);return n.isTimeSeries()?o=D.call(i,o):n.isCategorized()&&_(o)&&(o=r.axis_x_categories.indexOf(t.value)),Math.ceil(i.scale.x(o))},b.yvCustom=function(t,e){var i=this.scale,n=t.axis&&"y2"===t.axis?i.y2:i.y,r=e?t[e]:this.getBaseValue(t);return Math.ceil(n(r))},b.initStanfordData=function(){var e=this,i=this.config,a=this.$$.data.targets[0];a.values.sort(Y);var s=a.values.map(function(i){return t(this,e),i.epochs}.bind(this));a.minEpochs=isNaN(i.scale_min)?Math.min.apply(Math,s):i.scale_min,a.maxEpochs=isNaN(i.scale_max)?Math.max.apply(Math,s):i.scale_max,a.colors=S(i.colors)?i.colors:(0,n.interpolateHslLong)((0,r.hsl)(250,1,.5),(0,r.hsl)(0,1,.5)),a.colorscale=(0,o.scaleSequentialLog)(a.colors).domain([a.minEpochs,a.maxEpochs])},b.getStanfordPointColor=function(t){return this.data.targets[0].colorscale(t.epochs)},b.setStanfordTooltip=function(){var e=this.$$.config;$(e.tooltip_contents)&&(e.tooltip_contents=function(i,n,r,o){var a=this,s=e.data_x,c='<table class="'+h.tooltip+'"><tbody>';return i.forEach(function(e){t(this,a);var i=e.id,l=void 0===i?"":i,b=e.value,u=void 0===b?0:b,d=e.epochs,f=void 0===d?0:d,p=e.x;c+="<tr>\n\t\t\t\t\t\t\t<th>"+(s||"")+'</th>\n\t\t\t\t\t\t\t<th class="value">'+n(void 0===p?"":p)+"</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>"+e.id+'</th>\n\t\t\t\t\t\t\t<th class="value">'+r(u)+'</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class="'+h.tooltipName+"-"+l+'">\n\t\t\t\t\t\t\t<td class="name"><span style="background-color:'+o(e)+'"></span>Epochs</td>\n\t\t\t\t\t\t\t<td class="value">'+r(f)+"</td>\n\t\t\t\t\t\t</tr>"}.bind(this)),c+"</tbody></table>"})},b.countEpochsInRegion=function(e){var i=this,n=this.data.targets[0],r=n.values.reduce(function(e,n){return t(this,i),e+ +n.epochs}.bind(this),0),o=n.values.reduce(function(n,r){return t(this,i),function(t,e){for(var i=t.x,n=t.value,r=!1,o=0,a=e.length-1;o<e.length;a=o++){var s=e[o].x,c=e[o].y,l=e[a].x,b=e[a].y;c>n!=b>n&&i<(l-s)*(n-c)/(b-c)+s&&(r=!r)}return r}(r,e)?n+ +r.epochs:n}.bind(this),0);return{value:o,percentage:0!==o?+(o/r*100).toFixed(1):0}},l}(q)}(),b=b.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.8.0-next.2
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -236,7 +236,7 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
236
236
|
};
|
|
237
237
|
return Plugin;
|
|
238
238
|
}();
|
|
239
|
-
Plugin.version = "3.
|
|
239
|
+
Plugin.version = "3.8.0-next.2";
|
|
240
240
|
|
|
241
241
|
;// CONCATENATED MODULE: ./src/Plugin/tableview/Options.ts
|
|
242
242
|
/**
|
|
@@ -376,23 +376,25 @@ var _this = undefined;
|
|
|
376
376
|
/* eslint-disable no-new-func, no-undef */
|
|
377
377
|
|
|
378
378
|
var win = function () {
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
}.bind(undefined)()
|
|
379
|
+
_newArrowCheck(this, _this);
|
|
380
|
+
var root = typeof globalThis === "object" && globalThis !== null && globalThis.Object === Object && globalThis || typeof global === "object" && global !== null && global.Object === Object && global || typeof self === "object" && self !== null && self.Object === Object && self;
|
|
381
|
+
return root || Function("return this")();
|
|
382
|
+
}.bind(undefined)(),
|
|
383
|
+
hasRAF = typeof win.requestAnimationFrame === "function",
|
|
384
|
+
hasRIC = typeof win.requestIdleCallback === "function",
|
|
385
|
+
requestAnimationFrame = hasRAF ? win.requestAnimationFrame : function (cb) {
|
|
386
|
+
_newArrowCheck(this, _this);
|
|
387
|
+
return setTimeout(cb, 1);
|
|
388
|
+
}.bind(undefined),
|
|
389
|
+
cancelAnimationFrame = hasRAF ? win.cancelAnimationFrame : function (id) {
|
|
390
|
+
_newArrowCheck(this, _this);
|
|
391
|
+
return clearTimeout(id);
|
|
392
|
+
}.bind(undefined),
|
|
393
|
+
requestIdleCallback = hasRIC ? win.requestIdleCallback : requestAnimationFrame,
|
|
394
|
+
cancelIdleCallback = hasRIC ? win.cancelIdleCallback : cancelAnimationFrame,
|
|
395
|
+
doc = win == null ? void 0 : win.document;
|
|
383
396
|
/* eslint-enable no-new-func, no-undef */
|
|
384
|
-
|
|
385
397
|
// fallback for non-supported environments
|
|
386
|
-
win.requestIdleCallback = win.requestIdleCallback || function (cb) {
|
|
387
|
-
_newArrowCheck(this, _this);
|
|
388
|
-
return setTimeout(cb, 1);
|
|
389
|
-
}.bind(undefined);
|
|
390
|
-
// win.cancelIdleCallback = win.cancelIdleCallback || (id => clearTimeout(id));
|
|
391
|
-
win.requestAnimationFrame = win.requestAnimationFrame || function (cb) {
|
|
392
|
-
_newArrowCheck(this, _this);
|
|
393
|
-
return setTimeout(cb, 1);
|
|
394
|
-
}.bind(undefined);
|
|
395
|
-
var doc = win == null ? void 0 : win.document;
|
|
396
398
|
;// CONCATENATED MODULE: ./src/module/util.ts
|
|
397
399
|
|
|
398
400
|
|
|
@@ -468,6 +470,18 @@ var isValue = function (v) {
|
|
|
468
470
|
_newArrowCheck(this, util_this);
|
|
469
471
|
return obj && !(obj != null && obj.nodeType) && isObjectType(obj) && !isArray(obj);
|
|
470
472
|
}.bind(undefined);
|
|
473
|
+
/**
|
|
474
|
+
* Check if is array
|
|
475
|
+
* @param {Array} arr Data to be checked
|
|
476
|
+
* @returns {boolean}
|
|
477
|
+
* @private
|
|
478
|
+
*/
|
|
479
|
+
/**
|
|
480
|
+
* Check if is object
|
|
481
|
+
* @param {object} obj Data to be checked
|
|
482
|
+
* @returns {boolean}
|
|
483
|
+
* @private
|
|
484
|
+
*/
|
|
471
485
|
/**
|
|
472
486
|
* Get specified key value from object
|
|
473
487
|
* If default value is given, will return if given key value not found
|
|
@@ -1247,7 +1261,7 @@ function convertInputType(mouse, touch) {
|
|
|
1247
1261
|
function runUntil(fn, conditionFn) {
|
|
1248
1262
|
var _this18 = this;
|
|
1249
1263
|
if (conditionFn() === !1) {
|
|
1250
|
-
|
|
1264
|
+
requestAnimationFrame(function () {
|
|
1251
1265
|
_newArrowCheck(this, _this18);
|
|
1252
1266
|
return runUntil(fn, conditionFn);
|
|
1253
1267
|
}.bind(this));
|
|
@@ -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.8.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
|
|
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 B}});var u=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}();u.version="3.8.0-next.2";var s=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>",y=(o(1),o(3),void 0),g=function(){return i(this,y),"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)(),m="function"==typeof g.requestAnimationFrame,w="function"==typeof g.requestIdleCallback,O=m?g.requestAnimationFrame:function(t){return i(this,y),setTimeout(t,1)}.bind(void 0),j=m?g.cancelAnimationFrame:function(t){return i(this,y),clearTimeout(t)}.bind(void 0),E=(w&&g.requestIdleCallback,w&&g.cancelIdleCallback,null==g?void 0:g.document),T=void 0;(function(t){return i(this,T),t||0===t}).bind(void 0),function(t){return i(this,T),"function"==typeof t}.bind(void 0);var $=function(t){return i(this,T),"string"==typeof t}.bind(void 0),x=function(t){return i(this,T),"number"==typeof t}.bind(void 0),S=function(t){return i(this,T),void 0===t}.bind(void 0),P=function(t){return i(this,T),void 0!==t}.bind(void 0),C=(function(t){return i(this,T),"boolean"==typeof t}.bind(void 0),function(t){return i(this,T),10*Math.ceil(t/10)}.bind(void 0),function(t){return i(this,T),Math.ceil(t)+.5}.bind(void 0),function(t){return i(this,T),t[1]-t[0]}.bind(void 0),function(t){return i(this,T),"object"==typeof t}.bind(void 0)),k=function(t){return i(this,T),S(t)||null===t||$(t)&&0===t.length||C(t)&&!(t instanceof Date)&&0===Object.keys(t).length||x(t)&&isNaN(t)}.bind(void 0),M=(function(t){return i(this,T),!k(t)}.bind(void 0),function(t){return i(this,T),Array.isArray(t)}.bind(void 0)),_=function(t){return i(this,T),t&&!(null!=t&&t.nodeType)&&C(t)&&!M(t)}.bind(void 0);(function(t){return i(this,T),t.charAt(0).toUpperCase()+t.slice(1)}).bind(void 0);(function(t){return i(this,T),[].slice.call(t)}).bind(void 0);function q(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 _(t)&&_(c)&&Object.keys(c).forEach(function(n){i(this,e);var o=c[n];_(o)?(t[n]||(t[n]={}),t[n]=q(t[n],o)):t[n]=M(o)?o.concat():o}.bind(this)),q.apply(void 0,[t].concat(o))}(function(t,e,n){void 0===n&&(n=1),i(this,T);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,T);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=E.createEvent("MouseEvent");c.initMouseEvent(o,r.bubbles,r.cancelable,g,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,T);var o=new Touch(q({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 A(t,e){var n=t;for(var i in e)n=n.replace(new RegExp("{="+i+"}","g"),e[i]);return n}function D(t){var e,n,o,r=this,c=this.config,a=function(){i(this,r);var t=n.shift();return t&&e&&C(e)&&t in e?(e=e[t],a()):t?void 0:e}.bind(this);Object.keys(c).forEach(function(u){i(this,r),e=t,n=u.split("_"),o=a(),P(o)&&(c[u]=o)}.bind(this)),this.api&&(this.state.orgConfig=t)}function N(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 I(t){for(var e,i=1;i<arguments.length;i++)e=null!=arguments[i]?arguments[i]:{},i%2?N(Object(e),!0).forEach((function(i){n(t,i,e[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):N(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}));return t}var B=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 s,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(){D.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 u=document.createElement("style");u.id=l,u.innerHTML=b,(document.head||document.getElementsByTagName("head")[0]).appendChild(u)}(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=A(h,{title:r.length?this.config.categoryTitle:""}),a="",u=[];r.forEach(function(e){var n=this;i(this,t),c+=A(h,{title:e.id}),e.values.forEach(function(t,e){i(this,n),u[e]||(u[e]=[t.x]),u[e].push(t.value)}.bind(this))}.bind(this)),u.forEach(function(e){var o=this;i(this,t),a+="<tr>"+e.map(function(t,e){return i(this,o),A(e?p:v,{value:0===e?n.categoryFormat.bind(this)(t):x(t)?t.toLocaleString():""})}.bind(this)).join("")+"</tr>"}.bind(this));var s=A(d,I(I({},n),{},{title:n.title||e.config.title_text||"",thead:c,tbody:a})).replace(/<[^>]+><\/[^>]+>/g,"");o.innerHTML=s},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}(u)}(),r=r.default}()}));
|