billboard.js 3.9.2 → 3.10.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/README.md +2 -2
  2. package/dist/billboard.css +2 -2
  3. package/dist/billboard.js +2705 -2529
  4. package/dist/billboard.min.css +2 -2
  5. package/dist/billboard.min.js +2 -2
  6. package/dist/billboard.pkgd.js +3516 -3329
  7. package/dist/billboard.pkgd.min.js +4 -4
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.js +15 -15
  9. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  10. package/dist/plugin/billboardjs-plugin-sparkline.js +215 -196
  11. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  12. package/dist/plugin/billboardjs-plugin-stanford.js +244 -239
  13. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  14. package/dist/plugin/billboardjs-plugin-tableview.js +184 -164
  15. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  16. package/dist/plugin/billboardjs-plugin-textoverlap.js +170 -151
  17. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  18. package/dist/plugin/pkgd/{billboardjs-plugin-bubblecompare.js → billboardjs-plugin-bubblecompare.pkgd.js} +667 -642
  19. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +12 -0
  20. package/dist/plugin/pkgd/{billboardjs-plugin-sparkline.js → billboardjs-plugin-sparkline.pkgd.js} +864 -820
  21. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +12 -0
  22. package/dist/plugin/pkgd/{billboardjs-plugin-stanford.js → billboardjs-plugin-stanford.pkgd.js} +929 -900
  23. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +12 -0
  24. package/dist/plugin/pkgd/{billboardjs-plugin-tableview.js → billboardjs-plugin-tableview.pkgd.js} +833 -788
  25. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +12 -0
  26. package/dist/plugin/pkgd/{billboardjs-plugin-textoverlap.js → billboardjs-plugin-textoverlap.pkgd.js} +932 -897
  27. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +12 -0
  28. package/dist/theme/dark.css +5 -4
  29. package/dist/theme/dark.min.css +2 -2
  30. package/dist/theme/datalab.css +5 -4
  31. package/dist/theme/datalab.min.css +2 -2
  32. package/dist/theme/graph.css +5 -4
  33. package/dist/theme/graph.min.css +2 -2
  34. package/dist/theme/insight.css +5 -4
  35. package/dist/theme/insight.min.css +2 -2
  36. package/dist-esm/billboard.js +605 -468
  37. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +3 -3
  38. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +13 -7
  39. package/dist-esm/plugin/billboardjs-plugin-stanford.js +21 -28
  40. package/dist-esm/plugin/billboardjs-plugin-tableview.js +17 -11
  41. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +13 -7
  42. package/package.json +31 -31
  43. package/src/Chart/api/axis.ts +4 -0
  44. package/src/Chart/api/category.ts +8 -4
  45. package/src/Chart/api/export.ts +1 -2
  46. package/src/Chart/api/subchart.ts +162 -89
  47. package/src/Chart/api/zoom.ts +69 -79
  48. package/src/ChartInternal/Axis/AxisRendererHelper.ts +0 -8
  49. package/src/ChartInternal/data/IData.ts +4 -1
  50. package/src/ChartInternal/data/convert.helper.ts +1 -15
  51. package/src/ChartInternal/data/data.ts +8 -2
  52. package/src/ChartInternal/interactions/eventrect.ts +0 -1
  53. package/src/ChartInternal/interactions/flow.ts +1 -7
  54. package/src/ChartInternal/interactions/interaction.ts +10 -4
  55. package/src/ChartInternal/interactions/subchart.ts +36 -30
  56. package/src/ChartInternal/interactions/zoom.ts +13 -3
  57. package/src/ChartInternal/internals/category.ts +2 -2
  58. package/src/ChartInternal/internals/clip.ts +4 -4
  59. package/src/ChartInternal/internals/domain.ts +46 -10
  60. package/src/ChartInternal/internals/grid.ts +57 -86
  61. package/src/ChartInternal/internals/redraw.ts +0 -5
  62. package/src/ChartInternal/internals/region.ts +35 -12
  63. package/src/ChartInternal/internals/text.ts +1 -26
  64. package/src/ChartInternal/internals/title.ts +10 -48
  65. package/src/ChartInternal/internals/tooltip.ts +47 -51
  66. package/src/ChartInternal/shape/arc.ts +16 -6
  67. package/src/ChartInternal/shape/candlestick.ts +2 -17
  68. package/src/ChartInternal/shape/shape.ts +50 -4
  69. package/src/ChartInternal/shape/treemap.ts +2 -2
  70. package/src/Plugin/bubblecompare/index.ts +1 -1
  71. package/src/Plugin/stanford/Elements.ts +10 -2
  72. package/src/Plugin/stanford/index.ts +1 -24
  73. package/src/Plugin/tableview/index.ts +2 -2
  74. package/src/config/Options/axis/x.ts +1 -0
  75. package/src/config/Options/common/main.ts +12 -2
  76. package/src/config/Options/common/tooltip.ts +10 -10
  77. package/src/config/Options/data/axis.ts +3 -1
  78. package/src/config/Options/data/data.ts +10 -2
  79. package/src/config/Store/State.ts +3 -0
  80. package/src/module/Cache.ts +7 -5
  81. package/src/module/browser.ts +34 -14
  82. package/src/module/util.ts +8 -4
  83. package/src/module/worker.ts +24 -13
  84. package/src/scss/billboard.scss +4 -2
  85. package/src/scss/theme/dark.scss +4 -2
  86. package/src/scss/theme/datalab.scss +4 -2
  87. package/src/scss/theme/graph.scss +4 -2
  88. package/src/scss/theme/insight.scss +4 -2
  89. package/types/chart.d.ts +11 -0
  90. package/types/options.d.ts +3 -3
  91. package/types/types.d.ts +15 -1
