소재지 ₍₍◝(・'ω'・)◟⁾⁾ 🐟️?看XM(^_−)☆哈先看看刚看过卡卡国看过了回来冷藏柜好极过估计 PNG %k25u25%fgd5n!function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var i=0;ie&&(e=t.value);return e}},{key:"draw",value:function(){var t=this.element.getBoundingClientRect().width,e=this.element.getBoundingClientRect().height,i=this.params.padding,o=e*this.params.gapWidth,s=this.dataList.length,n=(this.cWidth=t,this.getMaxValue()),l=this.centerX=t/2,a=i,r=(e-2*i-o*s)/s,h=this.ratio=(t-2*i)/n;this.trapElementList.forEach(function(t){this.element.removeChild(t)},this),this.trapElementList=[],this.positionList=[],this.dataList.forEach(function(t,e){var t=t.value,i=t/2*h,s=a+r*e+o*e,n=s+r,t=(e===this.dataList.length-1?t:this.dataList[e+1].value)/2*h,s=(this.positionList.push([s,n,l,i,t]),this.drawTrapElement(s,n,l,i,t,this.getItemColor(e)));this.trapElementList.push(s),this.registerMouseEvents(s,e),this.element.appendChild(s)},this)}},{key:"getItemColor",value:function(t){return this.params.colors[t]||"#AAA"}},{key:"drawTrapElement",value:function(t,e,i,s,n,o){var l=document.createElementNS("http://www.w3.org/2000/svg","path"),a="M"+(i+s)+","+t+" ";return l.setAttribute("d",a+("L"+(i-s)+","+t+" ")+("L"+(i-n)+","+e+" ")+("L"+(i+n)+","+e+" ")+("L"+(i+s)+","+t)),l.setAttribute("fill",o),l.setAttribute("stroke-width",this.params.strokeWidth),l.setAttribute("stroke",o),l}},{key:"showTooltip",value:function(t){var e,i,s=this.params.tooltipStyleString,n=this.params.tooltipClassName,o=document.createElement("div"),s=(o.setAttribute("style",s),o.setAttribute("class",n),this.params.callbacks.tooltipHtml);s&&(n=s(t),t=(s=this.positionList[t])[2]+s[3],e=s[0],s=s[3]>this.cWidth/5,i=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop,t+=(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft)+this.element.getBoundingClientRect().left,e+=i+this.element.getBoundingClientRect().top,o.innerHTML=n,o.style.top=e+"px",o.style.left=t+"px",o.style.pointerEvents="none",s&&(o.style.transform="translate(-100%, 0)"),this.tooltipElement=o,document.body.appendChild(o))}},{key:"hideTooltip",value:function(t){document.body.removeChild(this.tooltipElement)}},{key:"outlineItem",value:function(t){t=this.trapElementList[t];t&&t.setAttribute("stroke",this.params.outlineColor)}},{key:"cancelOutlineItem",value:function(t){var e=this.trapElementList[t];e&&e.setAttribute("stroke",this.getItemColor(t))}},{key:"registerMouseEvents",value:function(t,e){t.onclick=function(t){1===t.which?this.triggerEvent("leftClick",{index:e,originalEvent:t}):2===t.which&&this.triggerEvent("rightClick",{index:e,originalEvent:t})}.bind(this),t.onmouseover=function(t){this.outlineItem(e),this.params.showTooltip&&this.showTooltip(e)}.bind(this),t.onmouseout=function(t){this.cancelOutlineItem(e),this.params.showTooltip&&this.hideTooltip(e)}.bind(this)}},{key:"triggerEvent",value:function(t,e){t=this.params.events[t];t&&t.call(this,e)}}]),o}()}.call(this,EspoFunnel); //# sourceMappingURL=espo-funnel-chart.js.map