realchart 1.4.7 → 1.4.9

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.
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
- * RealChart Pictogram v1.4.7
3
+ * RealChart Pictogram v1.4.9
4
4
  * Copyright (C) 2023-2025 WooriTech Inc.
5
5
  * All Rights Reserved.
6
6
  */
7
- !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}(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!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,-t.yLen-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,t.yLen-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._yBase>0;if(this._info={inverted:this._inverted,reversed:this._reversed,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(t).setVis(!0):this._hoverFigureView&&this._hoverFigureView.setVis(!1)},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)},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._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})}));
7
+ !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}(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!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})}));
@@ -492,6 +492,9 @@
492
492
  .rct-polar-yaxis-line {
493
493
  stroke: #afafaf;
494
494
  }
495
+ .rct-polar-yaxis-baseline {
496
+ stroke: #afafaf;
497
+ }
495
498
  .rct-root .rct-polar-yaxis-grid-line {
496
499
  stroke: #cacaca;
497
500
  }
@@ -510,6 +513,15 @@
510
513
  .rct-root[data-theme='real'] .rct-polar-axis-labels {
511
514
  fill: #f0d9be;
512
515
  }
516
+ .rct-root .rct-polar-yaxis-label {
517
+ font-size: 0.9em;
518
+ }
519
+ .rct-root[data-theme='dark'] .rct-polar-yaxis-label {
520
+ font-size: 0.9em;
521
+ }
522
+ .rct-root[data-theme='real'] .rct-polar-yaxis-label {
523
+ font-size: 0.9em;
524
+ }
513
525
  .rct-root .rct-series[data-index="0"] {
514
526
  fill: #0098ff;
515
527
  stroke: #0098ff;
@@ -1493,12 +1505,84 @@
1493
1505
  filter: brightness(115%) !important;
1494
1506
  opacity: 1 !important;
1495
1507
  }
