billboard.js 3.4.0-next.2 → 3.4.0
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 +47 -18
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +93 -32
- package/dist/billboard.pkgd.min.js +2 -2
- 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 +9 -5
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +9 -5
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +9 -5
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +9 -5
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +55 -19
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +55 -19
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +55 -19
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +55 -19
- 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 +38 -18
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +7 -4
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/package.json +8 -8
- package/src/ChartInternal/ChartInternal.ts +19 -8
- package/src/ChartInternal/shape/arc.ts +1 -1
- package/src/ChartInternal/shape/bar.ts +1 -1
- package/src/ChartInternal/shape/point.ts +6 -3
- package/src/module/generator.ts +7 -1
- package/src/module/util.ts +4 -2
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.4.0
|
|
8
|
+
* @version 3.4.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -192,7 +192,7 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
192
192
|
return Plugin;
|
|
193
193
|
}();
|
|
194
194
|
|
|
195
|
-
Plugin.version = "3.4.0
|
|
195
|
+
Plugin.version = "3.4.0";
|
|
196
196
|
|
|
197
197
|
;// CONCATENATED MODULE: ./src/Plugin/bubblecompare/index.ts
|
|
198
198
|
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.4.0
|
|
8
|
+
* @version 3.4.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
12
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3-selection")):"function"==typeof define&&define.amd?define("bb",["d3-selection"],e):"object"==typeof exports?exports.bb=e(require("d3-selection")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.bubblecompare=e(t.d3))}(this,(function(t){return function(){"use strict";var e=[,function(e){e.exports=t}],n={};function i(t){var r=n[t];if(void 0!==r)return r.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,i),o.exports}i.d=function(t,e){for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var r={};return function(){function t(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function e(t,n){return e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(t,n)}i.d(r,{default:function(){return u}});var n=i(1),o=function(){function t(t){void 0===t&&(t={}),this.$$=void 0,this.options=void 0,this.options=t}var e=t.prototype;return e.$beforeInit=function(){},e.$init=function(){},e.$afterInit=function(){},e.$redraw=function(){},e.$willDestroy=function(){var t=this;Object.keys(this).forEach((function(e){t[e]=null,delete t[e]}))},t}();o.version="3.4.0
|
|
12
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3-selection")):"function"==typeof define&&define.amd?define("bb",["d3-selection"],e):"object"==typeof exports?exports.bb=e(require("d3-selection")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.bubblecompare=e(t.d3))}(this,(function(t){return function(){"use strict";var e=[,function(e){e.exports=t}],n={};function i(t){var r=n[t];if(void 0!==r)return r.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,i),o.exports}i.d=function(t,e){for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var r={};return function(){function t(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function e(t,n){return e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(t,n)}i.d(r,{default:function(){return u}});var n=i(1),o=function(){function t(t){void 0===t&&(t={}),this.$$=void 0,this.options=void 0,this.options=t}var e=t.prototype;return e.$beforeInit=function(){},e.$init=function(){},e.$afterInit=function(){},e.$redraw=function(){},e.$willDestroy=function(){var t=this;Object.keys(this).forEach((function(e){t[e]=null,delete t[e]}))},t}();o.version="3.4.0";var u=function(i){var r,o;function u(e){var n=i.call(this,e)||this;return n.$$=void 0,t(n)||t(n)}o=i,(r=u).prototype=Object.create(o.prototype),r.prototype.constructor=r,e(r,o);var s=u.prototype;return s.$init=function(){var t=this.$$;t.findClosest=this.findClosest.bind(this),t.getBubbleR=this.getBubbleR.bind(this),t.pointExpandedR=this.pointExpandedR.bind(this)},s.pointExpandedR=function(t){var e=this.getBubbleR(t),n=this.options.expandScale,i=void 0===n?1:n;return u.raiseFocusedBubbleLayer(t),this.changeCursorPoint(),e*i},u.raiseFocusedBubbleLayer=function(t){t.raise&&(0,n.select)(t.node().parentNode.parentNode).raise()},s.changeCursorPoint=function(){this.$$.$el.svg.select(".bb-event-rect").style("cursor","pointer")},s.findClosest=function(t,e){var n=this,i=this.$$;return t.filter((function(t){return t&&!i.isBarType(t.id)})).reduce((function(t,r){return i.dist(r,e)<n.getBubbleR(r)?r:t}),0)},s.getBubbleR=function(t){var e=this,n=this.options,i=n.minR,r=n.maxR,o=this.getZData(t);if(!o)return i;var u=this.$$.data.targets.reduce((function(t,n){var i=t[0],r=t[1],o=e.getZData(n.values[0]);return[Math.min(i,o),Math.max(r,o)]}),[1e4,0]),s=u[0],a=u[1],c=s>0&&a===s?0:o/a;return Math.abs(c)*(r-i)+i},s.getZData=function(t){return this.$$.isBubbleZType(t)?this.$$.getBubbleZData(t.value,"z"):t.value},u}(o);u.version="0.0.1"}(),r=r.default}()}));
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.4.0
|
|
8
|
+
* @version 3.4.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -375,7 +375,7 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
375
375
|
return Plugin;
|
|
376
376
|
}();
|
|
377
377
|
|
|
378
|
-
Plugin.version = "3.4.0
|
|
378
|
+
Plugin.version = "3.4.0";
|
|
379
379
|
|
|
380
380
|
;// CONCATENATED MODULE: ./src/Plugin/sparkline/Options.ts
|
|
381
381
|
/**
|
|
@@ -1213,9 +1213,13 @@ function parseDate(date) {
|
|
|
1213
1213
|
if (date instanceof Date) {
|
|
1214
1214
|
parsedDate = date;
|
|
1215
1215
|
} else if (isString(date)) {
|
|
1216
|
-
var
|
|
1216
|
+
var _format$dataTime,
|
|
1217
|
+
config = this.config,
|
|
1217
1218
|
format = this.format;
|
|
1218
|
-
|
|
1219
|
+
|
|
1220
|
+
// if fails to parse, try by new Date()
|
|
1221
|
+
// https://github.com/naver/billboard.js/issues/1714
|
|
1222
|
+
parsedDate = (_format$dataTime = format.dataTime(config.data_xFormat)(date)) != null ? _format$dataTime : new Date(date);
|
|
1219
1223
|
} else if (isNumber(date) && !isNaN(date)) {
|
|
1220
1224
|
parsedDate = new Date(+date);
|
|
1221
1225
|
}
|
|
@@ -1234,7 +1238,7 @@ function parseDate(date) {
|
|
|
1234
1238
|
|
|
1235
1239
|
|
|
1236
1240
|
function isTabVisible() {
|
|
1237
|
-
return !doc.
|
|
1241
|
+
return (doc == null ? void 0 : doc.hidden) === !1 || (doc == null ? void 0 : doc.visibilityState) === "visible";
|
|
1238
1242
|
}
|
|
1239
1243
|
/**
|
|
1240
1244
|
* Get the current input type
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.4.0
|
|
8
|
+
* @version 3.4.0
|
|
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}],r={};function i(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return n[e](o,o.exports,i),o.exports}i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o={};return function(){function e(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t,i=1;i<arguments.length;i++)t=null!=arguments[i]?arguments[i]:{},i%2?r(Object(t),!0).forEach((function(r){n(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):r(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}i.d(o,{default:function(){return f}});var c={button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_"},b=(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a({},c),{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"}),{buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"}),function(){function e(e){void 0===e&&(e={}),this.$$=void 0,this.options=void 0,this.options=e}var t=e.prototype;return t.$beforeInit=function(){},t.$init=function(){},t.$afterInit=function(){},t.$redraw=function(){},t.$willDestroy=function(){var e=this;Object.keys(this).forEach((function(t){e[t]=null,delete e[t]}))},e}());b.version="3.4.0
|
|
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}],r={};function i(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return n[e](o,o.exports,i),o.exports}i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o={};return function(){function e(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t,i=1;i<arguments.length;i++)t=null!=arguments[i]?arguments[i]:{},i%2?r(Object(t),!0).forEach((function(r){n(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):r(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}i.d(o,{default:function(){return f}});var c={button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_"},b=(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a(a({},c),{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"}),{buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"}),function(){function e(e){void 0===e&&(e={}),this.$$=void 0,this.options=void 0,this.options=e}var t=e.prototype;return t.$beforeInit=function(){},t.$init=function(){},t.$afterInit=function(){},t.$redraw=function(){},t.$willDestroy=function(){var e=this;Object.keys(this).forEach((function(t){e[t]=null,delete e[t]}))},e}());b.version="3.4.0";var l=function(){return{selector:void 0}},s=(i(1),i(3),"object"==typeof globalThis&&null!==globalThis&&globalThis.Object===Object&&globalThis||"object"==typeof global&&null!==global&&global.Object===Object&&global||"object"==typeof self&&null!==self&&self.Object===Object&&self||Function("return this")());s.requestIdleCallback=s.requestIdleCallback||function(e){return setTimeout(e,1)},s.cancelIdleCallback=s.cancelIdleCallback||function(e){return clearTimeout(e)};var u=null==s?void 0:s.document;var d=function(e){return void 0!==e},h=function(e){return"object"==typeof e};!function(){try{new MouseEvent("t")}catch(e){return function(e,t,n){void 0===n&&(n={bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});var r=u.createEvent("MouseEvent");r.initMouseEvent(t,n.bubbles,n.cancelable,s,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),e.dispatchEvent(r)}}}();function g(e){var t,n,r,i=this.config,o=function(){var e=n.shift();return e&&t&&h(t)&&e in t?(t=t[e],o()):e?void 0:t};Object.keys(i).forEach((function(a){t=e,n=a.split("_"),r=o(),d(r)&&(i[a]=r)}))}var f=function(n){var r,i;function o(t){var r=n.call(this,t)||this;return r.config=void 0,r.element=void 0,r.config=new l,e(r)||e(r)}i=n,(r=o).prototype=Object.create(i.prototype),r.prototype.constructor=r,t(r,i);var a=o.prototype;return a.$beforeInit=function(){g.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,r){return"getShapeX"===r?{}:n.call(this,e,t)},e.getBarW=function(e,n){return t.call(this,e,n,1)}},a.overrideOptions=function(){var e=this.$$.config;e.legend_show=!1,e.resize_auto=!1,e.axis_x_show=!1,e.axis_x_padding={left:15,right:15,unit:"px"},e.axis_y_show=!1,e.axis_y_padding=5,e.tooltip_position||(e.tooltip_position=function(e,t,n){var r=this.internal.state.event,i=r.pageY-1.35*n,o=r.pageX-t/2;return i<0&&(i=0),o<0&&(o=0),{top:i,left:o}})},a.$init=function(){var e=this.$$.$el;e.chart.style("width","0").style("height","0").style("pointer-events","none"),document.body.appendChild(e.tooltip.node())},a.$afterInit=function(){this.$$.$el.svg.attr("style",null).style("width","0").style("height","0"),this.bindEvents(!0)},a.bindEvents=function(e){var t=this;if(void 0===e&&(e=!0),this.$$.config.interaction_enabled){var n=(e?"add":"remove")+"EventListener";this.element.forEach((function(e){var r=e.querySelector("svg");r[n]("mouseover",t.overHandler),r[n]("mousemove",t.moveHandler),r[n]("mouseout",t.outHandler)}))}},a.overHandler=function(e){this.$$.state.eventReceiver.rect=e.target.getBoundingClientRect()},a.moveHandler=function(e){var t,n,r,i=this.$$,o=i.getDataIndexFromEvent(e),a=null==(t=i.api.data(e.target.__id))?void 0:t[0],c=null==(n=a)||null==(r=n.values)?void 0:r[o];c&&!c.name&&(c.name=c.id),i.state.event=e,i.setExpand(o,a.id,!0),i.showTooltip([c],e.target)},a.outHandler=function(e){var t=this.$$;t.state.event=e,t.unexpandCircles(),t.hideTooltip()},a.$redraw=function(){var e,t=this.$$,n=t.$el,r=this.element,i=t.api.data(),o=null==(e=n.chart.html().match(/<svg[^>]*>/))?void 0:e[0];if(r.length<i.length){for(var a=n.chart.node(),b=i.length-r.length;b>0;b--)a.parentNode.insertBefore(r[0].cloneNode(),a.nextSibling);this.element=document.querySelectorAll(this.config.selector),r=this.element}i.map((function(e){return e.id})).forEach((function(e,t){var i="."+c.target+"-"+e,a=n.main.selectAll(i),b=r[t].querySelector("svg");b||(r[t].innerHTML=o+"</svg>",(b=r[t].querySelector("svg")).__id=e),b.querySelector(i)||a.style("opacity",null),a.style("fill","none").style("opacity",null),b.innerHTML="",b.appendChild(a.node())}))},a.$willDestroy=function(){this.bindEvents(!1),this.element.forEach((function(e){e.innerHTML=""}))},o}(b);f.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.4.0
|
|
8
|
+
* @version 3.4.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -1134,9 +1134,13 @@ function parseDate(date) {
|
|
|
1134
1134
|
if (date instanceof Date) {
|
|
1135
1135
|
parsedDate = date;
|
|
1136
1136
|
} else if (isString(date)) {
|
|
1137
|
-
var
|
|
1137
|
+
var _format$dataTime,
|
|
1138
|
+
config = this.config,
|
|
1138
1139
|
format = this.format;
|
|
1139
|
-
|
|
1140
|
+
|
|
1141
|
+
// if fails to parse, try by new Date()
|
|
1142
|
+
// https://github.com/naver/billboard.js/issues/1714
|
|
1143
|
+
parsedDate = (_format$dataTime = format.dataTime(config.data_xFormat)(date)) != null ? _format$dataTime : new Date(date);
|
|
1140
1144
|
} else if (isNumber(date) && !isNaN(date)) {
|
|
1141
1145
|
parsedDate = new Date(+date);
|
|
1142
1146
|
}
|
|
@@ -1155,7 +1159,7 @@ function parseDate(date) {
|
|
|
1155
1159
|
|
|
1156
1160
|
|
|
1157
1161
|
function isTabVisible() {
|
|
1158
|
-
return !doc.
|
|
1162
|
+
return (doc == null ? void 0 : doc.hidden) === !1 || (doc == null ? void 0 : doc.visibilityState) === "visible";
|
|
1159
1163
|
}
|
|
1160
1164
|
/**
|
|
1161
1165
|
* Get the current input type
|
|
@@ -1322,7 +1326,7 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
1322
1326
|
return Plugin;
|
|
1323
1327
|
}();
|
|
1324
1328
|
|
|
1325
|
-
Plugin.version = "3.4.0
|
|
1329
|
+
Plugin.version = "3.4.0";
|
|
1326
1330
|
|
|
1327
1331
|
;// CONCATENATED MODULE: ./src/Plugin/stanford/Options.ts
|
|
1328
1332
|
/**
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.4.0
|
|
8
|
+
* @version 3.4.0
|
|
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,r,a,o,i){return function(){"use strict";var c=[,function(t){t.exports=r},,function(t){t.exports=a},,function(e){e.exports=t},function(t){t.exports=e},function(t){t.exports=n},function(t){t.exports=o},function(t){t.exports=i}],s={};function l(t){var e=s[t];if(void 0!==e)return e.exports;var n=s[t]={exports:{}};return c[t](n,n.exports,l),n.exports}l.d=function(t,e){for(var n in e)l.o(e,n)&&!l.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},l.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var u={};return function(){function t(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function e(t,n){return e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(t,n)}l.d(u,{default:function(){return T}});var n=l(5),r=l(6),a=l(7);function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function c(t){for(var e,n=1;n<arguments.length;n++)e=null!=arguments[n]?arguments[n]:{},n%2?i(Object(e),!0).forEach((function(n){o(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):i(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}));return t}var s={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},b=(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c({},{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"}),s),{buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"}),l(1),l(3),"object"==typeof globalThis&&null!==globalThis&&globalThis.Object===Object&&globalThis||"object"==typeof global&&null!==global&&global.Object===Object&&global||"object"==typeof self&&null!==self&&self.Object===Object&&self||Function("return this")());b.requestIdleCallback=b.requestIdleCallback||function(t){return setTimeout(t,1)},b.cancelIdleCallback=b.cancelIdleCallback||function(t){return clearTimeout(t)};var d=null==b?void 0:b.document;var h=function(t){return"function"==typeof t},f=function(t){return"string"==typeof t},p=function(t){return"number"==typeof t},g=function(t){return void 0!==t},v=function(t){return"object"==typeof t},x=function(t){return void 0===t||null===t||f(t)&&0===t.length||v(t)&&!(t instanceof Date)&&0===Object.keys(t).length||p(t)&&isNaN(t)};!function(){try{new MouseEvent("t")}catch(t){return function(t,e,n){void 0===n&&(n={bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});var r=d.createEvent("MouseEvent");r.initMouseEvent(e,n.bubbles,n.cancelable,b,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),t.dispatchEvent(r)}}}();function y(t){var e;if(t instanceof Date)e=t;else if(f(t)){var n=this.config;e=this.format.dataTime(n.data_xFormat)(t)}else p(t)&&!isNaN(t)&&(e=new Date(+t));return e&&!isNaN(+e)||console&&console.error&&console.error("Failed to parse x '"+t+"' to Date object"),e}function m(t){var e,n,r,a=this.config,o=function(){var t=n.shift();return t&&e&&v(e)&&t in e?(e=e[t],o()):t?void 0:e};Object.keys(a).forEach((function(i){e=t,n=i.split("_"),r=o(),g(r)&&(a[i]=r)}))}var w=function(){function t(t){void 0===t&&(t={}),this.$$=void 0,this.options=void 0,this.options=t}var e=t.prototype;return e.$beforeInit=function(){},e.$init=function(){},e.$afterInit=function(){},e.$redraw=function(){},e.$willDestroy=function(){var t=this;Object.keys(this).forEach((function(e){t[e]=null,delete t[e]}))},t}();w.version="3.4.0-next.2";var S=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:[]}},_="bb-colorscale",O="bb-stanford-elements",j="bb-stanford-line",C="bb-stanford-lines",E="bb-stanford-region",$="bb-stanford-regions";function k(t,e){return t.epochs<e.epochs?-1:t.epochs>e.epochs?1:0}function M(t){for(var e,n=function(t){for(var e,n,r=0,a=0,o=t.length,i=o-1;a<o;i=a,a++)e=t[a],n=t[i],r+=e.x*n.y,r-=e.y*n.x;return r/2}(t),r=0,a=0,o=0,i=t.length,c=i-1;o<i;c=o,o++){var s=t[o],l=t[c];e=s.x*l.y-l.x*s.y,r+=(s.x+l.x)*e,a+=(s.y+l.y)*e}return{x:r/(e=6*n),y:a/e}}var L=function(){function t(t){this.owner=void 0,this.owner=t;var e=t.$$.$el.main.select(".bb-chart").append("g").attr("class",O);e.append("g").attr("class",C),e.append("g").attr("class",$)}var e=t.prototype;return e.updateStanfordLines=function(t){var e=this.owner.$$,n=e.config,r=e.$el.main,a=n.axis_rotated,o=this.xvCustom.bind(e),i=this.yvCustom.bind(e),c=r.select("."+C).style("shape-rendering","geometricprecision").selectAll("."+j).data(this.owner.config.lines);c.exit().transition().duration(t).style("opacity","0").remove();var s=c.enter().append("g");s.append("line").style("opacity","0"),s.merge(c).attr("class",(function(t){return j+(t.class?" "+t.class:"")})).select("line").transition().duration(t).attr("x1",(function(t){return a?i(t,"y1"):o(t,"x1")})).attr("x2",(function(t){return a?i(t,"y2"):o(t,"x2")})).attr("y1",(function(t){return a?o(t,"x1"):i(t,"y1")})).attr("y2",(function(t){return a?o(t,"x2"):i(t,"y2")})).transition().style("opacity",null)},e.updateStanfordRegions=function(t){var e=this.owner.$$,n=e.config,r=e.$el.main,a=n.axis_rotated,o=this.xvCustom.bind(e),i=this.yvCustom.bind(e),c=this.owner.countEpochsInRegion.bind(e),s=r.select("."+$).selectAll("."+E).data(this.owner.config.regions);s.exit().transition().duration(t).style("opacity","0").remove();var l=s.enter().append("g");l.append("polygon").style("opacity","0"),l.append("text").attr("transform",a?"rotate(-90)":"").style("opacity","0"),(s=l.merge(s)).attr("class",(function(t){return E+(t.class?" "+t.class:"")})).select("polygon").transition().duration(t).attr("points",(function(t){return t.points.map((function(t){return[a?i(t,"y"):o(t,"x"),a?o(t,"x"):i(t,"y")].join(",")})).join(" ")})).transition().style("opacity",(function(t){return(t.opacity?t.opacity:.2)+""})),s.select("text").transition().duration(t).attr("x",(function(t){return a?i(M(t.points),"y"):o(M(t.points),"x")})).attr("y",(function(t){return a?o(M(t.points),"x"):i(M(t.points),"y")})).text((function(t){if(t.text){var e=c(t.points),n=e.value,r=e.percentage;return t.text(n,r)}return""})).attr("text-anchor","middle").attr("dominant-baseline","middle").transition().style("opacity",null)},e.updateStanfordElements=function(t){void 0===t&&(t=0),this.updateStanfordLines(t),this.updateStanfordRegions(t)},e.xvCustom=function(t,e){var n=this,r=n.axis,a=n.config,o=e?t[e]:n.getBaseValue(t);return r.isTimeSeries()?o=y.call(n,o):r.isCategorized()&&f(o)&&(o=a.axis_x_categories.indexOf(t.value)),Math.ceil(n.scale.x(o))},e.yvCustom=function(t,e){var n=this,r=t.axis&&"y2"===t.axis?n.scale.y2:n.scale.y,a=e?t[e]:n.getBaseValue(t);return Math.ceil(r(a))},t}(),P=l(8),D=l(9),q=function(){function t(t){this.owner=void 0,this.colorScale=void 0,this.owner=t}var e=t.prototype;return e.drawColorScale=function(){var t=this.owner,e=t.$$,n=t.config,r=e.data.targets[0],o=e.state.height-n.padding_bottom-n.padding_top,i=n.scale_width,c=function(t,e,n){void 0===n&&(n=1);for(var r=[],a=0|Math.max(0,Math.ceil((e-t)/n)),o=t;o<a;o++)r.push(t+o*n);return r}(n.padding_bottom,o,5),s=(0,a.scaleSequential)(r.colors).domain([c[c.length-1],c[0]]);this.colorScale&&this.colorScale.remove(),this.colorScale=e.$el.svg.append("g").attr("width",50).attr("height",o).attr("class",_),this.colorScale.append("g").attr("transform","translate(0, "+n.padding_top+")").selectAll("bars").data(c).enter().append("rect").attr("y",(function(t,e){return 5*e})).attr("x",0).attr("width",i).attr("height",5).attr("fill",(function(t){return s(t)}));var l=(0,a.scaleLog)().domain([r.minEpochs,r.maxEpochs]).range([c[0]+n.padding_top+c[c.length-1]+5-1,c[0]+n.padding_top]),u=(0,P.axisRight)(l),b=n.scale_format;"pow10"===b?u.tickValues([1,10,100,1e3,1e4,1e5,1e6,1e7]):h(b)?u.tickFormat(b):u.tickFormat((0,D.format)("d"));var d=this.colorScale.append("g").attr("class","legend axis").attr("transform","translate("+i+",0)").call(u);"pow10"===b&&d.selectAll(".tick text").text(null).filter((function(t){return t/Math.pow(10,Math.ceil(Math.log(t)/Math.LN10-1e-12))==1})).text(10).append("tspan").attr("dy","-.7em").text((function(t){return Math.round(Math.log(t)/Math.LN10)})),this.colorScale.attr("transform","translate("+(e.state.current.width-this.xForColorScale())+", 0)")},e.xForColorScale=function(){return this.owner.config.padding_right+this.colorScale.node().getBBox().width},e.getColorScalePadding=function(){return this.xForColorScale()+this.owner.config.padding_left+20},t}(),T=function(o){var i,c;function l(e){var n=o.call(this,e)||this;return n.config=void 0,n.colorScale=void 0,n.elements=void 0,n.config=new S,t(n)||t(n)}c=o,(i=l).prototype=Object.create(c.prototype),i.prototype.constructor=i,e(i,c);var u=l.prototype;return u.$beforeInit=function(){var t=this,e=this.$$;e.config.data_xSort=!1,e.isMultipleX=function(){return!0},e.showGridFocus=function(){},e.labelishData=function(t){return t.values},e.opacityForCircle=function(){return 1};var n=e.getCurrentPaddingRight.bind(e);e.getCurrentPaddingRight=function(){return n()+(t.colorScale?t.colorScale.getColorScalePadding():0)}},u.$init=function(){var t=this.$$;m.call(this,this.options),t.color=this.getStanfordPointColor.bind(t),this.colorScale=new q(this),this.elements=new L(this),this.convertData(),this.initStanfordData(),this.setStanfordTooltip(),this.colorScale.drawColorScale(),this.$redraw()},u.$redraw=function(t){var e,n;null==(e=this.colorScale)||e.drawColorScale(),null==(n=this.elements)||n.updateStanfordElements(t)},u.getOptions=function(){return new S},u.convertData=function(){var t=this.$$.data.targets,e=this.options.epochs;t.forEach((function(t){t.values.forEach((function(t,n){t.epochs=e[n]})),t.minEpochs=void 0,t.maxEpochs=void 0,t.colors=void 0,t.colorscale=void 0}))},u.xvCustom=function(t,e){var n=this,r=n.axis,a=n.config,o=e?t[e]:n.getBaseValue(t);return r.isTimeSeries()?o=y.call(n,o):r.isCategorized()&&f(o)&&(o=a.axis_x_categories.indexOf(t.value)),Math.ceil(n.scale.x(o))},u.yvCustom=function(t,e){var n=this.scale,r=t.axis&&"y2"===t.axis?n.y2:n.y,a=e?t[e]:this.getBaseValue(t);return Math.ceil(r(a))},u.initStanfordData=function(){var t=this.config,e=this.$$.data.targets[0];e.values.sort(k);var o=e.values.map((function(t){return t.epochs}));e.minEpochs=isNaN(t.scale_min)?Math.min.apply(Math,o):t.scale_min,e.maxEpochs=isNaN(t.scale_max)?Math.max.apply(Math,o):t.scale_max,e.colors=h(t.colors)?t.colors:(0,n.interpolateHslLong)((0,r.hsl)(250,1,.5),(0,r.hsl)(0,1,.5)),e.colorscale=(0,a.scaleSequentialLog)(e.colors).domain([e.minEpochs,e.maxEpochs])},u.getStanfordPointColor=function(t){return this.data.targets[0].colorscale(t.epochs)},u.setStanfordTooltip=function(){var t=this.$$.config;x(t.tooltip_contents)&&(t.tooltip_contents=function(e,n,r,a){var o='<table class="'+s.tooltip+'"><tbody>';return e.forEach((function(e){o+="<tr>\n\t\t\t\t\t\t\t<th>"+n(t.data_x)+'</th>\n\t\t\t\t\t\t\t<th class="value">'+r(e.x)+"</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>"+n(e.id)+'</th>\n\t\t\t\t\t\t\t<th class="value">'+r(e.value)+'</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class="'+s.tooltipName+"-"+e.id+'">\n\t\t\t\t\t\t\t<td class="name"><span style="background-color:'+a(e)+'"></span>'+n("Epochs")+'</td>\n\t\t\t\t\t\t\t<td class="value">'+r(e.epochs)+"</td>\n\t\t\t\t\t\t</tr>"})),o+"</tbody></table>"})},u.countEpochsInRegion=function(t){var e=this.data.targets[0],n=e.values.reduce((function(t,e){return t+ +e.epochs}),0),r=e.values.reduce((function(e,n){return function(t,e){for(var n=t.x,r=t.value,a=!1,o=0,i=e.length-1;o<e.length;i=o++){var c=e[o].x,s=e[o].y,l=e[i].x,u=e[i].y;s>r!=u>r&&n<(l-c)*(r-s)/(u-s)+c&&(a=!a)}return a}(n,t)?e+ +n.epochs:e}),0);return{value:r,percentage:0!==r?+(r/n*100).toFixed(1):0}},l}(w)}(),u=u.default}()}));
|
|
12
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3-interpolate"),require("d3-color"),require("d3-scale"),require("d3-selection"),require("d3-brush"),require("d3-axis"),require("d3-format")):"function"==typeof define&&define.amd?define("bb",["d3-interpolate","d3-color","d3-scale","d3-selection","d3-brush","d3-axis","d3-format"],e):"object"==typeof exports?exports.bb=e(require("d3-interpolate"),require("d3-color"),require("d3-scale"),require("d3-selection"),require("d3-brush"),require("d3-axis"),require("d3-format")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.stanford=e(t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3))}(this,(function(t,e,n,r,a,o,i){return function(){"use strict";var c=[,function(t){t.exports=r},,function(t){t.exports=a},,function(e){e.exports=t},function(t){t.exports=e},function(t){t.exports=n},function(t){t.exports=o},function(t){t.exports=i}],s={};function l(t){var e=s[t];if(void 0!==e)return e.exports;var n=s[t]={exports:{}};return c[t](n,n.exports,l),n.exports}l.d=function(t,e){for(var n in e)l.o(e,n)&&!l.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},l.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var u={};return function(){function t(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function e(t,n){return e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(t,n)}l.d(u,{default:function(){return T}});var n=l(5),r=l(6),a=l(7);function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function c(t){for(var e,n=1;n<arguments.length;n++)e=null!=arguments[n]?arguments[n]:{},n%2?i(Object(e),!0).forEach((function(n){o(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):i(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}));return t}var s={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},b=(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c({},{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"}),s),{buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"}),l(1),l(3),"object"==typeof globalThis&&null!==globalThis&&globalThis.Object===Object&&globalThis||"object"==typeof global&&null!==global&&global.Object===Object&&global||"object"==typeof self&&null!==self&&self.Object===Object&&self||Function("return this")());b.requestIdleCallback=b.requestIdleCallback||function(t){return setTimeout(t,1)},b.cancelIdleCallback=b.cancelIdleCallback||function(t){return clearTimeout(t)};var d=null==b?void 0:b.document;var h=function(t){return"function"==typeof t},f=function(t){return"string"==typeof t},p=function(t){return"number"==typeof t},g=function(t){return void 0!==t},v=function(t){return"object"==typeof t},x=function(t){return void 0===t||null===t||f(t)&&0===t.length||v(t)&&!(t instanceof Date)&&0===Object.keys(t).length||p(t)&&isNaN(t)};!function(){try{new MouseEvent("t")}catch(t){return function(t,e,n){void 0===n&&(n={bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});var r=d.createEvent("MouseEvent");r.initMouseEvent(e,n.bubbles,n.cancelable,b,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),t.dispatchEvent(r)}}}();function y(t){var e;if(t instanceof Date)e=t;else if(f(t)){var n,r=this.config;e=null!=(n=this.format.dataTime(r.data_xFormat)(t))?n:new Date(t)}else p(t)&&!isNaN(t)&&(e=new Date(+t));return e&&!isNaN(+e)||console&&console.error&&console.error("Failed to parse x '"+t+"' to Date object"),e}function m(t){var e,n,r,a=this.config,o=function(){var t=n.shift();return t&&e&&v(e)&&t in e?(e=e[t],o()):t?void 0:e};Object.keys(a).forEach((function(i){e=t,n=i.split("_"),r=o(),g(r)&&(a[i]=r)}))}var w=function(){function t(t){void 0===t&&(t={}),this.$$=void 0,this.options=void 0,this.options=t}var e=t.prototype;return e.$beforeInit=function(){},e.$init=function(){},e.$afterInit=function(){},e.$redraw=function(){},e.$willDestroy=function(){var t=this;Object.keys(this).forEach((function(e){t[e]=null,delete t[e]}))},t}();w.version="3.4.0";var S=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:[]}},_="bb-colorscale",O="bb-stanford-elements",j="bb-stanford-line",C="bb-stanford-lines",E="bb-stanford-region",$="bb-stanford-regions";function k(t,e){return t.epochs<e.epochs?-1:t.epochs>e.epochs?1:0}function M(t){for(var e,n=function(t){for(var e,n,r=0,a=0,o=t.length,i=o-1;a<o;i=a,a++)e=t[a],n=t[i],r+=e.x*n.y,r-=e.y*n.x;return r/2}(t),r=0,a=0,o=0,i=t.length,c=i-1;o<i;c=o,o++){var s=t[o],l=t[c];e=s.x*l.y-l.x*s.y,r+=(s.x+l.x)*e,a+=(s.y+l.y)*e}return{x:r/(e=6*n),y:a/e}}var D=function(){function t(t){this.owner=void 0,this.owner=t;var e=t.$$.$el.main.select(".bb-chart").append("g").attr("class",O);e.append("g").attr("class",C),e.append("g").attr("class",$)}var e=t.prototype;return e.updateStanfordLines=function(t){var e=this.owner.$$,n=e.config,r=e.$el.main,a=n.axis_rotated,o=this.xvCustom.bind(e),i=this.yvCustom.bind(e),c=r.select("."+C).style("shape-rendering","geometricprecision").selectAll("."+j).data(this.owner.config.lines);c.exit().transition().duration(t).style("opacity","0").remove();var s=c.enter().append("g");s.append("line").style("opacity","0"),s.merge(c).attr("class",(function(t){return j+(t.class?" "+t.class:"")})).select("line").transition().duration(t).attr("x1",(function(t){return a?i(t,"y1"):o(t,"x1")})).attr("x2",(function(t){return a?i(t,"y2"):o(t,"x2")})).attr("y1",(function(t){return a?o(t,"x1"):i(t,"y1")})).attr("y2",(function(t){return a?o(t,"x2"):i(t,"y2")})).transition().style("opacity",null)},e.updateStanfordRegions=function(t){var e=this.owner.$$,n=e.config,r=e.$el.main,a=n.axis_rotated,o=this.xvCustom.bind(e),i=this.yvCustom.bind(e),c=this.owner.countEpochsInRegion.bind(e),s=r.select("."+$).selectAll("."+E).data(this.owner.config.regions);s.exit().transition().duration(t).style("opacity","0").remove();var l=s.enter().append("g");l.append("polygon").style("opacity","0"),l.append("text").attr("transform",a?"rotate(-90)":"").style("opacity","0"),(s=l.merge(s)).attr("class",(function(t){return E+(t.class?" "+t.class:"")})).select("polygon").transition().duration(t).attr("points",(function(t){return t.points.map((function(t){return[a?i(t,"y"):o(t,"x"),a?o(t,"x"):i(t,"y")].join(",")})).join(" ")})).transition().style("opacity",(function(t){return(t.opacity?t.opacity:.2)+""})),s.select("text").transition().duration(t).attr("x",(function(t){return a?i(M(t.points),"y"):o(M(t.points),"x")})).attr("y",(function(t){return a?o(M(t.points),"x"):i(M(t.points),"y")})).text((function(t){if(t.text){var e=c(t.points),n=e.value,r=e.percentage;return t.text(n,r)}return""})).attr("text-anchor","middle").attr("dominant-baseline","middle").transition().style("opacity",null)},e.updateStanfordElements=function(t){void 0===t&&(t=0),this.updateStanfordLines(t),this.updateStanfordRegions(t)},e.xvCustom=function(t,e){var n=this,r=n.axis,a=n.config,o=e?t[e]:n.getBaseValue(t);return r.isTimeSeries()?o=y.call(n,o):r.isCategorized()&&f(o)&&(o=a.axis_x_categories.indexOf(t.value)),Math.ceil(n.scale.x(o))},e.yvCustom=function(t,e){var n=this,r=t.axis&&"y2"===t.axis?n.scale.y2:n.scale.y,a=e?t[e]:n.getBaseValue(t);return Math.ceil(r(a))},t}(),L=l(8),P=l(9),q=function(){function t(t){this.owner=void 0,this.colorScale=void 0,this.owner=t}var e=t.prototype;return e.drawColorScale=function(){var t=this.owner,e=t.$$,n=t.config,r=e.data.targets[0],o=e.state.height-n.padding_bottom-n.padding_top,i=n.scale_width,c=function(t,e,n){void 0===n&&(n=1);for(var r=[],a=0|Math.max(0,Math.ceil((e-t)/n)),o=t;o<a;o++)r.push(t+o*n);return r}(n.padding_bottom,o,5),s=(0,a.scaleSequential)(r.colors).domain([c[c.length-1],c[0]]);this.colorScale&&this.colorScale.remove(),this.colorScale=e.$el.svg.append("g").attr("width",50).attr("height",o).attr("class",_),this.colorScale.append("g").attr("transform","translate(0, "+n.padding_top+")").selectAll("bars").data(c).enter().append("rect").attr("y",(function(t,e){return 5*e})).attr("x",0).attr("width",i).attr("height",5).attr("fill",(function(t){return s(t)}));var l=(0,a.scaleLog)().domain([r.minEpochs,r.maxEpochs]).range([c[0]+n.padding_top+c[c.length-1]+5-1,c[0]+n.padding_top]),u=(0,L.axisRight)(l),b=n.scale_format;"pow10"===b?u.tickValues([1,10,100,1e3,1e4,1e5,1e6,1e7]):h(b)?u.tickFormat(b):u.tickFormat((0,P.format)("d"));var d=this.colorScale.append("g").attr("class","legend axis").attr("transform","translate("+i+",0)").call(u);"pow10"===b&&d.selectAll(".tick text").text(null).filter((function(t){return t/Math.pow(10,Math.ceil(Math.log(t)/Math.LN10-1e-12))==1})).text(10).append("tspan").attr("dy","-.7em").text((function(t){return Math.round(Math.log(t)/Math.LN10)})),this.colorScale.attr("transform","translate("+(e.state.current.width-this.xForColorScale())+", 0)")},e.xForColorScale=function(){return this.owner.config.padding_right+this.colorScale.node().getBBox().width},e.getColorScalePadding=function(){return this.xForColorScale()+this.owner.config.padding_left+20},t}(),T=function(o){var i,c;function l(e){var n=o.call(this,e)||this;return n.config=void 0,n.colorScale=void 0,n.elements=void 0,n.config=new S,t(n)||t(n)}c=o,(i=l).prototype=Object.create(c.prototype),i.prototype.constructor=i,e(i,c);var u=l.prototype;return u.$beforeInit=function(){var t=this,e=this.$$;e.config.data_xSort=!1,e.isMultipleX=function(){return!0},e.showGridFocus=function(){},e.labelishData=function(t){return t.values},e.opacityForCircle=function(){return 1};var n=e.getCurrentPaddingRight.bind(e);e.getCurrentPaddingRight=function(){return n()+(t.colorScale?t.colorScale.getColorScalePadding():0)}},u.$init=function(){var t=this.$$;m.call(this,this.options),t.color=this.getStanfordPointColor.bind(t),this.colorScale=new q(this),this.elements=new D(this),this.convertData(),this.initStanfordData(),this.setStanfordTooltip(),this.colorScale.drawColorScale(),this.$redraw()},u.$redraw=function(t){var e,n;null==(e=this.colorScale)||e.drawColorScale(),null==(n=this.elements)||n.updateStanfordElements(t)},u.getOptions=function(){return new S},u.convertData=function(){var t=this.$$.data.targets,e=this.options.epochs;t.forEach((function(t){t.values.forEach((function(t,n){t.epochs=e[n]})),t.minEpochs=void 0,t.maxEpochs=void 0,t.colors=void 0,t.colorscale=void 0}))},u.xvCustom=function(t,e){var n=this,r=n.axis,a=n.config,o=e?t[e]:n.getBaseValue(t);return r.isTimeSeries()?o=y.call(n,o):r.isCategorized()&&f(o)&&(o=a.axis_x_categories.indexOf(t.value)),Math.ceil(n.scale.x(o))},u.yvCustom=function(t,e){var n=this.scale,r=t.axis&&"y2"===t.axis?n.y2:n.y,a=e?t[e]:this.getBaseValue(t);return Math.ceil(r(a))},u.initStanfordData=function(){var t=this.config,e=this.$$.data.targets[0];e.values.sort(k);var o=e.values.map((function(t){return t.epochs}));e.minEpochs=isNaN(t.scale_min)?Math.min.apply(Math,o):t.scale_min,e.maxEpochs=isNaN(t.scale_max)?Math.max.apply(Math,o):t.scale_max,e.colors=h(t.colors)?t.colors:(0,n.interpolateHslLong)((0,r.hsl)(250,1,.5),(0,r.hsl)(0,1,.5)),e.colorscale=(0,a.scaleSequentialLog)(e.colors).domain([e.minEpochs,e.maxEpochs])},u.getStanfordPointColor=function(t){return this.data.targets[0].colorscale(t.epochs)},u.setStanfordTooltip=function(){var t=this.$$.config;x(t.tooltip_contents)&&(t.tooltip_contents=function(e,n,r,a){var o='<table class="'+s.tooltip+'"><tbody>';return e.forEach((function(e){o+="<tr>\n\t\t\t\t\t\t\t<th>"+n(t.data_x)+'</th>\n\t\t\t\t\t\t\t<th class="value">'+r(e.x)+"</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>"+n(e.id)+'</th>\n\t\t\t\t\t\t\t<th class="value">'+r(e.value)+'</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class="'+s.tooltipName+"-"+e.id+'">\n\t\t\t\t\t\t\t<td class="name"><span style="background-color:'+a(e)+'"></span>'+n("Epochs")+'</td>\n\t\t\t\t\t\t\t<td class="value">'+r(e.epochs)+"</td>\n\t\t\t\t\t\t</tr>"})),o+"</tbody></table>"})},u.countEpochsInRegion=function(t){var e=this.data.targets[0],n=e.values.reduce((function(t,e){return t+ +e.epochs}),0),r=e.values.reduce((function(e,n){return function(t,e){for(var n=t.x,r=t.value,a=!1,o=0,i=e.length-1;o<e.length;i=o++){var c=e[o].x,s=e[o].y,l=e[i].x,u=e[i].y;s>r!=u>r&&n<(l-c)*(r-s)/(u-s)+c&&(a=!a)}return a}(n,t)?e+ +n.epochs:e}),0);return{value:r,percentage:0!==r?+(r/n*100).toFixed(1):0}},l}(w)}(),u=u.default}()}));
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.4.0
|
|
8
|
+
* @version 3.4.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -212,7 +212,7 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
212
212
|
return Plugin;
|
|
213
213
|
}();
|
|
214
214
|
|
|
215
|
-
Plugin.version = "3.4.0
|
|
215
|
+
Plugin.version = "3.4.0";
|
|
216
216
|
|
|
217
217
|
;// CONCATENATED MODULE: ./src/Plugin/tableview/Options.ts
|
|
218
218
|
/**
|
|
@@ -1150,9 +1150,13 @@ function parseDate(date) {
|
|
|
1150
1150
|
if (date instanceof Date) {
|
|
1151
1151
|
parsedDate = date;
|
|
1152
1152
|
} else if (isString(date)) {
|
|
1153
|
-
var
|
|
1153
|
+
var _format$dataTime,
|
|
1154
|
+
config = this.config,
|
|
1154
1155
|
format = this.format;
|
|
1155
|
-
|
|
1156
|
+
|
|
1157
|
+
// if fails to parse, try by new Date()
|
|
1158
|
+
// https://github.com/naver/billboard.js/issues/1714
|
|
1159
|
+
parsedDate = (_format$dataTime = format.dataTime(config.data_xFormat)(date)) != null ? _format$dataTime : new Date(date);
|
|
1156
1160
|
} else if (isNumber(date) && !isNaN(date)) {
|
|
1157
1161
|
parsedDate = new Date(+date);
|
|
1158
1162
|
}
|
|
@@ -1171,7 +1175,7 @@ function parseDate(date) {
|
|
|
1171
1175
|
|
|
1172
1176
|
|
|
1173
1177
|
function isTabVisible() {
|
|
1174
|
-
return !doc.
|
|
1178
|
+
return (doc == null ? void 0 : doc.hidden) === !1 || (doc == null ? void 0 : doc.visibilityState) === "visible";
|
|
1175
1179
|
}
|
|
1176
1180
|
/**
|
|
1177
1181
|
* Get the current input type
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.4.0
|
|
8
|
+
* @version 3.4.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
12
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3-selection"),require("d3-brush")):"function"==typeof define&&define.amd?define("bb",["d3-selection","d3-brush"],e):"object"==typeof exports?exports.bb=e(require("d3-selection"),require("d3-brush")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.tableview=e(t.d3,t.d3))}(this,(function(t,e){return function(){"use strict";var n=[,function(e){e.exports=t},,function(t){t.exports=e}],r={};function o(t){var e=r[t];if(void 0!==e)return e.exports;var i=r[t]={exports:{}};return n[t](i,i.exports,o),i.exports}o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var i={};return function(){function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function n(t,e){return n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(t,e)}o.d(i,{default:function(){return $}});var r=function(){function t(t){void 0===t&&(t={}),this.$$=void 0,this.options=void 0,this.options=t}var e=t.prototype;return e.$beforeInit=function(){},e.$init=function(){},e.$afterInit=function(){},e.$redraw=function(){},e.$willDestroy=function(){var t=this;Object.keys(this).forEach((function(e){t[e]=null,delete t[e]}))},t}();r.version="3.4.0
|
|
12
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3-selection"),require("d3-brush")):"function"==typeof define&&define.amd?define("bb",["d3-selection","d3-brush"],e):"object"==typeof exports?exports.bb=e(require("d3-selection"),require("d3-brush")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.tableview=e(t.d3,t.d3))}(this,(function(t,e){return function(){"use strict";var n=[,function(e){e.exports=t},,function(t){t.exports=e}],r={};function o(t){var e=r[t];if(void 0!==e)return e.exports;var i=r[t]={exports:{}};return n[t](i,i.exports,o),i.exports}o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var i={};return function(){function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function n(t,e){return n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(t,e)}o.d(i,{default:function(){return $}});var r=function(){function t(t){void 0===t&&(t={}),this.$$=void 0,this.options=void 0,this.options=t}var e=t.prototype;return e.$beforeInit=function(){},e.$init=function(){},e.$afterInit=function(){},e.$redraw=function(){},e.$willDestroy=function(){var t=this;Object.keys(this).forEach((function(e){t[e]=null,delete t[e]}))},t}();r.version="3.4.0";var c=function(){return{selector:void 0,categoryTitle:"Category",categoryFormat:function(t){var e=t;return this.$$.axis.isCategorized()?e=this.$$.categoryName(t):this.$$.axis.isTimeSeries()&&(e=t.toLocaleDateString()),e},class:void 0,style:!0,title:void 0,updateOnToggle:!0}},l="__tableview-style__",a="bb-tableview",u=".bb-tableview {\n\t\tborder-collapse:collapse;\n\t\tborder-spacing:0;\n\t\tbackground:#fff;\n\t\tmin-width:100%;\n\t\tmargin-top:10px;\n\t\tfont-family:sans-serif;\n\t\tfont-size:.9em;\n\t}\n\t.bb-tableview tr:hover {\n\t\tbackground:#eef7ff;\n\t}\n\t.bb-tableview thead tr {\n\t\tbackground:#f8f8f8;\n\t}\n\t.bb-tableview caption,.bb-tableview td,.bb-tableview th {\n\t\ttext-align: center;\n\t\tborder:1px solid silver;\n\t\tpadding:.5em;\n\t}\n\t.bb-tableview caption {\n\t\tfont-size:1.1em;\n\t\tfont-weight:700;\n\t\tmargin-bottom: -1px;\n\t}",s="<caption>{=title}</caption>\n\t\t<thead><tr>{=thead}</tr></thead>\n\t\t<tbody>{=tbody}</tbody>",f='<th scope="col">{=title}</th>',b='<th scope="row">{=value}</th>',d="<td>{=value}</td>",p=(o(1),o(3),"object"==typeof globalThis&&null!==globalThis&&globalThis.Object===Object&&globalThis||"object"==typeof global&&null!==global&&global.Object===Object&&global||"object"==typeof self&&null!==self&&self.Object===Object&&self||Function("return this")());p.requestIdleCallback=p.requestIdleCallback||function(t){return setTimeout(t,1)},p.cancelIdleCallback=p.cancelIdleCallback||function(t){return clearTimeout(t)};var h=null==p?void 0:p.document;var v=function(t){return"number"==typeof t},g=function(t){return void 0!==t},y=function(t){return"object"==typeof t};!function(){try{new MouseEvent("t")}catch(t){return function(t,e,n){void 0===n&&(n={bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});var r=h.createEvent("MouseEvent");r.initMouseEvent(e,n.bubbles,n.cancelable,p,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),t.dispatchEvent(r)}}}();function m(t,e){var n=t;for(var r in e)n=n.replace(new RegExp("{="+r+"}","g"),e[r]);return n}function O(t){var e,n,r,o=this.config,i=function(){var t=n.shift();return t&&e&&y(e)&&t in e?(e=e[t],i()):t?void 0:e};Object.keys(o).forEach((function(c){e=t,n=c.split("_"),r=i(),g(r)&&(o[c]=r)}))}function j(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function w(e){for(var n,r=1;r<arguments.length;r++)n=null!=arguments[r]?arguments[r]:{},r%2?j(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}));return e}var $=function(t){var r,o;function i(n){var r=t.call(this,n)||this;return r.config=void 0,r.element=void 0,r.config=new c,e(r)||e(r)}o=t,(r=i).prototype=Object.create(o.prototype),r.prototype.constructor=r,n(r,o);var p=i.prototype;return p.$beforeInit=function(){O.call(this,this.options)},p.$init=function(){var t,e=this.config,n=e.class,r=e.selector,o=e.style,i=document.querySelector(r||"."+(n||a));if(!i){var c=this.$$.$el.chart.node();i=document.createElement("table"),c.parentNode.insertBefore(i,c.nextSibling)}if("TABLE"!==i.tagName){var s=document.createElement("table");i.appendChild(s),i=s}if(o&&!document.getElementById(l)){var f=document.createElement("style");f.id=l,f.innerHTML=u,(document.head||document.getElementsByTagName("head")[0]).appendChild(f)}(t=i.classList).add.apply(t,[o&&a,n].filter(Boolean)),this.element=i},p.generateTable=function(){var t=this,e=this.$$,n=this.config,r=this.element,o=e.filterTargetsToShow(e.data.targets),i=m(f,{title:o.length?this.config.categoryTitle:""}),c="",l=[];o.forEach((function(t){i+=m(f,{title:t.id}),t.values.forEach((function(t,e){l[e]||(l[e]=[t.x]),l[e].push(t.value)}))})),l.forEach((function(e){c+="<tr>"+e.map((function(e,r){return m(r?d:b,{value:0===r?n.categoryFormat.bind(t)(e):v(e)?e.toLocaleString():""})})).join("")+"</tr>"}));var a=m(s,w(w({},n),{},{title:n.title||e.config.title_text||"",thead:i,tbody:c})).replace(/<[^>]+><\/[^>]+>/g,"");r.innerHTML=a},p.$redraw=function(){var t=this.$$.state;t.resizing||!this.config.updateOnToggle&&t.toggling||this.generateTable()},p.$willDestroy=function(){if(this.element.parentNode.removeChild(this.element),1===this.$$.charts.length){var t,e=document.getElementById(l);null==e||null==(t=e.parentNode)||t.removeChild(e)}},i}(r)}(),i=i.default}()}));
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.4.0
|
|
8
|
+
* @version 3.4.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -953,9 +953,13 @@ function parseDate(date) {
|
|
|
953
953
|
if (date instanceof Date) {
|
|
954
954
|
parsedDate = date;
|
|
955
955
|
} else if (isString(date)) {
|
|
956
|
-
var
|
|
956
|
+
var _format$dataTime,
|
|
957
|
+
config = this.config,
|
|
957
958
|
format = this.format;
|
|
958
|
-
|
|
959
|
+
|
|
960
|
+
// if fails to parse, try by new Date()
|
|
961
|
+
// https://github.com/naver/billboard.js/issues/1714
|
|
962
|
+
parsedDate = (_format$dataTime = format.dataTime(config.data_xFormat)(date)) != null ? _format$dataTime : new Date(date);
|
|
959
963
|
} else if (isNumber(date) && !isNaN(date)) {
|
|
960
964
|
parsedDate = new Date(+date);
|
|
961
965
|
}
|
|
@@ -974,7 +978,7 @@ function parseDate(date) {
|
|
|
974
978
|
|
|
975
979
|
|
|
976
980
|
function isTabVisible() {
|
|
977
|
-
return !doc.
|
|
981
|
+
return (doc == null ? void 0 : doc.hidden) === !1 || (doc == null ? void 0 : doc.visibilityState) === "visible";
|
|
978
982
|
}
|
|
979
983
|
/**
|
|
980
984
|
* Get the current input type
|
|
@@ -1141,7 +1145,7 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
1141
1145
|
return Plugin;
|
|
1142
1146
|
}();
|
|
1143
1147
|
|
|
1144
|
-
Plugin.version = "3.4.0
|
|
1148
|
+
Plugin.version = "3.4.0";
|
|
1145
1149
|
|
|
1146
1150
|
;// CONCATENATED MODULE: ./src/Plugin/textoverlap/Options.ts
|
|
1147
1151
|
/**
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.4.0
|
|
8
|
+
* @version 3.4.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
12
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("d3-delaunay"),require("d3-polygon"),require("d3-selection"),require("d3-brush")):"function"==typeof define&&define.amd?define("bb",["d3-delaunay","d3-polygon","d3-selection","d3-brush"],t):"object"==typeof exports?exports.bb=t(require("d3-delaunay"),require("d3-polygon"),require("d3-selection"),require("d3-brush")):(e.bb=e.bb||{},e.bb.plugin=e.bb.plugin||{},e.bb.plugin.textoverlap=t(e.d3,e.d3,e.d3,e.d3))}(this,(function(e,t,n,o){return function(){"use strict";var r={3:function(e){e.exports=o},12:function(t){t.exports=e},13:function(e){e.exports=t},1:function(e){e.exports=n}},i={};function c(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}};return r[e](n,n.exports,c),n.exports}c.d=function(e,t){for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var u={};return function(){function e(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}c.d(u,{default:function(){return d}});var n=c(12),o=c(13);c(1),c(3);var r="object"==typeof globalThis&&null!==globalThis&&globalThis.Object===Object&&globalThis||"object"==typeof global&&null!==global&&global.Object===Object&&global||"object"==typeof self&&null!==self&&self.Object===Object&&self||Function("return this")();r.requestIdleCallback=r.requestIdleCallback||function(e){return setTimeout(e,1)},r.cancelIdleCallback=r.cancelIdleCallback||function(e){return clearTimeout(e)};var i=null==r?void 0:r.document;var a=function(e){return void 0!==e},l=function(e){return"object"==typeof e};!function(){try{new MouseEvent("t")}catch(e){return function(e,t,n){void 0===n&&(n={bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});var o=i.createEvent("MouseEvent");o.initMouseEvent(t,n.bubbles,n.cancelable,r,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),e.dispatchEvent(o)}}}();function s(e){var t,n,o,r=this.config,i=function(){var e=n.shift();return e&&t&&l(t)&&e in t?(t=t[e],i()):e?void 0:t};Object.keys(r).forEach((function(c){t=e,n=c.split("_"),o=i(),a(o)&&(r[c]=o)}))}var f=function(){function e(e){void 0===e&&(e={}),this.$$=void 0,this.options=void 0,this.options=e}var t=e.prototype;return t.$beforeInit=function(){},t.$init=function(){},t.$afterInit=function(){},t.$redraw=function(){},t.$willDestroy=function(){var e=this;Object.keys(this).forEach((function(t){e[t]=null,delete e[t]}))},e}();f.version="3.4.0
|
|
12
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("d3-delaunay"),require("d3-polygon"),require("d3-selection"),require("d3-brush")):"function"==typeof define&&define.amd?define("bb",["d3-delaunay","d3-polygon","d3-selection","d3-brush"],t):"object"==typeof exports?exports.bb=t(require("d3-delaunay"),require("d3-polygon"),require("d3-selection"),require("d3-brush")):(e.bb=e.bb||{},e.bb.plugin=e.bb.plugin||{},e.bb.plugin.textoverlap=t(e.d3,e.d3,e.d3,e.d3))}(this,(function(e,t,n,o){return function(){"use strict";var r={3:function(e){e.exports=o},12:function(t){t.exports=e},13:function(e){e.exports=t},1:function(e){e.exports=n}},i={};function c(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}};return r[e](n,n.exports,c),n.exports}c.d=function(e,t){for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var u={};return function(){function e(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}c.d(u,{default:function(){return d}});var n=c(12),o=c(13);c(1),c(3);var r="object"==typeof globalThis&&null!==globalThis&&globalThis.Object===Object&&globalThis||"object"==typeof global&&null!==global&&global.Object===Object&&global||"object"==typeof self&&null!==self&&self.Object===Object&&self||Function("return this")();r.requestIdleCallback=r.requestIdleCallback||function(e){return setTimeout(e,1)},r.cancelIdleCallback=r.cancelIdleCallback||function(e){return clearTimeout(e)};var i=null==r?void 0:r.document;var a=function(e){return void 0!==e},l=function(e){return"object"==typeof e};!function(){try{new MouseEvent("t")}catch(e){return function(e,t,n){void 0===n&&(n={bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});var o=i.createEvent("MouseEvent");o.initMouseEvent(t,n.bubbles,n.cancelable,r,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),e.dispatchEvent(o)}}}();function s(e){var t,n,o,r=this.config,i=function(){var e=n.shift();return e&&t&&l(t)&&e in t?(t=t[e],i()):e?void 0:t};Object.keys(r).forEach((function(c){t=e,n=c.split("_"),o=i(),a(o)&&(r[c]=o)}))}var f=function(){function e(e){void 0===e&&(e={}),this.$$=void 0,this.options=void 0,this.options=e}var t=e.prototype;return t.$beforeInit=function(){},t.$init=function(){},t.$afterInit=function(){},t.$redraw=function(){},t.$willDestroy=function(){var e=this;Object.keys(this).forEach((function(t){e[t]=null,delete e[t]}))},e}();f.version="3.4.0";var b=function(){return{selector:void 0,extent:1,area:0}},d=function(r){var i,c;function u(t){var n=r.call(this,t)||this;return n.config=void 0,n.config=new b,e(n)||e(n)}c=r,(i=u).prototype=Object.create(c.prototype),i.prototype.constructor=i,t(i,c);var a=u.prototype;return a.$init=function(){s.call(this,this.options)},a.$redraw=function(){var e=this.$$.$el,t=this.config.selector,n=t?e.main.selectAll(t):e.text;n.empty()||this.preventLabelOverlap(n)},a.generateVoronoi=function(e){var t=this.$$.scale,o=["x","y"].map((function(e){return t[e].domain()})),r=o[0],i=o[1],c=[i[0],r[1]];return r[1]=c[0],i[0]=c[1],n.Delaunay.from(e).voronoi([].concat(r,i))},a.preventLabelOverlap=function(e){var t=this.config,n=t.extent,r=t.area,i=e.data().map((function(e){return[e.index,e.value]})),c=this.generateVoronoi(i),u=0;e.each((function(){var e=c.cellPolygon(u);if(e&&this){var t=i[u],a=t[0],l=t[1],s=(0,o.polygonCentroid)(e),f=s[0],b=s[1],d=Math.abs((0,o.polygonArea)(e)),p=Math.round(Math.atan2(b-l,f-a)/Math.PI*2),v=n*(0===p?1:-1),h=-1===p?-n:n+5,y=1===Math.abs(p)?"middle":0===p?"start":"end";this.style.display=d<r?"none":"",this.setAttribute("text-anchor",y),this.setAttribute("dy","0."+(1===p?71:35)+"em"),this.setAttribute("transform","translate("+v+", "+h+")")}u++}))},u}(f)}(),u=u.default}()}));
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.4.0
|
|
8
|
+
* @version 3.4.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -17438,7 +17438,7 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
17438
17438
|
return Plugin;
|
|
17439
17439
|
}();
|
|
17440
17440
|
|
|
17441
|
-
Plugin.version = "3.4.0
|
|
17441
|
+
Plugin.version = "3.4.0";
|
|
17442
17442
|
|
|
17443
17443
|
;// CONCATENATED MODULE: ./src/Plugin/bubblecompare/index.ts
|
|
17444
17444
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.4.0
|
|
8
|
+
* @version 3.4.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -17333,7 +17333,7 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
17333
17333
|
return Plugin;
|
|
17334
17334
|
}();
|
|
17335
17335
|
|
|
17336
|
-
Plugin.version = "3.4.0
|
|
17336
|
+
Plugin.version = "3.4.0";
|
|
17337
17337
|
|
|
17338
17338
|
;// CONCATENATED MODULE: ./src/Plugin/sparkline/Options.ts
|
|
17339
17339
|
/**
|
|
@@ -18637,15 +18637,15 @@ var _brighter = 1 / _darker;
|
|
|
18637
18637
|
|
|
18638
18638
|
|
|
18639
18639
|
var reI = "\\s*([+-]?\\d+)\\s*",
|
|
18640
|
-
reN = "\\s*([+-]?\\d
|
|
18641
|
-
reP = "\\s*([+-]?\\d
|
|
18640
|
+
reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",
|
|
18641
|
+
reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
|
|
18642
18642
|
reHex = /^#([0-9a-f]{3,8})$/,
|
|
18643
18643
|
reRgbInteger = new RegExp("^rgb\\(\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*\\)$"),
|
|
18644
|
-
reRgbPercent = new RegExp("^rgb\\(\\s*([+-]?\\d
|
|
18645
|
-
reRgbaInteger = new RegExp("^rgba\\(\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d
|
|
18646
|
-
reRgbaPercent = new RegExp("^rgba\\(\\s*([+-]?\\d
|
|
18647
|
-
reHslPercent = new RegExp("^hsl\\(\\s*([+-]?\\d
|
|
18648
|
-
reHslaPercent = new RegExp("^hsla\\(\\s*([+-]?\\d
|
|
18644
|
+
reRgbPercent = new RegExp("^rgb\\(\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*\\)$"),
|
|
18645
|
+
reRgbaInteger = new RegExp("^rgba\\(\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*\\)$"),
|
|
18646
|
+
reRgbaPercent = new RegExp("^rgba\\(\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*\\)$"),
|
|
18647
|
+
reHslPercent = new RegExp("^hsl\\(\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*,\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*\\)$"),
|
|
18648
|
+
reHslaPercent = new RegExp("^hsla\\(\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*,\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*\\)$"),
|
|
18649
18649
|
named = {
|
|
18650
18650
|
aliceblue: 0xf0f8ff,
|
|
18651
18651
|
antiquewhite: 0xfaebd7,
|
|
@@ -18806,6 +18806,7 @@ src_define(Color, color, {
|
|
|
18806
18806
|
hex: color_formatHex,
|
|
18807
18807
|
// Deprecated! Use color.formatHex.
|
|
18808
18808
|
formatHex: color_formatHex,
|
|
18809
|
+
formatHex8: color_formatHex8,
|
|
18809
18810
|
formatHsl: color_formatHsl,
|
|
18810
18811
|
formatRgb: color_formatRgb,
|
|
18811
18812
|
toString: color_formatRgb
|
|
@@ -18815,6 +18816,10 @@ function color_formatHex() {
|
|
|
18815
18816
|
return this.rgb().formatHex();
|
|
18816
18817
|
}
|
|
18817
18818
|
|
|
18819
|
+
function color_formatHex8() {
|
|
18820
|
+
return this.rgb().formatHex8();
|
|
18821
|
+
}
|
|
18822
|
+
|
|
18818
18823
|
function color_formatHsl() {
|
|
18819
18824
|
return hslConvert(this).formatHsl();
|
|
18820
18825
|
}
|
|
@@ -18877,12 +18882,16 @@ src_define(Rgb, color_rgb, extend(Color, {
|
|
|
18877
18882
|
rgb: function () {
|
|
18878
18883
|
return this;
|
|
18879
18884
|
},
|
|
18885
|
+
clamp: function clamp() {
|
|
18886
|
+
return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
|
|
18887
|
+
},
|
|
18880
18888
|
displayable: function displayable() {
|
|
18881
18889
|
return -.5 <= this.r && this.r < 255.5 && -.5 <= this.g && this.g < 255.5 && -.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
|
|
18882
18890
|
},
|
|
18883
18891
|
hex: rgb_formatHex,
|
|
18884
18892
|
// Deprecated! Use color.formatHex.
|
|
18885
18893
|
formatHex: rgb_formatHex,
|
|
18894
|
+
formatHex8: rgb_formatHex8,
|
|
18886
18895
|
formatRgb: rgb_formatRgb,
|
|
18887
18896
|
toString: rgb_formatRgb
|
|
18888
18897
|
}));
|
|
@@ -18891,14 +18900,25 @@ function rgb_formatHex() {
|
|
|
18891
18900
|
return "#" + hex(this.r) + hex(this.g) + hex(this.b);
|
|
18892
18901
|
}
|
|
18893
18902
|
|
|
18903
|
+
function rgb_formatHex8() {
|
|
18904
|
+
return "#" + hex(this.r) + hex(this.g) + hex(this.b) + hex((isNaN(this.opacity) ? 1 : this.opacity) * 255);
|
|
18905
|
+
}
|
|
18906
|
+
|
|
18894
18907
|
function rgb_formatRgb() {
|
|
18895
|
-
var a = this.opacity;
|
|
18896
|
-
|
|
18897
|
-
|
|
18908
|
+
var a = clampa(this.opacity);
|
|
18909
|
+
return "" + (a === 1 ? "rgb(" : "rgba(") + clampi(this.r) + ", " + clampi(this.g) + ", " + clampi(this.b) + (a === 1 ? ")" : ", " + a + ")");
|
|
18910
|
+
}
|
|
18911
|
+
|
|
18912
|
+
function clampa(opacity) {
|
|
18913
|
+
return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
|
|
18914
|
+
}
|
|
18915
|
+
|
|
18916
|
+
function clampi(value) {
|
|
18917
|
+
return Math.max(0, Math.min(255, Math.round(value) || 0));
|
|
18898
18918
|
}
|
|
18899
18919
|
|
|
18900
18920
|
function hex(value) {
|
|
18901
|
-
value =
|
|
18921
|
+
value = clampi(value);
|
|
18902
18922
|
return (value < 16 ? "0" : "") + value.toString(16);
|
|
18903
18923
|
}
|
|
18904
18924
|
|
|
@@ -18960,17 +18980,29 @@ src_define(Hsl, hsl, extend(Color, {
|
|
|
18960
18980
|
m1 = 2 * l - m2;
|
|
18961
18981
|
return new Rgb(hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), hsl2rgb(h, m1, m2), hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), this.opacity);
|
|
18962
18982
|
},
|
|
18983
|
+
clamp: function clamp() {
|
|
18984
|
+
return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
|
|
18985
|
+
},
|
|
18963
18986
|
displayable: function displayable() {
|
|
18964
18987
|
return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
|
|
18965
18988
|
},
|
|
18966
18989
|
formatHsl: function formatHsl() {
|
|
18967
|
-
var a = this.opacity;
|
|
18968
|
-
|
|
18969
|
-
return (a === 1 ? "hsl(" : "hsla(") + (this.h || 0) + ", " + (this.s || 0) * 100 + "%, " + (this.l || 0) * 100 + "%" + (a === 1 ? ")" : ", " + a + ")");
|
|
18990
|
+
var a = clampa(this.opacity);
|
|
18991
|
+
return "" + (a === 1 ? "hsl(" : "hsla(") + clamph(this.h) + ", " + clampt(this.s) * 100 + "%, " + clampt(this.l) * 100 + "%" + (a === 1 ? ")" : ", " + a + ")");
|
|
18970
18992
|
}
|
|
18971
18993
|
}));
|
|
18994
|
+
|
|
18995
|
+
function clamph(value) {
|
|
18996
|
+
value = (value || 0) % 360;
|
|
18997
|
+
return value < 0 ? value + 360 : value;
|
|
18998
|
+
}
|
|
18999
|
+
|
|
19000
|
+
function clampt(value) {
|
|
19001
|
+
return Math.max(0, Math.min(1, value || 0));
|
|
19002
|
+
}
|
|
18972
19003
|
/* From FvD 13.37, CSS Color Module Level 3 */
|
|
18973
19004
|
|
|
19005
|
+
|
|
18974
19006
|
function hsl2rgb(h, m1, m2) {
|
|
18975
19007
|
return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255;
|
|
18976
19008
|
}
|
|
@@ -21935,9 +21967,13 @@ function parseDate(date) {
|
|
|
21935
21967
|
if (date instanceof Date) {
|
|
21936
21968
|
parsedDate = date;
|
|
21937
21969
|
} else if (isString(date)) {
|
|
21938
|
-
var
|
|
21970
|
+
var _format$dataTime,
|
|
21971
|
+
config = this.config,
|
|
21939
21972
|
format = this.format;
|
|
21940
|
-
|
|
21973
|
+
|
|
21974
|
+
// if fails to parse, try by new Date()
|
|
21975
|
+
// https://github.com/naver/billboard.js/issues/1714
|
|
21976
|
+
parsedDate = (_format$dataTime = format.dataTime(config.data_xFormat)(date)) != null ? _format$dataTime : new Date(date);
|
|
21941
21977
|
} else if (isNumber(date) && !isNaN(date)) {
|
|
21942
21978
|
parsedDate = new Date(+date);
|
|
21943
21979
|
}
|
|
@@ -21956,7 +21992,7 @@ function parseDate(date) {
|
|
|
21956
21992
|
|
|
21957
21993
|
|
|
21958
21994
|
function isTabVisible() {
|
|
21959
|
-
return !doc.
|
|
21995
|
+
return (doc == null ? void 0 : doc.hidden) === !1 || (doc == null ? void 0 : doc.visibilityState) === "visible";
|
|
21960
21996
|
}
|
|
21961
21997
|
/**
|
|
21962
21998
|
* Get the current input type
|