@@ -5,8 +5,8 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.9.2
8
+ * @version 3.10.0-next.1
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
12
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3-interpolate"),require("d3-color"),require("d3-scale"),require("d3-selection"),require("d3-brush"),require("d3-axis"),require("d3-format")):"function"==typeof define&&define.amd?define("bb",["d3-interpolate","d3-color","d3-scale","d3-selection","d3-brush","d3-axis","d3-format"],e):"object"==typeof exports?exports.bb=e(require("d3-interpolate"),require("d3-color"),require("d3-scale"),require("d3-selection"),require("d3-brush"),require("d3-axis"),require("d3-format")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.stanford=e(t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3))}(this,(function(t,e,i,n,r,o,a){return function(){"use strict";var s=[,function(t){t.exports=n},,function(t){t.exports=r},,function(e){e.exports=t},function(t){t.exports=e},function(t){t.exports=i},function(t){t.exports=o},function(t){t.exports=a}],c={};function l(t){var e=c[t];if(void 0!==e)return e.exports;var i=c[t]={exports:{}};return s[t](i,i.exports,l),i.exports}l.d=function(t,e){for(var i in e)l.o(e,i)&&!l.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},l.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var b={};return function(){function t(t,e){if(t!==e)throw new TypeError("Cannot instantiate an arrow function")}function e(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}l.d(b,{default:function(){return K}});var n=l(5),r=l(6),o=l(7);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t){var e=function(t,e){if("object"!==a(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!==a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===a(e)?e:String(e)}function c(t,e,i){return(e=s(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function u(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function d(t){for(var e,i=1;i<arguments.length;i++)e=null!=arguments[i]?arguments[i]:{},i%2?u(Object(e),!0).forEach((function(i){c(t,i,e[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):u(Object(e)).forEach((function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(e,i))}));return t}var h={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},f=(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d({},{button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_"}),{arc:"bb-arc",arcLabelLine:"bb-arc-label-line",arcs:"bb-arcs",chartArc:"bb-chart-arc",chartArcs:"bb-chart-arcs",chartArcsBackground:"bb-chart-arcs-background",chartArcsTitle:"bb-chart-arcs-title",needle:"bb-needle"}),{area:"bb-area",areas:"bb-areas"}),{axis:"bb-axis",axisX:"bb-axis-x",axisXLabel:"bb-axis-x-label",axisY:"bb-axis-y",axisY2:"bb-axis-y2",axisY2Label:"bb-axis-y2-label",axisYLabel:"bb-axis-y-label"}),{bar:"bb-bar",bars:"bb-bars",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars"}),{candlestick:"bb-candlestick",candlesticks:"bb-candlesticks",chartCandlestick:"bb-chart-candlestick",chartCandlesticks:"bb-chart-candlesticks",valueDown:"bb-value-down",valueUp:"bb-value-up"}),{chartCircles:"bb-chart-circles",circle:"bb-circle",circles:"bb-circles"}),{colorPattern:"bb-color-pattern",colorScale:"bb-colorscale"}),{dragarea:"bb-dragarea",INCLUDED:"_included_"}),{chartArcsGaugeMax:"bb-chart-arcs-gauge-max",chartArcsGaugeMin:"bb-chart-arcs-gauge-min",chartArcsGaugeUnit:"bb-chart-arcs-gauge-unit",chartArcsGaugeTitle:"bb-chart-arcs-gauge-title",gaugeValue:"bb-gauge-value"}),{legend:"bb-legend",legendBackground:"bb-legend-background",legendItem:"bb-legend-item",legendItemEvent:"bb-legend-item-event",legendItemHidden:"bb-legend-item-hidden",legendItemPoint:"bb-legend-item-point",legendItemTile:"bb-legend-item-tile"}),{chartLine:"bb-chart-line",chartLines:"bb-chart-lines",line:"bb-line",lines:"bb-lines"}),{eventRect:"bb-event-rect",eventRects:"bb-event-rects",eventRectsMultiple:"bb-event-rects-multiple",eventRectsSingle:"bb-event-rects-single"}),{focused:"bb-focused",defocused:"bb-defocused",legendItemFocused:"bb-legend-item-focused",xgridFocus:"bb-xgrid-focus",ygridFocus:"bb-ygrid-focus"}),{grid:"bb-grid",gridLines:"bb-grid-lines",xgrid:"bb-xgrid",xgridLine:"bb-xgrid-line",xgridLines:"bb-xgrid-lines",xgrids:"bb-xgrids",ygrid:"bb-ygrid",ygridLine:"bb-ygrid-line",ygridLines:"bb-ygrid-lines",ygrids:"bb-ygrids"}),{chartRadar:"bb-chart-radar",chartRadars:"bb-chart-radars"}),{region:"bb-region",regions:"bb-regions"}),{selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",SELECTED:"_selected_"}),{shape:"bb-shape",shapes:"bb-shapes"}),{brush:"bb-brush",subchart:"bb-subchart"}),{chartText:"bb-chart-text",chartTexts:"bb-chart-texts",text:"bb-text",texts:"bb-texts",title:"bb-title",TextOverlapping:"text-overlapping"}),h),{treemap:"bb-treemap",chartTreemap:"bb-chart-treemap",chartTreemaps:"bb-chart-treemaps"}),{buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"}),l(1),l(3),void 0),p=function(){return t(this,f),"object"==typeof globalThis&&null!==globalThis&&globalThis.Object===Object&&globalThis||"object"==typeof global&&null!==global&&global.Object===Object&&global||"object"==typeof self&&null!==self&&self.Object===Object&&self||Function("return this")()}.bind(void 0)(),g="function"==typeof p.requestAnimationFrame,v="function"==typeof p.requestIdleCallback,y=g?p.requestAnimationFrame:function(e){return t(this,f),setTimeout(e,1)}.bind(void 0),m=g?p.cancelAnimationFrame:function(e){return t(this,f),clearTimeout(e)}.bind(void 0),x=(v&&p.requestIdleCallback,v&&p.cancelIdleCallback,null==p?void 0:p.document),w=void 0;(function(e){return t(this,w),e||0===e}).bind(void 0);var S=function(e){return t(this,w),"function"==typeof e}.bind(void 0),_=function(e){return t(this,w),"string"==typeof e}.bind(void 0),E=function(e){return t(this,w),"number"==typeof e}.bind(void 0),O=function(e){return t(this,w),void 0===e}.bind(void 0),j=function(e){return t(this,w),void 0!==e}.bind(void 0),C=(function(e){return t(this,w),"boolean"==typeof e}.bind(void 0),function(e){return t(this,w),10*Math.ceil(e/10)}.bind(void 0),function(e){return t(this,w),Math.ceil(e)+.5}.bind(void 0),function(e){return t(this,w),e[1]-e[0]}.bind(void 0),function(e){return t(this,w),"object"==typeof e}.bind(void 0)),$=function(e){return t(this,w),O(e)||null===e||_(e)&&0===e.length||C(e)&&!(e instanceof Date)&&0===Object.keys(e).length||E(e)&&isNaN(e)}.bind(void 0),M=(function(e){return t(this,w),!$(e)}.bind(void 0),function(e){return t(this,w),Array.isArray(e)}.bind(void 0)),T=function(e){return t(this,w),e&&!(null!=e&&e.nodeType)&&C(e)&&!M(e)}.bind(void 0);(function(e){return t(this,w),e.charAt(0).toUpperCase()+e.slice(1)}).bind(void 0);(function(e){return t(this,w),[].slice.call(e)}).bind(void 0);function k(e){for(var i=this,n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];if(!r.length||1===r.length&&!r[0])return e;var a=r.shift();return T(e)&&T(a)&&Object.keys(a).forEach(function(n){t(this,i);var r=a[n];T(r)?(e[n]||(e[n]={}),e[n]=k(e[n],r)):e[n]=M(r)?r.concat():r}.bind(this)),k.apply(void 0,[e].concat(r))}var P=function(e,i,n){void 0===n&&(n=1),t(this,w);for(var r=[],o=0|Math.max(0,Math.ceil((i-e)/n)),a=e;a<o;a++)r.push(e+a*n);return r}.bind(void 0);(function(){var e=this;t(this,w);var i=function(){return t(this,e),{bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0}}.bind(this);try{return new MouseEvent("t"),function(n,r,o){void 0===o&&(o=i()),t(this,e),n.dispatchEvent(new MouseEvent(r,o))}.bind(this)}catch(n){return function(n,r,o){void 0===o&&(o=i()),t(this,e);var a=x.createEvent("MouseEvent");a.initMouseEvent(r,o.bubbles,o.cancelable,p,0,o.screenX,o.screenY,o.clientX,o.clientY,!1,!1,!1,!1,0,null),n.dispatchEvent(a)}.bind(this)}}).bind(void 0)(),function(e,i,n){t(this,w);var r=new Touch(k({identifier:Date.now(),target:e,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},n));e.dispatchEvent(new TouchEvent(i,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[r],targetTouches:[],changedTouches:[r]}))}.bind(void 0);function D(t){var e;if(t instanceof Date)e=t;else if(_(t)){var i,n=this.config;e=null!=(i=this.format.dataTime(n.data_xFormat)(t))?i:new Date(t)}else E(t)&&!isNaN(t)&&(e=new Date(+t));return e&&!isNaN(+e)||console&&console.error&&console.error("Failed to parse x '"+t+"' to Date object"),e}function A(e){var i,n,r,o=this,a=this.config,s=function(){t(this,o);var e=n.shift();return e&&i&&C(i)&&e in i?(i=i[e],s()):e?void 0:i}.bind(this);Object.keys(a).forEach(function(c){t(this,o),i=e,n=c.split("_"),r=s(),j(r)&&(a[c]=r)}.bind(this)),this.api&&(this.state.orgConfig=e)}var q=function(){function e(t){void 0===t&&(t={}),this.$$=void 0,this.options=void 0,this.options=t}var i=e.prototype;return i.$beforeInit=function(){},i.$init=function(){},i.$afterInit=function(){},i.$redraw=function(){},i.$willDestroy=function(){var e=this;Object.keys(this).forEach(function(i){t(this,e),this[i]=null,delete this[i]}.bind(this))},e}();q.version="3.9.2";var L=function(){return{colors:void 0,epochs:[],lines:[],scale_min:void 0,scale_max:void 0,scale_width:20,scale_format:void 0,padding_top:0,padding_right:0,padding_bottom:0,padding_left:0,regions:[]}},F="bb-colorscale",N="bb-stanford-elements",I="bb-stanford-line",R="bb-stanford-lines",B="bb-stanford-region",X="bb-stanford-regions";function Y(t,e){return t.epochs<e.epochs?-1:t.epochs>e.epochs?1:0}function V(t){for(var e,i=function(t){for(var e,i,n=0,r=0,o=t.length,a=o-1;r<o;a=r,r++)e=t[r],i=t[a],n+=e.x*i.y,n-=e.y*i.x;return n/2}(t),n=0,r=0,o=0,a=t.length,s=a-1;o<a;s=o,o++){var c=t[o],l=t[s];e=c.x*l.y-l.x*c.y,n+=(c.x+l.x)*e,r+=(c.y+l.y)*e}return{x:n/(e=6*i),y:r/e}}var z=function(){function e(t){this.owner=void 0,this.owner=t;var e=t.$$.$el.main.select(".bb-chart").append("g").attr("class",N);e.append("g").attr("class",R),e.append("g").attr("class",X)}var i=e.prototype;return i.updateStanfordLines=function(e){var i=this,n=this.owner.$$,r=n.config,o=n.$el.main,a=r.axis_rotated,s=this.xvCustom.bind(n),c=this.yvCustom.bind(n),l=o.select("."+R).style("shape-rendering","geometricprecision").selectAll("."+I).data(this.owner.config.lines);l.exit().transition().duration(e).style("opacity","0").remove();var b=l.enter().append("g");b.append("line").style("opacity","0"),b.merge(l).attr("class",function(e){return t(this,i),I+(e.class?" "+e.class:"")}.bind(this)).select("line").transition().duration(e).attr("x1",function(e){return t(this,i),a?c(e,"y1"):s(e,"x1")}.bind(this)).attr("x2",function(e){return t(this,i),a?c(e,"y2"):s(e,"x2")}.bind(this)).attr("y1",function(e){return t(this,i),a?s(e,"x1"):c(e,"y1")}.bind(this)).attr("y2",function(e){return t(this,i),a?s(e,"x2"):c(e,"y2")}.bind(this)).transition().style("opacity",null)},i.updateStanfordRegions=function(e){var i=this,n=this.owner.$$,r=n.config,o=n.$el.main,a=r.axis_rotated,s=this.xvCustom.bind(n),c=this.yvCustom.bind(n),l=this.owner.countEpochsInRegion.bind(n),b=o.select("."+X).selectAll("."+B).data(this.owner.config.regions);b.exit().transition().duration(e).style("opacity","0").remove();var u=b.enter().append("g");u.append("polygon").style("opacity","0"),u.append("text").attr("transform",a?"rotate(-90)":"").style("opacity","0"),(b=u.merge(b)).attr("class",function(e){return t(this,i),B+(e.class?" "+e.class:"")}.bind(this)).select("polygon").transition().duration(e).attr("points",function(e){var n=this;return t(this,i),e.points.map(function(e){return t(this,n),[a?c(e,"y"):s(e,"x"),a?s(e,"x"):c(e,"y")].join(",")}.bind(this)).join(" ")}.bind(this)).transition().style("opacity",function(e){return t(this,i),(e.opacity?e.opacity:.2)+""}.bind(this)),b.select("text").transition().duration(e).attr("x",function(e){return t(this,i),a?c(V(e.points),"y"):s(V(e.points),"x")}.bind(this)).attr("y",function(e){return t(this,i),a?s(V(e.points),"x"):c(V(e.points),"y")}.bind(this)).text(function(e){if(t(this,i),e.text){var n=l(e.points),r=n.value,o=n.percentage;return e.text(r,o)}return""}.bind(this)).attr("text-anchor","middle").attr("dominant-baseline","middle").transition().style("opacity",null)},i.updateStanfordElements=function(t){void 0===t&&(t=0),this.updateStanfordLines(t),this.updateStanfordRegions(t)},i.xvCustom=function(t,e){var i=this,n=i.axis,r=i.config,o=e?t[e]:i.getBaseValue(t);return n.isTimeSeries()?o=D.call(i,o):n.isCategorized()&&_(o)&&(o=r.axis_x_categories.indexOf(t.value)),Math.ceil(i.scale.x(o))},i.yvCustom=function(t,e){var i=this,n=t.axis&&"y2"===t.axis?i.scale.y2:i.scale.y,r=e?t[e]:i.getBaseValue(t);return Math.ceil(n(r))},e}(),G=l(8),U=l(9),H=function(){function e(t){this.owner=void 0,this.colorScale=void 0,this.owner=t}var i=e.prototype;return i.drawColorScale=function(){var e=this,i=this.owner,n=i.$$,r=i.config,a=n.data.targets[0],s=n.state.height-r.padding_bottom-r.padding_top,c=r.scale_width,l=P(r.padding_bottom,s,5),b=(0,o.scaleSequential)(a.colors).domain([l[l.length-1],l[0]]);this.colorScale&&this.colorScale.remove(),this.colorScale=n.$el.svg.append("g").attr("width",50).attr("height",s).attr("class",F),this.colorScale.append("g").attr("transform","translate(0, "+r.padding_top+")").selectAll("bars").data(l).enter().append("rect").attr("y",function(i,n){return t(this,e),5*n}.bind(this)).attr("x",0).attr("width",c).attr("height",5).attr("fill",function(i){return t(this,e),b(i)}.bind(this));var u=(0,o.scaleSymlog)().domain([a.minEpochs,a.maxEpochs]).range([l[0]+r.padding_top+l[l.length-1]+5-1,l[0]+r.padding_top]),d=(0,G.axisRight)(u),h=r.scale_format;"pow10"===h?d.tickValues([1,10,100,1e3,1e4,1e5,1e6,1e7]):S(h)?d.tickFormat(h):d.tickFormat((0,U.format)("d"));var f=this.colorScale.append("g").attr("class","legend axis").attr("transform","translate("+c+",0)").call(d);"pow10"===h&&f.selectAll(".tick text").text(null).filter(function(i){return t(this,e),i/Math.pow(10,Math.ceil(Math.log(i)/Math.LN10-1e-12))==1}.bind(this)).text(10).append("tspan").attr("dy","-.7em").text(function(i){return t(this,e),Math.round(Math.log(i)/Math.LN10)}.bind(this)),this.colorScale.attr("transform","translate("+(n.state.current.width-this.xForColorScale())+", 0)")},i.xForColorScale=function(){return this.owner.config.padding_right+this.colorScale.node().getBBox().width},i.getColorScalePadding=function(){return this.xForColorScale()+this.owner.config.padding_left+20},e}(),K=function(a){var s,c;function l(t){var i=a.call(this,t)||this;return i.config=void 0,i.colorScale=void 0,i.elements=void 0,i.config=new L,e(i)||e(i)}c=a,(s=l).prototype=Object.create(c.prototype),s.prototype.constructor=s,i(s,c);var b=l.prototype;return b.$beforeInit=function(){var e=this,i=this.$$;i.config.data_xSort=!1,i.isMultipleX=function(){return t(this,e),!0}.bind(this),i.showGridFocus=function(){t(this,e)}.bind(this),i.labelishData=function(i){return t(this,e),i.values}.bind(this),i.opacityForCircle=function(){return t(this,e),1}.bind(this);var n=i.getCurrentPaddingRight.bind(i);i.getCurrentPaddingRight=function(){return t(this,e),n()+(this.colorScale?this.colorScale.getColorScalePadding():0)}.bind(this)},b.$init=function(){var t=this.$$;A.call(this,this.options),t.color=this.getStanfordPointColor.bind(t),this.colorScale=new H(this),this.elements=new z(this),this.convertData(),this.initStanfordData(),this.setStanfordTooltip(),this.colorScale.drawColorScale(),this.$redraw()},b.$redraw=function(t){var e,i;null==(e=this.colorScale)||e.drawColorScale(),null==(i=this.elements)||i.updateStanfordElements(t)},b.getOptions=function(){return new L},b.convertData=function(){var e=this,i=this.$$.data.targets,n=this.options.epochs;i.forEach(function(i){var r=this;t(this,e),i.values.forEach(function(e,i){t(this,r),e.epochs=n[i]}.bind(this)),i.minEpochs=void 0,i.maxEpochs=void 0,i.colors=void 0,i.colorscale=void 0}.bind(this))},b.xvCustom=function(t,e){var i=this,n=i.axis,r=i.config,o=e?t[e]:i.getBaseValue(t);return n.isTimeSeries()?o=D.call(i,o):n.isCategorized()&&_(o)&&(o=r.axis_x_categories.indexOf(t.value)),Math.ceil(i.scale.x(o))},b.yvCustom=function(t,e){var i=this.scale,n=t.axis&&"y2"===t.axis?i.y2:i.y,r=e?t[e]:this.getBaseValue(t);return Math.ceil(n(r))},b.initStanfordData=function(){var e=this,i=this.config,a=this.$$.data.targets[0];a.values.sort(Y);var s=a.values.map(function(i){return t(this,e),i.epochs}.bind(this));a.minEpochs=isNaN(i.scale_min)?Math.min.apply(Math,s):i.scale_min,a.maxEpochs=isNaN(i.scale_max)?Math.max.apply(Math,s):i.scale_max,a.colors=S(i.colors)?i.colors:(0,n.interpolateHslLong)((0,r.hsl)(250,1,.5),(0,r.hsl)(0,1,.5)),a.colorscale=(0,o.scaleSequentialLog)(a.colors).domain([a.minEpochs,a.maxEpochs])},b.getStanfordPointColor=function(t){return this.data.targets[0].colorscale(t.epochs)},b.setStanfordTooltip=function(){var e=this.$$.config;$(e.tooltip_contents)&&(e.tooltip_contents=function(i,n,r,o){var a=this,s=e.data_x,c='<table class="'+h.tooltip+'"><tbody>';return i.forEach(function(e){t(this,a);var i=e.id,l=void 0===i?"":i,b=e.value,u=void 0===b?0:b,d=e.epochs,f=void 0===d?0:d,p=e.x;c+="<tr>\n\t\t\t\t\t\t\t<th>"+(s||"")+'</th>\n\t\t\t\t\t\t\t<th class="value">'+n(void 0===p?"":p)+"</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>"+e.id+'</th>\n\t\t\t\t\t\t\t<th class="value">'+r(u)+'</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class="'+h.tooltipName+"-"+l+'">\n\t\t\t\t\t\t\t<td class="name"><span style="background-color:'+o(e)+'"></span>Epochs</td>\n\t\t\t\t\t\t\t<td class="value">'+r(f)+"</td>\n\t\t\t\t\t\t</tr>"}.bind(this)),c+"</tbody></table>"})},b.countEpochsInRegion=function(e){var i=this,n=this.data.targets[0],r=n.values.reduce(function(e,n){return t(this,i),e+ +n.epochs}.bind(this),0),o=n.values.reduce(function(n,r){return t(this,i),function(t,e){for(var i=t.x,n=t.value,r=!1,o=0,a=e.length-1;o<e.length;a=o++){var s=e[o].x,c=e[o].y,l=e[a].x,b=e[a].y;c>n!=b>n&&i<(l-s)*(n-c)/(b-c)+s&&(r=!r)}return r}(r,e)?n+ +r.epochs:n}.bind(this),0);return{value:o,percentage:0!==o?+(o/r*100).toFixed(1):0}},l}(q)}(),b=b.default}()}));
12
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3-interpolate"),require("d3-color"),require("d3-scale"),require("d3-selection"),require("d3-brush"),require("d3-axis"),require("d3-format")):"function"==typeof define&&define.amd?define("bb",["d3-interpolate","d3-color","d3-scale","d3-selection","d3-brush","d3-axis","d3-format"],e):"object"==typeof exports?exports.bb=e(require("d3-interpolate"),require("d3-color"),require("d3-scale"),require("d3-selection"),require("d3-brush"),require("d3-axis"),require("d3-format")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.stanford=e(t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3))}(this,(function(t,e,n,i,r,o,s){return function(){"use strict";var a={272:function(t){t.exports=o},514:function(t){t.exports=r},947:function(t){t.exports=e},936:function(t){t.exports=s},560:function(e){e.exports=t},379:function(t){t.exports=n},288:function(t){t.exports=i}},c={};function l(t){var e=c[t];if(void 0!==e)return e.exports;var n=c[t]={exports:{}};return a[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 b={};return function(){function t(t,e){if(t!==e)throw new TypeError("Cannot instantiate an arrow function")}function e(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function n(t,e){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},n(t,e)}l.d(b,{default:function(){return U}});var i=l(560),r=l(947),o=l(379);function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function a(t){var e=function(t,e){if("object"!==s(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==s(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===s(e)?e:String(e)}function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function u(t){for(var e,n=1;n<arguments.length;n++)e=null!=arguments[n]?arguments[n]:{},n%2?c(Object(e),!0).forEach((function(n){var i,r,o;i=t,r=n,o=e[n],(r=a(r))in i?Object.defineProperty(i,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[r]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):c(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}));return t}const d={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"};u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u({},{button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_"}),{arc:"bb-arc",arcLabelLine:"bb-arc-label-line",arcs:"bb-arcs",chartArc:"bb-chart-arc",chartArcs:"bb-chart-arcs",chartArcsBackground:"bb-chart-arcs-background",chartArcsTitle:"bb-chart-arcs-title",needle:"bb-needle"}),{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"}),d),{treemap:"bb-treemap",chartTreemap:"bb-chart-treemap",chartTreemaps:"bb-chart-treemaps"}),{buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"}),l(288),l(514);const h="object"==typeof globalThis&&null!==globalThis&&globalThis.Object===Object&&globalThis||"object"==typeof global&&null!==global&&global.Object===Object&&global||"object"==typeof self&&null!==self&&self.Object===Object&&self||Function("return this")(),f=null==h?void 0:h.document,p=function(e){var n=this;const i="function"==typeof(null==e?void 0:e.requestAnimationFrame),r="function"==typeof(null==e?void 0:e.requestIdleCallback);return[i?e.requestAnimationFrame:function(e){return t(this,n),setTimeout(e,1)}.bind(this),i?e.cancelAnimationFrame:function(e){return t(this,n),clearTimeout(e)}.bind(this),r?e.requestIdleCallback:g,r?e.cancelIdleCallback:v]}(h),g=p[0],v=p[1];p[2],p[3];var y=void 0;(function(e){return t(this,y),e||0===e}).bind(void 0);const m=function(e){return t(this,y),"function"==typeof e}.bind(void 0),x=function(e){return t(this,y),"string"==typeof e}.bind(void 0),w=function(e){return t(this,y),"number"==typeof e}.bind(void 0),S=function(e){return t(this,y),void 0===e}.bind(void 0),_=function(e){return t(this,y),void 0!==e}.bind(void 0),E=(function(e){return t(this,y),"boolean"==typeof e}.bind(void 0),function(e){return t(this,y),10*Math.ceil(e/10)}.bind(void 0),function(e){return t(this,y),Math.ceil(e)+.5}.bind(void 0),function(e){return t(this,y),e[1]-e[0]}.bind(void 0),function(e){return t(this,y),"object"==typeof e}.bind(void 0)),j=function(e){return t(this,y),S(e)||null===e||x(e)&&0===e.length||E(e)&&!(e instanceof Date)&&0===Object.keys(e).length||w(e)&&isNaN(e)}.bind(void 0),O=(function(e){return t(this,y),!j(e)}.bind(void 0),function(e){return t(this,y),Array.isArray(e)}.bind(void 0)),C=function(e){return t(this,y),e&&!(null!=e&&e.nodeType)&&E(e)&&!O(e)}.bind(void 0);(function(e){return t(this,y),e.charAt(0).toUpperCase()+e.slice(1)}).bind(void 0);(function(e){return t(this,y),[].slice.call(e)}).bind(void 0);function $(e){for(var n=this,i=arguments.length,r=Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];if(!r.length||1===r.length&&!r[0])return e;const s=r.shift();return C(e)&&C(s)&&Object.keys(s).forEach(function(i){t(this,n);const r=s[i];C(r)?(e[i]||(e[i]={}),e[i]=$(e[i],r)):e[i]=O(r)?r.concat():r}.bind(this)),$.apply(void 0,[e].concat(r))}const T=function(e,n,i){void 0===i&&(i=1),t(this,y);const r=[],o=0|Math.max(0,Math.ceil((n-e)/i));for(let t=e;t<o;t++)r.push(e+t*i);return r}.bind(void 0);(function(){var e=this;t(this,y);const n=function(){return t(this,e),{bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0}}.bind(this);try{return new MouseEvent("t"),function(i,r,o){void 0===o&&(o=n()),t(this,e),i.dispatchEvent(new MouseEvent(r,o))}.bind(this)}catch(i){return function(i,r,o){void 0===o&&(o=n()),t(this,e);const s=f.createEvent("MouseEvent");s.initMouseEvent(r,o.bubbles,o.cancelable,h,0,o.screenX,o.screenY,o.clientX,o.clientY,!1,!1,!1,!1,0,null),i.dispatchEvent(s)}.bind(this)}}).bind(void 0)(),function(e,n,i){t(this,y);const r=new Touch($({identifier:Date.now(),target:e,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},i));e.dispatchEvent(new TouchEvent(n,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[r],targetTouches:[],changedTouches:[r]}))}.bind(void 0);function k(t){let e;if(t instanceof Date)e=t;else if(x(t)){var n;const i=this.config;e=null!=(n=this.format.dataTime(i.data_xFormat)(t))?n:new Date(t)}else w(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(e){var n=this;const i=this.config;let r,o,s;const a=function(){t(this,n);const e=o.shift();return e&&r&&E(r)&&e in r?(r=r[e],a()):e?void 0:r}.bind(this);Object.keys(i).forEach(function(c){t(this,n),r=e,o=c.split("_"),s=a(),_(s)&&(i[c]=s)}.bind(this)),this.api&&(this.state.orgConfig=e)}let P=function(){function e(t){void 0===t&&(t={}),this.$$=void 0,this.options=void 0,this.options=t}var n=e.prototype;return n.$beforeInit=function(){},n.$init=function(){},n.$afterInit=function(){},n.$redraw=function(){},n.$willDestroy=function(){var e=this;Object.keys(this).forEach(function(n){t(this,e),this[n]=null,delete this[n]}.bind(this))},e}();P.version="3.10.0-next.1";let D=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:[]}};var A="bb-colorscale",q="bb-stanford-elements",L="bb-stanford-line",F="bb-stanford-lines",N="bb-stanford-region",I="bb-stanford-regions";function R(t,e){return t.epochs<e.epochs?-1:t.epochs>e.epochs?1:0}function B(t){const e=function(t){let e,n,i=0;for(let r=0,o=t.length,s=o-1;r<o;s=r,r++)e=t[r],n=t[s],i+=e.x*n.y,i-=e.y*n.x;return i/=2,i}(t);let n,i=0,r=0;for(let e=0,o=t.length,s=o-1;e<o;s=e,e++){const o=t[e],a=t[s];n=o.x*a.y-a.x*o.y,i+=(o.x+a.x)*n,r+=(o.y+a.y)*n}return n=6*e,{x:i/n,y:r/n}}let X=function(){function e(t){this.owner=void 0,this.owner=t;const e=t.$$.$el.main.select(".bb-chart").append("g").attr("class",q);e.append("g").attr("class",F),e.append("g").attr("class",I)}var n=e.prototype;return n.updateStanfordLines=function(e){var n=this;const i=this.owner.$$,r=i.config,o=i.$el.main,s=r.axis_rotated,a=this.xvCustom.bind(i),c=this.yvCustom.bind(i),l=o.select("."+F).style("shape-rendering","geometricprecision").selectAll("."+L).data(this.owner.config.lines);l.exit().transition().duration(e).style("opacity","0").remove();const b=l.enter().append("g");b.append("line").style("opacity","0"),b.merge(l).attr("class",function(e){return t(this,n),L+(e.class?" "+e.class:"")}.bind(this)).select("line").transition().duration(e).attr("x1",function(e){t(this,n);return s?c(e,"y1"):a(e,"x1")}.bind(this)).attr("x2",function(e){return t(this,n),s?c(e,"y2"):a(e,"x2")}.bind(this)).attr("y1",function(e){t(this,n);return s?a(e,"x1"):c(e,"y1")}.bind(this)).attr("y2",function(e){return t(this,n),s?a(e,"x2"):c(e,"y2")}.bind(this)).transition().style("opacity",null)},n.updateStanfordRegions=function(e){var n=this;const i=this.owner.$$,r=i.config,o=i.$el.main,s=r.axis_rotated,a=this.xvCustom.bind(i),c=this.yvCustom.bind(i),l=this.owner.countEpochsInRegion.bind(i);let b=o.select("."+I).selectAll("."+N).data(this.owner.config.regions);b.exit().transition().duration(e).style("opacity","0").remove();const u=b.enter().append("g");u.append("polygon").style("opacity","0"),u.append("text").attr("transform",s?"rotate(-90)":"").style("opacity","0"),b=u.merge(b),b.attr("class",function(e){return t(this,n),N+(e.class?" "+e.class:"")}.bind(this)).select("polygon").transition().duration(e).attr("points",function(e){var i=this;return t(this,n),e.points.map(function(e){return t(this,i),[s?c(e,"y"):a(e,"x"),s?a(e,"x"):c(e,"y")].join(",")}.bind(this)).join(" ")}.bind(this)).transition().style("opacity",function(e){return t(this,n),(e.opacity?e.opacity:.2)+""}.bind(this)),b.select("text").transition().duration(e).attr("x",function(e){return t(this,n),s?c(B(e.points),"y"):a(B(e.points),"x")}.bind(this)).attr("y",function(e){return t(this,n),s?a(B(e.points),"x"):c(B(e.points),"y")}.bind(this)).text(function(e){if(t(this,n),e.text){const t=l(e.points),n=t.value,i=t.percentage;return e.text(n,i)}return""}.bind(this)).attr("text-anchor","middle").attr("dominant-baseline","middle").transition().style("opacity",null)},n.updateStanfordElements=function(t){void 0===t&&(t=0),this.updateStanfordLines(t),this.updateStanfordRegions(t)},n.xvCustom=function(t,e){const n=this,i=n.axis,r=n.config;let o=e?t[e]:n.getBaseValue(t);return i.isTimeSeries()?o=k.call(n,o):i.isCategorized()&&x(o)&&(o=r.axis_x_categories.indexOf(t.value)),Math.ceil(n.scale.x(o))},n.yvCustom=function(t,e){const n=this,i=t.axis&&"y2"===t.axis?n.scale.y2:n.scale.y,r=e?t[e]:n.getBaseValue(t);return Math.ceil(i(r))},e}();var Y=l(272),G=l(936);let z=function(){function e(t){this.owner=void 0,this.colorScale=void 0,this.owner=t}var n=e.prototype;return n.drawColorScale=function(){var e=this;const n=this.owner,i=n.$$,r=n.config,s=i.data.targets[0],a=i.state.height-r.padding_bottom-r.padding_top,c=r.scale_width,l=T(r.padding_bottom,a,5),b=(0,o.scaleSequential)(s.colors).domain([l[l.length-1],l[0]]);this.colorScale&&this.colorScale.remove(),this.colorScale=i.$el.svg.append("g").attr("width",50).attr("height",a).attr("class",A),this.colorScale.append("g").attr("transform","translate(0, "+r.padding_top+")").selectAll("bars").data(l).enter().append("rect").attr("y",function(n,i){return t(this,e),5*i}.bind(this)).attr("x",0).attr("width",c).attr("height",5).attr("fill",function(n){return t(this,e),b(n)}.bind(this));const u=(0,o.scaleSymlog)().domain([s.minEpochs,s.maxEpochs]).range([l[0]+r.padding_top+l[l.length-1]+5-1,l[0]+r.padding_top]),d=(0,Y.axisRight)(u),h=r.scale_format;"pow10"===h?d.tickValues([1,10,100,1e3,1e4,1e5,1e6,1e7]):m(h)?d.tickFormat(h):d.tickFormat((0,G.format)("d"));const f=this.colorScale.append("g").attr("class","legend axis").attr("transform","translate("+c+",0)").call(d);"pow10"===h&&f.selectAll(".tick text").text(null).filter(function(n){return t(this,e),n/Math.pow(10,Math.ceil(Math.log(n)/Math.LN10-1e-12))==1}.bind(this)).text(10).append("tspan").attr("dy","-.7em").text(function(n){return t(this,e),Math.round(Math.log(n)/Math.LN10)}.bind(this)),this.colorScale.attr("transform","translate("+(i.state.current.width-this.xForColorScale())+", 0)")},n.xForColorScale=function(){return this.owner.config.padding_right+this.colorScale.node().getBBox().width},n.getColorScalePadding=function(){return this.xForColorScale()+this.owner.config.padding_left+20},e}(),U=function(s){var a,c;function l(t){var n=s.call(this,t)||this;return n.config=void 0,n.colorScale=void 0,n.elements=void 0,n.config=new D,e(n)||e(n)}c=s,(a=l).prototype=Object.create(c.prototype),a.prototype.constructor=a,n(a,c);var b=l.prototype;return b.$beforeInit=function(){var e=this;const n=this.$$;n.config.data_xSort=!1,n.isMultipleX=function(){return t(this,e),!0}.bind(this),n.showGridFocus=function(){t(this,e)}.bind(this),n.labelishData=function(n){return t(this,e),n.values}.bind(this),n.opacityForCircle=function(){return t(this,e),1}.bind(this);const i=n.getCurrentPaddingRight.bind(n);n.getCurrentPaddingRight=function(){return t(this,e),i()+(this.colorScale?this.colorScale.getColorScalePadding():0)}.bind(this)},b.$init=function(){const t=this.$$;M.call(this,this.options),t.color=this.getStanfordPointColor.bind(t),this.colorScale=new z(this),this.elements=new X(this),this.convertData(),this.initStanfordData(),this.setStanfordTooltip(),this.colorScale.drawColorScale(),this.$redraw()},b.$redraw=function(t){var e,n;null==(e=this.colorScale)||e.drawColorScale(),null==(n=this.elements)||n.updateStanfordElements(t)},b.getOptions=function(){return new D},b.convertData=function(){var e=this;const n=this.$$.data.targets,i=this.options.epochs;n.forEach(function(n){var r=this;t(this,e),n.values.forEach(function(e,n){t(this,r),e.epochs=i[n]}.bind(this)),n.minEpochs=void 0,n.maxEpochs=void 0,n.colors=void 0,n.colorscale=void 0}.bind(this))},b.initStanfordData=function(){var e=this;const n=this.config,s=this.$$.data.targets[0];s.values.sort(R);const a=s.values.map(function(n){return t(this,e),n.epochs}.bind(this));s.minEpochs=isNaN(n.scale_min)?Math.min.apply(Math,a):n.scale_min,s.maxEpochs=isNaN(n.scale_max)?Math.max.apply(Math,a):n.scale_max,s.colors=m(n.colors)?n.colors:(0,i.interpolateHslLong)((0,r.hsl)(250,1,.5),(0,r.hsl)(0,1,.5)),s.colorscale=(0,o.scaleSequentialLog)(s.colors).domain([s.minEpochs,s.maxEpochs])},b.getStanfordPointColor=function(t){return this.data.targets[0].colorscale(t.epochs)},b.setStanfordTooltip=function(){const e=this.$$.config;j(e.tooltip_contents)&&(e.tooltip_contents=function(n,i,r,o){var s=this;const a=e.data_x;let c='<table class="'+d.tooltip+'"><tbody>';return n.forEach(function(e){t(this,s);const n=e.id,l=void 0===n?"":n,b=e.value,u=void 0===b?0:b,h=e.epochs,f=void 0===h?0:h,p=e.x;c+="<tr>\n\t\t\t\t\t\t\t<th>"+(a||"")+'</th>\n\t\t\t\t\t\t\t<th class="value">'+i(void 0===p?"":p)+"</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>"+e.id+'</th>\n\t\t\t\t\t\t\t<th class="value">'+r(u)+'</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class="'+d.tooltipName+"-"+l+'">\n\t\t\t\t\t\t\t<td class="name"><span style="background-color:'+o(e)+'"></span>Epochs</td>\n\t\t\t\t\t\t\t<td class="value">'+r(f)+"</td>\n\t\t\t\t\t\t</tr>"}.bind(this)),c+"</tbody></table>"})},b.countEpochsInRegion=function(e){var n=this;const i=this.data.targets[0],r=i.values.reduce(function(e,i){return t(this,n),e+ +i.epochs}.bind(this),0),o=i.values.reduce(function(i,r){return t(this,n),function(t,e){const n=t.x,i=t.value;let r=!1;for(let t=0,o=e.length-1;t<e.length;o=t++){const s=e[t].x,a=e[t].y,c=e[o].x,l=e[o].y;a>i!=l>i&&n<(c-s)*(i-a)/(l-a)+s&&(r=!r)}return r}(r,e)?i+ +r.epochs:i}.bind(this),0);return{value:o,percentage:0!==o?+(o/r*100).toFixed(1):0}},l}(P)}(),b=b.default}()}));