billboard.js 3.5.0-next.1 → 3.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/README.md +5 -2
  2. package/dist/billboard.css +1 -1
  3. package/dist/billboard.js +795 -461
  4. package/dist/billboard.min.css +1 -1
  5. package/dist/billboard.min.js +2 -2
  6. package/dist/billboard.pkgd.js +1968 -1320
  7. package/dist/billboard.pkgd.min.js +3 -3
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  9. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  10. package/dist/plugin/billboardjs-plugin-sparkline.js +72 -27
  11. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  12. package/dist/plugin/billboardjs-plugin-stanford.js +72 -27
  13. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  14. package/dist/plugin/billboardjs-plugin-tableview.js +72 -27
  15. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  16. package/dist/plugin/billboardjs-plugin-textoverlap.js +72 -27
  17. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  18. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +1172 -858
  19. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +1243 -884
  20. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +1244 -885
  21. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +1245 -886
  22. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +1246 -887
  23. package/dist/theme/datalab.css +1 -1
  24. package/dist/theme/datalab.min.css +1 -1
  25. package/dist/theme/graph.css +1 -1
  26. package/dist/theme/graph.min.css +1 -1
  27. package/dist/theme/insight.css +1 -1
  28. package/dist/theme/insight.min.css +1 -1
  29. package/dist-esm/billboard.js +662 -368
  30. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  31. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +4 -3
  32. package/dist-esm/plugin/billboardjs-plugin-stanford.js +4 -3
  33. package/dist-esm/plugin/billboardjs-plugin-tableview.js +4 -3
  34. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +4 -3
  35. package/package.json +26 -26
  36. package/src/Chart/api/chart.ts +4 -1
  37. package/src/Chart/api/data.ts +2 -2
  38. package/src/Chart/api/flow.ts +125 -115
  39. package/src/Chart/api/selection.ts +1 -1
  40. package/src/ChartInternal/Axis/AxisRenderer.ts +1 -1
  41. package/src/ChartInternal/Axis/AxisRendererHelper.ts +1 -1
  42. package/src/ChartInternal/ChartInternal.ts +39 -18
  43. package/src/ChartInternal/data/IData.ts +2 -2
  44. package/src/ChartInternal/data/convert.helper.ts +226 -0
  45. package/src/ChartInternal/data/convert.ts +44 -210
  46. package/src/ChartInternal/data/data.ts +1 -1
  47. package/src/ChartInternal/data/load.ts +5 -4
  48. package/src/ChartInternal/interactions/drag.ts +1 -1
  49. package/src/ChartInternal/internals/class.ts +1 -1
  50. package/src/ChartInternal/internals/color.ts +39 -41
  51. package/src/ChartInternal/internals/domain.ts +1 -1
  52. package/src/ChartInternal/internals/format.ts +1 -1
  53. package/src/ChartInternal/internals/legend.ts +21 -6
  54. package/src/ChartInternal/internals/region.ts +1 -1
  55. package/src/ChartInternal/internals/scale.ts +1 -1
  56. package/src/ChartInternal/internals/size.axis.ts +1 -1
  57. package/src/ChartInternal/internals/style.ts +54 -0
  58. package/src/ChartInternal/internals/text.ts +6 -6
  59. package/src/ChartInternal/internals/tooltip.ts +1 -1
  60. package/src/ChartInternal/shape/arc.ts +6 -5
  61. package/src/ChartInternal/shape/area.ts +16 -8
  62. package/src/ChartInternal/shape/bar.ts +13 -10
  63. package/src/ChartInternal/shape/line.ts +3 -2
  64. package/src/ChartInternal/shape/point.ts +16 -10
  65. package/src/ChartInternal/shape/polar.ts +2 -2
  66. package/src/ChartInternal/shape/shape.ts +2 -2
  67. package/src/Plugin/sparkline/index.ts +1 -1
  68. package/src/Plugin/textoverlap/index.ts +5 -2
  69. package/src/config/Options/Options.ts +2 -0
  70. package/src/config/Options/common/boost.ts +31 -0
  71. package/src/config/Options/data/data.ts +1 -1
  72. package/src/config/Options/shape/area.ts +6 -1
  73. package/src/config/Store/Element.ts +1 -1
  74. package/src/config/Store/State.ts +3 -0
  75. package/src/module/Cache.ts +1 -1
  76. package/src/module/browser.ts +2 -1
  77. package/src/module/generator.ts +8 -13
  78. package/src/module/util.ts +41 -1
  79. package/src/module/worker.ts +101 -0
  80. package/types/axis.d.ts +2 -2
  81. package/types/options.d.ts +24 -0
