realchart 1.4.8 → 1.4.10
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.
- package/gauge.d.ts +3 -4
- package/gauge.js +3 -3
- package/gauge.mjs +3 -3
- package/heatmap.js +2 -2
- package/heatmap.mjs +2 -2
- package/ie/gauge.ie.js +3 -3
- package/ie/heatmap.ie.js +2 -2
- package/ie/index.ie.js +3 -3
- package/ie/pictogram.ie.js +3 -3
- package/ie/realchart-style.ie.css +73 -1
- package/ie/split.ie.js +2 -2
- package/ie/treemap.ie.js +2 -2
- package/ie/vector.ie.js +2 -2
- package/ie/wordcloud.ie.js +3 -3
- package/index.d.ts +269 -84
- package/index.js +3 -3
- package/index.mjs +3 -3
- package/package.json +1 -1
- package/pictogram.d.ts +1 -0
- package/pictogram.js +3 -3
- package/pictogram.mjs +3 -3
- package/realchart-style.css +31 -1
- package/split.js +2 -2
- package/split.mjs +2 -2
- package/treemap.js +2 -2
- package/treemap.mjs +2 -2
- package/vector.js +2 -2
- package/vector.mjs +2 -2
- package/wordcloud.js +3 -3
- package/wordcloud.mjs +3 -3
package/ie/pictogram.ie.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* RealChart Pictogram v1.4.
|
|
4
|
-
* Copyright (C) 2023-
|
|
3
|
+
* RealChart Pictogram v1.4.10
|
|
4
|
+
* Copyright (C) 2023-2026 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,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})}));
|
|
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.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})}));
|
|
@@ -1505,12 +1505,84 @@
|
|
|
1505
1505
|
filter: brightness(115%) !important;
|
|
1506
1506
|
opacity: 1 !important;
|
|
1507
1507
|
}
|
|
1508
|
-
.rct-series-trendline {
|
|
1508
|
+
.rct-root .rct-series-trendline {
|
|
1509
1509
|
stroke: #ff0000;
|
|
1510
1510
|
stroke-width: 2px;
|
|
1511
1511
|
stroke-linejoin: round;
|
|
1512
1512
|
fill: none;
|
|
1513
1513
|
}
|
|
1514
|
+
.rct-root[data-theme='dark'] .rct-series-trendline {
|
|
1515
|
+
stroke: #ff0000;
|
|
1516
|
+
stroke-width: 2px;
|
|
1517
|
+
stroke-linejoin: round;
|
|
1518
|
+
fill: none;
|
|
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
|
+
}
|
|
1514
1586
|
.rct-point-unhover {
|
|
1515
1587
|
opacity: 0.3;
|
|
1516
1588
|
transition: opacity 0.7s;
|
package/ie/split.ie.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* RealChart Split v1.4.
|
|
4
|
-
* Copyright (C) 2023-
|
|
3
|
+
* RealChart Split v1.4.10
|
|
4
|
+
* Copyright (C) 2023-2026 WooriTech Inc.
|
|
5
5
|
* All Rights Reserved.
|
|
6
6
|
*/
|
|
7
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).RealChartSplit={},t.RealChart)}(this,(function(t,e){"use strict";function o(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(o){if("default"!==o){var i=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(e,o,i.get?i:{enumerable:!0,get:function(){return t[o]}})}})),e.default=t,Object.freeze(e)}var i,r=o(e),n=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])},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 o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),s=function(){function t(t,e){this.row=t,this.col=e,this._axes=[]}return t.prototype.sort=function(t,e){var o=this,i=e&&!t||!e&&t;this._axes.length>1&&(i?this._axes.sort((function(t,e){var i=t._posValue(),r=e._posValue();return i===r?i<0?e._index-t._index:i>0?t._index-e._index:t.row!==e.row?e.row-t.row:t.row<o.row?e._index-t._index:t._index-e._index:r-i})):this._axes.sort((function(t,e){var i=t._posValue(),r=e._posValue();return i===r?i<0?t._index-e._index:i>0?e._index-t._index:t.col!==e.col?t.col-t.col:t.col<o.col?t._index-e._index:e._index-t._index:i-r})))},t}(),a=function(){function t(t,e){this.chart=t,this.isX=e}return t.prototype.rows=function(){return this._matrix.length},t.prototype.cols=function(){return this._matrix[0].length},t.prototype._prepare=function(t,e,o,i){var r=this;this._doPrepare(t,e,o),this._matrix.forEach((function(t){t.forEach((function(t){return t.sort(r.isX,i)}))}))},t.prototype.get=function(t,e){return this._matrix[t][e]},t.prototype.getRow=function(t){return this._matrix[t]},t.prototype.getColumn=function(t){return this._matrix.map((function(e){return e[t]}))},t.prototype._buildTicks=function(t,e){var o=this.isX;this._matrix.forEach((function(i,r){i.forEach((function(i,r){i._axes.forEach((function(i){!i.isBased()&&(e<2||o)&&i._buildTicks(t[o?i.options.col:i.options.row],e)}))}))})),this._matrix.forEach((function(i,r){i.forEach((function(i,r){i._axes.forEach((function(i){i.isBased()&&(e<2||o)&&i._buildTicks(t[o?i.options.col:i.options.row],e)}))}))}))},t.prototype._calcPoints=function(t,e){var o=this.isX;this._matrix.forEach((function(i){i.forEach((function(i,r){i._axes.forEach((function(i){if(e<2||o){var r=o?i.options.col:i.options.row;i._calcPoints(t[r],e)}}))}))}))},t}(),c=function(t){function e(e){return t.call(this,e,!0)||this}return n(e,t),e.prototype._doPrepare=function(t,e,o){for(var i=this._matrix=new Array(e+1),r=0;r<i.length;r++){i[r]=[];for(var n=0;n<o;n++)i[r].push(new s(r,n))}t.forEach((function(t){var o,r,n=t.options.position,s=t.row;"opposite"===n?(s++,t._runPos=n):s<e-1&&"between"===n?(s++,t._runPos="normal"):t._runPos=n,null===(r=null===(o=i[s])||void 0===o?void 0:o[t.col])||void 0===r||r._axes.push(t)}))},e}(a),h=function(t){function e(e){return t.call(this,e,!1)||this}return n(e,t),e.prototype._doPrepare=function(t,e,o){for(var i=this._matrix=new Array(e),r=0;r<i.length;r++){i[r]=[];for(var n=0;n<=o;n++)i[r].push(new s(r,n))}t.forEach((function(t){var e,r,n=t.options.position,s=t.col;"opposite"===n?(s++,t._runPos=n):t.col<o-1&&"between"===n?(s++,t._runPos="normal"):t._runPos=n,null===(r=null===(e=i[t.row])||void 0===e?void 0:e[s])||void 0===r||r._axes.push(t)}))},e}(a),u=function(){var t=function(e,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])},t(e,o)};return function(e,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function i(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),p=function(t){function o(e){var o=t.call(this,e.chart)||this;return o.pane=e,o}return u(o,t),o.prototype.contains=function(t){return t.col===this.pane.col||t.row===this.pane.row},o.defaults=e.extend(e.Body.defaults,{extended:!0,radius:void 0,centerX:void 0,centerY:void 0}),o}(e.Body),f=function(t){function e(e){var o=t.call(this,e.chart)||this;return o.pane=e,o}return u(e,t),e.prototype._doPrepareRender=function(e){t.prototype._doPrepareRender.call(this,e),this._location="body"},e.prototype._getLegendSources=function(){return this.options.visible?this.chart._getSeries().getLegendSources(this.pane.row,this.pane.col):[]},e}(e.Legend),l=function(t){function e(e,o,i){var r=t.call(this,e)||this;return r.row=o,r.col=i,r}return u(e,t),e.prototype._doInit=function(t){t.body=(this._body=new p(this)).init(),t.legend=(this._legend=new f(this)).init()},Object.defineProperty(e.prototype,"body",{get:function(){return this._body},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"legend",{get:function(){return this._legend},enumerable:!1,configurable:!0}),e.prototype._prepareRender=function(){this._body._prepareRender(),this._legend._prepareRender()},e}(e.ChartItem),_=function(t){function o(e){var o=t.call(this,e)||this;return o._cols=1,o._rows=1,o._paneDic={},o._panes=[],o._xAxes=new c(e),o._yAxes=new h(e),o}return u(o,t),Object.defineProperty(o.prototype,"count",{get:function(){return this._rows*this._cols},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"rowCount",{get:function(){return this._rows},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"colCount",{get:function(){return this._cols},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"paneCount",{get:function(){return this._rows*this._cols},enumerable:!1,configurable:!0}),o.prototype.colSizes=function(){return this._colSizes},o.prototype.rowSizes=function(){return this._rowSizes},o.prototype.getPane=function(t,e){return this._panes[t][e]},o.prototype.getRow=function(t){return this._panes[t]},o.prototype.getColumn=function(t){return this._panes.map((function(e){return e[t]}))},o.prototype.getAxisOf=function(t,e){var o,i,r=this.chart,n=t.body;if(n){var s=n.pane;return e?r._getXAxes().get(t.options.xAxis)||this._xAxes.get(s.row,s.col)._axes[0]||(null===(o=r._getSeries().getPaneSeries(s.row,s.col)[0])||void 0===o?void 0:o._xAxisObj):r._getXAxes().get(t.options.yAxis)||this._yAxes.get(n.pane.row,n.pane.col)._axes[0]||(null===(i=r._getSeries().getPaneSeries(s.row,s.col)[0])||void 0===i?void 0:i._yAxisObj)}},o.prototype.isValidAxis=function(t){return t&&t.row<this._rows&&t.col<this._cols},o.prototype._doLoadProp=function(e,o){return["panes","cols","rows"].indexOf(e)>=0||t.prototype._doLoadProp.call(this,e,o)},o.prototype._doSetSimple=function(o){if(e.isArray(o)&&o.length>0){var i=e.maxv(1,+o[0]),r=e.maxv(1,e.pickNum(+o[1],i));return i>0&&r>0&&(this.$_parsePanes(i,r),this.visible=!0),!0}return t.prototype._doSetSimple.call(this,o)},o.prototype._load=function(o){return t.prototype._load.call(this,o),e.isObject(o)&&(this.$_parsePanes(o.rows,o.cols),this._paneDic=this.$_loadPanes(o.panes)),this},o.prototype._doPrepareRender=function(t){this._panes=this.$_collectPanes(t),this._panes.forEach((function(t){return t.forEach((function(t){return t._prepareRender()}))}))},o.prototype._calcSizes=function(t,o){var i=t.length,r=new Array(i),n=0;if(i>1){var s=o,a=0;for(n=0;n<i;n++){var c=t[n];e.isNumber(c)?s-=r[n]=Math.max(0,Math.min(s,c)):a+=c.size}if(a>0)for(n=0;n<i;n++){c=t[n];e.isNumber(c)||(r[n]=s*c.size/a)}}else r[n]=o;return r},o.prototype.getXLens=function(t){return this._calcSizes(this._colSizes,t)},o.prototype.getYLens=function(t){return this._calcSizes(this._rowSizes,t)},o.prototype.measureAxes=function(t,e,o,i){var r=this.getXLens(o?e:t),n=this.getYLens(o?t:e);this._xAxes._buildTicks(r,i),this._yAxes._buildTicks(n,i),this.$_calcAxesPoints(r,n,i)},o.prototype.$_calcAxesPoints=function(t,e,o){this._xAxes._calcPoints(t,o),this._yAxes._calcPoints(e,o)},o.prototype.completeAxesPoints=function(t,e){this.$_calcAxesPoints(t,e,101)},o.prototype.getBodyAnnotation=function(t){for(var e in this._paneDic){var o=this._paneDic[e].body.getAnnotation(t);if(o)return o}},o.prototype.prepareRender=function(t,e){var o=this.chart.isInverted();this._prepareRender(),this._xAxes._prepare(t,this._rows,this._cols,o),this._yAxes._prepare(e,this._rows,this._cols,o)},o.prototype.$_parseSizes=function(t){return(e.isArray(t)&&t.length>0?t.slice(0):t>0?new Array(t).fill("*"):["*"]).map((function(t){if(e.isString(t)){var o=t.trim();return{size:"*"===o?1:e.pickNum(parseFloat(o),1)}}return e.pickNum(+t,1)}))},o.prototype.$_parsePanes=function(t,e){this._colSizes=this.$_parseSizes(e),this._rowSizes=this.$_parseSizes(t),this._cols=this._colSizes.length,this._rows=this._rowSizes.length},o.prototype.$_loadPanes=function(t){var o=this,i=this.chart,r=this._op.extendBody?i._body._config:void 0,n={};if(t=e.isArray(t)?t:e.isObject(t)?[t]:null,e.isArray(t)&&t.forEach((function(t){var e=+t.row||0,s=+t.col||0;if(s>=0&&s<o._cols&&e>=0&&e<o._rows){var a=new l(i,e,s),c=t;a.init(),!r||t&&t.body&&!1===t.body.extended||(t?(c=Object.assign({},t),t.body?!1!==t.body.extended&&(c.body=Object.assign({},r,t.body)):c.body=r):c={body:r}),a._load(c),n[e+","+s]=a}})),r)for(var s=0;s<this._rows;s++)for(var a=0;a<this._cols;a++){var c=s+","+a;if(!n[c]){var h=new l(i,s,a);h.init(),h._load({body:r}),n[c]=h}}return n},o.prototype.$_collectPanes=function(t){for(var e=[],o=0;o<this._rows;o++){for(var i=[],r=0;r<this._cols;r++){var n=this._paneDic[o+","+r]||new l(t,o,r)._initObject();i.push(n)}e.push(i)}return e},o.defaults=e.extend(e.ChartItem.defaults,{visible:!1,extendBody:!0,gap:0}),o}(e.ChartItem),d=function(){var t=function(e,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])},t(e,o)};return function(e,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function i(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),y=function(t){function o(){var e=null!==t&&t.apply(this,arguments)||this;return e.views=[],e._gap=0,e}return d(o,t),o.prototype.isEmpty=function(){return 0===this.views.length},o.prototype.prepare=function(t,o,i,r){var n=this.views,s=[];for(this.isX=i,r._axes.forEach((function(t){t.checkVisible()&&o.isValidAxis(t)&&s.push(t)}));n.length<s.length;){var a=new e.AxisView(t);this.add(a),n.push(a)}for(;n.length>s.length;)n.pop().remove();if(n.forEach((function(t,e){t.setModel(s[e])})),this.axes=s,this.setVis(n.length>0)){var c=n[0].model;this._gap=c.chart.getAxesGap()}},o.prototype.prepareGuides=function(t,e,o){var i=this,r=this.views,n=this.axes;r.forEach((function(o,r){var s=n[r];e.forEach((function(e){e.forEach((function(e){e.isConnected(s)&&o.setVis(i.visible)&&(o.prepareGuides(t,e.row,e.col,e._guideContainer,e._frontGuideContainer),s._isHorz||(e._axes||(e._axes=[]),e._axes.push(s)))}))}))})),e.forEach((function(e){e.forEach((function(e){e._axes&&(e._gridRowContainer.addAll(t,e._axes),e._axes=[])}))}))},o.prototype.checkHeights=function(t,e,o){return this.views.length>0?this.$_checkHeights(this.views,t,e,o):0},o.prototype.$_checkHeights=function(t,e,o,i){var r=0;return t&&(t.forEach((function(t){r+=t.checkHeight(e,o,i)})),r+=(this.views.length-1)*this._gap),r},o.prototype.checkWidths=function(t,e,o){return this.views.length>0?this.$_checkWidths(this.views,t,e,o):0},o.prototype.$_checkWidths=function(t,e,o,i){var r=0;return t&&(t.forEach((function(t){r+=t.checkWidth(e,o,i)})),r+=(this.views.length-1)*this._gap),r},o.prototype.getScrollView=function(t){for(var e,o=0,i=this.views;o<i.length;o++){var r=i[o];if(null===(e=r._scrollView)||void 0===e?void 0:e.contains(t))return r._scrollView}},o.prototype.setMargins=function(t,e,o,i){this.views.forEach((function(r){return r.setMargins(t,e,o,i)}))},o.prototype._setInverted=function(e){t.prototype._setInverted.call(this,e),this.isHorz=e&&!this.isX||!e&&this.isX},o.prototype._doMeasure=function(t,e,o,i,r){var n=this.axes;if(this.isHorz){var s=0;return this.views.forEach((function(e,a){s+=e.measure(t,n[a],o,i,r).height})),{width:o,height:s}}var a=0;return this.views.forEach((function(e,s){a+=e.measure(t,n[s],o,i,r).width})),{width:a,height:i}},o.prototype._doLayout=function(t){var e=this.views,o=this.width,i=this.height,r=e.length,n=0,s=r-1;if(this.isHorz){for(var a=0,c=void 0;n<r;n++){if((d=e[n]).model._posValue()<1)break;d.trans(0,a),a+=d.mh}for(c=a,a=i;s>=0;s--){if((d=e[s]).model._posValue()>-1)break;a-=d.mh,d.trans(0,a)}for(var h=a-c,u=0,p=n;p<=s;p++)u+=e[p].mh;c+=(h-u)/2;for(p=n;p<=s;p++){(d=e[p]).trans(0,c),c+=d.mh}e.forEach((function(t){t.resize(o,t.mh),t.model._calcPoints(o,999),t.layout()}))}else{for(var f=0,l=void 0;n<r;n++){if((d=e[n]).model._posValue()>-1)break;d.trans(f,0),f+=d.mw}for(l=f,f=o;s>=0;s--){if((d=e[s]).model._posValue()<1)break;f-=d.mw,d.trans(f,0)}var _=f-l;for(u=0,p=n;p<=s;p++)u+=e[p].mw;l+=(_-u)/2;for(p=n;p<=s;p++){var d;(d=e[p]).trans(l,0),l+=d.mw}e.forEach((function(t){t.resize(t.mw,i),t.model._calcPoints(i,999),t.layout()}))}},o}(e.SectionView),g=function(t){function o(e,o){var i=t.call(this,e,"rct-axis-container")||this;return i.isX=o,i.sections=[],i}return d(o,t),o.prototype.prepare=function(t,e,o,i,r){for(var n=this,s=this.isX?o.getRow(i):o.getColumn(i);this.sections.length<s.length;){var a=new y(t);this.add(a),this.sections.push(a)}for(;this.sections.length>s.length;)this.sections.pop().remove();this.sections.forEach((function(o,r){n.isX?(o.row=i,o.col=r):(o.col=i,o.row=r),o.prepare(t,e,n.isX,s[r])})),this._setInverted(r)},o.prototype.prepareGuides=function(t,e,o,i){for(var r=this,n=this.isX?o.getRow(i):o.getColumn(i);this.sections.length<n.length;){var s=new y(t);this.add(s),this.sections.push(s)}for(;this.sections.length>n.length;)this.sections.pop().remove();this.sections.forEach((function(n,s){r.isX?(n.row=i,n.col=s):(n.col=i,n.row=s),n.prepareGuides(t,e,o)}))},o.prototype.checkWidths=function(t,e,o){return this.sections.length>0?this._isHorz?this.sections.reduce((function(i,r){return i+r.checkWidths(t,e,o)}),0):this.sections.reduce((function(i,r){return Math.max(i,r.checkWidths(t,e,o))}),0):0},o.prototype.checkHeights=function(t,e,o){return this.sections.length>0?this._isHorz?this.sections.reduce((function(i,r){return Math.max(i,r.checkHeights(t,e,o))}),0):this.sections.reduce((function(i,r){return i+r.checkHeights(t,e,o)}),0):0},o.prototype._setInverted=function(e){t.prototype._setInverted.call(this,e),this._isHorz=e&&!this.isX||!e&&this.isX},o.prototype._doMeasure=function(t,o,i,r,n){var s=0,a=0;return this._isHorz?this.sections.forEach((function(s){a=e.maxv(a,s.measure(t,o,i,r,n).height)})):this.sections.forEach((function(a){s=e.maxv(s,a.measure(t,o,i,r,n).width)})),{width:s,height:a}},o.prototype._doLayout=function(t){var e=this;this._isHorz?this.height>0&&this.sections.forEach((function(o,i){o.resize(t[2*(i+1)]-t[2*(i+1)-1],e.height),o.trans(t[2*i+1]-t[1],0),o.layout()})):this.width>0&&this.sections.forEach((function(o,i){o.resize(e.width,t[2*(i+1)]-t[2*(i+1)-1]),o.trans(0,e.height-(t[2*(i+1)]-t[1])),o.layout()}))},o}(e.SectionView),v=function(t){function o(o,i){var r=t.call(this,o,i)||this;return r.row=0,r.col=0,r.add(r._legendView=new e.LegendView(o)),r}return d(o,t),o.prototype.getCol=function(){return this.col},o.prototype.getRow=function(){return this.row},o.prototype.getTooltipPos=function(){return{x:this.parent.parent.tx+this.tx,y:this.parent.parent.ty+this.ty}},o.prototype.prepareRender=function(t,o){var i=o.chart,r=o.depth.visible,n=this.row,s=this.col,a=i._split.getPane(n,s).body;this._animatable=e.RcControl._animatable&&i.animatable(),this._prepareSeries(t,o,i._getSeries().getPaneSeries(n,s),r),this._prepareGauges(t,i,i._getGauges().getPaneVisibles(n,s)),this._prepareAnnotations(t,a.getAnnotations().concat(i._getAnnotations().getPaneVisibles(n,s)))},o.prototype._doMeasure=function(e,o,i,r,n){return this._legendView.setVis(o.pane.legend.visible)&&this._legendView.measure(e,o.pane.legend,i,r,n),t.prototype._doMeasure.call(this,e,o,i,r,n)},o.prototype._doLayout=function(){t.prototype._doLayout.call(this);var e=this._legendView;if(e.visible){this._seriesViews.forEach((function(t){if(t.needDecoreateLegend()){var o=e.legendOfSeries(t.model);o&&t.decoreateLegend(o)}}));var o=e.model.options,i=o.align,r=o.verticalAlign,n=0,s=0,a=+o.offsetX||0;switch(i){case"right":n+=this.width-e.mw-a;break;case"center":n+=(this.width-e.mw)/2+a;break;default:n+=a}switch(a=+o.offsetY||0,r){case"bottom":s+=this.height-e.mh-a;break;case"middle":s+=(this.height-e.mh)/2+a;break;default:s+=a}e.trans(n,s).resize(e.mw,e.mh),e.layout()}},o}(e.BodyView),w=function(t){function o(e,i){var r=t.call(this,e,o.STYLE_NAME)||this;return r._bodies=[],r._xContainers=[],r._yContainers=[],r._owner=i,r}return d(o,t),Object.defineProperty(o.prototype,"bodies",{get:function(){return this._bodies},enumerable:!1,configurable:!0}),o.prototype.bodyViewOf=function(t){return this._bodies.find((function(e){return e.contains(t)}))},o.prototype.prepare=function(t,e){e.chart,this.$_init(t),this._model=e,this.$_prepareBodies(t,e)},o.prototype.measure=function(t,e,o,i,r){var n=e.chart,s=this._inverted=e.chart.isInverted(),a=e._xAxes,c=e._yAxes,h=o,u=i;this.$_prepareAxes(t,a,!0,s),this.$_prepareAxes(t,c,!1,s),e.measureAxes(o,i,s,r),s?(o-=this._xContainers.reduce((function(e,r){return e+r.checkWidths(t,o,i)}),0),i-=this._yContainers.reduce((function(e,r){return e+r.checkHeights(t,o,i)}),0)):(i-=this._xContainers.reduce((function(e,r){return e+r.checkHeights(t,o,i)}),0),o-=this._yContainers.reduce((function(e,r){return e+r.checkWidths(t,o,i)}),0)),e.measureAxes(o,i,s,r),this._xContainers.forEach((function(e){return e.measure(t,n,o,i,r)})),this._yContainers.forEach((function(e){return e.measure(t,n,o,i,r)})),o=h,i=u,s?(o-=this._xContainers.reduce((function(t,e){return t+e.mw}),0),i-=this._yContainers.reduce((function(t,e){return t+e.mh}),0)):(i-=this._xContainers.reduce((function(t,e){return t+e.mh}),0),o-=this._yContainers.reduce((function(t,e){return t+e.mw}),0)),r++,e.measureAxes(o,i,s,r),this.$_prepareAxisGuides(t,a,!0),this.$_prepareAxisGuides(t,c,!1),this._xContainers.forEach((function(e){e.measure(t,n,o,i,r)})),this._yContainers.forEach((function(e){e.measure(t,n,o,i,r)}));var p=e.getXLens(s?i:o),f=e.getYLens(s?o:i);e.completeAxesPoints(p,f)},o.prototype.layout=function(){var t=this._model,e=this.width,o=this.height;this._back.resize(e,o),this.$_calcExtents(t,e,o),this.$_layoutAxes(t,!0,e,o),this.$_layoutAxes(t,!1,e,o),this.$_layoutBodies(t,e,o)},o.prototype.seriesByDom=function(t){for(var e=0,o=this._bodies;e<o.length;e++){var i=o[e].seriesByDom(t);if(i)return i}},o.prototype.getSeries=function(t){for(var e=0,o=this.bodies;e<o.length;e++){var i=o[e].findSeries(t);if(i)return i}},o.prototype.legendByDom=function(t){for(var e=0,o=this.bodies;e<o.length;e++){var i=o[e]._legendView.legendByDom(t);if(i)return i}},o.prototype.$_init=function(t){this._back||(this.add(this._back=new e.RectElement(t)),this._back.setStyles({fill:"none"}),this.add(this._bodyContainer=new e.LayerElement(t,void 0)),this.add(this._axisContainer=new e.LayerElement(t,void 0)))},o.prototype.$_prepareBodies=function(t,e){e.chart;for(var o=e.paneCount,i=e.rowCount,r=e.colCount,n=this._bodies,s=this._bodyMap=[];n.length<o;){var a=new v(t,this._owner);this._bodyContainer.add(a),n.push(a)}for(;n.length>o;)n.pop().remove();for(var c=0;c<i;c++){for(var h=[],u=0;u<r;u++){var p=n[c*r+u];h.push(p),p.row=c,p.col=u}s.push(h)}n.forEach((function(o){o.prepareRender(t,e.getPane(o.row,o.col).body),o.prepareGuideContainers(),o._gridRowContainer.prepare()}))},o.prototype.$_prepareAxes=function(t,e,o,i){for(var r=this._model.chart,n=o?this._xContainers:this._yContainers,s=o?e.rows():e.cols();n.length<s;){var a=new g(t,o);this._axisContainer.add(a),n.push(a)}for(;n.length>s;)n.pop().remove();n.forEach((function(o,n){o.prepare(t,r,e,n,i)}))},o.prototype.$_prepareAxisGuides=function(t,e,o){var i=this;(o?this._xContainers:this._yContainers).forEach((function(o,r){o.prepareGuides(t,i._bodyMap,e,r)}))},o.prototype.$_calc=function(t,e,o,i){var r=o.length,n=new Array(2*(r+1)),s=e-t.reduce((function(t,e){return t+e[i]}),0),a=this._model._calcSizes(o,s),c=0,h=0;for(h=0;h<r;h++)n[2*h]=c,n[2*h+1]=c+=t[h][i],c+=a[h];return n[2*h]=c,n[2*h+1]=c+t[h][i],n},o.prototype.$_calcExtents=function(t,e,o){this._inverted?(this._rowPoints=this.$_calc(this._xContainers,e,t.rowSizes(),"mw"),this._colPoints=this.$_calc(this._yContainers,o,t.colSizes(),"mh")):(this._rowPoints=this.$_calc(this._xContainers,o,t.rowSizes(),"mh"),this._colPoints=this.$_calc(this._yContainers,e,t.colSizes(),"mw"))},o.prototype.$_layoutAxes=function(t,e,o,i){var r=this.control._padding,n=this._rowPoints,s=this._colPoints,a=e?this._xContainers:this._yContainers;if(this._inverted)if(e){var c=s[1],h=s[s.length-2]-c;a.forEach((function(t,e){t.resize(t.mw,h),t.trans(n[2*e],i-s[s.length-2]),t.layout(s)}))}else{var u=n[1],p=n[n.length-2]-u;a.forEach((function(t,e){for(var o=t.sections,a=0,c=o.length;a<c;a++){var h=o[a],f=0===a?r.left:0,l=a===c-1?r.right:0,_=0,d=0;c>1&&(_=n[2*a+1]-n[2*a],d=n[2*(a+1)+1]-n[2*(a+1)],0===a?o[a+1].isEmpty()?d=n[2*(a+1)]-n[2*(a+1)-1]:d/=2:a===c-1?o[a-1].isEmpty()?_=n[2*(a-1)]-n[2*(a-1)-1]:_/=2:(o[a-1].isEmpty()?_=n[2*(a-1)]-n[2*(a-1)-1]:_/=2,o[a+1].isEmpty()?d=n[2*(a+1)]-n[2*(a+1)-1]:d/=2)),h.setMargins(f,_,d,l)}t.resize(p,t.mh),t.trans(u,i-s[2*e+1]),t.layout(n)}))}else if(e){var f=s[1];o=s[s.length-2]-f,a.forEach((function(t,e){for(var c=t.sections,h=0,u=c.length;h<u;h++){var p=c[h],l=0===e?r.left:0,_=e===a.length-1?r.right:0,d=0,y=0;u>1&&(d=s[2*h+1]-s[2*h],y=s[2*(h+1)+1]-s[2*(h+1)],0===h?c[h+1].isEmpty()?y=s[2*(h+1)]-s[2*(h+1)-1]:y/=2:h===u-1?c[h-1].isEmpty()?d=s[2*(h-1)]-s[2*(h-1)-1]:d/=2:(c[h-1].isEmpty()?d=s[2*(h-1)]-s[2*(h-1)-1]:d/=2,c[h+1].isEmpty()?y=s[2*(h+1)]-n[2*(h+1)-1]:y/=2)),p.setMargins(l,d,y,_)}t.resize(o,t.mh),t.trans(f,i-n[2*e+1]),t.layout(s)}))}else{var l=n[n.length-2],_=l-n[1];a.forEach((function(t,e){t.resize(t.mw,_),t.trans(s[2*e],i-l),t.layout(n)}))}},o.prototype.$_layoutBodies=function(t,e,o){var i=t.rowCount,r=t.colCount,n=this._rowPoints,s=this._colPoints,a=this._bodies;if(this._inverted)for(var c=0;c<i;c++)for(var h=n[2*(c+1)-1],u=n[2*(c+1)],p=0;p<r;p++){var f=a[c*r+p],l=s[2*p+1],_=s[2*(p+1)];f.measure(this.doc,t.getPane(c,p).body,u-h,_-l,1),f.resize(u-h,_-l),f.trans(h,this.height-_),f.layout()}else for(c=0;c<i;c++)for(l=n[2*(c+1)-1],_=n[2*(c+1)],p=0;p<r;p++){f=a[c*r+p],h=s[2*(p+1)-1],u=s[2*(p+1)];f.measure(this.doc,t.getPane(c,p).body,u-h,_-l,1),f.resize(u-h,_-l),f.trans(h,o-_),f.layout()}},o.STYLE_NAME="rct-panes",o}(e.PaneContainer);function x(t){(function(t){return t.Series&&t.SeriesView})(t)&&(t.ChartObject.registerSplitClass(_),t.ChartView.registerPaneClass(w))}x(r),t.Split=_,t.default=x,Object.defineProperty(t,"__esModule",{value:!0})}));
|
package/ie/treemap.ie.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* RealChart Treemap v1.4.
|
|
4
|
-
* Copyright (C) 2023-
|
|
3
|
+
* RealChart Treemap v1.4.10
|
|
4
|
+
* Copyright (C) 2023-2026 WooriTech Inc.
|
|
5
5
|
* All Rights Reserved.
|
|
6
6
|
*/
|
|
7
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).RealChartTreemap={},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)}),h=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return n(i,t),i.prototype._assignTo=function(i){return e.assignObj(t.prototype._assignTo.call(this,i),{id:this.id,group:this.group})},i.prototype._readArray=function(t,i){if(i.length<=2)this.isNull=!0;else{var r=i.length>3?1:0;r>0&&(this.x=i[e.pickNum(t.options.xField,0)]),this.y=i[e.pickNum(t.options.yField,0+r)],this.id=e.toStr(i[e.pickNum(t.options.idField,1+r)]),this.group=e.toStr(i[e.pickNum(t.options.groupField,2+r)])}},i.prototype._readObject=function(i,r){t.prototype._readObject.call(this,i,r),this.id=e.toStr(r[i.options.idField]),this.group=e.toStr(r[i.options.groupField])},i}(e.DataPoint),s=function(t){function i(e){var i=t.call(this,e.chart)||this;return i.level=e,i.floating=!0,i}return n(i,t),i.defaults=e.extend(e.ChartItem.defaults,{visible:!1}),i}(e.ChartItem);!function(t){function e(e,i){var r=t.call(this,e.chart)||this;return r.series=e,r.level=i,r.head=new s(r),r}n(e,t)}(e.ChartItem);var u=function(){function t(t){this.point=t}return t.prototype.level=function(){return this.parent?this.parent.level()+1:0},t.prototype.getArea=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.setArea=function(t,e,i,r){this.x=t,this.y=e,this.width=i,this.height=r},t.prototype.getTotal=function(){return this.children.reduce((function(t,e){return t+e.value}),0)},t}(),a=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e._map={},e._levels=1,e}return n(i,t),i.prototype.buildMap=function(t,i){function r(t){if(t.children){var i=0;t.children.forEach((function(t,e){r(t),i+=t.value})),t.value=i,t.children=t.children.sort((function(t,e){return e.value-t.value})),t.children.forEach((function(t,e){t.index=e})),h=e.maxv(h,t.level()+1+1)}else n.push(t),t.value=t.point?t.point.yValue:0}var o="vertical"===this._op.startDir||i>t,n=this._leafs=[],h=1;return this._roots.forEach((function(t,e){r(t)})),this._roots=this._roots.sort((function(t,e){return e.value-t.value})),this._roots.forEach((function(t,e){t.index=e})),(this[this._op.algorithm]||this.squarify).call(this,this._roots,t,i,o),this._levels=h,{roots:this._roots,leafs:this._leafs}},i.prototype.needAxes=function(){return!1},i.prototype.canMixWith=function(t){return!1},i.prototype._createPoint=function(t){return new h(t)},i.prototype._getLabeledPoints=function(){return this._leafs.map((function(t){return t.point}))},i.prototype._doPrepareRender=function(){t.prototype._doPrepareRender.call(this),this._roots=this.$_buildTree(this._runPoints)},i.prototype.$_buildTree=function(t){var e=[],i=[],r=this._map;t.forEach((function(t){if(t.id||!t.isNull){var o=new u(t);t.id&&(r[t.id]=o),t.group?i.push(o):e.push(o)}}));for(var o=i.length-1;o>=0;o--){var n=i[o],h=r[n.point.group];(n.parent=h)?(h.children||(h.children=[]),h.children.push(n),n.children&&i.splice(o,1)):(e.push(n),i.splice(o,1))}return e},i.prototype.$_squarifyRow=function(t,i,r,o){var n=i.width*i.height,h=i.width,s=i.height,u=i.x,a=i.y,l=Number.MAX_VALUE,c=0,p=[];if(2===t.length)return(1===r?h>s:h>=s)?t.forEach((function(t){t.setArea(u,a,h*t.value/o,s),u+=t.width})):t.forEach((function(t){t.setArea(u,a,h,s*t.value/o),a+=t.height})),0;for(var f=function(){var f,d,y,_,g=void 0;return f=t.shift(),g=(c+=f.value)*n/o,1===r?(d=g/s,y=s*f.value/c):(y=g/h,d=h*f.value/c),_=e.maxv(d/y,y/d),t.length>0&&_>l?(t.unshift(f),c-=f.value,g=n*c/o,1===r?d=g/(y=s):y=g/(d=h),p.forEach((function(t){1===r?(t.setArea(u,a,d,s*t.value/c),a+=t.height):(t.setArea(u,a,h*t.value/c,y),u+=t.width)})),1===r?(i.x+=d,i.width-=d):(i.y+=y,i.height-=y),{value:o-c}):0===t.length?(g=n*c/o,1===r?d=g/(y=s):y=g/(d=h),p.push(f),p.forEach((function(t){1===r?(t.setArea(u,a,d,s*t.value/c),a+=t.height):(t.setArea(u,a,h*t.value/c,y),u+=t.width)})),{value:0}):(l=_,void p.push(f))};t.length>0;){var d=f();if("object"==typeof d)return d.value}},i.prototype.$_squarify=function(t,e,i,r){var o=this,n=t.slice(0),h=i?1:0,s=t.reduce((function(t,e){return t+e.value}),0);do{s=this.$_squarifyRow(n,e,h,s),r&&(h=1-h)}while(s>0);t.forEach((function(t){t.children&&o.$_squarify(t.children,t.getArea(),!i,!0)}))},i.prototype.squarify=function(t,e,i,r){this.$_squarify(t,{x:0,y:0,width:e,height:i},r,!0)},i.prototype.strip=function(t,e,i,r){this.$_squarify(t,{x:0,y:0,width:e,height:i},r,!1)},i.prototype.$_sliceNext=function(t,e,i,r){if(t.x=e.x,t.y=e.y,1===i){var o=e.height*t.value/r;t.width=e.width,t.height=o,e.y+=o,e.height-=o}else{var n=e.width*t.value/r;t.height=e.height,t.width=n,e.x+=n,e.width-=n}t.children&&this.$_slice(t.children,t.getArea(),0===i,!0)},i.prototype.$_slice=function(t,e,i,r){var o=this,n=t.reduce((function(t,e){return t+e.value}),0),h=i?1:0;t.forEach((function(t){o.$_sliceNext(t,e,h,n),n-=t.value,r&&(h=1-h)}))},i.prototype.slice=function(t,e,i,r){this.$_slice(t,{x:0,y:0,width:e,height:i},r,!1)},i.prototype.sliceDice=function(t,e,i,r){this.$_slice(t,{x:0,y:0,width:e,height:i},r,!0)},i.type=e.TreemapSeriesType,i.defaults=e.extend(e.Series.defaults,{idField:"id",groupField:"group",algorithm:"squarify",alternate:!0,groupMode:!0}),i}(e.Series),l=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)}}(),c=function(t){function i(i){return t.call(this,i,e.SeriesView.POINT_CLASS)||this}return l(i,t),Object.defineProperty(i.prototype,"point",{get:function(){return this.node.point},enumerable:!1,configurable:!0}),i.prototype.render=function(t){if(1!==t){var e=Object.assign({},this.node);e.width*=t,e.height*=t,e.x+=(this.node.width-e.width)/2,e.y+=(this.node.height-e.height)/2,this.setRect(e)}else this.setRect(this.node)},i}(e.RectElement);!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}l(e,t)}(c);var p=function(t){function i(i){var r=t.call(this,i,"rct-treemap-series")||this;return r._nodeViews=new e.ElementPool(r._pointContainer,c),r}return l(i,t),i.prototype._lazyPrepareLabels=function(){return!0},i.prototype._getPointPool=function(){return this._nodeViews},i.prototype._prepareSeries=function(t,e){},i.prototype._renderSeries=function(t,e){this._pointContainer.invert(this._inverted,e),this._rootView?this.$_renderGroups(t,e):this.$_renderLeafs(t,e)},i.prototype._runShowEffect=function(t){t&&e.SeriesAnimation.grow(this)},i.prototype._doViewRateChanged=function(t){this._rootView?this.$_renderGroups(this.width,this.height):this.$_renderLeafs(this.width,this.height)},i.prototype.$_renderLeafs=function(t,i){var r=this,o=this.model,n=o._xAxisObj,h=o._yAxisObj,s=this._inverted;o.pointLabel;var u=this._getGrowRate(),a=this._labelViews(),l=s?t:i,c=s?i:t,p=o.buildMap(c,l);p.roots;var f,d=p.leafs,y=new e.Color(o._calcedColor),_=[{fill:""}];null==a||a.prepare(this.doc,this);var g=this._labelContainer._textAlign;this._nodeViews.prepare(d.length,(function(t,i,p){var v=d[i],w=v.point,x=v.parent,b=y;x&&(!x._color&&x.point.color?b=x._color=new e.Color(x.point.color):x._color&&(b=x._color)),t.node=v,_[0].fill=b.brighten(v.index/p).toString(),r._setPointStyle(t,o,w,_),n.options.reversed&&(v.x=c-v.x-v.width),h.options.reversed&&(v.y=l-v.y-v.height),s&&(v.y=v.y-l),t.render(u);var m=v.x+v.width/2,O=v.y+v.height/2;if(w.xPos=s?-v.y-v.height/2:m,w.yPos=s?c-v.x-v.width/2:O,a&&(f=a.get(w,0))){f.setContrast(t.dom).layout(g);var S=f.getBBox();f.setVis(v.width>=S.height&&v.height>=S.height)&&(s?(m=-v.y-v.height/2-S.width/2,O=c-v.x-(v.width+S.height)/2):(m-=S.width/2,O-=S.height/2),f.trans(m,O),r._layoutLabelRotation(f))}}))},i.prototype.$_renderGroups=function(t,e){},i}(e.SeriesView);function f(t){(function(t){return t.Series&&t.SeriesView})(t)&&(t.Series.register(a),t.SeriesView.register([a,p]))}f(o),t.TreemapSeries=a,t.default=f,Object.defineProperty(t,"__esModule",{value:!0})}));
|
package/ie/vector.ie.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* RealChart Vector v1.4.
|
|
4
|
-
* Copyright (C) 2023-
|
|
3
|
+
* RealChart Vector v1.4.10
|
|
4
|
+
* Copyright (C) 2023-2026 WooriTech Inc.
|
|
5
5
|
* All Rights Reserved.
|
|
6
6
|
*/
|
|
7
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).RealChartVector={},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 o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var o,r=n(e),i=(o=function(t,e){return o=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])},o(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}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return i(n,t),n.prototype._assignTo=function(n){return e.assignObj(t.prototype._assignTo.call(this,n),{length:this.length,angle:this.angle,lengthValue:this.lengthValue,angleValue:this.angleValue})},n.prototype._valuesChangd=function(e){return this.length!==e.length||this.angle!==e.angle||t.prototype._valuesChangd.call(this,e)},n.prototype._readArray=function(t,n){if(n.length<=2)this.isNull=!0;else{var o=n.length>3?1:0;o>0&&(this.x=n[e.pickNum(t.options.xField,0)]),this.y=n[e.pickNum(t.options.yField,0+o)],this.length=n[e.pickNum(t.options.lengthField,1+o)],this.angle=n[e.pickNum(t.options.angleField,2+o)]}},n.prototype._readObject=function(n,o){t.prototype._readObject.call(this,n,o),this.length=e.pickProp(o[n.options.lengthField],o.length),this.angle=e.pickProp(o[n.options.angleField],o.angle),this.y=e.pickProp3(n._yFielder(o),o.y,o.value)},n.prototype._readSingle=function(e){t.prototype._readSingle.call(this,e),this.length=this.angle=this.y},n.prototype.parse=function(e){t.prototype.parse.call(this,e),this.isNull||(this.isNull=isNaN(this.lengthValue)||isNaN(this.angleValue))},n.prototype.initValues=function(){this.lengthValue=parseFloat(this.length),this.angleValue=parseFloat(this.angle)},n.prototype.initPrev=function(t,e){e.yValue=this.yValue,e.lengthValue=.001},n.prototype.applyValueRate=function(t,n){this.lengthValue=e.incv(t.lengthValue,this.lengthValue,n)},n}(e.DataPoint),a=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return i(n,t),n.prototype._createPoint=function(t){return new s(t)},n.prototype._doPrepareRender=function(){t.prototype._doPrepareRender.call(this);var n=this._runPoints;if(n.length>0){var o=this._op.maxLength,r=this._op.origin,i=n.map((function(t){return t.length})).reduce((function(t,n){return e.maxv(t,n)}));n.forEach((function(t){var e=t.length/i;switch(t._len=e*o,r){case"start":t._off=-t._len/2;break;case"end":t._off=t._len/2;break;default:t._off=0}}))}},n.prototype._createLegendMarker=function(t,n){for(var o=.3,r=.7*n,i=[0,-o*n,-.2*n,-o*n,0,-.6*n,.2*n,-o*n,0,-o*n,0,.6*n],s=["M",i[0],i[1]+r],a=2;a<i.length;a+=2)s.push("L",i[a],i[a+1]+r);var l=new e.PathElement(t,e.Series.LEGEND_MARKER).setPath(s);return l.setStyle("strokeWidth","2px"),l.rotation=30,l},n.type=e.VectorSeriesType,n.defaults=e.extend(e.Series.defaults,{origin:"center",maxLength:20,startAngle:0,arrowHead:"close"}),n}(e.ConnectableSeries),l=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 o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l(e,t),e.prototype.layout=function(t,e,n){var o,r=this.point._len,i=r*n,s=.5,a=(r-i)/2;switch(t){case"none":o=[0,a-s*i,0,a+s*i];break;case"open":o=[0,a-.45*i,0-.15*i,a-.2*i,0,a-s*i,0+.15*i,a-.2*i,0,a-.45*i,0,a+s*i];break;default:var l=.3;o=[0,a-l*i,0-.1*i,a-l*i,0,a-s*i,0+.1*i,a-l*i,0,a-l*i,0,a+s*i]}for(var p=this.point._off*n,u=["M",o[0],o[1]+p],c=2;c<o.length;c+=2)u.push("L",o[c],o[c+1]+p);this.rotation=e,this.setPath(u)},e}(e.PointElement),u=function(t){function n(n){var o=t.call(this,n,"rct-vector-series")||this;return o._arrows=new e.ElementPool(o._pointContainer,p),o}return l(n,t),n.prototype._getPointPool=function(){return this._arrows},n.prototype._prepareSeries=function(t,e){this.$_prepareArrows(e,this._visPoints)},n.prototype._renderSeries=function(t,e){var n=this.model,o=n.options.startAngle,r=n.options.arrowHead,i=n._xAxisObj,s=n._yAxisObj,a=this._inverted,l=a?t:e,p=a?e:t,u=this._getGrowRate(),c=a?0:e,h=i.options.reversed?-1:1,f=s.options.reversed;this._pointContainer.invert(a,e),this._arrows.forEach((function(t){var e=t.point;if(t.setVis(!e.isNull)){var n=i.getPos(p,e.xValue),g=c-s.getPos(l,e.yValue),y=o+e.angleValue*h;f&&(y=180-y),e.xPos=a?c+s.getPos(l,e.yValue):n,e.yPos=a?p-i.getPos(p,e.xValue):g,t.trans(n,g),t.layout(r,y,u)}}))},n.prototype._runShowEffect=function(t){t&&e.SeriesAnimation.grow(this)},n.prototype._doViewRateChanged=function(t){this._renderSeries(this.width,this.height)},n.prototype.getPointsAt=function(t,e){return[]},n.prototype.$_prepareArrows=function(t,e){var n=this;this._arrows.prepare(e.length,(function(o,r){var i=o.point=e[r];n._setPointStyle(o,t,i)}))},n}(e.SeriesView);function c(t){(function(t){return t.Series&&t.SeriesView})(t)&&(t.Series.register(a),t.SeriesView.register([a,u]))}c(r),t.VectorSeries=a,t.default=c,Object.defineProperty(t,"__esModule",{value:!0})}));
|
package/ie/wordcloud.ie.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* RealChart Wordcloud v1.4.
|
|
4
|
-
* Copyright (C) 2023-
|
|
3
|
+
* RealChart Wordcloud v1.4.10
|
|
4
|
+
* Copyright (C) 2023-2026 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})}));
|