1496
- .rct-series-trendline {
1508
+ .rct-root .rct-series-trendline {
1509
+ stroke: #ff0000;
1510
+ stroke-width: 2px;
1511
+ stroke-linejoin: round;
1512
+ fill: none;
1513
+ }
1514
+ .rct-root[data-theme='dark'] .rct-series-trendline {
1497
1515
  stroke: #ff0000;
1498
1516
  stroke-width: 2px;
1499
1517
  stroke-linejoin: round;
1500
1518
  fill: none;
1501
1519
  }
1520
+ .rct-root[data-theme='real'] .rct-series-trendline {
1521
+ stroke: #ff0000;
1522
+ stroke-width: 2px;
1523
+ stroke-linejoin: round;
1524
+ fill: none;
1525
+ }
1526
+ .rct-root .rct-series-trendline-marker {
1527
+ stroke: #555;
1528
+ stroke-width: 2px;
1529
+ fill: white;
1530
+ }
1531
+ .rct-root[data-theme='dark'] .rct-series-trendline-marker {
1532
+ stroke: #555;
1533
+ stroke-width: 2px;
1534
+ fill: white;
1535
+ }
1536
+ .rct-root[data-theme='real'] .rct-series-trendline-marker {
1537
+ stroke: #555;
1538
+ stroke-width: 2px;
1539
+ fill: white;
1540
+ }
1541
+ .rct-root .rct-series-trendline-fixed {
1542
+ stroke: none;
1543
+ fill: #000000;
1544
+ fill-opacity: 0.2;
1545
+ }
1546
+ .rct-root[data-theme='dark'] .rct-series-trendline-fixed {
1547
+ stroke: none;
1548
+ fill: #000000;
1549
+ fill-opacity: 0.2;
1550
+ }
1551
+ .rct-root[data-theme='real'] .rct-series-trendline-fixed {
1552
+ stroke: none;
1553
+ fill: #000000;
1554
+ fill-opacity: 0.2;
1555
+ }
1556
+ .rct-root .rct-series-trendline-variable {
1557
+ stroke: none;
1558
+ fill: #00ff00;
1559
+ fill-opacity: 0.2;
1560
+ }
1561
+ .rct-root[data-theme='dark'] .rct-series-trendline-variable {
1562
+ stroke: none;
1563
+ fill: #00ff00;
1564
+ fill-opacity: 0.2;
1565
+ }
1566
+ .rct-root[data-theme='real'] .rct-series-trendline-variable {
1567
+ stroke: none;
1568
+ fill: #00ff00;
1569
+ fill-opacity: 0.2;
1570
+ }
1571
+ .rct-root .rct-series-trendline-label {
1572
+ font-family: monospace;
1573
+ font-size: 13px;
1574
+ fill: #111;
1575
+ }
1576
+ .rct-root[data-theme='dark'] .rct-series-trendline-label {
1577
+ font-family: monospace;
1578
+ font-size: 13px;
1579
+ fill: #111;
1580
+ }
1581
+ .rct-root[data-theme='real'] .rct-series-trendline-label {
1582
+ font-family: monospace;
1583
+ font-size: 13px;
1584
+ fill: #111;
1585
+ }
1502
1586
  .rct-point-unhover {
1503
1587
  opacity: 0.3;
1504
1588
  transition: opacity 0.7s;
package/ie/split.ie.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /**
3
- * RealChart Split v1.4.7
3
+ * RealChart Split v1.4.9
4
4
  * Copyright (C) 2023-2025 WooriTech Inc.
5
5
  * All Rights Reserved.
6
6
  */
package/ie/treemap.ie.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /**
3
- * RealChart Treemap v1.4.7
3
+ * RealChart Treemap v1.4.9
4
4
  * Copyright (C) 2023-2025 WooriTech Inc.
5
5
  * All Rights Reserved.
6
6
  */
package/ie/vector.ie.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /**
3
- * RealChart Vector v1.4.7
3
+ * RealChart Vector v1.4.9
4
4
  * Copyright (C) 2023-2025 WooriTech Inc.
5
5
  * All Rights Reserved.
6
6
  */
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
- * RealChart Wordcloud v1.4.7
3
+ * RealChart Wordcloud v1.4.9
4
4
  * Copyright (C) 2023-2025 WooriTech Inc.
5
5
  * All Rights Reserved.
6
6
  */
7
- !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).RealChartWordCloud={},t.RealChart)}(this,(function(t,e){"use strict";function n(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var i,r=n(e),o=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(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 n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(e.WidgetSeriesPoint),s=function(t){function e(e,n){var i=t.call(this,e)||this;return i.points=n,i}return o(e,t),e}(a),h=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return o(n,t),n.prototype.$_denormalizeFontSize=function(t,i,r){var o,a;return"min"==t?(o=e.calcPercent(e.parsePercentSize(n.MinFontSize,!1),i),a=e.calcPercent(e.parsePercentSize(n.MaxMinFontSize,!1),i)):(o=e.calcPercent(e.parsePercentSize(n.MinMaxFontSize,!1),i),a=e.calcPercent(e.parsePercentSize(n.MaxFontSize,!1),i)),r>1?a:r<0?o:r*(a-o)+o},n.prototype.calcFontRatio=function(t,n,i,r){return e.calcPercent(n,i,r)},n.prototype.getMinFontSize=function(t,i){var r=this._minFontSizeDim,o=r.fixed,a=r.size,s=o&&a<=1?this.$_denormalizeFontSize("min",t,a):e.calcPercent(this._minFontSizeDim,t,i);return Math.max(e.calcPercent(e.parsePercentSize(n.MinFontSize,!1),t),s)},n.prototype.getMaxFontSize=function(t,i){var r=this._maxFontSizeDim,o=r.fixed,a=r.size,s=o&&a<=1?this.$_denormalizeFontSize("max",t,a):e.calcPercent(this._maxFontSizeDim,t,i);return Math.min(e.calcPercent(e.parsePercentSize(n.MaxFontSize,!1),t),s)},n.prototype.getLogFunc=function(){var t=this._op.logBase;return t>=2?function(e){return Math.max(Math.log(e)/Math.log(t))}:function(t){return t}},n.prototype._colorByPoint=function(){return this._op.colorByPoint},n.prototype._createPoint=function(t){return new a(t)},n.prototype._createOthersPoint=function(t,e){return t.y=e.map((function(t){return t.y})).reduce((function(t,e){return t+e})),new s(t,e)},n.prototype._doApply=function(n){var i;t.prototype._doApply.call(this,n),(n.text!==this._text||e.Utils.equalArrays(this._excludes,n.excludes))&&(this._text=n.text,this._excludes=null===(i=n.excludes)||void 0===i?void 0:i.slice(),this._dataSourceDirty=!0),this._setDims(n,"minFontSize","maxFontSize")},n.prototype._doLoadPoints=function(n){var i=this._op,r=i.text,o=[];if(r){var a=Math.max(i.minLength||1,1),s={},h=i.excludes,c=r.split(/\s+/g);for(var u in Array.isArray(h)&&h.length>0&&(c=c.filter((function(t){return h.indexOf(t)<0}))),c.forEach((function(t){t.length>=a&&(t in s?s[t]++:s[t]=1)})),s)o.push({x:u,y:s[u]})}else if(Array.isArray(n)&&!(n.length>0&&"object"==typeof n[0]&&null!==n[0]))for(var l=0;l<n.length;l+=2)o.push({x:e.toStr(n[l]),y:n[l+1]||0});o.length>0&&(n=o.sort((function(t,e){return e.y-t.y}))),t.prototype._doLoadPoints.call(this,n)},n.prototype.isPointLabelVisible=function(t){return!1},n.prototype._prepareRender=function(){t.prototype._prepareRender.call(this),this.collectValues(null,null),this.prepareReferents(null),this.collectRanges(null)},n.type=e.WordCloudSeriesType,n.MinFontSize=8,n.MaxMinFontSize=15,n.MaxFontSize="15%",n.MinMaxFontSize="5%",n.defaults=e.extend(e.WidgetSeries.defaults,{frame:"rectangle",maxCount:100,maxFontSize:1,minFontSize:0,colorByPoint:!0,autoScale:!0,drawTimeout:2e4}),n}(e.WidgetSeries),c=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),u=Math.floor,l=function(){function t(t){this._options=t}return t.prototype.start=function(t,n,i,r,o,a){var s=this;this._container=t;var h="circle"===i.frame||"ellipse"===i.frame,c=i.autoScale,u=e.pickNum(i.seed,0)*Math.PI*2/360,l=Math.max(0,e.pickNum(i.wordGap,0)),p=r,f=0,_=o,d=0,y=0;this._prepare(i,r,o),this._unit,this._startTime=Date.now(),n.forEach((function(t){var e=t.point;if(s._findPos(t,h,i.shuffle,s._radius,u,l)){var n=t.box.bounds,r=n.x,o=n.y,a=n.width,c=n.height;s.$_placeWord(t),e.xPos=r+a/2,e.yPos=o,p=Math.min(p,r),f=Math.max(f,r+a),_=Math.min(_,o),d=Math.max(d,o+c),y++}else t.setVis(!1)})),e.Utils.log("Words placed.",y,"of",n.length);var x=f-p,m=d-_,g=r/2,M=o/2,v=c?1/(Math.max(x/r,m/o)+.02):1,w=~~((p+x/2-g)*v),P=~~((_+m/2-M)*v);return this._trans={x:w,y:P,cx:g,cy:M,rate:v},n.forEach((function(t){var e=t.point;e.xPos=g-w+(e.xPos-g)*v,e.yPos=M-P+(e.yPos-M)*v})),this.$_transform(),null==a||a(n),this},t.prototype.stop=function(){},t.prototype.$_transform=function(t){void 0===t&&(t=1);var n=this._trans,i=n.x,r=n.y,o=n.cx,a=n.cy,s=n.rate;if(i=~~(i*t),r=~~(r*t),e.isIE){var h=s*t,c=o*(1-h),u=a*(1-h);this._container.trans(-i+c,-r+u),this._container.scale(h)}else this._container.dom.setAttribute("transform-origin","".concat(o," ").concat(a)),this._container.trans(-i,-r),this._container.scale(s*t)},t.prototype._prepare=function(t,e,n){var i=this._unit=8;this._grid=[],this._cols=u(e/i),this._rows=u(n/i),this._radius=u(Math.sqrt(this._cols*this._cols+this._rows*this._rows)/2);var r=2*this._radius;this._center={c:this._radius,r:this._radius};for(var o=0;o<r;o++)this._grid.push([]);this._rdPoints=[],this._ellipticity="ellipse"===t.frame||"rectangle"===t.frame?n/e:1},t.prototype._isOverlapping=function(t){for(var e=this._grid,n=t.r1;n<=t.r2;n++)for(var i=t.c1;i<=t.c2;i++)if(e[n]||(e[n]=[]),e[n][i])return!0;return!1},t.prototype.$_placeWord=function(t){for(var e=this._grid,n=t.box,i=n.r1;i<=n.r2;i++)for(var r=n.c1;r<=n.c2;r++)e[i][r]=t},t.prototype._getPoints=function(t,e,n){if(this._rdPoints[t])return this._rdPoints[t];var i=this._center,r=this._ellipticity,o=Math.min(t*this._unit,64),a=0,s=[];for(0===t&&s.push([i.c,i.r]);a<o;){var h=a/o*2*Math.PI+n,c=t*Math.cos(h)/r,u=t*Math.sin(h);if(!e){var l=Math.max(Math.abs(Math.cos(h)),Math.abs(Math.sin(h)));c/=l,u/=l}s.push([~~(i.c+c),~~(i.r+u)]),a++}return this._rdPoints[t]=s},t.prototype._rotatePoint=function(t,e,n){var i=e*Math.PI/180,r=Math.cos(i),o=Math.sin(i),a=t.x,s=t.y,h=t.width,c=t.height,u=a+h,l=s+c,p=a+h/2,f=s+c/2,_=[{x:a,y:s},{x:u,y:s},{x:a,y:l},{x:u,y:l}].map((function(t){return{x:p+(t.x-p)*r-(t.y-f)*o,y:f+(t.x-p)*o+(t.y-f)*r}})),d=Math.min.apply(Math,_.map((function(t){return t.x}))),y=Math.min.apply(Math,_.map((function(t){return t.y}))),x=Math.max.apply(Math,_.map((function(t){return t.x}))),m=Math.max.apply(Math,_.map((function(t){return t.y}))),g=this._unit,M=x-d,v=m-y;return{c1:Math.max(0,~~(d/g)),r1:Math.max(0,~~(y/g)),c2:~~(x/g),r2:~~(m/g)+n,bounds:{x:d,y:y,width:M,height:v}}},t.prototype._getBox=function(t,e,n,i,r){void 0===r&&(r=0);var o=this._unit,a=t.getBBox().width,s=t.hText,h=a/o,c=s/o,u=Math.ceil(h/2),l=Math.ceil(c/2),p=Math.max(0,e-u),f=Math.max(0,n-l),_=p+Math.ceil(h),d=f+Math.ceil(c),y={x:(e-u)*o,y:(n-l)*o,width:a,height:s};return r?this._rotatePoint(y,r,i):{c1:p,r1:f,c2:_+i,r2:d,bounds:y}},t.prototype.$_drawDebugBox=function(t,n){var i=this._container.doc,r=t.bounds,o=r.x,a=r.y,s=r.width,h=r.height,c=e.RectElement.create(i,"",o,a,s,h);c.setFill((null==n?void 0:n.fill)||"#ff000055"),c.setStroke((null==n?void 0:n.stroke)||"none"),c.setAttr("stroke-dasharray",(null==n?void 0:n.strokeDashArray)||"4"),this._container.add(c)},t.prototype._findPos=function(t,n,i,r,o,a){var s=this,h=0,c=0;r=Math.max(r,this._grid.length+1);for(var u=[0,-90],l=u.length;h<r;){var p=Date.now()-this._startTime;if(p>e.pickNum(this._options.drawTimeout,5e3))throw new Error("단어배치 시간이 ".concat(p," ms 경과하여 중단합니다."));var f=this._getPoints(h,n,o+c++%4*(Math.PI/4));if(i&&e.Utils.shuffle(f),f.some((function(n,i){var r=s._options.rotation?u[~~(e.Utils.randomLike(i+o)*l)]:0,h=s._getBox(t,n[0],n[1],a,r);if(!s._isOverlapping(h)){if(h.bounds.x<0||h.bounds.y<0)return!1;var c=s._getBox(t,n[0],n[1],a).bounds,p={x:c.width/2,y:c.height/2};return t.wx=c.x,t.wy=c.y,t.setRotation(p.x,p.y,r),t.box=h,!0}})))return!0;h++}},t}(),p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype._findPos=function(t,e,n,i,r,o){var a=this;if(this._getPoints(i,e,n?Math.random()*Math.PI*2:r).some((function(e){var n=a._getBox(t,e[0],e[1],o);if(!a._isOverlapping(n))return t.box=n,!0})))return!0},e.prototype._getPoints=function(t,e,n){var i=this._center,r=this._ellipticity,o=2*t*this._unit,a=-1,s=[];0===t&&s.push([i.c,i.r]);var h=n>Math.PI?1:-1;if(e)for(;++a<o;){var c=a/o,u=n+a*c*h,l=t*c;f=l*Math.cos(u)/r,p=l*Math.sin(u),_=i.c+f,d=i.r+p;s.push([~~_,~~d])}else for(var p,f=(p=this._unit>>1)/r,_=i.c+f*Math.cos(n),d=i.r+p*Math.sin(n),y=Math.max(1,this._unit>>1),x=y-Math.max(1,y>>1);++a>=0;){switch(f=(p=1+x*Math.pow(.99,a))/r,3&(h*Math.sqrt(1+8*a)-1)/2){case 0:_+=f;break;case 1:d+=p;break;case 2:_-=f;break;default:d-=p}if(Math.max(Math.abs(_-t),Math.abs(d-t))>t)break;s.push([~~_,~~d])}return s},e.prototype._getBox=function(t,e,n,i){var r=this._unit,o=t.getBBox(),a=t.hText,s=Math.min(2*this._radius,Math.max(0,e-u(o.width/2/r))),h=Math.min(2*this._radius,Math.max(0,n-u(a/2/r)));return{c1:s,r1:h,c2:s+u(o.width/r)+i,r2:h+u(a/r),w:t.width,h:a}},e}(l),f=function(t){function n(n){var i=t.call(this,n,e.SeriesView.POINT_CLASS)||this;return i.add(i.hintView=new e.RectElement(n)),i.hintView.setStyles({stroke:"none",fill:"transparent"}),i.add(i.textView=new e.TextElement(n)),i.textView.setStyle("pointerEvents","none"),i}return c(n,t),n.prototype.getBBox=function(){return this._bbox?this._bbox:this._bbox=this.textView.getBBox()},n.prototype.layout=function(){var t=this.getBBox();this.hintView.setRect({x:0,y:this.yText*n.TOP_PAD,width:t.width,height:this.hText-this.yText}),this.textView.transY(-this.yText*n.TOP_PAD)},n.TOP_PAD=.5,n}(e.RcElement),_=function(t){function n(n){var i=t.call(this,n,"rct-wordcloud-series")||this;return i._pointContainer.add(i._wordContainer=new e.LayerElement(n,null)),i._words=new e.ElementPool(i._wordContainer,f),i}return c(n,t),n.prototype._getPointPool=function(){return this._words},n.prototype.needFronting=function(){return!1},n.prototype.getClipContainer=function(){return null},n.prototype.isEmptyView=function(){return this._empty},n.prototype._refreshZombie=function(){},n.prototype._renderSeries=function(t,n){var i=this,r=this.model.options,o=r.text;if(t!==this._wSave||n!==this._hSave||o!==this._tSave){var a=+new Date,s=this._visPoints.slice();if(r.minWeight>0&&(s=s.filter((function(t){return t.yValue>=r.minWeight}))),r.minLength>1&&(s=s.filter((function(t){return t.x.length>=r.minLength}))),r.maxCount<s.length&&(s.length=Math.max(0,r.maxCount)),this.$_prepareWords(this.doc,this.model,s),"spiral"===r.placer)this._placer=new p(r).start(this._wordContainer,this._words._internalItems(),r,t,n,(function(e){i.$_layoutWords(t,n)}));else this._placer=new l(r).start(this._wordContainer,this._words._internalItems(),r,t,n,(function(e){i.$_layoutWords(t,n)}));this._wSave=t,this._hSave=n,this._tSave=o,this._empty=s.length<1,e.Utils.log(s.length+" words placed in "+(+new Date-a)+"ms.")}else this.$_layoutWords(t,n)},n.prototype._runShowEffect=function(t){t&&e.SeriesAnimation.spread(this,(function(){}))},n.prototype._doPosRateChanged=function(t){this.$_layoutWords(this.width,this.height)},n.prototype.$_prepareWords=function(t,n,i){var r,o=this,a=n._minY,s=n._maxY,h=s-a,c=this.height,u=n.getMaxFontSize(c,1),l=Math.min(u,n.getMinFontSize(c,0)),p=a===s||l===u,_=p?NaN:n.options.logBase,d=getComputedStyle(this._wordContainer.dom).fontFamily,y=Math.min(2,Math.max(.1,+n.options.textHeight)),x=isNaN(y)?t.createElement("canvas").getContext("2d"):null,m=1-f.TOP_PAD;this._words.prepare(i.length,(function(s,c){var f=s.point=i[c],g=s.textView;s._bbox=null;var M=(f.y-a)/h;_>1&&(M=1-(Math.pow(_,1-M)-1)/(_-1));var v=l+(p?(u-l)/2:M*(u-l)),w=f.x;o._preparePoint(t,n,f,s),delete s.box,g.text=w,g.anchor=e.TextAnchor.START,g.setStyles({fontSize:e.pixel(v)}),g.layoutText(),x?(x.font="".concat(e.pixel(v)," ").concat(d),r=x.measureText(w),s.yText=.9*Math.max(0,r.fontBoundingBoxAscent-r.actualBoundingBoxAscent),s.hText=Math.ceil((r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)*(v<=10?1.1:1.08)-.1)+s.yText*m):(s.yText=0,s.hText=s.getBBox().height*y),s.layout(),s.setVis(!0)}))},n.prototype.$_layoutWords=function(t,e){var n,i=this._getPosRate();null===(n=this._placer)||void 0===n||n.$_transform(i),i=1-i,this._words.forEach((function(n){var r=n.box.bounds,o=r.width,a=r.height,s=(t-o)/2,h=(e-a)/2;n.trans(n.wx-(n.wx-s)*i,n.wy-(n.wy-h)*i)}))},n}(e.WidgetSeriesView);function d(t){(function(t){return t.Series&&t.SeriesView})(t)&&(t.Series.register(h),t.SeriesView.register([h,_]))}d(r),t.WordCloudSeries=h,t.default=d,Object.defineProperty(t,"__esModule",{value:!0})}));
7
+ !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).RealChartWordCloud={},t.RealChart)}(this,(function(t,e){"use strict";function n(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var i,r=n(e),o=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(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 n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(e.WidgetSeriesPoint),s=function(t){function e(e,n){var i=t.call(this,e)||this;return i.points=n,i}return o(e,t),e}(a),h=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return o(n,t),n.prototype.$_denormalizeFontSize=function(t,i,r){var o,a;return"min"==t?(o=e.calcPercent(e.parsePercentSize(n.MinFontSize,!1),i),a=e.calcPercent(e.parsePercentSize(n.MaxMinFontSize,!1),i)):(o=e.calcPercent(e.parsePercentSize(n.MinMaxFontSize,!1),i),a=e.calcPercent(e.parsePercentSize(n.MaxFontSize,!1),i)),r>1?a:r<0?o:r*(a-o)+o},n.prototype.calcFontRatio=function(t,n,i,r){return e.calcPercent(n,i,r)},n.prototype.getMinFontSize=function(t,i){var r=this._minFontSizeDim,o=r.fixed,a=r.size,s=o&&a<=1?this.$_denormalizeFontSize("min",t,a):e.calcPercent(this._minFontSizeDim,t,i);return Math.max(e.calcPercent(e.parsePercentSize(n.MinFontSize,!1),t),s)},n.prototype.getMaxFontSize=function(t,i){var r=this._maxFontSizeDim,o=r.fixed,a=r.size,s=o&&a<=1?this.$_denormalizeFontSize("max",t,a):e.calcPercent(this._maxFontSizeDim,t,i);return Math.min(e.calcPercent(e.parsePercentSize(n.MaxFontSize,!1),t),s)},n.prototype.getLogFunc=function(){var t=this._op.logBase;return t>=2?function(e){return Math.max(Math.log(e)/Math.log(t))}:function(t){return t}},n.prototype._colorByPoint=function(){return this._op.colorByPoint},n.prototype._createPoint=function(t){return new a(t)},n.prototype._createOthersPoint=function(t,e){return t.y=e.map((function(t){return t.y})).reduce((function(t,e){return t+e})),new s(t,e)},n.prototype._doApply=function(n){var i;t.prototype._doApply.call(this,n),(n.text!==this._text||e.Utils.equalArrays(this._excludes,n.excludes))&&(this._text=n.text,this._excludes=null===(i=n.excludes)||void 0===i?void 0:i.slice(),this._dataSourceDirty=!0),this._setDims(n,"minFontSize","maxFontSize")},n.prototype._doLoadPoints=function(n){var i=this._op,r=i.text,o=[];if(r){var a=Math.max(i.minLength||1,1),s={},h=i.excludes,c=r.split(/\s+/g);for(var u in Array.isArray(h)&&h.length>0&&(c=c.filter((function(t){return h.indexOf(t)<0}))),c.forEach((function(t){t.length>=a&&(t in s?s[t]++:s[t]=1)})),s)o.push({x:u,y:s[u]})}else if(Array.isArray(n)&&!(n.length>0&&"object"==typeof n[0]&&null!==n[0]))for(var l=0;l<n.length;l+=2)o.push({x:e.toStr(n[l]),y:n[l+1]||0});o.length>0&&(n=o.sort((function(t,e){return e.y-t.y}))),t.prototype._doLoadPoints.call(this,n)},n.prototype.isPointLabelVisible=function(t){return!1},n.prototype._prepareRender=function(){t.prototype._prepareRender.call(this),this.collectValues(null,null),this.prepareReferents(null),this.collectRanges(null,null)},n.type=e.WordCloudSeriesType,n.MinFontSize=8,n.MaxMinFontSize=15,n.MaxFontSize="15%",n.MinMaxFontSize="5%",n.defaults=e.extend(e.WidgetSeries.defaults,{frame:"rectangle",maxCount:100,maxFontSize:1,minFontSize:0,colorByPoint:!0,autoScale:!0,drawTimeout:2e4}),n}(e.WidgetSeries),c=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),u=Math.floor,l=function(){function t(t){this._options=t}return t.prototype.start=function(t,n,i,r,o,a){var s=this;this._container=t;var h="circle"===i.frame||"ellipse"===i.frame,c=i.autoScale,u=e.pickNum(i.seed,0)*Math.PI*2/360,l=Math.max(0,e.pickNum(i.wordGap,0)),p=r,f=0,_=o,d=0,y=0;this._prepare(i,r,o),this._unit,this._startTime=Date.now(),n.forEach((function(t){var e=t.point;if(s._findPos(t,h,i.shuffle,s._radius,u,l)){var n=t.box.bounds,r=n.x,o=n.y,a=n.width,c=n.height;s.$_placeWord(t),e.xPos=r+a/2,e.yPos=o,p=Math.min(p,r),f=Math.max(f,r+a),_=Math.min(_,o),d=Math.max(d,o+c),y++}else t.setVis(!1)})),e.Utils.log("Words placed.",y,"of",n.length);var x=f-p,m=d-_,g=r/2,M=o/2,v=c?1/(Math.max(x/r,m/o)+.02):1,w=~~((p+x/2-g)*v),P=~~((_+m/2-M)*v);return this._trans={x:w,y:P,cx:g,cy:M,rate:v},n.forEach((function(t){var e=t.point;e.xPos=g-w+(e.xPos-g)*v,e.yPos=M-P+(e.yPos-M)*v})),this.$_transform(),null==a||a(n),this},t.prototype.stop=function(){},t.prototype.$_transform=function(t){void 0===t&&(t=1);var n=this._trans,i=n.x,r=n.y,o=n.cx,a=n.cy,s=n.rate;if(i=~~(i*t),r=~~(r*t),e.isIE){var h=s*t,c=o*(1-h),u=a*(1-h);this._container.trans(-i+c,-r+u),this._container.scale(h)}else this._container.dom.setAttribute("transform-origin","".concat(o," ").concat(a)),this._container.trans(-i,-r),this._container.scale(s*t)},t.prototype._prepare=function(t,e,n){var i=this._unit=8;this._grid=[],this._cols=u(e/i),this._rows=u(n/i),this._radius=u(Math.sqrt(this._cols*this._cols+this._rows*this._rows)/2);var r=2*this._radius;this._center={c:this._radius,r:this._radius};for(var o=0;o<r;o++)this._grid.push([]);this._rdPoints=[],this._ellipticity="ellipse"===t.frame||"rectangle"===t.frame?n/e:1},t.prototype._isOverlapping=function(t){for(var e=this._grid,n=t.r1;n<=t.r2;n++)for(var i=t.c1;i<=t.c2;i++)if(e[n]||(e[n]=[]),e[n][i])return!0;return!1},t.prototype.$_placeWord=function(t){for(var e=this._grid,n=t.box,i=n.r1;i<=n.r2;i++)for(var r=n.c1;r<=n.c2;r++)e[i][r]=t},t.prototype._getPoints=function(t,e,n){if(this._rdPoints[t])return this._rdPoints[t];var i=this._center,r=this._ellipticity,o=Math.min(t*this._unit,64),a=0,s=[];for(0===t&&s.push([i.c,i.r]);a<o;){var h=a/o*2*Math.PI+n,c=t*Math.cos(h)/r,u=t*Math.sin(h);if(!e){var l=Math.max(Math.abs(Math.cos(h)),Math.abs(Math.sin(h)));c/=l,u/=l}s.push([~~(i.c+c),~~(i.r+u)]),a++}return this._rdPoints[t]=s},t.prototype._rotatePoint=function(t,e,n){var i=e*Math.PI/180,r=Math.cos(i),o=Math.sin(i),a=t.x,s=t.y,h=t.width,c=t.height,u=a+h,l=s+c,p=a+h/2,f=s+c/2,_=[{x:a,y:s},{x:u,y:s},{x:a,y:l},{x:u,y:l}].map((function(t){return{x:p+(t.x-p)*r-(t.y-f)*o,y:f+(t.x-p)*o+(t.y-f)*r}})),d=Math.min.apply(Math,_.map((function(t){return t.x}))),y=Math.min.apply(Math,_.map((function(t){return t.y}))),x=Math.max.apply(Math,_.map((function(t){return t.x}))),m=Math.max.apply(Math,_.map((function(t){return t.y}))),g=this._unit,M=x-d,v=m-y;return{c1:Math.max(0,~~(d/g)),r1:Math.max(0,~~(y/g)),c2:~~(x/g),r2:~~(m/g)+n,bounds:{x:d,y:y,width:M,height:v}}},t.prototype._getBox=function(t,e,n,i,r){void 0===r&&(r=0);var o=this._unit,a=t.getBBox().width,s=t.hText,h=a/o,c=s/o,u=Math.ceil(h/2),l=Math.ceil(c/2),p=Math.max(0,e-u),f=Math.max(0,n-l),_=p+Math.ceil(h),d=f+Math.ceil(c),y={x:(e-u)*o,y:(n-l)*o,width:a,height:s};return r?this._rotatePoint(y,r,i):{c1:p,r1:f,c2:_+i,r2:d,bounds:y}},t.prototype.$_drawDebugBox=function(t,n){var i=this._container.doc,r=t.bounds,o=r.x,a=r.y,s=r.width,h=r.height,c=e.RectElement.create(i,"",o,a,s,h);c.setFill((null==n?void 0:n.fill)||"#ff000055"),c.setStroke((null==n?void 0:n.stroke)||"none"),c.setAttr("stroke-dasharray",(null==n?void 0:n.strokeDashArray)||"4"),this._container.add(c)},t.prototype._findPos=function(t,n,i,r,o,a){var s=this,h=0,c=0;r=Math.max(r,this._grid.length+1);for(var u=[0,-90],l=u.length;h<r;){var p=Date.now()-this._startTime;if(p>e.pickNum(this._options.drawTimeout,5e3))throw new Error("단어배치 시간이 ".concat(p," ms 경과하여 중단합니다."));var f=this._getPoints(h,n,o+c++%4*(Math.PI/4));if(i&&e.Utils.shuffle(f),f.some((function(n,i){var r=s._options.rotation?u[~~(e.Utils.randomLike(i+o)*l)]:0,h=s._getBox(t,n[0],n[1],a,r);if(!s._isOverlapping(h)){if(h.bounds.x<0||h.bounds.y<0)return!1;var c=s._getBox(t,n[0],n[1],a).bounds,p={x:c.width/2,y:c.height/2};return t.wx=c.x,t.wy=c.y,t.setRotation(p.x,p.y,r),t.box=h,!0}})))return!0;h++}},t}(),p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype._findPos=function(t,e,n,i,r,o){var a=this;if(this._getPoints(i,e,n?Math.random()*Math.PI*2:r).some((function(e){var n=a._getBox(t,e[0],e[1],o);if(!a._isOverlapping(n))return t.box=n,!0})))return!0},e.prototype._getPoints=function(t,e,n){var i=this._center,r=this._ellipticity,o=2*t*this._unit,a=-1,s=[];0===t&&s.push([i.c,i.r]);var h=n>Math.PI?1:-1;if(e)for(;++a<o;){var c=a/o,u=n+a*c*h,l=t*c;f=l*Math.cos(u)/r,p=l*Math.sin(u),_=i.c+f,d=i.r+p;s.push([~~_,~~d])}else for(var p,f=(p=this._unit>>1)/r,_=i.c+f*Math.cos(n),d=i.r+p*Math.sin(n),y=Math.max(1,this._unit>>1),x=y-Math.max(1,y>>1);++a>=0;){switch(f=(p=1+x*Math.pow(.99,a))/r,3&(h*Math.sqrt(1+8*a)-1)/2){case 0:_+=f;break;case 1:d+=p;break;case 2:_-=f;break;default:d-=p}if(Math.max(Math.abs(_-t),Math.abs(d-t))>t)break;s.push([~~_,~~d])}return s},e.prototype._getBox=function(t,e,n,i){var r=this._unit,o=t.getBBox(),a=t.hText,s=Math.min(2*this._radius,Math.max(0,e-u(o.width/2/r))),h=Math.min(2*this._radius,Math.max(0,n-u(a/2/r)));return{c1:s,r1:h,c2:s+u(o.width/r)+i,r2:h+u(a/r),w:t.width,h:a}},e}(l),f=function(t){function n(n){var i=t.call(this,n,e.SeriesView.POINT_CLASS)||this;return i.add(i.hintView=new e.RectElement(n)),i.hintView.setStyles({stroke:"none",fill:"transparent"}),i.add(i.textView=new e.TextElement(n)),i.textView.setStyle("pointerEvents","none"),i}return c(n,t),n.prototype.getBBox=function(){return this._bbox?this._bbox:this._bbox=this.textView.getBBox()},n.prototype.layout=function(){var t=this.getBBox();this.hintView.setRect({x:0,y:this.yText*n.TOP_PAD,width:t.width,height:this.hText-this.yText}),this.textView.transY(-this.yText*n.TOP_PAD)},n.TOP_PAD=.5,n}(e.RcElement),_=function(t){function n(n){var i=t.call(this,n,"rct-wordcloud-series")||this;return i._pointContainer.add(i._wordContainer=new e.LayerElement(n,null)),i._words=new e.ElementPool(i._wordContainer,f),i}return c(n,t),n.prototype._getPointPool=function(){return this._words},n.prototype.needFronting=function(){return!1},n.prototype.getClipContainer=function(){return null},n.prototype.isEmptyView=function(){return this._empty},n.prototype._refreshZombie=function(){},n.prototype._renderSeries=function(t,n){var i=this,r=this.model.options,o=r.text;if(t!==this._wSave||n!==this._hSave||o!==this._tSave){var a=+new Date,s=this._visPoints.slice();if(r.minWeight>0&&(s=s.filter((function(t){return t.yValue>=r.minWeight}))),r.minLength>1&&(s=s.filter((function(t){return t.x.length>=r.minLength}))),r.maxCount<s.length&&(s.length=Math.max(0,r.maxCount)),this.$_prepareWords(this.doc,this.model,s),"spiral"===r.placer)this._placer=new p(r).start(this._wordContainer,this._words._internalItems(),r,t,n,(function(e){i.$_layoutWords(t,n)}));else this._placer=new l(r).start(this._wordContainer,this._words._internalItems(),r,t,n,(function(e){i.$_layoutWords(t,n)}));this._wSave=t,this._hSave=n,this._tSave=o,this._empty=s.length<1,e.Utils.log(s.length+" words placed in "+(+new Date-a)+"ms.")}else this.$_layoutWords(t,n)},n.prototype._runShowEffect=function(t){t&&e.SeriesAnimation.spread(this,(function(){}))},n.prototype._doPosRateChanged=function(t){this.$_layoutWords(this.width,this.height)},n.prototype.$_prepareWords=function(t,n,i){var r,o=this,a=n._minY,s=n._maxY,h=s-a,c=this.height,u=n.getMaxFontSize(c,1),l=Math.min(u,n.getMinFontSize(c,0)),p=a===s||l===u,_=p?NaN:n.options.logBase,d=getComputedStyle(this._wordContainer.dom).fontFamily,y=Math.min(2,Math.max(.1,+n.options.textHeight)),x=isNaN(y)?t.createElement("canvas").getContext("2d"):null,m=1-f.TOP_PAD;this._words.prepare(i.length,(function(s,c){var f=s.point=i[c],g=s.textView;s._bbox=null;var M=(f.y-a)/h;_>1&&(M=1-(Math.pow(_,1-M)-1)/(_-1));var v=l+(p?(u-l)/2:M*(u-l)),w=f.x;o._preparePoint(t,n,f,s),delete s.box,g.text=w,g.anchor=e.TextAnchor.START,g.setStyles({fontSize:e.pixel(v)}),g.layoutText(),x?(x.font="".concat(e.pixel(v)," ").concat(d),r=x.measureText(w),s.yText=.9*Math.max(0,r.fontBoundingBoxAscent-r.actualBoundingBoxAscent),s.hText=Math.ceil((r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)*(v<=10?1.1:1.08)-.1)+s.yText*m):(s.yText=0,s.hText=s.getBBox().height*y),s.layout(),s.setVis(!0)}))},n.prototype.$_layoutWords=function(t,e){var n,i=this._getPosRate();null===(n=this._placer)||void 0===n||n.$_transform(i),i=1-i,this._words.forEach((function(n){var r=n.box.bounds,o=r.width,a=r.height,s=(t-o)/2,h=(e-a)/2;n.trans(n.wx-(n.wx-s)*i,n.wy-(n.wy-h)*i)}))},n}(e.WidgetSeriesView);function d(t){(function(t){return t.Series&&t.SeriesView})(t)&&(t.Series.register(h),t.SeriesView.register([h,_]))}d(r),t.WordCloudSeries=h,t.default=d,Object.defineProperty(t,"__esModule",{value:!0})}));