@@ -5,8 +5,8 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.5.0-next.1
8
+ * @version 3.5.1
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
12
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3-interpolate"),require("d3-color"),require("d3-scale"),require("d3-selection"),require("d3-brush"),require("d3-axis"),require("d3-format")):"function"==typeof define&&define.amd?define("bb",["d3-interpolate","d3-color","d3-scale","d3-selection","d3-brush","d3-axis","d3-format"],e):"object"==typeof exports?exports.bb=e(require("d3-interpolate"),require("d3-color"),require("d3-scale"),require("d3-selection"),require("d3-brush"),require("d3-axis"),require("d3-format")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.stanford=e(t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3))}(this,(function(t,e,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 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 i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}l.d(d,{default:function(){return Y}});var n=l(5),r=l(6),o=l(7);function a(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function s(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 c(t){for(var e,i=1;i<arguments.length;i++)e=null!=arguments[i]?arguments[i]:{},i%2?s(Object(e),!0).forEach((function(i){a(t,i,e[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):s(Object(e)).forEach((function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(e,i))}));return t}var b={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},u=(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"}),b),{buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"}),l(1),l(3),void 0),h=function(){return t(this,u),"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)();h.requestIdleCallback=h.requestIdleCallback||function(e){return t(this,u),setTimeout(e,1)}.bind(void 0),h.cancelIdleCallback=h.cancelIdleCallback||function(e){return t(this,u),clearTimeout(e)}.bind(void 0);var f=null==h?void 0:h.document,p=void 0;(function(e){return t(this,p),e||0===e}).bind(void 0);var g=function(e){return t(this,p),"function"==typeof e}.bind(void 0),v=function(e){return t(this,p),"string"==typeof e}.bind(void 0),x=function(e){return t(this,p),"number"==typeof e}.bind(void 0),y=function(e){return t(this,p),void 0===e}.bind(void 0),m=function(e){return t(this,p),void 0!==e}.bind(void 0),w=(function(e){return t(this,p),"boolean"==typeof e}.bind(void 0),function(e){return t(this,p),10*Math.ceil(e/10)}.bind(void 0),function(e){return t(this,p),Math.ceil(e)+.5}.bind(void 0),function(e){return t(this,p),e[1]-e[0]}.bind(void 0),function(e){return t(this,p),"object"==typeof e}.bind(void 0)),S=function(e){return t(this,p),y(e)||null===e||v(e)&&0===e.length||w(e)&&!(e instanceof Date)&&0===Object.keys(e).length||x(e)&&isNaN(e)}.bind(void 0),_=(function(e){return t(this,p),!S(e)}.bind(void 0),function(e){return t(this,p),Array.isArray(e)}.bind(void 0)),O=function(e){return t(this,p),e&&!(null!=e&&e.nodeType)&&w(e)&&!_(e)}.bind(void 0);(function(e){return t(this,p),e.charAt(0).toUpperCase()+e.slice(1)}).bind(void 0);(function(e){return t(this,p),[].slice.call(e)}).bind(void 0);function E(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 O(e)&&O(a)&&Object.keys(a).forEach(function(n){t(this,i);var r=a[n];O(r)?(e[n]||(e[n]={}),e[n]=E(e[n],r)):e[n]=_(r)?r.concat():r}.bind(this)),E.apply(void 0,[e].concat(r))}var j=function(e,i,n){void 0===n&&(n=1),t(this,p);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,p);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=f.createEvent("MouseEvent");a.initMouseEvent(r,o.bubbles,o.cancelable,h,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,p);var r=new Touch(E({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 C(t){var e;if(t instanceof Date)e=t;else if(v(t)){var i,n=this.config;e=null!=(i=this.format.dataTime(n.data_xFormat)(t))?i: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 $(e){var i,n,r,o=this,a=this.config,s=function(){t(this,o);var e=n.shift();return e&&i&&w(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(),m(r)&&(a[c]=r)}.bind(this))}var M=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}();M.version="3.5.0-next.1";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:[]}},T="bb-colorscale",D="bb-stanford-elements",P="bb-stanford-line",L="bb-stanford-lines",q="bb-stanford-region",A="bb-stanford-regions";function I(t,e){return t.epochs<e.epochs?-1:t.epochs>e.epochs?1:0}function N(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 R=function(){function e(t){this.owner=void 0,this.owner=t;var e=t.$$.$el.main.select(".bb-chart").append("g").attr("class",D);e.append("g").attr("class",L),e.append("g").attr("class",A)}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("."+L).style("shape-rendering","geometricprecision").selectAll("."+P).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,i),P+(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),d=o.select("."+A).selectAll("."+q).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,i),q+(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)),d.select("text").transition().duration(e).attr("x",function(e){return t(this,i),a?c(N(e.points),"y"):s(N(e.points),"x")}.bind(this)).attr("y",function(e){return t(this,i),a?s(N(e.points),"x"):c(N(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=C.call(i,o):n.isCategorized()&&v(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}(),F=l(8),B=l(9),X=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=j(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=n.$el.svg.append("g").attr("width",50).attr("height",s).attr("class",T),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),d(i)}.bind(this));var b=(0,o.scaleLog)().domain([a.minEpochs,a.maxEpochs]).range([l[0]+r.padding_top+l[l.length-1]+5-1,l[0]+r.padding_top]),u=(0,F.axisRight)(b),h=r.scale_format;"pow10"===h?u.tickValues([1,10,100,1e3,1e4,1e5,1e6,1e7]):g(h)?u.tickFormat(h):u.tickFormat((0,B.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(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}(),Y=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 k,e(i)||e(i)}c=a,(s=l).prototype=Object.create(c.prototype),s.prototype.constructor=s,i(s,c);var d=l.prototype;return d.$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)},d.$init=function(){var t=this.$$;$.call(this,this.options),t.color=this.getStanfordPointColor.bind(t),this.colorScale=new X(this),this.elements=new R(this),this.convertData(),this.initStanfordData(),this.setStanfordTooltip(),this.colorScale.drawColorScale(),this.$redraw()},d.$redraw=function(t){var e,i;null==(e=this.colorScale)||e.drawColorScale(),null==(i=this.elements)||i.updateStanfordElements(t)},d.getOptions=function(){return new k},d.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))},d.xvCustom=function(t,e){var i=this,n=i.axis,r=i.config,o=e?t[e]:i.getBaseValue(t);return n.isTimeSeries()?o=C.call(i,o):n.isCategorized()&&v(o)&&(o=r.axis_x_categories.indexOf(t.value)),Math.ceil(i.scale.x(o))},d.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))},d.initStanfordData=function(){var e=this,i=this.config,a=this.$$.data.targets[0];a.values.sort(I);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=g(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])},d.getStanfordPointColor=function(t){return this.data.targets[0].colorscale(t.epochs)},d.setStanfordTooltip=function(){var e=this.$$.config;S(e.tooltip_contents)&&(e.tooltip_contents=function(i,n,r,o){var a=this,s=e.data_x,c='<table class="'+b.tooltip+'"><tbody>';return i.forEach(function(e){t(this,a);var i=e.id,l=void 0===i?"":i,d=e.value,u=void 0===d?0:d,h=e.epochs,f=void 0===h?0:h,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="'+b.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 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,d=e[a].y;c>n!=d>n&&i<(l-s)*(n-c)/(d-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}(M)}(),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 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 i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}l.d(d,{default:function(){return Y}});var n=l(5),r=l(6),o=l(7);function a(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function s(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 c(t){for(var e,i=1;i<arguments.length;i++)e=null!=arguments[i]?arguments[i]:{},i%2?s(Object(e),!0).forEach((function(i){a(t,i,e[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):s(Object(e)).forEach((function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(e,i))}));return t}var b={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},u=(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"}),b),{buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"}),l(1),l(3),void 0),h=function(){return t(this,u),"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)();h.requestIdleCallback=h.requestIdleCallback||function(e){return t(this,u),setTimeout(e,1)}.bind(void 0),h.requestAnimationFrame=h.requestAnimationFrame||function(e){return t(this,u),setTimeout(e,1)}.bind(void 0);var f=null==h?void 0:h.document,p=void 0;(function(e){return t(this,p),e||0===e}).bind(void 0);var g=function(e){return t(this,p),"function"==typeof e}.bind(void 0),v=function(e){return t(this,p),"string"==typeof e}.bind(void 0),x=function(e){return t(this,p),"number"==typeof e}.bind(void 0),y=function(e){return t(this,p),void 0===e}.bind(void 0),m=function(e){return t(this,p),void 0!==e}.bind(void 0),w=(function(e){return t(this,p),"boolean"==typeof e}.bind(void 0),function(e){return t(this,p),10*Math.ceil(e/10)}.bind(void 0),function(e){return t(this,p),Math.ceil(e)+.5}.bind(void 0),function(e){return t(this,p),e[1]-e[0]}.bind(void 0),function(e){return t(this,p),"object"==typeof e}.bind(void 0)),S=function(e){return t(this,p),y(e)||null===e||v(e)&&0===e.length||w(e)&&!(e instanceof Date)&&0===Object.keys(e).length||x(e)&&isNaN(e)}.bind(void 0),_=(function(e){return t(this,p),!S(e)}.bind(void 0),function(e){return t(this,p),Array.isArray(e)}.bind(void 0)),O=function(e){return t(this,p),e&&!(null!=e&&e.nodeType)&&w(e)&&!_(e)}.bind(void 0);(function(e){return t(this,p),e.charAt(0).toUpperCase()+e.slice(1)}).bind(void 0);(function(e){return t(this,p),[].slice.call(e)}).bind(void 0);function E(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 O(e)&&O(a)&&Object.keys(a).forEach(function(n){t(this,i);var r=a[n];O(r)?(e[n]||(e[n]={}),e[n]=E(e[n],r)):e[n]=_(r)?r.concat():r}.bind(this)),E.apply(void 0,[e].concat(r))}var j=function(e,i,n){void 0===n&&(n=1),t(this,p);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,p);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=f.createEvent("MouseEvent");a.initMouseEvent(r,o.bubbles,o.cancelable,h,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,p);var r=new Touch(E({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 C(t){var e;if(t instanceof Date)e=t;else if(v(t)){var i,n=this.config;e=null!=(i=this.format.dataTime(n.data_xFormat)(t))?i: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 $(e){var i,n,r,o=this,a=this.config,s=function(){t(this,o);var e=n.shift();return e&&i&&w(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(),m(r)&&(a[c]=r)}.bind(this))}var M=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}();M.version="3.5.1";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:[]}},T="bb-colorscale",D="bb-stanford-elements",P="bb-stanford-line",L="bb-stanford-lines",q="bb-stanford-region",A="bb-stanford-regions";function F(t,e){return t.epochs<e.epochs?-1:t.epochs>e.epochs?1:0}function N(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 R=function(){function e(t){this.owner=void 0,this.owner=t;var e=t.$$.$el.main.select(".bb-chart").append("g").attr("class",D);e.append("g").attr("class",L),e.append("g").attr("class",A)}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("."+L).style("shape-rendering","geometricprecision").selectAll("."+P).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,i),P+(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),d=o.select("."+A).selectAll("."+q).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,i),q+(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)),d.select("text").transition().duration(e).attr("x",function(e){return t(this,i),a?c(N(e.points),"y"):s(N(e.points),"x")}.bind(this)).attr("y",function(e){return t(this,i),a?s(N(e.points),"x"):c(N(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=C.call(i,o):n.isCategorized()&&v(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}(),I=l(8),B=l(9),X=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=j(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=n.$el.svg.append("g").attr("width",50).attr("height",s).attr("class",T),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),d(i)}.bind(this));var b=(0,o.scaleLog)().domain([a.minEpochs,a.maxEpochs]).range([l[0]+r.padding_top+l[l.length-1]+5-1,l[0]+r.padding_top]),u=(0,I.axisRight)(b),h=r.scale_format;"pow10"===h?u.tickValues([1,10,100,1e3,1e4,1e5,1e6,1e7]):g(h)?u.tickFormat(h):u.tickFormat((0,B.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(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}(),Y=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 k,e(i)||e(i)}c=a,(s=l).prototype=Object.create(c.prototype),s.prototype.constructor=s,i(s,c);var d=l.prototype;return d.$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)},d.$init=function(){var t=this.$$;$.call(this,this.options),t.color=this.getStanfordPointColor.bind(t),this.colorScale=new X(this),this.elements=new R(this),this.convertData(),this.initStanfordData(),this.setStanfordTooltip(),this.colorScale.drawColorScale(),this.$redraw()},d.$redraw=function(t){var e,i;null==(e=this.colorScale)||e.drawColorScale(),null==(i=this.elements)||i.updateStanfordElements(t)},d.getOptions=function(){return new k},d.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))},d.xvCustom=function(t,e){var i=this,n=i.axis,r=i.config,o=e?t[e]:i.getBaseValue(t);return n.isTimeSeries()?o=C.call(i,o):n.isCategorized()&&v(o)&&(o=r.axis_x_categories.indexOf(t.value)),Math.ceil(i.scale.x(o))},d.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))},d.initStanfordData=function(){var e=this,i=this.config,a=this.$$.data.targets[0];a.values.sort(F);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=g(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])},d.getStanfordPointColor=function(t){return this.data.targets[0].colorscale(t.epochs)},d.setStanfordTooltip=function(){var e=this.$$.config;S(e.tooltip_contents)&&(e.tooltip_contents=function(i,n,r,o){var a=this,s=e.data_x,c='<table class="'+b.tooltip+'"><tbody>';return i.forEach(function(e){t(this,a);var i=e.id,l=void 0===i?"":i,d=e.value,u=void 0===d?0:d,h=e.epochs,f=void 0===h?0:h,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="'+b.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 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,d=e[a].y;c>n!=d>n&&i<(l-s)*(n-c)/(d-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}(M)}(),d=d.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.5.0-next.1
8
+ * @version 3.5.1
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -221,7 +221,7 @@ var Plugin = /*#__PURE__*/function () {
221
221
  return Plugin;
222
222
  }();
223
223
 
224
- Plugin.version = "3.5.0-next.1";
224
+ Plugin.version = "3.5.1";
225
225
 
226
226
  ;// CONCATENATED MODULE: ./src/Plugin/tableview/Options.ts
227
227
  /**
@@ -390,12 +390,13 @@ win.requestIdleCallback = win.requestIdleCallback || function (cb) {
390
390
  _newArrowCheck(this, _this);
391
391
 
392
392
  return setTimeout(cb, 1);
393
- }.bind(undefined);
393
+ }.bind(undefined); // win.cancelIdleCallback = win.cancelIdleCallback || (id => clearTimeout(id));
394
+
394
395
 
395
- win.cancelIdleCallback = win.cancelIdleCallback || function (id) {
396
+ win.requestAnimationFrame = win.requestAnimationFrame || function (cb) {
396
397
  _newArrowCheck(this, _this);
397
398
 
398
- return clearTimeout(id);
399
+ return setTimeout(cb, 1);
399
400
  }.bind(undefined);
400
401
 
401
402
  var doc = win == null ? void 0 : win.document;
@@ -954,6 +955,29 @@ var toArray = function (v) {
954
955
 
955
956
  return [].slice.call(v);
956
957
  }.bind(undefined);
958
+ /**
959
+ * Add CSS rules
960
+ * @param {object} style Style object
961
+ * @param {string} selector Selector string
962
+ * @param {Array} prop Prps arrary
963
+ * @returns {number} Newely added rule index
964
+ * @private
965
+ */
966
+
967
+
968
+ function addCssRules(style, selector, prop) {
969
+ var _this9 = this,
970
+ rootSelctor = style.rootSelctor,
971
+ sheet = style.sheet,
972
+ getSelector = function (s) {
973
+ _newArrowCheck(this, _this9);
974
+
975
+ return s.replace(/\s?(bb-)/g, ".$1").replace(/\.+/g, ".");
976
+ }.bind(this),
977
+ rule = rootSelctor + " " + getSelector(selector) + " {" + prop.join(";") + "}";
978
+
979
+ return sheet[sheet.insertRule ? "insertRule" : "addRule"](rule, sheet.cssRules.length);
980
+ }
957
981
  /**
958
982
  * Get css rules for specified stylesheets
959
983
  * @param {Array} styleSheets The stylesheets to get the rules from
@@ -963,11 +987,11 @@ var toArray = function (v) {
963
987
 
964
988
 
965
989
  function getCssRules(styleSheets) {
966
- var _this9 = this,
990
+ var _this10 = this,
967
991
  rules = [];
968
992
 
969
993
  styleSheets.forEach(function (sheet) {
970
- _newArrowCheck(this, _this9);
994
+ _newArrowCheck(this, _this10);
971
995
 
972
996
  try {
973
997
  if (sheet.cssRules && sheet.cssRules.length) {
@@ -1008,16 +1032,16 @@ function getTranslation(node) {
1008
1032
 
1009
1033
 
1010
1034
  function getUnique(data) {
1011
- var _this10 = this,
1035
+ var _this11 = this,
1012
1036
  isDate = data[0] instanceof Date,
1013
1037
  d = (isDate ? data.map(Number) : data).filter(function (v, i, self) {
1014
- _newArrowCheck(this, _this10);
1038
+ _newArrowCheck(this, _this11);
1015
1039
 
1016
1040
  return self.indexOf(v) === i;
1017
1041
  }.bind(this));
1018
1042
 
1019
1043
  return isDate ? d.map(function (v) {
1020
- _newArrowCheck(this, _this10);
1044
+ _newArrowCheck(this, _this11);
1021
1045
 
1022
1046
  return new Date(v);
1023
1047
  }.bind(this)) : d;
@@ -1031,10 +1055,10 @@ function getUnique(data) {
1031
1055
 
1032
1056
 
1033
1057
  function mergeArray(arr) {
1034
- var _this11 = this;
1058
+ var _this12 = this;
1035
1059
 
1036
1060
  return arr && arr.length ? arr.reduce(function (p, c) {
1037
- _newArrowCheck(this, _this11);
1061
+ _newArrowCheck(this, _this12);
1038
1062
 
1039
1063
  return p.concat(c);
1040
1064
  }.bind(this)) : [];
@@ -1049,7 +1073,7 @@ function mergeArray(arr) {
1049
1073
 
1050
1074
 
1051
1075
  function mergeObj(target) {
1052
- for (var _this12 = this, _len4 = arguments.length, objectN = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
1076
+ for (var _this13 = this, _len4 = arguments.length, objectN = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
1053
1077
  objectN[_key4 - 1] = arguments[_key4];
1054
1078
  }
1055
1079
 
@@ -1061,7 +1085,7 @@ function mergeObj(target) {
1061
1085
 
1062
1086
  if (isObject(target) && isObject(source)) {
1063
1087
  Object.keys(source).forEach(function (key) {
1064
- _newArrowCheck(this, _this12);
1088
+ _newArrowCheck(this, _this13);
1065
1089
 
1066
1090
  var value = source[key];
1067
1091
 
@@ -1086,7 +1110,7 @@ function mergeObj(target) {
1086
1110
 
1087
1111
 
1088
1112
  function sortValue(data, isAsc) {
1089
- var _this13 = this;
1113
+ var _this14 = this;
1090
1114
 
1091
1115
  if (isAsc === void 0) {
1092
1116
  isAsc = !0;
@@ -1096,24 +1120,24 @@ function sortValue(data, isAsc) {
1096
1120
 
1097
1121
  if (data[0] instanceof Date) {
1098
1122
  fn = isAsc ? function (a, b) {
1099
- _newArrowCheck(this, _this13);
1123
+ _newArrowCheck(this, _this14);
1100
1124
 
1101
1125
  return a - b;
1102
1126
  }.bind(this) : function (a, b) {
1103
- _newArrowCheck(this, _this13);
1127
+ _newArrowCheck(this, _this14);
1104
1128
 
1105
1129
  return b - a;
1106
1130
  }.bind(this);
1107
1131
  } else {
1108
1132
  if (isAsc && !data.every(isNaN)) {
1109
1133
  fn = function (a, b) {
1110
- _newArrowCheck(this, _this13);
1134
+ _newArrowCheck(this, _this14);
1111
1135
 
1112
1136
  return a - b;
1113
1137
  }.bind(this);
1114
1138
  } else if (!isAsc) {
1115
1139
  fn = function (a, b) {
1116
- _newArrowCheck(this, _this13);
1140
+ _newArrowCheck(this, _this14);
1117
1141
 
1118
1142
  return a > b && -1 || a < b && 1 || a === b && 0;
1119
1143
  }.bind(this);
@@ -1132,9 +1156,9 @@ function sortValue(data, isAsc) {
1132
1156
 
1133
1157
 
1134
1158
  function getMinMax(type, data) {
1135
- var _this14 = this,
1159
+ var _this15 = this,
1136
1160
  res = data.filter(function (v) {
1137
- _newArrowCheck(this, _this14);
1161
+ _newArrowCheck(this, _this15);
1138
1162
 
1139
1163
  return notEmpty(v);
1140
1164
  }.bind(this));
@@ -1179,12 +1203,12 @@ var getRange = function (start, end, step) {
1179
1203
  }.bind(undefined),
1180
1204
  emulateEvent = {
1181
1205
  mouse: function () {
1182
- var _this15 = this;
1206
+ var _this16 = this;
1183
1207
 
1184
1208
  _newArrowCheck(this, util_this);
1185
1209
 
1186
1210
  var getParams = function () {
1187
- _newArrowCheck(this, _this15);
1211
+ _newArrowCheck(this, _this16);
1188
1212
 
1189
1213
  return {
1190
1214
  bubbles: !1,
@@ -1204,7 +1228,7 @@ var getRange = function (start, end, step) {
1204
1228
  params = getParams();
1205
1229
  }
1206
1230
 
1207
- _newArrowCheck(this, _this15);
1231
+ _newArrowCheck(this, _this16);
1208
1232
 
1209
1233
  el.dispatchEvent(new MouseEvent(eventType, params));
1210
1234
  }.bind(this);
@@ -1215,7 +1239,7 @@ var getRange = function (start, end, step) {
1215
1239
  params = getParams();
1216
1240
  }
1217
1241
 
1218
- _newArrowCheck(this, _this15);
1242
+ _newArrowCheck(this, _this16);
1219
1243
 
1220
1244
  var mouseEvent = doc.createEvent("MouseEvent"); // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent
1221
1245
 
@@ -1316,7 +1340,7 @@ function isTabVisible() {
1316
1340
 
1317
1341
 
1318
1342
  function convertInputType(mouse, touch) {
1319
- var _this16 = this,
1343
+ var _this17 = this,
1320
1344
  DocumentTouch = win.DocumentTouch,
1321
1345
  matchMedia = win.matchMedia,
1322
1346
  navigator = win.navigator,
@@ -1345,13 +1369,34 @@ function convertInputType(mouse, touch) {
1345
1369
 
1346
1370
 
1347
1371
  var hasMouse = mouse && ["any-hover:hover", "any-pointer:fine"].some(function (v) {
1348
- _newArrowCheck(this, _this16);
1372
+ _newArrowCheck(this, _this17);
1349
1373
 
1350
1374
  return matchMedia == null ? void 0 : matchMedia("(" + v + ")").matches;
1351
1375
  }.bind(this)); // fallback to 'mouse' if no input type is detected.
1352
1376
 
1353
1377
  return hasMouse && "mouse" || hasTouch && "touch" || "mouse";
1354
1378
  }
1379
+ /**
1380
+ * Run function until given condition function return true
1381
+ * @param {Function} fn Function to be executed when condition is true
1382
+ * @param {Function} conditionFn Condition function to check if condition is true
1383
+ * @private
1384
+ */
1385
+
1386
+
1387
+ function runUntil(fn, conditionFn) {
1388
+ var _this18 = this;
1389
+
1390
+ if (conditionFn() === !1) {
1391
+ win.requestAnimationFrame(function () {
1392
+ _newArrowCheck(this, _this18);
1393
+
1394
+ return runUntil(fn, conditionFn);
1395
+ }.bind(this));
1396
+ } else {
1397
+ fn();
1398
+ }
1399
+ }
1355
1400
  ;// CONCATENATED MODULE: ./src/config/config.ts
1356
1401
 
1357
1402
 
@@ -5,8 +5,8 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.5.0-next.1
8
+ * @version 3.5.1
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
12
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3-selection"),require("d3-brush")):"function"==typeof define&&define.amd?define("bb",["d3-selection","d3-brush"],e):"object"==typeof exports?exports.bb=e(require("d3-selection"),require("d3-brush")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.tableview=e(t.d3,t.d3))}(this,(function(t,e){return function(){"use strict";var n=[,function(e){e.exports=t},,function(t){t.exports=e}],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(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,e){if(t!==e)throw new TypeError("Cannot instantiate an arrow function")}function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}o.d(r,{default:function(){return D}});var c=function(){function t(t){void 0===t&&(t={}),this.$$=void 0,this.options=void 0,this.options=t}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}();c.version="3.5.0-next.1";var a=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}},s="__tableview-style__",u="bb-tableview",l=".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>",b='<th scope="col">{=title}</th>',f='<th scope="row">{=value}</th>',h="<td>{=value}</td>",v=(o(1),o(3),void 0),p=function(){return e(this,v),"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(t){return e(this,v),setTimeout(t,1)}.bind(void 0),p.cancelIdleCallback=p.cancelIdleCallback||function(t){return e(this,v),clearTimeout(t)}.bind(void 0);var g=null==p?void 0:p.document,y=void 0;(function(t){return e(this,y),t||0===t}).bind(void 0),function(t){return e(this,y),"function"==typeof t}.bind(void 0);var m=function(t){return e(this,y),"string"==typeof t}.bind(void 0),w=function(t){return e(this,y),"number"==typeof t}.bind(void 0),O=function(t){return e(this,y),void 0===t}.bind(void 0),j=function(t){return e(this,y),void 0!==t}.bind(void 0),E=(function(t){return e(this,y),"boolean"==typeof t}.bind(void 0),function(t){return e(this,y),10*Math.ceil(t/10)}.bind(void 0),function(t){return e(this,y),Math.ceil(t)+.5}.bind(void 0),function(t){return e(this,y),t[1]-t[0]}.bind(void 0),function(t){return e(this,y),"object"==typeof t}.bind(void 0)),$=function(t){return e(this,y),O(t)||null===t||m(t)&&0===t.length||E(t)&&!(t instanceof Date)&&0===Object.keys(t).length||w(t)&&isNaN(t)}.bind(void 0),T=(function(t){return e(this,y),!$(t)}.bind(void 0),function(t){return e(this,y),Array.isArray(t)}.bind(void 0)),x=function(t){return e(this,y),t&&!(null!=t&&t.nodeType)&&E(t)&&!T(t)}.bind(void 0);(function(t){return e(this,y),t.charAt(0).toUpperCase()+t.slice(1)}).bind(void 0);(function(t){return e(this,y),[].slice.call(t)}).bind(void 0);function P(t){for(var n=this,i=arguments.length,o=Array(i>1?i-1:0),r=1;r<i;r++)o[r-1]=arguments[r];if(!o.length||1===o.length&&!o[0])return t;var c=o.shift();return x(t)&&x(c)&&Object.keys(c).forEach(function(i){e(this,n);var o=c[i];x(o)?(t[i]||(t[i]={}),t[i]=P(t[i],o)):t[i]=T(o)?o.concat():o}.bind(this)),P.apply(void 0,[t].concat(o))}(function(t,n,i){void 0===i&&(i=1),e(this,y);for(var o=[],r=0|Math.max(0,Math.ceil((n-t)/i)),c=t;c<r;c++)o.push(t+c*i);return o}).bind(void 0),function(){var t=this;e(this,y);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,o,r){void 0===r&&(r=n()),e(this,t),i.dispatchEvent(new MouseEvent(o,r))}.bind(this)}catch(i){return function(i,o,r){void 0===r&&(r=n()),e(this,t);var c=g.createEvent("MouseEvent");c.initMouseEvent(o,r.bubbles,r.cancelable,p,0,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),i.dispatchEvent(c)}.bind(this)}}.bind(void 0)(),function(t,n,i){e(this,y);var o=new Touch(P({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:[o],targetTouches:[],changedTouches:[o]}))}.bind(void 0);function k(t,e){var n=t;for(var i in e)n=n.replace(new RegExp("{="+i+"}","g"),e[i]);return n}function C(t){var n,i,o,r=this,c=this.config,a=function(){e(this,r);var t=i.shift();return t&&n&&E(n)&&t in n?(n=n[t],a()):t?void 0:n}.bind(this);Object.keys(c).forEach(function(s){e(this,r),n=t,i=s.split("_"),o=a(),j(o)&&(c[s]=o)}.bind(this))}function M(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 _(e){for(var n,i=1;i<arguments.length;i++)n=null!=arguments[i]?arguments[i]:{},i%2?M(Object(n),!0).forEach((function(i){t(e,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}));return e}var D=function(t){var o,r;function c(e){var i=t.call(this,e)||this;return i.config=void 0,i.element=void 0,i.config=new a,n(i)||n(i)}r=t,(o=c).prototype=Object.create(r.prototype),o.prototype.constructor=o,i(o,r);var v=c.prototype;return v.$beforeInit=function(){C.call(this,this.options)},v.$init=function(){var t,e=this.config,n=e.class,i=e.selector,o=e.style,r=document.querySelector(i||"."+(n||u));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(s)){var d=document.createElement("style");d.id=s,d.innerHTML=l,(document.head||document.getElementsByTagName("head")[0]).appendChild(d)}(t=r.classList).add.apply(t,[o&&u,n].filter(Boolean)),this.element=r},v.generateTable=function(){var t=this,n=this.$$,i=this.config,o=this.element,r=n.filterTargetsToShow(n.data.targets),c=k(b,{title:r.length?this.config.categoryTitle:""}),a="",s=[];r.forEach(function(n){var i=this;e(this,t),c+=k(b,{title:n.id}),n.values.forEach(function(t,n){e(this,i),s[n]||(s[n]=[t.x]),s[n].push(t.value)}.bind(this))}.bind(this)),s.forEach(function(n){var o=this;e(this,t),a+="<tr>"+n.map(function(t,n){return e(this,o),k(n?h:f,{value:0===n?i.categoryFormat.bind(this)(t):w(t)?t.toLocaleString():""})}.bind(this)).join("")+"</tr>"}.bind(this));var u=k(d,_(_({},i),{},{title:i.title||n.config.title_text||"",thead:c,tbody:a})).replace(/<[^>]+><\/[^>]+>/g,"");o.innerHTML=u},v.$redraw=function(){var t=this.$$.state;t.resizing||!this.config.updateOnToggle&&t.toggling||this.generateTable()},v.$willDestroy=function(){if(this.element.parentNode.removeChild(this.element),1===this.$$.charts.length){var t,e=document.getElementById(s);null==e||null==(t=e.parentNode)||t.removeChild(e)}},c}(c)}(),r=r.default}()}));
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(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,e){if(t!==e)throw new TypeError("Cannot instantiate an arrow function")}function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}o.d(r,{default:function(){return q}});var c=function(){function t(t){void 0===t&&(t={}),this.$$=void 0,this.options=void 0,this.options=t}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}();c.version="3.5.1";var a=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}},s="__tableview-style__",u="bb-tableview",l=".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>",b='<th scope="col">{=title}</th>',f='<th scope="row">{=value}</th>',h="<td>{=value}</td>",v=(o(1),o(3),void 0),p=function(){return e(this,v),"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(t){return e(this,v),setTimeout(t,1)}.bind(void 0),p.requestAnimationFrame=p.requestAnimationFrame||function(t){return e(this,v),setTimeout(t,1)}.bind(void 0);var g=null==p?void 0:p.document,y=void 0;(function(t){return e(this,y),t||0===t}).bind(void 0),function(t){return e(this,y),"function"==typeof t}.bind(void 0);var m=function(t){return e(this,y),"string"==typeof t}.bind(void 0),w=function(t){return e(this,y),"number"==typeof t}.bind(void 0),O=function(t){return e(this,y),void 0===t}.bind(void 0),j=function(t){return e(this,y),void 0!==t}.bind(void 0),E=(function(t){return e(this,y),"boolean"==typeof t}.bind(void 0),function(t){return e(this,y),10*Math.ceil(t/10)}.bind(void 0),function(t){return e(this,y),Math.ceil(t)+.5}.bind(void 0),function(t){return e(this,y),t[1]-t[0]}.bind(void 0),function(t){return e(this,y),"object"==typeof t}.bind(void 0)),$=function(t){return e(this,y),O(t)||null===t||m(t)&&0===t.length||E(t)&&!(t instanceof Date)&&0===Object.keys(t).length||w(t)&&isNaN(t)}.bind(void 0),T=(function(t){return e(this,y),!$(t)}.bind(void 0),function(t){return e(this,y),Array.isArray(t)}.bind(void 0)),x=function(t){return e(this,y),t&&!(null!=t&&t.nodeType)&&E(t)&&!T(t)}.bind(void 0);(function(t){return e(this,y),t.charAt(0).toUpperCase()+t.slice(1)}).bind(void 0);(function(t){return e(this,y),[].slice.call(t)}).bind(void 0);function P(t){for(var n=this,i=arguments.length,o=Array(i>1?i-1:0),r=1;r<i;r++)o[r-1]=arguments[r];if(!o.length||1===o.length&&!o[0])return t;var c=o.shift();return x(t)&&x(c)&&Object.keys(c).forEach(function(i){e(this,n);var o=c[i];x(o)?(t[i]||(t[i]={}),t[i]=P(t[i],o)):t[i]=T(o)?o.concat():o}.bind(this)),P.apply(void 0,[t].concat(o))}(function(t,n,i){void 0===i&&(i=1),e(this,y);for(var o=[],r=0|Math.max(0,Math.ceil((n-t)/i)),c=t;c<r;c++)o.push(t+c*i);return o}).bind(void 0),function(){var t=this;e(this,y);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,o,r){void 0===r&&(r=n()),e(this,t),i.dispatchEvent(new MouseEvent(o,r))}.bind(this)}catch(i){return function(i,o,r){void 0===r&&(r=n()),e(this,t);var c=g.createEvent("MouseEvent");c.initMouseEvent(o,r.bubbles,r.cancelable,p,0,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),i.dispatchEvent(c)}.bind(this)}}.bind(void 0)(),function(t,n,i){e(this,y);var o=new Touch(P({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:[o],targetTouches:[],changedTouches:[o]}))}.bind(void 0);function k(t,e){var n=t;for(var i in e)n=n.replace(new RegExp("{="+i+"}","g"),e[i]);return n}function C(t){var n,i,o,r=this,c=this.config,a=function(){e(this,r);var t=i.shift();return t&&n&&E(n)&&t in n?(n=n[t],a()):t?void 0:n}.bind(this);Object.keys(c).forEach(function(s){e(this,r),n=t,i=s.split("_"),o=a(),j(o)&&(c[s]=o)}.bind(this))}function M(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 _(e){for(var n,i=1;i<arguments.length;i++)n=null!=arguments[i]?arguments[i]:{},i%2?M(Object(n),!0).forEach((function(i){t(e,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}));return e}var q=function(t){var o,r;function c(e){var i=t.call(this,e)||this;return i.config=void 0,i.element=void 0,i.config=new a,n(i)||n(i)}r=t,(o=c).prototype=Object.create(r.prototype),o.prototype.constructor=o,i(o,r);var v=c.prototype;return v.$beforeInit=function(){C.call(this,this.options)},v.$init=function(){var t,e=this.config,n=e.class,i=e.selector,o=e.style,r=document.querySelector(i||"."+(n||u));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(s)){var d=document.createElement("style");d.id=s,d.innerHTML=l,(document.head||document.getElementsByTagName("head")[0]).appendChild(d)}(t=r.classList).add.apply(t,[o&&u,n].filter(Boolean)),this.element=r},v.generateTable=function(){var t=this,n=this.$$,i=this.config,o=this.element,r=n.filterTargetsToShow(n.data.targets),c=k(b,{title:r.length?this.config.categoryTitle:""}),a="",s=[];r.forEach(function(n){var i=this;e(this,t),c+=k(b,{title:n.id}),n.values.forEach(function(t,n){e(this,i),s[n]||(s[n]=[t.x]),s[n].push(t.value)}.bind(this))}.bind(this)),s.forEach(function(n){var o=this;e(this,t),a+="<tr>"+n.map(function(t,n){return e(this,o),k(n?h:f,{value:0===n?i.categoryFormat.bind(this)(t):w(t)?t.toLocaleString():""})}.bind(this)).join("")+"</tr>"}.bind(this));var u=k(d,_(_({},i),{},{title:i.title||n.config.title_text||"",thead:c,tbody:a})).replace(/<[^>]+><\/[^>]+>/g,"");o.innerHTML=u},v.$redraw=function(){var t=this.$$.state;t.resizing||!this.config.updateOnToggle&&t.toggling||this.generateTable()},v.$willDestroy=function(){if(this.element.parentNode.removeChild(this.element),1===this.$$.charts.length){var t,e=document.getElementById(s);null==e||null==(t=e.parentNode)||t.removeChild(e)}},c}(c)}(),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.5.0-next.1
8
+ * @version 3.5.1
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -189,12 +189,13 @@ win.requestIdleCallback = win.requestIdleCallback || function (cb) {
189
189
  _newArrowCheck(this, _this);
190
190
 
191
191
  return setTimeout(cb, 1);
192
- }.bind(undefined);
192
+ }.bind(undefined); // win.cancelIdleCallback = win.cancelIdleCallback || (id => clearTimeout(id));
193
+
193
194
 
