UNPKG

realchart

Version:

Wooritech charting library

8 lines (6 loc) 26 kB
/** * RealChart Pictogram v1.4.12 * Copyright (C) 2023-2026 WooriTech Inc. * All Rights Reserved. */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("realchart")):"function"==typeof define&&define.amd?define(["exports","realchart"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RealChartPictogram={},t.RealChart)}(this,(function(t,e){"use strict";function i(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(i){if("default"!==i){var r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:function(){return t[i]}})}})),e.default=t,Object.freeze(e)}var r,o=i(e),n=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),s=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return n(i,t),i.prototype._createLegendMarker=function(t,i){return e.RectElement.create(t,e.Series.LEGEND_MARKER,0,0,i,i,2)},i.type=e.PictogramSeriesType,i.defaults=e.extend(e.BasedSeries.defaults,{iconGap:2,integral:!1,integralThreshold:.5}),i}(e.BasedSeries),a=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),l=function(t){function i(i){var r=t.call(this,i,e.SeriesView.POINT_CLASS)||this;return r.add(r._back=new e.RectElement(i)),r._back.setTransparent(!0),r}return a(i,t),i.prototype.preppareIcons=function(t,e,i,r){},i.prototype.layout=function(t,e,i){var r=this.wPoint,o=this.hPoint;e-=r/2,o<0&&(t=t.map((function(t){return-t}))),this._back.setBounds(e,i-o,r,o)},i}(e.RcElement),h=function(t){function i(i){var r=t.call(this,i,"rct-pictogram-series")||this;return r._bars=new e.ElementPool(r._pointContainer,l),r}return a(i,t),i.prototype._getPointPool=function(){return this._bars},i.prototype._preparePoints=function(t,e,i){},i.prototype._layoutPoint=function(t,e,i,r,o,n){},i}(e.BasedSeriesView),u=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),p=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return u(i,t),i.prototype._readObject=function(i,r){t.prototype._readObject.call(this,i,r),this.figure=e.pickProp(i._figureFielder(r),r.figure)},i.prototype._readArray=function(e,i){t.prototype._readArray.call(this,e,i);var r=+e.options.figureField;isNaN(r)||(this.figure=i[r])},i}(e.BarSeriesPoint),c=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return u(i,t),i.prototype.getMode=function(){return this._mode},i.prototype.getFigure=function(){return this._figurePath},i.prototype.getImage=function(t){var e=t.figure;return"number"==typeof e&&(e=this._imageUrls[e]),!e&&this._op.figureByPoint&&(e=this._imageUrls[t.vindex%this._imageUrls.length]),this._imageRoot+(e||this._imageUrls[0])},i.prototype.getFigureWidth=function(t){return e.calcPercent(this._widthDim,t,t)},i.prototype.getFigureGap=function(){return this._figureGap},i.prototype._createPoint=function(t){return new p(t)},i.prototype._createLegendMarker=function(t,i){return e.RectElement.create(t,e.Series.LEGEND_MARKER,0,0,i,i,2)},i.prototype._doApply=function(i){t.prototype._doApply.call(this,i),this._figureFielder=this._createFielder(i.figureField||"figure"),this._figurePath=e.isArray(i.figurePath)?i.figurePath.join(" "):i.figurePath;var r=i.figureImage;e.isArray(r)?this._imageUrls=r.slice(0):e.isString(r)?this._imageUrls=[r]:this._imageUrls=[],this._imageRoot=e.isString(i.figureImageRoot)?i.figureImageRoot:"",this._mode="both"===i.mode||"figure"===i.mode?i.mode:i.figurePath?"both":"figure",this._figureGap=e.pickNum(i.figureGap,0),this._widthDim=e.parsePercentSize(i.figureWidth,!0)},i.type=e.PictorialBarSeriesType,i.defaults=e.extend(e.BarSeriesBase.defaults,{mode:"auto",figureWidth:"100%"}),i}(e.BarSeriesBase),f=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e}(e.WidgetSeriesPoint),y=function(t){function e(e,i){var r=t.call(this,e)||this;return r.points=i,r}return f(e,t),e}(_),d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.getDistance=function(){return isNaN(this._op.distance)?"far"===this._op.align?e.ENDED_DIST:e.OUTSIDE_DIST:this._op.distance||0},e.OUTSIDE_DIST=25,e.ENDED_DIST=10,e}(e.WidgetSeriesLabel),g=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return f(i,t),Object.defineProperty(i.prototype,"paths",{get:function(){return this._paths},enumerable:!1,configurable:!0}),i.prototype.getPictorialSize=function(t,i,r){var o=e.calcPercent(this._sizeDim,1),n=e.minv(i*o/t.width,r*o/t.height);return{width:e.pickNum(e.calcPercent(this._widthDim,i),t.width*n),height:e.pickNum(e.calcPercent(this._heightDim,r),t.height*n)}},Object.defineProperty(i.prototype,"pointLabel",{get:function(){return this._pointLabel},enumerable:!1,configurable:!0}),i.prototype._createLabel=function(t){return new d(t)},i.prototype._createPoint=function(t){return new _(t)},i.prototype._createOthersPoint=function(t,e){return t.y=e.map((function(t){return t.y})).reduce((function(t,e){return t+e})),new y(t,e)},i.prototype.needClip=function(t){return!1},i.prototype.getTotal=function(){var i=t.prototype.getSum.call(this);return Math.max(i,e.calcPercent(this._totalDim,i))},i.prototype.getSum=function(){var i=t.prototype.getSum.call(this),r=e.calcPercent(this._totalDim,i);return Math.max(i,e.pickNum(r,i))},i.prototype._doApply=function(i){t.prototype._doApply.call(this,i),this._paths=e.isArray(i.figure)?i.figure:[i.figure||""],this._setDims(i,"total","width","height"),this._sizeDim=e.parsePercentSize(i.size||"80%",!1)},i.prototype._createLegendMarker=function(t,i){return e.RectElement.create(t,e.Series.LEGEND_MARKER,0,0,i,i,2)},i.type=e.PictorialSeriesType,i.defaults=e.extend(e.WidgetSeries.defaults,{size:"90%",reversed:!1}),i}(e.WidgetSeries),m=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),v=function(t){function i(i){var r=t.call(this,i)||this;return r.add(r._figureLayer=new e.RcElement(i,"")),r._figureLayer.add(r._figureView=new e.PathElement(i,"")),r.add(r._imageLayer=new e.RcElement(i,"")),r._imageLayer.add(r._imageView=new e.ImageElement(i,!1,"")),r._imageView.setAttr("preserveAspectRatio","none"),r.add(r._boxView=new e.PathElement(i,"")),r._figureView.setAttr("vector-effect","non-scaling-stroke"),r}return m(i,t),i.prototype.renderSvg=function(t,e,i,r,o){var n,s=this._figureView;this._imageLayer.setVis(!1),this._figureLayer.setVis(!0),s.scale(1),s.setPath(r),n=s.getBounds(),t.both?s.scale(o/(t.inverted?n.height:n.width)):t.inverted?s.scale(o/n.height,(t.reversed?-1:1)*this.hPoint/n.width):s.scale(o/n.width,(t.reversed?-1:1)*this.hPoint/n.height),this.$_layoutFigure(t,this._figureLayer,this._figureView,e,i)},i.prototype.renderImage=function(t,e,i,r,o){var n=this._imageView;this._figureLayer.setVis(!1),this._imageLayer.setVis(!0),n.url=r,n.width=o,n.height=t.both?void 0:Math.abs(this.hPoint),this.$_layoutFigure(t,this._imageLayer,n,e,i)},i.prototype.$_layoutFigure=function(t,i,r,o,n){var s=r.getBounds(),a=!t.upperClip,l=this.hPoint,h=!1;t.inverted?t.reversed?a?(r.trans(o+s.height/2,n-l),this._dir="left"):l<0?(r.trans(o+s.height/2,-t.yBase-l),this._dir="left"):(r.trans(o-s.height/2,-t.yBase-l),this._dir="right"):a?(r.trans(o-s.height/2,-l),this._dir="right"):l<0?(r.trans(o+s.height/2,-t.yBase-l),this._dir="left"):(r.trans(o-s.height/2,-t.yBase-l),this._dir="right"):t.reversed?a?(r.trans(o+s.width/2,-l),this._dir="bottom"):l<0?(r.trans(o+s.width/2,t.yLen-t.yBase-l),this._dir="bottom"):(r.trans(o-s.width/2,t.yLen-t.yBase-l),this._dir="top"):a?(r.trans(o-s.width/2,n-l),this._dir="top"):l<0?(r.trans(o+s.width/2,t.yLen-t.yBase-l),this._dir="bottom"):(r.trans(o-s.width/2,t.yLen-t.yBase-l),this._dir="top"),a?(r.rotate(t.reversed?180:0),i.removeAttr("clip-path")):(h=this.point.yValue<t.base,t.reversed&&(h=!h),e.Dom.setClipPath(i.dom,h?t.lowerClip:t.upperClip),r.rotate(h?180:0)),this._boxView.setVis(t.both)&&(h||(h=a&&t.reversed),l-=(h?-1:1)*((t.inverted?s.width:s.height)+t.gap),this.$_layoutBox(t,h,o,n,l))},i.prototype.$_layoutBox=function(t,i,r,o,n){this._boxView.setVis(i?n<0:n>0)&&this._boxView.setPath(e.SvgShapes.bar(r-this.wPoint/2,o,this.wPoint,-n,t.rTop,t.rBottom))},i}(e.BoxPointElementEx),w=function(t){function i(e){return t.call(this,e,"rct-pictorialbar-series")||this}return m(i,t),i.prototype._createBarPool=function(t,i){return new e.ElementPool(t,v)},i.prototype._prepareLayoutPoints=function(t,i){var r=this.model,o=this._yBase,n=this._baseVal>r._yAxisObj.axisMin();if(this._info={inverted:this._inverted,reversed:this._yReversed,base:this._baseVal,yBase:o,both:"both"===r.getMode(),gap:r.getFigureGap(),yLen:this._yLen,rTop:+r.options.topRadius||0,rBottom:+r.options.bottomRadius||0,upperClip:"",lowerClip:""},n){if(!this._upperClip){var s=this.doc,a=this.dom.querySelector("defs")||s.createElementNS(e.SVGNS,"defs"),l=e.Utils.uniqueKey()+"-";this.insertDom(a,this._pointContainer.dom),a.appendChild(this._upperClip=e.Dom.createClipRect(s,l+"upper")),a.appendChild(this._lowerClip=e.Dom.createClipRect(s,l+"lower"))}var h=this._upperClip.firstElementChild,u=this._lowerClip.firstElementChild;this._inverted?(e.Dom.setBounds(h,0,-t,i,t-o),e.Dom.setBounds(u,0,-o,i,t)):(e.Dom.setBounds(h,0,0,t,i-o),e.Dom.setBounds(u,0,i-o,t,o)),this._info.upperClip=this._upperClip.id,this._info.lowerClip=this._lowerClip.id}},i.prototype._layoutPoint=function(t,i,r,o,n,s){var a=t.point,l=this.model.getFigure();this._needMask=l&&this._info.both,t.wPoint=n*e.pickNum(a.width,1),t.hPoint=s,t.x=r,l?t.renderSvg(this._info,r,o,l,this._model.getFigureWidth(n)):t.renderImage(this._info,r,o,this._model.getImage(a),this._model.getFigureWidth(n))},i.prototype.setHoverStyle=function(i){if(t.prototype.setHoverStyle.call(this,i),this._needMask){var r=getComputedStyle(i.dom),o="none"!==r.stroke?parseFloat(r.strokeWidth):0;if(this._hoverFigureView.parent.setVis(o>0&&this._info.gap<o)){e.Dom.setImportantStyle(i.dom.style,"stroke-width",e.pixel(o+o/2|0));var n=0;switch(i._dir){case"top":case"right":n=-o/2;break;case"bottom":case"left":n=o/2}this._hoverBoxView.setAttribute("transform","translate(".concat(0,", ").concat(n,")"))}}},i.prototype.focusPointView=function(t,e){e&&this._needMask?this.$_showHoverView(this._hoverPoint=t).setVis(!0):this._hoverFigureView&&(this._hoverFigureView.parent.setVis(!1),this._hoverPoint=null)},i.prototype._renderSeries=function(e,i){t.prototype._renderSeries.call(this,e,i),this._hoverPoint&&this._hoverFigureView&&this._hoverFigureView.parent.visible&&this.$_showHoverView(this._hoverPoint)},i.prototype.$_showHoverView=function(t){var i=this._hoverFigureView;if(!i){var r=this.doc,o=void 0;this.add(new e.RcElement(r,"")).add(i=this._hoverFigureView=new e.RcElement(r,"")),i.parent.dom.style.pointerEvents="none",i.appendDom(o=r.createElementNS(e.SVGNS,"path")),o.style.stroke="none",i.parent.appendDom(o=this._hoverBoxView=r.createElementNS(e.SVGNS,"path")),o.style.stroke="none"}var n=i.dom.firstElementChild,s=this._hoverBoxView;return i.parent.setAttr("clip-path",this._pointContainer.getAttr("clip-path")),i.setAttr("clip-path",t._figureLayer.getAttr("clip-path")),n.setAttribute("d",t._figureView.getAttr("d")),n.style.fill=getComputedStyle(t._figureView.dom).fill,n.setAttribute("transform",t._figureView.getTransform()),e.Dom.setVisible(s,t._boxView.visible)&&(s.setAttribute("d",t._boxView.getAttr("d")),s.style.fill=getComputedStyle(t._boxView.dom).fill),this._inverted&&i.parent.setAttr("transform","rotate(90) translate(".concat(this.height,",").concat(0,") scale(-1, 1)")),i},i}(e.BarSeriesViewBase),P=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return P(e,t),e.prototype.getTooltipPos=function(){return{x:this.point.xPos+this.parent.parent.tx,y:this.point.yPos+this.parent.parent.ty}},e}(e.PointElement),S=function(t){function i(i){var r=t.call(this,i,"rct-pictorial-series")||this,o=e.Utils.uniqueKey()+"-",n=o+"figure",s=o+"clip",a=o+"hover";r._figurelView=i.createElementNS(e.SVGNS,"use"),r._figurelView.setAttribute("href","#".concat(n)),r._figurelView.setAttribute("class","rct-pictorial-series-figure"),r.insertDom(r._figurelView,r._pointContainer.dom);var l=i.createElementNS(e.SVGNS,"defs");r.insertDom(l,r._figurelView),r._sourceView=new e.PathElement(i),r._sourceView.setAttr("vector-effect","non-scaling-stroke"),r._sourceView.dom.id=n,l.appendChild(r._sourceView.dom);var h=i.createElementNS(e.SVGNS,"use"),u=i.createElementNS(e.SVGNS,"clipPath"),p=i.createElementNS(e.SVGNS,"clipPath");return h.setAttribute("href","#".concat(n)),u.appendChild(h),u.id=s,l.appendChild(u),p.appendChild(r._hoverRect=i.createElementNS(e.SVGNS,"path")),p.id=a,l.appendChild(p),r._hoverView=i.createElementNS(e.SVGNS,"use"),r._hoverView.setAttribute("href","#".concat(n)),r._hoverView.setAttribute("clip-path","url(#".concat(a)),r._hoverView.style.stroke="none",r._hoverView.style.fill="none",r.appendDom(r._hoverView),r._pointContainer.add(r._sliceLayer=new e.LayerElement(i,null)),r._pointContainer.setAttr("clip-path","url(#".concat(s,")")),r._slices=new e.ElementPool(r._sliceLayer,b),r.add(r._lineContainer=new e.PointLabelLineContainer(i)),r}return P(i,t),i.prototype._getPointPool=function(){return this._slices},i.prototype.getClipContainer=function(){return null},i.prototype._prepareSeries=function(e,i){t.prototype._prepareSeries.call(this,e,i),this.$_prepareSlices(e,i,this._visPoints),this._lineContainer.prepare(i)},i.prototype._renderSeries=function(t,i){this.$_renderFigure(this._sourceView,this._model,t,i);var r=this._visPoints,o=this.model.getCenter(t,i),n=this._figurelView.getBoundingClientRect(),s=o.x-n.width/2,a=o.y-n.height/2,l="translate(".concat(s,",").concat(a,")");e.Dom.hasFill(this._figurelView)||(this._figurelView.style.fill="transparent"),this._figurelView.setAttribute("transform",l),this._hoverView.setAttribute("transform",l),n.x=s,n.y=a,this.$_layoutSlices(r,n,t,i),this._pointContainer.trans(s,a),this._labelContainer.trans(s,a),this._lineContainer.trans(s,a),this.resize(n.width,n.height),this._rSave=n,this._wSave=t,this._hSave=i},i.prototype._runShowEffect=function(t){var i=this.model.options.reversed;t&&e.SeriesAnimation.reveal(this,{from:"column"===this.model.options.direction?i?"right":"left":i?"top":"bottom",view:this._sliceLayer})},i.prototype._refreshZombie=function(){this.$_layoutSlices(this._visPoints,this._rSave,this._wSave,this._hSave),this._hoverPoint&&!e.Dom.isHidden(this._hoverView)&&this.$_showHoverView(this._hoverPoint)},i.prototype._animationStarted=function(e){t.prototype._animationStarted.call(this,e),this._lineContainer.setVis(this._labelContainer.visible)},i.prototype.setHoverStyle=function(i){t.prototype.setHoverStyle.call(this,i);var r=getComputedStyle(i.dom),o="none"!==r.stroke&&parseFloat(r.strokeWidth)>0;e.Dom.setVisible(this._hoverView,o)&&Object.assign(this._hoverView.style,{stroke:r.stroke,strokeWidth:r.strokeWidth,strokeDasharray:r.strokeDasharray})},i.prototype.focusPointView=function(t,e){this._hoverView.style.display=e?"":"none",e&&this.$_showHoverView(t),this._hoverPoint=e?t:null},i.prototype.$_showHoverView=function(t){this._hoverRect.setAttribute("d",t.getAttr("d"))},i.prototype.$_prepareSlices=function(t,e,i){var r=this;this._slices.prepare(i.length,(function(o,n){var s=o.point=i[n];r._preparePoint(t,e,s,o)}))},i.prototype.$_renderFigure=function(t,i,r,o){var n,s;t.setPath(i.paths),n=t.getBBox(),s=i.getPictorialSize(n,r,o),t.scale(s.width/n.width,s.height/n.height),e.isIE&&this.$_prepareOutline(this._sourceView.dom,r,o,s.width/n.width,s.height/n.height)},i.prototype.$_layoutSlices=function(t,e,i,r){var o=this._model,n=o.pointLabel,s=o.options.reversed;this.$_calcRates(t),this._lineContainer.setStyleOrClass(n.connector.options.style),"column"===o.options.direction?this.$_renderHorz(s,e,r):this.$_renderVert(s,e,i)},i.prototype.$_calcRates=function(t){var i=this._zombie,r=this._zombieRate,o=t.length,n=this.model.getTotal();isNaN(n)&&(n=t.filter((function(t){return(t.visible||t===i)&&!t.isNull})).map((function(t){return t.yValue*(t===i?r:t._isDeleted()?t._vr:1)})).reduce((function(t,e){return t+e}),0)),o>1||o>0&&!i?1==o&&t[0]._isDeleted()||1===o&&t[0]._vr<1?t[0].yRate=1:t.forEach((function(t){var o=e.fixnum(t.yValue*(t===i?r:t._isDeleted()?t._vr:1)/n)||0;t.yRate=o})):1==o&&(t[0].yRate=e.fixnum(r))},i.prototype.$_createLabelInfo=function(t){var e=t.getCTM(),i=e.a,r=e.d,o=t.getBBox();return{dom:t,sx:i,sy:r,wFigure:o.width,hFigure:o.height}},i.prototype.$_renderVert=function(t,i,r){var o,n,s=this,a=this.model,l=i.width,h=i.height,u=this._labelViews(),p=a.pointLabel,c="inside"===a.getLabelPos(p),f=p.getOffset(),_=p.getDistance(),y=p.getAlign(),d=null==u?void 0:u.textAlign(),g=[],m=p.options.opposite,v=this._lineContainer.setVis(p.connector.visible)?this._lineContainer:null,w=new e.PathBuilder,P=a.getCenter(r,h).x-i.x,b=l/2,S=t?0:h,V=u?u.getWidth(0):0,x=g&&!c&&this.$_createLabelInfo(this._sourceView.dom);this._slices.forEach((function(a){var p=a.point;if(a.setVis(!p.isNull)){var L=h*p.yRate;if(t?(a.setPath(e.SvgShapes.rectangle(0,S,l,L)),p.yPos=S+L/2,S+=L):(p.yPos=S-L/2,S-=L,a.setPath(e.SvgShapes.rectangle(0,S,l,L))),p.xPos=b,n=null==v?void 0:v.get(p),u&&(o=u.get(p,0))&&o.visible){if(c){var E=o.isDomAnimating(),C=o.getBBox();!E&&o.layout(d||"center"),null==n||n.setVis(!1),o.trans(p.xPos-C.width/2,p.yPos-C.height/2)}else-1===y?s.$_layoutLabelNearVert(x,a,o,d,m,n,w,l,P,f,_):1==y?s.$_layoutLabelFarVert(x,a,o,d,m,n,w,f,_,V,i,r):s.$_layoutLabelOutVert(x,a,o,d,m,n,w,f,_);o.setContrast(c&&a.dom),g.push(o),o.setPosY(o.ty)}else n&&n.setVis(!1)}}))},i.prototype.$_renderHorz=function(t,i,r){var o,n,s=this,a=this.model,l=i.width,h=i.height,u=this._labelViews(),p=a.pointLabel,c="inside"===a.getLabelPos(p),f=p.getOffset(),_=p.getDistance(),y=p.getAlign(),d=null==u?void 0:u.textAlign(),g=[],m=p.options.opposite,v=this._lineContainer.setVis(p.connector.visible)?this._lineContainer:null,w=new e.PathBuilder,P=a.getCenter(l,r).y-i.y,b=h/2,S=u?u.getWidth(0):0,V=g&&!c&&this.$_createLabelInfo(this._sourceView.dom),x=t?l:0;this._slices.forEach((function(a){var p=a.point;if(a.setVis(!p.isNull)){var L=l*p.yRate;if(t?(p.xPos=x-L/2,x-=L,a.setPath(e.SvgShapes.rectangle(x,0,L,h))):(p.xPos=x+L/2,a.setPath(e.SvgShapes.rectangle(x,0,L,h)),x+=L),p.yPos=b,n=null==v?void 0:v.get(p),u&&(o=u.get(p,0))&&o.visible){if(c){var E=o.isDomAnimating(),C=o.getBBox();!E&&o.layout(d||"center"),o.trans(p.xPos-C.width/2,p.yPos-C.height/2),null==n||n.setVis(!1)}else-1===y?s.$_layoutLabelNearHorz(V,a,o,d,m,n,w,h,P,f,_):1==y?s.$_layoutLabelFarHorz(V,a,o,d,m,n,w,f,_,S,i,r):s.$_layoutLabelOutHorz(V,a,o,d,m,n,w,f,_);o.setContrast(c&&a.dom),g.push(o),o.setPosY(o.ty)}else n&&n.setVis(!1)}}))},i.prototype.$_prepareOutline=function(t,i,r,o,n){var s,a=+new Date,l=this.control.canvasCtx(),h=t.getTotalLength(),u=e.maxv(1,Math.round(h/500));l.setTransform(1,0,0,1,0,0),l.clearRect(0,0,i,r),l.scale(o,n),l.fillStyle="red",l.beginPath(),s=t.getPointAtLength(0),l.moveTo(s.x,s.y);for(var p=0;p<h;p+=u)s=t.getPointAtLength(p),l.lineTo(s.x,s.y);l.closePath(),l.fill(),console.log("canvas",+new Date-a,"ms.")},i.prototype.$_calcLabelPosVert=function(t,e,i){var r=t.dom,o=r.ownerSVGElement.createSVGPoint(),n=t.wFigure,s=t.sx,a=2*(t.sx<0?1:1/t.sx),l=i?0:t.wFigure;if(o.y=e.point.yPos/t.sy,i){for(;l<n;l+=a)if(o.x=l,r.isPointInFill(o))return l>0&&(o.x-=a/2,r.isPointInFill(o)&&(l=o.x)),l*s}else for(;l>=0;l-=a)if(o.x=l,r.isPointInFill(o))return l<n&&(o.x+=a/2,r.isPointInFill(o)&&(l=o.x)),l*s;return t.wFigure*t.sx/2},i.prototype.$_calcLabelPosVertIE=function(t,e,i){var r=this.control.canvasCtx(),o={x:0,y:0},n=t.wFigure,s=t.sx,a=2*(s<0?1:1/s),l=o.y=e.point.yPos,h=i?0:n*s;if(i){for(var u=n*s;h<u;h+=a)if(o.x=h,r.isPointInPath(o.x,l))return h>0&&(o.x-=a/2,r.isPointInPath(o.x,l)&&(h=o.x)),h}else for(;h>=0;h-=a)if(o.x=h,r.isPointInPath(h,l))return h<n*s&&(o.x+=a/2,r.isPointInPath(o.x,l)&&(h=o.x)),h;return n/2},i.prototype.$_layoutLabelOutVert=function(t,i,r,o,n,s,a,l,h){var u=i.point,p=r.isDomAnimating(),c=r.getBBox(),f=u.yPos;!p&&r.layout(o||(n?"right":"left"));var _=e.isIE?this.$_calcLabelPosVertIE(t,i,n):this.$_calcLabelPosVert(t,i,n);s&&(n?s.setLine(a.reset(0,0).line(-h,0).end()):s.setLine(a.reset(0,0).line(h,0).end()),s.trans(_,f)),n?_-=h+l+c.width:_+=h+l,r.trans(_,f-c.height/2)},i.prototype.$_layoutLabelNearVert=function(t,i,r,o,n,s,a,l,h,u,p){var c=i.point,f=r.isDomAnimating(),_=r.getBBox(),y=c.yPos;!f&&r.layout(o||(n?"right":"left"));var d=e.isIE?this.$_calcLabelPosVertIE(t,i,n):this.$_calcLabelPosVert(t,i,n),g=h;n?g-=l/2:g+=l/2,s&&(n?s.setLine(a.reset(0,0).line(g-d-p,0).end()):s.setLine(a.reset(0,0).line(g+p-d,0).end()),s.trans(d,y)),n?g-=u+p+_.width:g+=p+u,r.trans(g,y-_.height/2)},i.prototype.$_layoutLabelFarVert=function(t,i,r,o,n,s,a,l,h,u,p,c){var f=i.point,_=r.isDomAnimating(),y=r.getBBox(),d=f.yPos;!_&&r.layout(o||(n?"right":"left"));var g,m=e.isIE?this.$_calcLabelPosVertIE(t,i,n):this.$_calcLabelPosVert(t,i,n);g=n?h+l+u-p.x:c-p.x-h-u-l,s&&(n?s.setLine(a.reset(0,0).line(g-m-h,0).end()):s.setLine(a.reset(0,0).line(g+h-m,0).end()),s.trans(m,d)),n?g-=l+h+y.width:g+=h+l,r.trans(g,d-y.height/2)},i.prototype.$_calcLabelPosHorz=function(t,e,i){var r=t.dom,o=r.ownerSVGElement.createSVGPoint(),n=t.hFigure,s=t.sy,a=2*(t.sy<0?1:1/t.sy),l=i?t.hFigure:0;if(o.x=e.point.xPos/t.sx,i){for(;l>=0;l-=a)if(o.y=l,r.isPointInFill(o))return l<t.hFigure&&(o.y+=a/2,r.isPointInFill(o)&&(l=o.y)),l*s}else for(;l<n;l+=a)if(o.y=l,r.isPointInFill(o))return l>0&&(o.y-=a/2,r.isPointInFill(o)&&(l=o.y)),l*s;return t.hFigure*t.sy/2},i.prototype.$_calcLabelPosHorzIE=function(t,e,i){var r=this.control.canvasCtx(),o={x:0,y:0},n=t.hFigure,s=t.sy,a=2*(t.sy<0?1:1/t.sy),l=o.x=e.point.xPos,h=i?n*s:0;if(i){for(;h>=0;h-=a)if(o.y=h,r.isPointInPath(l,o.y))return h<n*s&&(o.y+=a/2,r.isPointInPath(l,o.y)&&(h=o.y)),h}else for(;h<n;h+=a)if(o.y=h,r.isPointInPath(l,o.y))return h>0&&(o.y-=a/2,r.isPointInPath(l,o.y)&&(h=o.y)),h;return t.hFigure*t.sy/2},i.prototype.$_layoutLabelOutHorz=function(t,i,r,o,n,s,a,l,h){var u=i.point,p=r.isDomAnimating(),c=r.getBBox(),f=u.xPos;!p&&r.layout(o);var _=e.isIE?this.$_calcLabelPosHorzIE(t,i,n):this.$_calcLabelPosHorz(t,i,n);s&&(n?s.setLine(a.reset(0,0).line(0,h).end()):s.setLine(a.reset(0,0).line(0,-h).end()),s.trans(f,_)),n?_+=h+l:_-=h+l,r.trans(f-c.width/2,n?_:_-c.height)},i.prototype.$_layoutLabelNearHorz=function(t,i,r,o,n,s,a,l,h,u,p){var c=i.point,f=r.isDomAnimating(),_=r.getBBox(),y=c.xPos;!f&&r.layout(o||(n?"right":"left"));var d=e.isIE?this.$_calcLabelPosHorzIE(t,i,n):this.$_calcLabelPosHorz(t,i,n),g=h;n?g+=l/2:g-=l/2,s&&(n?s.setLine(a.reset(0,0).line(0,g+p-d).end()):s.setLine(a.reset(0,0).line(0,g-d-p).end()),s.trans(y,d)),n?g+=p+u:g-=u+p+_.height,r.trans(y-_.width/2,g)},i.prototype.$_layoutLabelFarHorz=function(t,i,r,o,n,s,a,l,h,u,p,c){var f=i.point,_=r.isDomAnimating(),y=r.getBBox(),d=f.xPos;!_&&r.layout(o||(n?"right":"left"));var g,m=e.isIE?this.$_calcLabelPosHorzIE(t,i,n):this.$_calcLabelPosHorz(t,i,n);g=n?c-p.y-h-u-l:h+l+u-p.y,s&&(n?s.setLine(a.reset(0,0).line(0,g+h-m).end()):s.setLine(a.reset(0,0).line(0,g-m-h).end()),s.trans(d,m)),n?g+=h+l:g-=l+h+y.height,r.trans(d-y.width/2,g)},i}(e.WidgetSeriesView);function V(t){(function(t){return t.Series&&t.SeriesView})(t)&&(t.Series.register(s),t.Series.register(c),t.Series.register(g),t.SeriesView.register([s,h]),t.SeriesView.register([c,w]),t.SeriesView.register([g,S]))}V(o),t.PictogramSeries=s,t.PictorialBarSeries=c,t.PictorialSeries=g,t.default=V,Object.defineProperty(t,"__esModule",{value:!0})}));