194
- win.cancelIdleCallback = win.cancelIdleCallback || function (id) {
195
+ win.requestAnimationFrame = win.requestAnimationFrame || function (cb) {
195
196
  _newArrowCheck(this, _this);
196
197
 
197
- return clearTimeout(id);
198
+ return setTimeout(cb, 1);
198
199
  }.bind(undefined);
199
200
 
200
201
  var doc = win == null ? void 0 : win.document;
@@ -753,6 +754,29 @@ var toArray = function (v) {
753
754
 
754
755
  return [].slice.call(v);
755
756
  }.bind(undefined);
757
+ /**
758
+ * Add CSS rules
759
+ * @param {object} style Style object
760
+ * @param {string} selector Selector string
761
+ * @param {Array} prop Prps arrary
762
+ * @returns {number} Newely added rule index
763
+ * @private
764
+ */
765
+
766
+
767
+ function addCssRules(style, selector, prop) {
768
+ var _this9 = this,
769
+ rootSelctor = style.rootSelctor,
770
+ sheet = style.sheet,
771
+ getSelector = function (s) {
772
+ _newArrowCheck(this, _this9);
773
+
774
+ return s.replace(/\s?(bb-)/g, ".$1").replace(/\.+/g, ".");
775
+ }.bind(this),
776
+ rule = rootSelctor + " " + getSelector(selector) + " {" + prop.join(";") + "}";
777
+
778
+ return sheet[sheet.insertRule ? "insertRule" : "addRule"](rule, sheet.cssRules.length);
779
+ }
756
780
  /**
757
781
  * Get css rules for specified stylesheets
758
782
  * @param {Array} styleSheets The stylesheets to get the rules from
@@ -762,11 +786,11 @@ var toArray = function (v) {
762
786
 
763
787
 
764
788
  function getCssRules(styleSheets) {
765
- var _this9 = this,
789
+ var _this10 = this,
766
790
  rules = [];
767
791
 
768
792
  styleSheets.forEach(function (sheet) {
769
- _newArrowCheck(this, _this9);
793
+ _newArrowCheck(this, _this10);
770
794
 
771
795
  try {
772
796
  if (sheet.cssRules && sheet.cssRules.length) {
@@ -807,16 +831,16 @@ function getTranslation(node) {
807
831
 
808
832
 
809
833
  function getUnique(data) {
810
- var _this10 = this,
834
+ var _this11 = this,
811
835
  isDate = data[0] instanceof Date,
812
836
  d = (isDate ? data.map(Number) : data).filter(function (v, i, self) {
813
- _newArrowCheck(this, _this10);
837
+ _newArrowCheck(this, _this11);
814
838
 
815
839
  return self.indexOf(v) === i;
816
840
  }.bind(this));
817
841
 
818
842
  return isDate ? d.map(function (v) {
819
- _newArrowCheck(this, _this10);
843
+ _newArrowCheck(this, _this11);
820
844
 
821
845
  return new Date(v);
822
846
  }.bind(this)) : d;
@@ -830,10 +854,10 @@ function getUnique(data) {
830
854
 
831
855
 
832
856
  function mergeArray(arr) {
833
- var _this11 = this;
857
+ var _this12 = this;
834
858
 
835
859
  return arr && arr.length ? arr.reduce(function (p, c) {
836
- _newArrowCheck(this, _this11);
860
+ _newArrowCheck(this, _this12);
837
861
 
838
862
  return p.concat(c);
839
863
  }.bind(this)) : [];
@@ -848,7 +872,7 @@ function mergeArray(arr) {
848
872
 
849
873
 
850
874
  function mergeObj(target) {
851
- for (var _this12 = this, _len4 = arguments.length, objectN = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
875
+ for (var _this13 = this, _len4 = arguments.length, objectN = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
852
876
  objectN[_key4 - 1] = arguments[_key4];
853
877
  }
854
878
 
@@ -860,7 +884,7 @@ function mergeObj(target) {
860
884
 
861
885
  if (isObject(target) && isObject(source)) {
862
886
  Object.keys(source).forEach(function (key) {
863
- _newArrowCheck(this, _this12);
887
+ _newArrowCheck(this, _this13);
864
888
 
865
889
  var value = source[key];
866
890
 
@@ -885,7 +909,7 @@ function mergeObj(target) {
885
909
 
886
910
 
887
911
  function sortValue(data, isAsc) {
888
- var _this13 = this;
912
+ var _this14 = this;
889
913
 
890
914
  if (isAsc === void 0) {
891
915
  isAsc = !0;
@@ -895,24 +919,24 @@ function sortValue(data, isAsc) {
895
919
 
896
920
  if (data[0] instanceof Date) {
897
921
  fn = isAsc ? function (a, b) {
898
- _newArrowCheck(this, _this13);
922
+ _newArrowCheck(this, _this14);
899
923
 
900
924
  return a - b;
901
925
  }.bind(this) : function (a, b) {
902
- _newArrowCheck(this, _this13);
926
+ _newArrowCheck(this, _this14);
903
927
 
904
928
  return b - a;
905
929
  }.bind(this);
906
930
  } else {
907
931
  if (isAsc && !data.every(isNaN)) {
908
932
  fn = function (a, b) {
909
- _newArrowCheck(this, _this13);
933
+ _newArrowCheck(this, _this14);
910
934
 
911
935
  return a - b;
912
936
  }.bind(this);
913
937
  } else if (!isAsc) {
914
938
  fn = function (a, b) {
915
- _newArrowCheck(this, _this13);
939
+ _newArrowCheck(this, _this14);
916
940
 
917
941
  return a > b && -1 || a < b && 1 || a === b && 0;
918
942
  }.bind(this);
@@ -931,9 +955,9 @@ function sortValue(data, isAsc) {
931
955
 
932
956
 
933
957
  function getMinMax(type, data) {
934
- var _this14 = this,
958
+ var _this15 = this,
935
959
  res = data.filter(function (v) {
936
- _newArrowCheck(this, _this14);
960
+ _newArrowCheck(this, _this15);
937
961
 
938
962
  return notEmpty(v);
939
963
  }.bind(this));
@@ -978,12 +1002,12 @@ var getRange = function (start, end, step) {
978
1002
  }.bind(undefined),
979
1003
  emulateEvent = {
980
1004
  mouse: function () {
981
- var _this15 = this;
1005
+ var _this16 = this;
982
1006
 
983
1007
  _newArrowCheck(this, util_this);
984
1008
 
985
1009
  var getParams = function () {
986
- _newArrowCheck(this, _this15);
1010
+ _newArrowCheck(this, _this16);
987
1011
 
988
1012
  return {
989
1013
  bubbles: !1,
@@ -1003,7 +1027,7 @@ var getRange = function (start, end, step) {
1003
1027
  params = getParams();
1004
1028
  }
1005
1029
 
1006
- _newArrowCheck(this, _this15);
1030
+ _newArrowCheck(this, _this16);
1007
1031
 
1008
1032
  el.dispatchEvent(new MouseEvent(eventType, params));
1009
1033
  }.bind(this);
@@ -1014,7 +1038,7 @@ var getRange = function (start, end, step) {
1014
1038
  params = getParams();
1015
1039
  }
1016
1040
 
1017
- _newArrowCheck(this, _this15);
1041
+ _newArrowCheck(this, _this16);
1018
1042
 
1019
1043
  var mouseEvent = doc.createEvent("MouseEvent"); // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent
1020
1044
 
@@ -1115,7 +1139,7 @@ function isTabVisible() {
1115
1139
 
1116
1140
 
1117
1141
  function convertInputType(mouse, touch) {
1118
- var _this16 = this,
1142
+ var _this17 = this,
1119
1143
  DocumentTouch = win.DocumentTouch,
1120
1144
  matchMedia = win.matchMedia,
1121
1145
  navigator = win.navigator,
@@ -1144,13 +1168,34 @@ function convertInputType(mouse, touch) {
1144
1168
 
1145
1169
 
1146
1170
  var hasMouse = mouse && ["any-hover:hover", "any-pointer:fine"].some(function (v) {
1147
- _newArrowCheck(this, _this16);
1171
+ _newArrowCheck(this, _this17);
1148
1172
 
1149
1173
  return matchMedia == null ? void 0 : matchMedia("(" + v + ")").matches;
1150
1174
  }.bind(this)); // fallback to 'mouse' if no input type is detected.
1151
1175
 
1152
1176
  return hasMouse && "mouse" || hasTouch && "touch" || "mouse";
1153
1177
  }
1178
+ /**
1179
+ * Run function until given condition function return true
1180
+ * @param {Function} fn Function to be executed when condition is true
1181
+ * @param {Function} conditionFn Condition function to check if condition is true
1182
+ * @private
1183
+ */
1184
+
1185
+
1186
+ function runUntil(fn, conditionFn) {
1187
+ var _this18 = this;
1188
+
1189
+ if (conditionFn() === !1) {
1190
+ win.requestAnimationFrame(function () {
1191
+ _newArrowCheck(this, _this18);
1192
+
1193
+ return runUntil(fn, conditionFn);
1194
+ }.bind(this));
1195
+ } else {
1196
+ fn();
1197
+ }
1198
+ }
1154
1199
  ;// CONCATENATED MODULE: ./src/config/config.ts
1155
1200
 
1156
1201
 
@@ -1285,7 +1330,7 @@ var Plugin = /*#__PURE__*/function () {
1285
1330
  return Plugin;
1286
1331
  }();
1287
1332
 
1288
- Plugin.version = "3.5.0-next.1";
1333
+ Plugin.version = "3.5.1";
1289
1334
 
1290
1335
  ;// CONCATENATED MODULE: ./src/Plugin/textoverlap/Options.ts
1291
1336
  /**