realchart 1.4.4 → 1.4.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "realchart",
3
- "version": "1.4.4",
3
+ "version": "1.4.6",
4
4
  "description": "Wooritech charting library",
5
5
  "main": "./index.js",
6
6
  "module": "./index.mjs",
package/pictogram.d.ts ADDED
@@ -0,0 +1,95 @@
1
+ import * as RealChart from 'realchart';
2
+ import { BasedSeries, PictogramSeriesOptions, RcElement, BarSeriesBase, PictorialBarSeriesOptions, PictorialBarMode, DataPoint, BarSeriesPoint, WidgetSeries, PictorialSeriesOptions, Size, IChart, WidgetSeriesPoint, WidgetSeriesLabel, PictorialSeriesLabelOptions } from 'realchart';
3
+
4
+ /**
5
+ * Pictogram 시리즈 모델.<br/>
6
+ * 지정한 이미지 아이콘을 반복한다.
7
+ *
8
+ * {@link https://realchart.co.kr/docs/api/options/SeriesOptions#type type}은 {@link https://realchart.co.kr/config/config/series/pictogram pictogram}이고,
9
+ * {@link options 설정} 모델은 {@link https://realchart.co.kr/docs/api/options/PictogramSeriesOptions PictogramSeriesOptions}이다.
10
+ *
11
+ * @modules Vector
12
+ */
13
+ declare class PictogramSeries extends BasedSeries<PictogramSeriesOptions> {
14
+ static readonly type = "pictogram";
15
+ static defaults: PictogramSeriesOptions;
16
+ protected _createLegendMarker(doc: Document, size: number): RcElement;
17
+ }
18
+
19
+ declare class PictorialBarSeriesPoint extends BarSeriesPoint {
20
+ figure: string;
21
+ protected _readObject(series: PictorialBarSeries, v: any): void;
22
+ }
23
+ /**
24
+ * pictorial bar 시리즈 모델.<br/>
25
+ * 데이터포인트 bar 위에 svg나 이미지로 데이터포인트와 관련된 그림(figure)을 표시한다.
26
+ *
27
+ * {@link https://realchart.co.kr/docs/api/options/SeriesOptions#type type}은 {@link https://realchart.co.kr/config/config/series/pictorialbar pictorialbar}이고,
28
+ * {@link options 설정} 모델은 {@link https://realchart.co.kr/docs/api/options/PictorialBarSeriesOptions PictorialBarSeriesOptions}이다.
29
+ *
30
+ * @modules Vector
31
+ */
32
+ declare class PictorialBarSeries extends BarSeriesBase<PictorialBarSeriesOptions> {
33
+ static readonly type = "pictorialbar";
34
+ static defaults: PictorialBarSeriesOptions;
35
+ private _mode;
36
+ _figureFielder: (v: any) => any;
37
+ private _figurePath;
38
+ private _imageRoot;
39
+ private _imageUrls;
40
+ private _widthDim;
41
+ private _figureGap;
42
+ getMode(): PictorialBarMode;
43
+ getFigure(): string;
44
+ getImage(p: PictorialBarSeriesPoint): string;
45
+ getFigureWidth(barWidth: number): number;
46
+ getFigureGap(): number;
47
+ protected _createPoint(source: any): DataPoint;
48
+ protected _createLegendMarker(doc: Document, size: number): RcElement;
49
+ protected _doApply(op: PictorialBarSeriesOptions): void;
50
+ }
51
+
52
+ declare class PictorialSeriesPoint extends WidgetSeriesPoint {
53
+ }
54
+ declare class PictorialOthersPoint extends PictorialSeriesPoint {
55
+ points: PictorialSeriesPoint[];
56
+ constructor(source: any, points: PictorialSeriesPoint[]);
57
+ }
58
+ declare class PictorialSeriesLabel extends WidgetSeriesLabel<PictorialSeriesLabelOptions> {
59
+ static readonly OUTSIDE_DIST = 25;
60
+ static readonly ENDED_DIST = 10;
61
+ getDistance(): number;
62
+ }
63
+ /**
64
+ * Pictorial 시리즈 모델.<br/>
65
+ * SVG 이미지 하나를 값에 따라 수평 또는 수직 방향의 여러 영역으로 분할해서 표시한다.
66
+ *
67
+ * {@link https://realchart.co.kr/docs/api/options/SeriesOptions#type type}은 {@link https://realchart.co.kr/config/config/series/pictorial pictorial}이고,
68
+ * {@link options 설정} 모델은 {@link https://realchart.co.kr/docs/api/options/PictorialSeriesOptions PictorialSeriesOptions}이다.
69
+ *
70
+ * @modules Vector
71
+ */
72
+ declare class PictorialSeries extends WidgetSeries<PictorialSeriesOptions> {
73
+ static readonly type = "pictorial";
74
+ static defaults: PictorialSeriesOptions;
75
+ private _paths;
76
+ private _totalDim;
77
+ private _sizeDim;
78
+ private _widthDim;
79
+ private _heightDim;
80
+ get paths(): string[];
81
+ getPictorialSize(szPictorial: Size, wDomain: number, hDomain: number): Size;
82
+ get pointLabel(): PictorialSeriesLabel;
83
+ protected _createLabel(chart: IChart): PictorialSeriesLabel;
84
+ protected _createPoint(source: any): PictorialSeriesPoint;
85
+ protected _createOthersPoint(source: any, points: PictorialSeriesPoint[]): PictorialOthersPoint;
86
+ needClip(polar: boolean): boolean;
87
+ getTotal(): number;
88
+ getSum(): number;
89
+ protected _doApply(op: PictorialSeriesOptions): void;
90
+ protected _createLegendMarker(doc: Document, size: number): RcElement;
91
+ }
92
+
93
+ declare function registerSeries(chart: typeof RealChart): void;
94
+
95
+ export { PictogramSeries, PictorialBarSeries, PictorialSeries, registerSeries as default };
package/pictogram.js ADDED
@@ -0,0 +1,7 @@
1
+
2
+ /**
3
+ * RealChart Pictogram v1.4.6
4
+ * Copyright (C) 2023-2025 WooriTech Inc.
5
+ * All Rights Reserved.
6
+ */
7
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("realchart")):"function"==typeof define&&define.amd?define(["exports","realchart"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).RealChartPictogram={},e.RealChart)}(this,(function(e,t){"use strict";function i(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(i){if("default"!==i){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}})),t.default=e,Object.freeze(t)}var s=i(t);class r extends t.BasedSeries{_createLegendMarker(e,i){return t.RectElement.create(e,t.Series.LEGEND_MARKER,0,0,i,i,2)}}r.type=t.PictogramSeriesType,r.defaults=t.extend(t.BasedSeries.defaults,{iconGap:2,integral:!1,integralThreshold:.5});class o extends t.RcElement{constructor(e){super(e,t.SeriesView.POINT_CLASS),this.add(this._back=new t.RectElement(e)),this._back.setTransparent(!0)}preppareIcons(e,t,i,s){}layout(e,t,i){const s=this.wPoint,r=this.hPoint;t-=s/2,r<0&&(e=e.map((e=>-e))),this._back.setBounds(t,i-r,s,r)}}class n extends t.BasedSeriesView{constructor(e){super(e,"rct-pictogram-series"),this._bars=new t.ElementPool(this._pointContainer,o)}_getPointPool(){return this._bars}_preparePoints(e,t,i){}_layoutPoint(e,t,i,s,r,o){}}class a extends t.BarSeriesPoint{_readObject(e,i){super._readObject(e,i),this.figure=t.pickProp(e._figureFielder(i),i.figure)}}class h extends t.BarSeriesBase{getMode(){return this._mode}getFigure(){return this._figurePath}getImage(e){let t=e.figure;return!t&&this._op.figureByPoint&&(t=this._imageUrls[e.vindex%this._imageUrls.length]),this._imageRoot+(t||this._imageUrls[0])}getFigureWidth(e){return t.calcPercent(this._widthDim,e,e)}getFigureGap(){return this._figureGap}_createPoint(e){return new a(e)}_createLegendMarker(e,i){return t.RectElement.create(e,t.Series.LEGEND_MARKER,0,0,i,i,2)}_doApply(e){super._doApply(e),this._figureFielder=this._createFielder(e.figureField||"figure"),this._figurePath=t.isArray(e.figurePath)?e.figurePath.join(" "):e.figurePath;const i=e.figureImage;t.isArray(i)?this._imageUrls=i.slice(0):t.isString(i)?this._imageUrls=[i]:this._imageUrls=[],this._imageRoot=t.isString(e.figureImageRoot)?e.figureImageRoot:"",this._mode="both"===e.mode||"figure"===e.mode?e.mode:e.figurePath?"both":"figure",this._figureGap=t.pickNum(e.figureGap,0),this._widthDim=t.parsePercentSize(e.figureWidth,!0)}}h.type=t.PictorialBarSeriesType,h.defaults=t.extend(t.BarSeriesBase.defaults,{mode:"auto",figureWidth:"100%"});class l extends t.WidgetSeriesPoint{}class d extends l{constructor(e,t){super(e),this.points=t}}class c extends t.WidgetSeriesLabel{getDistance(){return isNaN(this._op.distance)?"far"===this._op.align?c.ENDED_DIST:c.OUTSIDE_DIST:this._op.distance||0}}c.OUTSIDE_DIST=25,c.ENDED_DIST=10;class u extends t.WidgetSeries{get paths(){return this._paths}getPictorialSize(e,i,s){const r=t.calcPercent(this._sizeDim,1),o=t.minv(i*r/e.width,s*r/e.height);return{width:t.pickNum(t.calcPercent(this._widthDim,i),e.width*o),height:t.pickNum(t.calcPercent(this._heightDim,s),e.height*o)}}get pointLabel(){return this._pointLabel}_createLabel(e){return new c(e)}_createPoint(e){return new l(e)}_createOthersPoint(e,t){return e.y=t.map((e=>e.y)).reduce(((e,t)=>e+t)),new d(e,t)}needClip(e){return!1}getTotal(){const e=super.getSum();return Math.max(e,t.calcPercent(this._totalDim,e))}getSum(){const e=super.getSum(),i=t.calcPercent(this._totalDim,e);return Math.max(e,t.pickNum(i,e))}_doApply(e){super._doApply(e),this._paths=t.isArray(e.figure)?e.figure:[e.figure||""],this._setDims(e,"total","width","height"),this._sizeDim=t.parsePercentSize(e.size||"80%",!1)}_createLegendMarker(e,i){return t.RectElement.create(e,t.Series.LEGEND_MARKER,0,0,i,i,2)}}u.type=t.PictorialSeriesType,u.defaults=t.extend(t.WidgetSeries.defaults,{size:"90%",reversed:!1});class _ extends t.BoxPointElementEx{constructor(e){super(e),this.add(this._figureLayer=new t.RcElement(e,"")),this._figureLayer.add(this._figureView=new t.PathElement(e,"")),this.add(this._imageLayer=new t.RcElement(e,"")),this._imageLayer.add(this._imageView=new t.ImageElement(e,!1,"")),this._imageView.setAttr("preserveAspectRatio","none"),this.add(this._boxView=new t.PathElement(e,"")),this._figureView.setAttr("vector-effect","non-scaling-stroke")}renderSvg(e,t,i,s,r){const o=this._figureView;let n;this._imageLayer.setVis(!1),this._figureLayer.setVis(!0),o.scale(1),o.setPath(s),n=o.getBounds(),e.both?o.scale(r/(e.inverted?n.height:n.width)):e.inverted?o.scale(r/n.height,(e.reversed?-1:1)*this.hPoint/n.width):o.scale(r/n.width,(e.reversed?-1:1)*this.hPoint/n.height),this.$_layoutFigure(e,this._figureLayer,this._figureView,t,i)}renderImage(e,t,i,s,r){const o=this._imageView;this._figureLayer.setVis(!1),this._imageLayer.setVis(!0),o.url=s,o.width=r,o.height=e.both?void 0:Math.abs(this.hPoint),this.$_layoutFigure(e,this._imageLayer,o,t,i)}$_layoutFigure(e,i,s,r,o){const n=s.getBounds(),a=!e.upperClip;let h=this.hPoint,l=!1;e.inverted?e.reversed?a?(s.trans(r+n.height/2,-e.yLen-h),this._dir="left"):h<0?(s.trans(r+n.height/2,-e.yBase-h),this._dir="left"):(s.trans(r-n.height/2,-e.yBase-h),this._dir="right"):a?(s.trans(r-n.height/2,-h),this._dir="right"):h<0?(s.trans(r+n.height/2,-e.yBase-h),this._dir="left"):(s.trans(r-n.height/2,-e.yBase-h),this._dir="right"):e.reversed?a?(s.trans(r+n.width/2,-h),this._dir="bottom"):h<0?(s.trans(r+n.width/2,e.yLen-e.yBase-h),this._dir="bottom"):(s.trans(r-n.width/2,e.yLen-e.yBase-h),this._dir="top"):a?(s.trans(r-n.width/2,e.yLen-h),this._dir="top"):h<0?(s.trans(r+n.width/2,e.yLen-e.yBase-h),this._dir="bottom"):(s.trans(r-n.width/2,e.yLen-e.yBase-h),this._dir="top"),a?(s.rotate(e.reversed?180:0),i.removeAttr("clip-path")):(l=this.point.yValue<e.base,e.reversed&&(l=!l),t.Dom.setClipPath(i.dom,l?e.lowerClip:e.upperClip),s.rotate(l?180:0)),this._boxView.setVis(e.both)&&(l||(l=a&&e.reversed),h-=(l?-1:1)*((e.inverted?n.width:n.height)+e.gap),this.$_layoutBox(e,l,r,o,h))}$_layoutBox(e,i,s,r,o){this._boxView.setVis(i?o<0:o>0)&&this._boxView.setPath(t.SvgShapes.bar(s-this.wPoint/2,r,this.wPoint,-o,e.rTop,e.rBottom))}}class g extends t.BarSeriesViewBase{constructor(e){super(e,"rct-pictorialbar-series")}_createBarPool(e,i){return new t.ElementPool(e,_)}_prepareLayoutPoints(e,i){const s=this.model,r=this._yBase,o=this._yBase>0;if(this._info={inverted:this._inverted,reversed:this._reversed,base:this._baseVal,yBase:r,both:"both"===s.getMode(),gap:s.getFigureGap(),yLen:this._yLen,rTop:+s.options.topRadius||0,rBottom:+s.options.bottomRadius||0,upperClip:"",lowerClip:""},o){if(!this._upperClip){const e=this.doc,i=this.dom.querySelector("defs")||e.createElementNS(t.SVGNS,"defs"),s=t.Utils.uniqueKey()+"-";this.insertDom(i,this._pointContainer.dom),i.appendChild(this._upperClip=t.Dom.createClipRect(e,s+"upper")),i.appendChild(this._lowerClip=t.Dom.createClipRect(e,s+"lower"))}const s=this._upperClip.children[0],o=this._lowerClip.children[0];this._inverted?(t.Dom.setBounds(s,0,-e,i,e-r),t.Dom.setBounds(o,0,-r,i,e)):(t.Dom.setBounds(s,0,0,e,i-r),t.Dom.setBounds(o,0,i-r,e,r)),this._info.upperClip=this._upperClip.id,this._info.lowerClip=this._lowerClip.id}}_layoutPoint(e,i,s,r,o,n){const a=e.point,h=this.model.getFigure();this._needMask=h&&this._info.both,e.wPoint=o*t.pickNum(a.width,1),e.hPoint=n,e.x=s,h?e.renderSvg(this._info,s,r,h,this._model.getFigureWidth(o)):e.renderImage(this._info,s,r,this._model.getImage(a),this._model.getFigureWidth(o))}setHoverStyle(e){if(super.setHoverStyle(e),this._needMask){const i=getComputedStyle(e.dom),s="none"!==i.stroke?parseFloat(i.strokeWidth):0;if(this._hoverFigureView.parent.setVis(s>0&&this._info.gap<s)){t.Dom.setImportantStyle(e.dom.style,"stroke-width",t.pixel(s+s/2|0));let i=0,r=0;switch(e._dir){case"top":case"right":r=-s/2;break;case"bottom":case"left":r=s/2}this._hoverBoxView.setAttribute("transform",`translate(${i}, ${r})`)}}}focusPointView(e,t){t&&this._needMask?this.$_showHoverView(e).setVis(!0):this._hoverFigureView&&this._hoverFigureView.setVis(!1)}$_showHoverView(e){let i=this._hoverFigureView;if(!i){const e=this.doc;let s;this.add(new t.RcElement(e,"")).add(i=this._hoverFigureView=new t.RcElement(e,"")),i.parent.dom.style.pointerEvents="none",i.appendDom(s=e.createElementNS(t.SVGNS,"path")),s.style.stroke="none",i.parent.appendDom(s=this._hoverBoxView=e.createElementNS(t.SVGNS,"path")),s.style.stroke="none"}const s=i.dom.children[0],r=this._hoverBoxView;return i.parent.setAttr("clip-path",this._pointContainer.getAttr("clip-path")),i.setAttr("clip-path",e._figureLayer.getAttr("clip-path")),s.setAttribute("d",e._figureView.getAttr("d")),s.style.fill=getComputedStyle(e._figureView.dom).fill,s.setAttribute("transform",e._figureView.getTransform()),t.Dom.setVisible(r,e._boxView.visible)&&(r.setAttribute("d",e._boxView.getAttr("d")),r.style.fill=getComputedStyle(e._boxView.dom).fill),this._inverted&&i.parent.setAttr("transform",`rotate(90) translate(${this.height},0) scale(-1, 1)`),i}}class p extends t.PointElement{getTooltipPos(){return{x:this.point.xPos+this.parent.parent.tx,y:this.point.yPos+this.parent.parent.ty}}}class m extends t.WidgetSeriesView{constructor(e){super(e,"rct-pictorial-series");const i=t.Utils.uniqueKey()+"-",s=i+"figure",r=i+"clip",o=i+"hover";this._figurelView=e.createElementNS(t.SVGNS,"use"),this._figurelView.setAttribute("href",`#${s}`),this._figurelView.setAttribute("class","rct-pictorial-series-figure"),this.insertDom(this._figurelView,this._pointContainer.dom);const n=e.createElementNS(t.SVGNS,"defs");this.insertDom(n,this._figurelView),this._sourceView=new t.PathElement(e),this._sourceView.setAttr("vector-effect","non-scaling-stroke"),this._sourceView.dom.id=s,n.appendChild(this._sourceView.dom);const a=e.createElementNS(t.SVGNS,"use"),h=e.createElementNS(t.SVGNS,"clipPath"),l=e.createElementNS(t.SVGNS,"clipPath");a.setAttribute("href",`#${s}`),h.appendChild(a),h.id=r,n.appendChild(h),l.appendChild(this._hoverRect=e.createElementNS(t.SVGNS,"path")),l.id=o,n.appendChild(l),this._hoverView=e.createElementNS(t.SVGNS,"use"),this._hoverView.setAttribute("href",`#${s}`),this._hoverView.setAttribute("clip-path",`url(#${o}`),this._hoverView.style.stroke="none",this._hoverView.style.fill="none",this.appendDom(this._hoverView),this._pointContainer.add(this._sliceLayer=new t.LayerElement(e,null)),this._pointContainer.setAttr("clip-path",`url(#${r})`),this._slices=new t.ElementPool(this._sliceLayer,p),this.add(this._lineContainer=new t.PointLabelLineContainer(e))}_getPointPool(){return this._slices}getClipContainer(){return null}_prepareSeries(e,t){super._prepareSeries(e,t),this.$_prepareSlices(e,t,this._visPoints),this._lineContainer.prepare(t)}_renderSeries(e,i){this.$_renderFigure(this._sourceView,this._model,e,i);const s=this._visPoints,r=this.model.getCenter(e,i),o=this._figurelView.getBoundingClientRect(),n=r.x-o.width/2,a=r.y-o.height/2,h=`translate(${n},${a})`;t.Dom.hasFill(this._figurelView)||(this._figurelView.style.fill="transparent"),this._figurelView.setAttribute("transform",h),this._hoverView.setAttribute("transform",h),o.x=n,o.y=a,this.$_layoutSlices(s,o,e,i),this._pointContainer.trans(n,a),this._labelContainer.trans(n,a),this._lineContainer.trans(n,a),this.resize(o.width,o.height),this._rSave=o,this._wSave=e,this._hSave=i}_runShowEffect(e){const i=this.model.options.reversed;e&&t.SeriesAnimation.reveal(this,{from:"column"===this.model.options.direction?i?"right":"left":i?"top":"bottom",view:this._sliceLayer})}_resizeZombie(){super._resizeZombie(),this.$_layoutSlices(this._visPoints,this._rSave,this._wSave,this._hSave)}_animationStarted(e){super._animationStarted(e),this._lineContainer.setVis(this._labelContainer.visible)}setHoverStyle(e){super.setHoverStyle(e);const i=getComputedStyle(e.dom),s="none"!==i.stroke&&parseFloat(i.strokeWidth)>0;t.Dom.setVisible(this._hoverView,s)&&Object.assign(this._hoverView.style,{stroke:i.stroke,strokeWidth:i.strokeWidth,strokeDasharray:i.strokeDasharray})}focusPointView(e,t){this._hoverView.style.display=t?"":"none",t&&this._hoverRect.setAttribute("d",e.getAttr("d"))}$_prepareSlices(e,t,i){this._slices.prepare(i.length,((s,r)=>{const o=s.point=i[r];this._preparePoint(e,t,o,s)}))}$_renderFigure(e,t,i,s){let r,o;e.setPath(t.paths),r=e.getBBox(),o=t.getPictorialSize(r,i,s),e.scale(o.width/r.width,o.height/r.height)}$_layoutSlices(e,t,i,s){const r=this._model,o=r.pointLabel,n=r.options.reversed;this.$_calcRates(e),this._lineContainer.setStyleOrClass(o.connector.options.style),"column"===r.options.direction?this.$_renderHorz(n,t,s):this.$_renderVert(n,t,i)}$_calcRates(e){const i=this._zombie,s=this._zombieRate,r=e.length;let o=this.model.getTotal();isNaN(o)&&(o=e.filter((e=>(e.visible||e===i)&&!e.isNull)).map((e=>e.yValue*(e===i?s:e._isDeleted()?e._vr:1))).reduce(((e,t)=>e+t),0)),r>1||r>0&&!i?1==r&&e[0]._isDeleted()||1===r&&e[0]._vr<1?e[0].yRate=1:e.forEach((e=>{const r=t.fixnum(e.yValue*(e===i?s:e._isDeleted()?e._vr:1)/o)||0;e.yRate=r})):1==r&&(e[0].yRate=t.fixnum(s))}$_createLabelInfo(e){const{a:t,d:i}=e.getCTM(),{width:s,height:r}=e.getBBox();return{dom:e,sx:t,sy:i,wFigure:s,hFigure:r}}$_renderVert(e,i,s){const r=this.model,o=i.width,n=i.height,a=this._labelViews(),h=r.pointLabel,l="inside"===r.getLabelPos(h),d=h.getOffset(),c=h.getDistance(),u=h.getAlign(),_=null==a?void 0:a.textAlign(),g=[],p=h.options.opposite,m=this._lineContainer.setVis(h.connector.visible)?this._lineContainer:null,y=new t.PathBuilder,f=r.getCenter(s,n).x-i.x,w=o/2;let P=e?0:n;const S=a?a.getWidth(0):0,V=g&&!l&&this.$_createLabelInfo(this._sourceView.dom);let b,v;this._slices.forEach((r=>{const h=r.point;if(r.setVis(!h.isNull)){const x=n*h.yRate;if(e?(r.setPath(t.SvgShapes.rectangle(0,P,o,x)),h.yPos=P+x/2,P+=x):(h.yPos=P-x/2,P-=x,r.setPath(t.SvgShapes.rectangle(0,P,o,x))),h.xPos=w,v=null==m?void 0:m.get(h),a&&(b=a.get(h,0))&&b.visible){if(l){const e=b.isDomAnimating(),t=b.getBBox();!e&&b.layout(_||"center"),null==v||v.setVis(!1),b.trans(h.xPos-t.width/2,h.yPos-t.height/2)}else-1===u?this.$_layoutLabelNearVert(V,r,b,_,p,v,y,o,f,d,c):1==u?this.$_layoutLabelFarVert(V,r,b,_,p,v,y,d,c,S,i,s):this.$_layoutLabelOutVert(V,r,b,_,p,v,y,d,c);b.setContrast(l&&r.dom),g.push(b),b.setPosY(b.ty)}else v&&v.setVis(!1)}}))}$_renderHorz(e,i,s){const r=this.model,o=i.width,n=i.height,a=this._labelViews(),h=r.pointLabel,l="inside"===r.getLabelPos(h),d=h.getOffset(),c=h.getDistance(),u=h.getAlign(),_=null==a?void 0:a.textAlign(),g=[],p=h.options.opposite,m=this._lineContainer.setVis(h.connector.visible)?this._lineContainer:null,y=new t.PathBuilder,f=r.getCenter(o,s).y-i.y,w=n/2,P=a?a.getWidth(0):0,S=g&&!l&&this.$_createLabelInfo(this._sourceView.dom);let V,b,v=e?o:0;this._slices.forEach((r=>{const h=r.point;if(r.setVis(!h.isNull)){const x=o*h.yRate;if(e?(h.xPos=v-x/2,v-=x,r.setPath(t.SvgShapes.rectangle(v,0,x,n))):(h.xPos=v+x/2,r.setPath(t.SvgShapes.rectangle(v,0,x,n)),v+=x),h.yPos=w,b=null==m?void 0:m.get(h),a&&(V=a.get(h,0))&&V.visible){if(l){const e=V.isDomAnimating(),t=V.getBBox();!e&&V.layout(_||"center"),V.trans(h.xPos-t.width/2,h.yPos-t.height/2),null==b||b.setVis(!1)}else-1===u?this.$_layoutLabelNearHorz(S,r,V,_,p,b,y,n,f,d,c):1==u?this.$_layoutLabelFarHorz(S,r,V,_,p,b,y,d,c,P,i,s):this.$_layoutLabelOutHorz(S,r,V,_,p,b,y,d,c);V.setContrast(l&&r.dom),g.push(V),V.setPosY(V.ty)}else b&&b.setVis(!1)}}))}$_calcLabelPosVert(e,t,i){const s=e.dom,r=s.ownerSVGElement.createSVGPoint(),o=2*(e.sx<0?1:1/e.sx);let n=t.point.yPos/e.sy,a=i?0:e.wFigure;if(i){for(;a<e.wFigure;a+=o)if(r.x=a,r.y=n,s.isPointInFill(r))return a>0&&(r.x-=o/2,s.isPointInFill(r)&&(a=r.x)),a*e.sx}else for(;a>=0;a-=o)if(r.x=a,r.y=n,s.isPointInFill(r))return a<e.wFigure&&(r.x+=o/2,s.isPointInFill(r)&&(a=r.x)),a*e.sx;return e.wFigure*e.sx/2}$_layoutLabelOutVert(e,t,i,s,r,o,n,a,h){const l=t.point,d=i.isDomAnimating(),c=i.getBBox(),u=l.yPos;!d&&i.layout(s||(r?"right":"left"));let _=this.$_calcLabelPosVert(e,t,r);o&&(r?o.setLine(n.reset(0,0).line(-h,0).end()):o.setLine(n.reset(0,0).line(h,0).end()),o.trans(_,u)),r?_-=h+a+c.width:_+=h+a,i.trans(_,u-c.height/2)}$_layoutLabelNearVert(e,t,i,s,r,o,n,a,h,l,d){const c=t.point,u=i.isDomAnimating(),_=i.getBBox(),g=c.yPos;!u&&i.layout(s||(r?"right":"left"));const p=c.xPos=this.$_calcLabelPosVert(e,t,r);let m=h;r?m-=a/2:m+=a/2,o&&(r?o.setLine(n.reset(0,0).line(m-p-d,0).end()):o.setLine(n.reset(0,0).line(m+d-p,0).end()),o.trans(p,g)),r?m-=l+d+_.width:m+=d+l,i.trans(m,g-_.height/2)}$_layoutLabelFarVert(e,t,i,s,r,o,n,a,h,l,d,c){const u=t.point,_=i.isDomAnimating(),g=i.getBBox(),p=u.yPos;!_&&i.layout(s||(r?"right":"left"));const m=u.xPos=this.$_calcLabelPosVert(e,t,r);let y;y=r?h+a+l-d.x:c-d.x-h-l-a,o&&(r?o.setLine(n.reset(0,0).line(y-m-h,0).end()):o.setLine(n.reset(0,0).line(y+h-m,0).end()),o.trans(m,p)),r?y-=a+h+g.width:y+=h+a,i.trans(y,p-g.height/2)}$_calcLabelPosHorz(e,t,i){const s=e.dom,r=s.ownerSVGElement.createSVGPoint(),o=2*(e.sy<0?1:1/e.sy);let n=t.point.xPos/e.sx,a=i?e.hFigure:0;if(i){for(;a>=0;a-=o)if(r.x=n,r.y=a,s.isPointInFill(r))return a<e.wFigure&&(r.y+=o/2,s.isPointInFill(r)&&(a=r.y)),a*e.sy}else for(;a<e.wFigure;a+=o)if(r.x=n,r.y=a,s.isPointInFill(r))return a>0&&(r.y-=o/2,s.isPointInFill(r)&&(a=r.y)),a*e.sy;return e.hFigure*e.sy/2}$_layoutLabelOutHorz(e,t,i,s,r,o,n,a,h){const l=t.point,d=i.isDomAnimating(),c=i.getBBox(),u=l.xPos;!d&&i.layout(s);let _=this.$_calcLabelPosHorz(e,t,r);o&&(r?o.setLine(n.reset(0,0).line(0,h).end()):o.setLine(n.reset(0,0).line(0,-h).end()),o.trans(u,_)),r?_+=h+a:_-=h+a,i.trans(u-c.width/2,r?_:_-c.height)}$_layoutLabelNearHorz(e,t,i,s,r,o,n,a,h,l,d){const c=t.point,u=i.isDomAnimating(),_=i.getBBox(),g=c.xPos;!u&&i.layout(s||(r?"right":"left"));let p=c.yPos=this.$_calcLabelPosHorz(e,t,r),m=h;r?m+=a/2:m-=a/2,o&&(r?o.setLine(n.reset(0,0).line(0,m+d-p).end()):o.setLine(n.reset(0,0).line(0,m-p-d).end()),o.trans(g,p)),r?m+=d+l:m-=l+d+_.height,i.trans(g-_.width/2,m)}$_layoutLabelFarHorz(e,t,i,s,r,o,n,a,h,l,d,c){const u=t.point,_=i.isDomAnimating(),g=i.getBBox(),p=u.xPos;!_&&i.layout(s||(r?"right":"left"));const m=u.yPos=this.$_calcLabelPosHorz(e,t,r);let y;y=r?c-d.y-h-l-a:h+a+l-d.y,o&&(r?o.setLine(n.reset(0,0).line(0,y+h-m).end()):o.setLine(n.reset(0,0).line(0,y-m-h).end()),o.trans(p,m)),r?y+=h+a:y-=a+h+g.height,i.trans(p-g.width/2,y)}}function y(e){(function(e){return e.Series&&e.SeriesView})(e)&&(e.Series.register(r),e.Series.register(h),e.Series.register(u),e.SeriesView.register([r,n]),e.SeriesView.register([h,g]),e.SeriesView.register([u,m]))}y(s),e.PictogramSeries=r,e.PictorialBarSeries=h,e.PictorialSeries=u,e.default=y,Object.defineProperty(e,"__esModule",{value:!0})}));
package/pictogram.mjs ADDED
@@ -0,0 +1,7 @@
1
+
2
+ /**
3
+ * RealChart Pictogram v1.4.6
4
+ * Copyright (C) 2023-2025 WooriTech Inc.
5
+ * All Rights Reserved.
6
+ */
7
+ import{PictogramSeriesType as e,extend as t,BasedSeries as i,RectElement as s,Series as r,BasedSeriesView as o,ElementPool as n,RcElement as h,SeriesView as a,PictorialBarSeriesType as l,BarSeriesBase as d,calcPercent as _,isArray as u,isString as g,pickNum as c,parsePercentSize as p,BarSeriesPoint as y,pickProp as m,PictorialSeriesType as w,WidgetSeries as f,WidgetSeriesLabel as V,minv as b,WidgetSeriesPoint as P,BarSeriesViewBase as v,SVGNS as x,Utils as L,Dom as S,pixel as C,BoxPointElementEx as $,PathElement as B,ImageElement as A,SvgShapes as F,WidgetSeriesView as D,LayerElement as E,PointLabelLineContainer as I,SeriesAnimation as N,fixnum as k,PathBuilder as R,PointElement as z}from"./index.mjs";class H extends i{_createLegendMarker(e,t){return s.create(e,r.LEGEND_MARKER,0,0,t,t,2)}}H.type=e,H.defaults=t(i.defaults,{iconGap:2,integral:!1,integralThreshold:.5});class T extends h{constructor(e){super(e,a.POINT_CLASS),this.add(this._back=new s(e)),this._back.setTransparent(!0)}preppareIcons(e,t,i,s){}layout(e,t,i){const s=this.wPoint,r=this.hPoint;t-=s/2,r<0&&(e=e.map((e=>-e))),this._back.setBounds(t,i-r,s,r)}}class M extends o{constructor(e){super(e,"rct-pictogram-series"),this._bars=new n(this._pointContainer,T)}_getPointPool(){return this._bars}_preparePoints(e,t,i){}_layoutPoint(e,t,i,s,r,o){}}class O extends y{_readObject(e,t){super._readObject(e,t),this.figure=m(e._figureFielder(t),t.figure)}}class G extends d{getMode(){return this._mode}getFigure(){return this._figurePath}getImage(e){let t=e.figure;return!t&&this._op.figureByPoint&&(t=this._imageUrls[e.vindex%this._imageUrls.length]),this._imageRoot+(t||this._imageUrls[0])}getFigureWidth(e){return _(this._widthDim,e,e)}getFigureGap(){return this._figureGap}_createPoint(e){return new O(e)}_createLegendMarker(e,t){return s.create(e,r.LEGEND_MARKER,0,0,t,t,2)}_doApply(e){super._doApply(e),this._figureFielder=this._createFielder(e.figureField||"figure"),this._figurePath=u(e.figurePath)?e.figurePath.join(" "):e.figurePath;const t=e.figureImage;u(t)?this._imageUrls=t.slice(0):g(t)?this._imageUrls=[t]:this._imageUrls=[],this._imageRoot=g(e.figureImageRoot)?e.figureImageRoot:"",this._mode="both"===e.mode||"figure"===e.mode?e.mode:e.figurePath?"both":"figure",this._figureGap=c(e.figureGap,0),this._widthDim=p(e.figureWidth,!0)}}G.type=l,G.defaults=t(d.defaults,{mode:"auto",figureWidth:"100%"});class W extends P{}class U extends W{constructor(e,t){super(e),this.points=t}}class j extends V{getDistance(){return isNaN(this._op.distance)?"far"===this._op.align?j.ENDED_DIST:j.OUTSIDE_DIST:this._op.distance||0}}j.OUTSIDE_DIST=25,j.ENDED_DIST=10;class K extends f{get paths(){return this._paths}getPictorialSize(e,t,i){const s=_(this._sizeDim,1),r=b(t*s/e.width,i*s/e.height);return{width:c(_(this._widthDim,t),e.width*r),height:c(_(this._heightDim,i),e.height*r)}}get pointLabel(){return this._pointLabel}_createLabel(e){return new j(e)}_createPoint(e){return new W(e)}_createOthersPoint(e,t){return e.y=t.map((e=>e.y)).reduce(((e,t)=>e+t)),new U(e,t)}needClip(e){return!1}getTotal(){const e=super.getSum();return Math.max(e,_(this._totalDim,e))}getSum(){const e=super.getSum(),t=_(this._totalDim,e);return Math.max(e,c(t,e))}_doApply(e){super._doApply(e),this._paths=u(e.figure)?e.figure:[e.figure||""],this._setDims(e,"total","width","height"),this._sizeDim=p(e.size||"80%",!1)}_createLegendMarker(e,t){return s.create(e,r.LEGEND_MARKER,0,0,t,t,2)}}K.type=w,K.defaults=t(f.defaults,{size:"90%",reversed:!1});class q extends ${constructor(e){super(e),this.add(this._figureLayer=new h(e,"")),this._figureLayer.add(this._figureView=new B(e,"")),this.add(this._imageLayer=new h(e,"")),this._imageLayer.add(this._imageView=new A(e,!1,"")),this._imageView.setAttr("preserveAspectRatio","none"),this.add(this._boxView=new B(e,"")),this._figureView.setAttr("vector-effect","non-scaling-stroke")}renderSvg(e,t,i,s,r){const o=this._figureView;let n;this._imageLayer.setVis(!1),this._figureLayer.setVis(!0),o.scale(1),o.setPath(s),n=o.getBounds(),e.both?o.scale(r/(e.inverted?n.height:n.width)):e.inverted?o.scale(r/n.height,(e.reversed?-1:1)*this.hPoint/n.width):o.scale(r/n.width,(e.reversed?-1:1)*this.hPoint/n.height),this.$_layoutFigure(e,this._figureLayer,this._figureView,t,i)}renderImage(e,t,i,s,r){const o=this._imageView;this._figureLayer.setVis(!1),this._imageLayer.setVis(!0),o.url=s,o.width=r,o.height=e.both?void 0:Math.abs(this.hPoint),this.$_layoutFigure(e,this._imageLayer,o,t,i)}$_layoutFigure(e,t,i,s,r){const o=i.getBounds(),n=!e.upperClip;let h=this.hPoint,a=!1;e.inverted?e.reversed?n?(i.trans(s+o.height/2,-e.yLen-h),this._dir="left"):h<0?(i.trans(s+o.height/2,-e.yBase-h),this._dir="left"):(i.trans(s-o.height/2,-e.yBase-h),this._dir="right"):n?(i.trans(s-o.height/2,-h),this._dir="right"):h<0?(i.trans(s+o.height/2,-e.yBase-h),this._dir="left"):(i.trans(s-o.height/2,-e.yBase-h),this._dir="right"):e.reversed?n?(i.trans(s+o.width/2,-h),this._dir="bottom"):h<0?(i.trans(s+o.width/2,e.yLen-e.yBase-h),this._dir="bottom"):(i.trans(s-o.width/2,e.yLen-e.yBase-h),this._dir="top"):n?(i.trans(s-o.width/2,e.yLen-h),this._dir="top"):h<0?(i.trans(s+o.width/2,e.yLen-e.yBase-h),this._dir="bottom"):(i.trans(s-o.width/2,e.yLen-e.yBase-h),this._dir="top"),n?(i.rotate(e.reversed?180:0),t.removeAttr("clip-path")):(a=this.point.yValue<e.base,e.reversed&&(a=!a),S.setClipPath(t.dom,a?e.lowerClip:e.upperClip),i.rotate(a?180:0)),this._boxView.setVis(e.both)&&(a||(a=n&&e.reversed),h-=(a?-1:1)*((e.inverted?o.width:o.height)+e.gap),this.$_layoutBox(e,a,s,r,h))}$_layoutBox(e,t,i,s,r){this._boxView.setVis(t?r<0:r>0)&&this._boxView.setPath(F.bar(i-this.wPoint/2,s,this.wPoint,-r,e.rTop,e.rBottom))}}class Y extends v{constructor(e){super(e,"rct-pictorialbar-series")}_createBarPool(e,t){return new n(e,q)}_prepareLayoutPoints(e,t){const i=this.model,s=this._yBase,r=this._yBase>0;if(this._info={inverted:this._inverted,reversed:this._reversed,base:this._baseVal,yBase:s,both:"both"===i.getMode(),gap:i.getFigureGap(),yLen:this._yLen,rTop:+i.options.topRadius||0,rBottom:+i.options.bottomRadius||0,upperClip:"",lowerClip:""},r){if(!this._upperClip){const e=this.doc,t=this.dom.querySelector("defs")||e.createElementNS(x,"defs"),i=L.uniqueKey()+"-";this.insertDom(t,this._pointContainer.dom),t.appendChild(this._upperClip=S.createClipRect(e,i+"upper")),t.appendChild(this._lowerClip=S.createClipRect(e,i+"lower"))}const i=this._upperClip.children[0],r=this._lowerClip.children[0];this._inverted?(S.setBounds(i,0,-e,t,e-s),S.setBounds(r,0,-s,t,e)):(S.setBounds(i,0,0,e,t-s),S.setBounds(r,0,t-s,e,s)),this._info.upperClip=this._upperClip.id,this._info.lowerClip=this._lowerClip.id}}_layoutPoint(e,t,i,s,r,o){const n=e.point,h=this.model.getFigure();this._needMask=h&&this._info.both,e.wPoint=r*c(n.width,1),e.hPoint=o,e.x=i,h?e.renderSvg(this._info,i,s,h,this._model.getFigureWidth(r)):e.renderImage(this._info,i,s,this._model.getImage(n),this._model.getFigureWidth(r))}setHoverStyle(e){if(super.setHoverStyle(e),this._needMask){const t=getComputedStyle(e.dom),i="none"!==t.stroke?parseFloat(t.strokeWidth):0;if(this._hoverFigureView.parent.setVis(i>0&&this._info.gap<i)){S.setImportantStyle(e.dom.style,"stroke-width",C(i+i/2|0));let t=0,s=0;switch(e._dir){case"top":case"right":s=-i/2;break;case"bottom":case"left":s=i/2}this._hoverBoxView.setAttribute("transform",`translate(${t}, ${s})`)}}}focusPointView(e,t){t&&this._needMask?this.$_showHoverView(e).setVis(!0):this._hoverFigureView&&this._hoverFigureView.setVis(!1)}$_showHoverView(e){let t=this._hoverFigureView;if(!t){const e=this.doc;let i;this.add(new h(e,"")).add(t=this._hoverFigureView=new h(e,"")),t.parent.dom.style.pointerEvents="none",t.appendDom(i=e.createElementNS(x,"path")),i.style.stroke="none",t.parent.appendDom(i=this._hoverBoxView=e.createElementNS(x,"path")),i.style.stroke="none"}const i=t.dom.children[0],s=this._hoverBoxView;return t.parent.setAttr("clip-path",this._pointContainer.getAttr("clip-path")),t.setAttr("clip-path",e._figureLayer.getAttr("clip-path")),i.setAttribute("d",e._figureView.getAttr("d")),i.style.fill=getComputedStyle(e._figureView.dom).fill,i.setAttribute("transform",e._figureView.getTransform()),S.setVisible(s,e._boxView.visible)&&(s.setAttribute("d",e._boxView.getAttr("d")),s.style.fill=getComputedStyle(e._boxView.dom).fill),this._inverted&&t.parent.setAttr("transform",`rotate(90) translate(${this.height},0) scale(-1, 1)`),t}}class Z extends z{getTooltipPos(){return{x:this.point.xPos+this.parent.parent.tx,y:this.point.yPos+this.parent.parent.ty}}}class J extends D{constructor(e){super(e,"rct-pictorial-series");const t=L.uniqueKey()+"-",i=t+"figure",s=t+"clip",r=t+"hover";this._figurelView=e.createElementNS(x,"use"),this._figurelView.setAttribute("href",`#${i}`),this._figurelView.setAttribute("class","rct-pictorial-series-figure"),this.insertDom(this._figurelView,this._pointContainer.dom);const o=e.createElementNS(x,"defs");this.insertDom(o,this._figurelView),this._sourceView=new B(e),this._sourceView.setAttr("vector-effect","non-scaling-stroke"),this._sourceView.dom.id=i,o.appendChild(this._sourceView.dom);const h=e.createElementNS(x,"use"),a=e.createElementNS(x,"clipPath"),l=e.createElementNS(x,"clipPath");h.setAttribute("href",`#${i}`),a.appendChild(h),a.id=s,o.appendChild(a),l.appendChild(this._hoverRect=e.createElementNS(x,"path")),l.id=r,o.appendChild(l),this._hoverView=e.createElementNS(x,"use"),this._hoverView.setAttribute("href",`#${i}`),this._hoverView.setAttribute("clip-path",`url(#${r}`),this._hoverView.style.stroke="none",this._hoverView.style.fill="none",this.appendDom(this._hoverView),this._pointContainer.add(this._sliceLayer=new E(e,null)),this._pointContainer.setAttr("clip-path",`url(#${s})`),this._slices=new n(this._sliceLayer,Z),this.add(this._lineContainer=new I(e))}_getPointPool(){return this._slices}getClipContainer(){return null}_prepareSeries(e,t){super._prepareSeries(e,t),this.$_prepareSlices(e,t,this._visPoints),this._lineContainer.prepare(t)}_renderSeries(e,t){this.$_renderFigure(this._sourceView,this._model,e,t);const i=this._visPoints,s=this.model.getCenter(e,t),r=this._figurelView.getBoundingClientRect(),o=s.x-r.width/2,n=s.y-r.height/2,h=`translate(${o},${n})`;S.hasFill(this._figurelView)||(this._figurelView.style.fill="transparent"),this._figurelView.setAttribute("transform",h),this._hoverView.setAttribute("transform",h),r.x=o,r.y=n,this.$_layoutSlices(i,r,e,t),this._pointContainer.trans(o,n),this._labelContainer.trans(o,n),this._lineContainer.trans(o,n),this.resize(r.width,r.height),this._rSave=r,this._wSave=e,this._hSave=t}_runShowEffect(e){const t=this.model.options.reversed;e&&N.reveal(this,{from:"column"===this.model.options.direction?t?"right":"left":t?"top":"bottom",view:this._sliceLayer})}_resizeZombie(){super._resizeZombie(),this.$_layoutSlices(this._visPoints,this._rSave,this._wSave,this._hSave)}_animationStarted(e){super._animationStarted(e),this._lineContainer.setVis(this._labelContainer.visible)}setHoverStyle(e){super.setHoverStyle(e);const t=getComputedStyle(e.dom),i="none"!==t.stroke&&parseFloat(t.strokeWidth)>0;S.setVisible(this._hoverView,i)&&Object.assign(this._hoverView.style,{stroke:t.stroke,strokeWidth:t.strokeWidth,strokeDasharray:t.strokeDasharray})}focusPointView(e,t){this._hoverView.style.display=t?"":"none",t&&this._hoverRect.setAttribute("d",e.getAttr("d"))}$_prepareSlices(e,t,i){this._slices.prepare(i.length,((s,r)=>{const o=s.point=i[r];this._preparePoint(e,t,o,s)}))}$_renderFigure(e,t,i,s){let r,o;e.setPath(t.paths),r=e.getBBox(),o=t.getPictorialSize(r,i,s),e.scale(o.width/r.width,o.height/r.height)}$_layoutSlices(e,t,i,s){const r=this._model,o=r.pointLabel,n=r.options.reversed;this.$_calcRates(e),this._lineContainer.setStyleOrClass(o.connector.options.style),"column"===r.options.direction?this.$_renderHorz(n,t,s):this.$_renderVert(n,t,i)}$_calcRates(e){const t=this._zombie,i=this._zombieRate,s=e.length;let r=this.model.getTotal();isNaN(r)&&(r=e.filter((e=>(e.visible||e===t)&&!e.isNull)).map((e=>e.yValue*(e===t?i:e._isDeleted()?e._vr:1))).reduce(((e,t)=>e+t),0)),s>1||s>0&&!t?1==s&&e[0]._isDeleted()||1===s&&e[0]._vr<1?e[0].yRate=1:e.forEach((e=>{const s=k(e.yValue*(e===t?i:e._isDeleted()?e._vr:1)/r)||0;e.yRate=s})):1==s&&(e[0].yRate=k(i))}$_createLabelInfo(e){const{a:t,d:i}=e.getCTM(),{width:s,height:r}=e.getBBox();return{dom:e,sx:t,sy:i,wFigure:s,hFigure:r}}$_renderVert(e,t,i){const s=this.model,r=t.width,o=t.height,n=this._labelViews(),h=s.pointLabel,a="inside"===s.getLabelPos(h),l=h.getOffset(),d=h.getDistance(),_=h.getAlign(),u=null==n?void 0:n.textAlign(),g=[],c=h.options.opposite,p=this._lineContainer.setVis(h.connector.visible)?this._lineContainer:null,y=new R,m=s.getCenter(i,o).x-t.x,w=r/2;let f=e?0:o;const V=n?n.getWidth(0):0,b=g&&!a&&this.$_createLabelInfo(this._sourceView.dom);let P,v;this._slices.forEach((s=>{const h=s.point;if(s.setVis(!h.isNull)){const x=o*h.yRate;if(e?(s.setPath(F.rectangle(0,f,r,x)),h.yPos=f+x/2,f+=x):(h.yPos=f-x/2,f-=x,s.setPath(F.rectangle(0,f,r,x))),h.xPos=w,v=null==p?void 0:p.get(h),n&&(P=n.get(h,0))&&P.visible){if(a){const e=P.isDomAnimating(),t=P.getBBox();!e&&P.layout(u||"center"),null==v||v.setVis(!1),P.trans(h.xPos-t.width/2,h.yPos-t.height/2)}else-1===_?this.$_layoutLabelNearVert(b,s,P,u,c,v,y,r,m,l,d):1==_?this.$_layoutLabelFarVert(b,s,P,u,c,v,y,l,d,V,t,i):this.$_layoutLabelOutVert(b,s,P,u,c,v,y,l,d);P.setContrast(a&&s.dom),g.push(P),P.setPosY(P.ty)}else v&&v.setVis(!1)}}))}$_renderHorz(e,t,i){const s=this.model,r=t.width,o=t.height,n=this._labelViews(),h=s.pointLabel,a="inside"===s.getLabelPos(h),l=h.getOffset(),d=h.getDistance(),_=h.getAlign(),u=null==n?void 0:n.textAlign(),g=[],c=h.options.opposite,p=this._lineContainer.setVis(h.connector.visible)?this._lineContainer:null,y=new R,m=s.getCenter(r,i).y-t.y,w=o/2,f=n?n.getWidth(0):0,V=g&&!a&&this.$_createLabelInfo(this._sourceView.dom);let b,P,v=e?r:0;this._slices.forEach((s=>{const h=s.point;if(s.setVis(!h.isNull)){const x=r*h.yRate;if(e?(h.xPos=v-x/2,v-=x,s.setPath(F.rectangle(v,0,x,o))):(h.xPos=v+x/2,s.setPath(F.rectangle(v,0,x,o)),v+=x),h.yPos=w,P=null==p?void 0:p.get(h),n&&(b=n.get(h,0))&&b.visible){if(a){const e=b.isDomAnimating(),t=b.getBBox();!e&&b.layout(u||"center"),b.trans(h.xPos-t.width/2,h.yPos-t.height/2),null==P||P.setVis(!1)}else-1===_?this.$_layoutLabelNearHorz(V,s,b,u,c,P,y,o,m,l,d):1==_?this.$_layoutLabelFarHorz(V,s,b,u,c,P,y,l,d,f,t,i):this.$_layoutLabelOutHorz(V,s,b,u,c,P,y,l,d);b.setContrast(a&&s.dom),g.push(b),b.setPosY(b.ty)}else P&&P.setVis(!1)}}))}$_calcLabelPosVert(e,t,i){const s=e.dom,r=s.ownerSVGElement.createSVGPoint(),o=2*(e.sx<0?1:1/e.sx);let n=t.point.yPos/e.sy,h=i?0:e.wFigure;if(i){for(;h<e.wFigure;h+=o)if(r.x=h,r.y=n,s.isPointInFill(r))return h>0&&(r.x-=o/2,s.isPointInFill(r)&&(h=r.x)),h*e.sx}else for(;h>=0;h-=o)if(r.x=h,r.y=n,s.isPointInFill(r))return h<e.wFigure&&(r.x+=o/2,s.isPointInFill(r)&&(h=r.x)),h*e.sx;return e.wFigure*e.sx/2}$_layoutLabelOutVert(e,t,i,s,r,o,n,h,a){const l=t.point,d=i.isDomAnimating(),_=i.getBBox(),u=l.yPos;!d&&i.layout(s||(r?"right":"left"));let g=this.$_calcLabelPosVert(e,t,r);o&&(r?o.setLine(n.reset(0,0).line(-a,0).end()):o.setLine(n.reset(0,0).line(a,0).end()),o.trans(g,u)),r?g-=a+h+_.width:g+=a+h,i.trans(g,u-_.height/2)}$_layoutLabelNearVert(e,t,i,s,r,o,n,h,a,l,d){const _=t.point,u=i.isDomAnimating(),g=i.getBBox(),c=_.yPos;!u&&i.layout(s||(r?"right":"left"));const p=_.xPos=this.$_calcLabelPosVert(e,t,r);let y=a;r?y-=h/2:y+=h/2,o&&(r?o.setLine(n.reset(0,0).line(y-p-d,0).end()):o.setLine(n.reset(0,0).line(y+d-p,0).end()),o.trans(p,c)),r?y-=l+d+g.width:y+=d+l,i.trans(y,c-g.height/2)}$_layoutLabelFarVert(e,t,i,s,r,o,n,h,a,l,d,_){const u=t.point,g=i.isDomAnimating(),c=i.getBBox(),p=u.yPos;!g&&i.layout(s||(r?"right":"left"));const y=u.xPos=this.$_calcLabelPosVert(e,t,r);let m;m=r?a+h+l-d.x:_-d.x-a-l-h,o&&(r?o.setLine(n.reset(0,0).line(m-y-a,0).end()):o.setLine(n.reset(0,0).line(m+a-y,0).end()),o.trans(y,p)),r?m-=h+a+c.width:m+=a+h,i.trans(m,p-c.height/2)}$_calcLabelPosHorz(e,t,i){const s=e.dom,r=s.ownerSVGElement.createSVGPoint(),o=2*(e.sy<0?1:1/e.sy);let n=t.point.xPos/e.sx,h=i?e.hFigure:0;if(i){for(;h>=0;h-=o)if(r.x=n,r.y=h,s.isPointInFill(r))return h<e.wFigure&&(r.y+=o/2,s.isPointInFill(r)&&(h=r.y)),h*e.sy}else for(;h<e.wFigure;h+=o)if(r.x=n,r.y=h,s.isPointInFill(r))return h>0&&(r.y-=o/2,s.isPointInFill(r)&&(h=r.y)),h*e.sy;return e.hFigure*e.sy/2}$_layoutLabelOutHorz(e,t,i,s,r,o,n,h,a){const l=t.point,d=i.isDomAnimating(),_=i.getBBox(),u=l.xPos;!d&&i.layout(s);let g=this.$_calcLabelPosHorz(e,t,r);o&&(r?o.setLine(n.reset(0,0).line(0,a).end()):o.setLine(n.reset(0,0).line(0,-a).end()),o.trans(u,g)),r?g+=a+h:g-=a+h,i.trans(u-_.width/2,r?g:g-_.height)}$_layoutLabelNearHorz(e,t,i,s,r,o,n,h,a,l,d){const _=t.point,u=i.isDomAnimating(),g=i.getBBox(),c=_.xPos;!u&&i.layout(s||(r?"right":"left"));let p=_.yPos=this.$_calcLabelPosHorz(e,t,r),y=a;r?y+=h/2:y-=h/2,o&&(r?o.setLine(n.reset(0,0).line(0,y+d-p).end()):o.setLine(n.reset(0,0).line(0,y-p-d).end()),o.trans(c,p)),r?y+=d+l:y-=l+d+g.height,i.trans(c-g.width/2,y)}$_layoutLabelFarHorz(e,t,i,s,r,o,n,h,a,l,d,_){const u=t.point,g=i.isDomAnimating(),c=i.getBBox(),p=u.xPos;!g&&i.layout(s||(r?"right":"left"));const y=u.yPos=this.$_calcLabelPosHorz(e,t,r);let m;m=r?_-d.y-a-l-h:a+h+l-d.y,o&&(r?o.setLine(n.reset(0,0).line(0,m+a-y).end()):o.setLine(n.reset(0,0).line(0,m-y-a).end()),o.trans(p,y)),r?m+=a+h:m-=h+a+c.height,i.trans(p-c.width/2,m)}}function Q(e){(function(e){return e.Series&&e.SeriesView})(e)&&(e.Series.register(H),e.Series.register(G),e.Series.register(K),e.SeriesView.register([H,M]),e.SeriesView.register([G,Y]),e.SeriesView.register([K,J]))}export{H as PictogramSeries,G as PictorialBarSeries,K as PictorialSeries,Q as default};
@@ -96,7 +96,6 @@
96
96
  --color-11: #8d877b;
97
97
  --color-12: #422c1e;
98
98
  }
99
-
100
99
  .rct-root[data-palette='vintage'] {
101
100
  --color-1: #2a9d8f;
102
101
  --color-2: #ff9a00;
@@ -1052,6 +1051,17 @@
1052
1051
  stroke-width: 2px;
1053
1052
  }
1054
1053
 
1054
+ /** pictorial series */
1055
+ .rct-pictorial-series .rct-point {
1056
+ stroke: none;
1057
+ }
1058
+ .rct-pictorial-series-figure {
1059
+ fill: #ddd;
1060
+ stroke: none;
1061
+ }
1062
+
1063
+ /** pictorialbar series */
1064
+
1055
1065
  /** wordcloud series */
1056
1066
  .rct-wordcloud-series .rct-point[data-focus] {
1057
1067
  filter: none !important;
package/split.js CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
- * RealChart Split v1.4.4
3
+ * RealChart Split v1.4.6
4
4
  * Copyright (C) 2023-2025 WooriTech Inc.
5
5
  * All Rights Reserved.
6
6
  */
7
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("realchart")):"function"==typeof define&&define.amd?define(["exports","realchart"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RealChartSplit={},t.RealChart)}(this,(function(t,e){"use strict";function s(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(s){if("default"!==s){var i=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:function(){return t[s]}})}})),e.default=t,Object.freeze(e)}var i=s(e);class r{constructor(t,e){this.row=t,this.col=e,this._axes=[]}sort(t,e){const s=e&&!t||!e&&t;this._axes.length>1&&(s?this._axes.sort(((t,e)=>{const s=t._posValue(),i=e._posValue();return s===i?s<0?e._index-t._index:s>0?t._index-e._index:t.row!==e.row?e.row-t.row:t.row<this.row?e._index-t._index:t._index-e._index:i-s})):this._axes.sort(((t,e)=>{const s=t._posValue(),i=e._posValue();return s===i?s<0?t._index-e._index:s>0?e._index-t._index:t.col!==e.col?t.col-t.col:t.col<this.col?t._index-e._index:e._index-t._index:s-i})))}}class n{constructor(t,e){this.chart=t,this.isX=e}rows(){return this._matrix.length}cols(){return this._matrix[0].length}_prepare(t,e,s,i){this._doPrepare(t,e,s),this._matrix.forEach((t=>{t.forEach((t=>t.sort(this.isX,i)))}))}get(t,e){return this._matrix[t][e]}getRow(t){return this._matrix[t]}getColumn(t){return this._matrix.map((e=>e[t]))}_buildTicks(t,e){const s=this.isX;this._matrix.forEach(((i,r)=>{i.forEach(((i,r)=>{i._axes.forEach((i=>{!i.isBased()&&(e<2||s)&&i._buildTicks(t[s?i.options.col:i.options.row],e)}))}))})),this._matrix.forEach(((i,r)=>{i.forEach(((i,r)=>{i._axes.forEach((i=>{i.isBased()&&(e<2||s)&&i._buildTicks(t[s?i.options.col:i.options.row],e)}))}))}))}_calcPoints(t,e){const s=this.isX;this._matrix.forEach((i=>{i.forEach(((i,r)=>{i._axes.forEach((i=>{if(e<2||s){const r=s?i.options.col:i.options.row;i._calcPoints(t[r],e)}}))}))}))}}class o extends n{constructor(t){super(t,!0)}_doPrepare(t,e,s){const i=this._matrix=new Array(e+1);for(let t=0;t<i.length;t++){i[t]=[];for(let e=0;e<s;e++)i[t].push(new r(t,e))}t.forEach((t=>{var s,r;const n=t.options.position;let o=t.row;"opposite"===n?(o++,t._runPos=n):o<e-1&&"between"===n?(o++,t._runPos="normal"):t._runPos=n,null===(r=null===(s=i[o])||void 0===s?void 0:s[t.col])||void 0===r||r._axes.push(t)}))}}class h extends n{constructor(t){super(t,!1)}_doPrepare(t,e,s){const i=this._matrix=new Array(e);for(let t=0;t<i.length;t++){i[t]=[];for(let e=0;e<=s;e++)i[t].push(new r(t,e))}t.forEach((t=>{var e,r;const n=t.options.position;let o=t.col;"opposite"===n?(o++,t._runPos=n):t.col<s-1&&"between"===n?(o++,t._runPos="normal"):t._runPos=n,null===(r=null===(e=i[t.row])||void 0===e?void 0:e[o])||void 0===r||r._axes.push(t)}))}}class a extends e.Body{constructor(t){super(t.chart),this.pane=t}contains(t){return t.col===this.pane.col||t.row===this.pane.row}}a.defaults=e.extend(e.Body.defaults,{extended:!0,radius:void 0,centerX:void 0,centerY:void 0});class l extends e.Legend{constructor(t){super(t.chart),this.pane=t}_doPrepareRender(t){super._doPrepareRender(t),this._location="body"}_getLegendSources(){return this.options.visible?this.chart._getSeries().getLegendSources(this.pane.row,this.pane.col):[]}}class d extends e.ChartItem{constructor(t,e,s){super(t),this.row=e,this.col=s}_doInit(t){t.body=(this._body=new a(this)).init(),t.legend=(this._legend=new l(this)).init()}get body(){return this._body}get legend(){return this._legend}_prepareRender(){this._body._prepareRender(),this._legend._prepareRender()}}class c extends e.ChartItem{constructor(t){super(t),this._cols=1,this._rows=1,this._paneDic={},this._panes=[],this._xAxes=new o(t),this._yAxes=new h(t)}get count(){return this._rows*this._cols}get rowCount(){return this._rows}get colCount(){return this._cols}get paneCount(){return this._rows*this._cols}colSizes(){return this._colSizes}rowSizes(){return this._rowSizes}getPane(t,e){return this._panes[t][e]}getRow(t){return this._panes[t]}getColumn(t){return this._panes.map((e=>e[t]))}getAxisOf(t,e){var s,i;const r=this.chart,n=t.body;if(n){const o=n.pane;return e?r._getXAxes().get(t.options.xAxis)||this._xAxes.get(o.row,o.col)._axes[0]||(null===(s=r._getSeries().getPaneSeries(o.row,o.col)[0])||void 0===s?void 0:s._xAxisObj):r._getXAxes().get(t.options.yAxis)||this._yAxes.get(n.pane.row,n.pane.col)._axes[0]||(null===(i=r._getSeries().getPaneSeries(o.row,o.col)[0])||void 0===i?void 0:i._yAxisObj)}}isValidAxis(t){return t&&t.row<this._rows&&t.col<this._cols}_doLoadProp(t,e){return["panes","cols","rows"].indexOf(t)>=0||super._doLoadProp(t,e)}_doSetSimple(t){if(e.isArray(t)&&t.length>0){const s=e.maxv(1,+t[0]),i=e.maxv(1,e.pickNum(+t[1],s));return s>0&&i>0&&(this.$_parsePanes(s,i),this.visible=!0),!0}return super._doSetSimple(t)}_load(t){return super._load(t),e.isObject(t)&&(this.$_parsePanes(t.rows,t.cols),this._paneDic=this.$_loadPanes(t.panes)),this}_doPrepareRender(t){this._panes=this.$_collectPanes(t),this._panes.forEach((t=>t.forEach((t=>t._prepareRender()))))}_calcSizes(t,s){const i=t.length,r=new Array(i);let n=0;if(i>1){let o=s,h=0;for(n=0;n<i;n++){const s=t[n];e.isNumber(s)?o-=r[n]=Math.max(0,Math.min(o,s)):h+=s.size}if(h>0)for(n=0;n<i;n++){const s=t[n];e.isNumber(s)||(r[n]=o*s.size/h)}}else r[n]=s;return r}getXLens(t){return this._calcSizes(this._colSizes,t)}getYLens(t){return this._calcSizes(this._rowSizes,t)}measureAxes(t,e,s,i){const r=this.getXLens(s?e:t),n=this.getYLens(s?t:e);this._xAxes._buildTicks(r,i),this._yAxes._buildTicks(n,i),this.$_calcAxesPoints(r,n,i)}$_calcAxesPoints(t,e,s){this._xAxes._calcPoints(t,s),this._yAxes._calcPoints(e,s)}completeAxesPoints(t,e){this.$_calcAxesPoints(t,e,101)}getBodyAnnotation(t){for(const e in this._paneDic){const s=this._paneDic[e].body.getAnnotation(t);if(s)return s}}prepareRender(t,e){const s=this.chart.isInverted();this._prepareRender(),this._xAxes._prepare(t,this._rows,this._cols,s),this._yAxes._prepare(e,this._rows,this._cols,s)}$_parseSizes(t){let s;return s=e.isArray(t)&&t.length>0?t.slice(0):t>0?new Array(t).fill("*"):["*"],s.map((t=>{if(e.isString(t)){const s=t.trim();return{size:"*"===s?1:e.pickNum(parseFloat(s),1)}}return e.pickNum(+t,1)}))}$_parsePanes(t,e){this._colSizes=this.$_parseSizes(e),this._rowSizes=this.$_parseSizes(t),this._cols=this._colSizes.length,this._rows=this._rowSizes.length}$_loadPanes(t){const s=this.chart,i=this._op.extendBody?s._body._config:void 0,r={};if(t=e.isArray(t)?t:e.isObject(t)?[t]:null,e.isArray(t)&&t.forEach((t=>{const e=+t.row||0,n=+t.col||0;if(n>=0&&n<this._cols&&e>=0&&e<this._rows){const o=new d(s,e,n);let h=t;o.init(),!i||t&&t.body&&!1===t.body.extended||(t?(h=Object.assign({},t),t.body?!1!==t.body.extended&&(h.body=Object.assign({},i,t.body)):h.body=i):h={body:i}),o._load(h),r[e+","+n]=o}})),i)for(let t=0;t<this._rows;t++)for(let e=0;e<this._cols;e++){const n=t+","+e;if(!r[n]){const o=new d(s,t,e);o.init(),o._load({body:i}),r[n]=o}}return r}$_collectPanes(t){const e=[];for(let s=0;s<this._rows;s++){const i=[];for(let e=0;e<this._cols;e++){const r=this._paneDic[s+","+e]||new d(t,s,e)._initObject();i.push(r)}e.push(i)}return e}}c.defaults=e.extend(e.ChartItem.defaults,{visible:!1,extendBody:!0,gap:0});const _="http://www.w3.org/2000/svg",u=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},p=Array.isArray,g=function(t){return"string"==typeof t},m=Object.assign,f=Math.min,y=Math.max,w=Math.abs,v=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t};let b=0;class x{static destroy(t){return t&&t.destroy()}constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(b++))}destroy(){return this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this._doDestroy(),this.$_destroyed=!0),null}_doDestroy(){}get destroying(){return this.$_destroying}get orphaned(){return this.$_destroying||this.$_destroyed}get hash(){return this.$_hash}isMe(t){return t===this.$_hash}toString(){return this.constructor.name}toBool(t){return"string"==typeof t?"true"===t:t}toNum(t,e=NaN){return t=parseFloat(t),isNaN(t)?e:t}}class A extends x{constructor(t,e,s,i=0){super(),this.removeDelay=0,this._pool=[],this._views=[],this._removes=[],this._owner=t,this._creator=e,this._styleName=s,this.removeDelay=i}_doDestroy(){this.freeAll(),this._owner=null,this._creator=null,super._doDestroy()}get isEmpty(){return 0===this._views.length}get count(){return this._views.length}get first(){return this._views[0]}get last(){return this._views[this._views.length-1]}get(t){return this._views[t]}getAll(){return this._views.slice()}pull(t){let e=this._views[t];return e||(e=this._pool.pop()||new this._creator(this._owner.doc,this._styleName),this._owner.add(e),this._views.push(e)),e}_internalItems(){return this._views}elementOf(t){for(let e of this._views)if(e.contains(t))return e}find(t){return this._views.find(t)}setRemoveDelay(t){return this.removeDelay=t,this}removeLater(t,e){const s=this._views.indexOf(t);s>=0&&(t.removeLater(e,(t=>{this._pool.push(t)})),this._views.splice(s,1))}$_create(t,e=-1,s=0){let i=this._pool.pop();return i||(i=new this._creator(t,this._styleName)),i}prepare(t,e,s){const i=this._owner.doc,r=this._owner,n=this._pool,o=this._views;for(;o.length>t;)n.push(o.pop().remove());for(;o.length<t;){const e=this.$_create(i);o.push(e),null==s||s(e,o.length-1,t),r.add(e)}return e&&this.forEach(e),this}borrow(){const t=this._pool.pop()||new this._creator(this._owner.doc,this._styleName);return this._owner.add(t),t}free(t,e=0){if(t){e>0?t.removeLater(e):t.remove(),this._pool.push(t);const s=this._views.indexOf(t);s>=0&&this._views.splice(s,1)}}freeAll(t,e=0){for(let s=(t=t||this._views).length-1;s>=0;s--)this.free(t[s],e)}freeHiddens(){const t=this._views;for(let e=t.length-1;e>=0;e--)!t[e].visible&&this.free(t[e],0)}freeFrom(t){const e=this._views;for(let s=e.length-1;s>=t;s--)this.free(e[s],0)}forEach(t){const e=this._views;for(let s=0,i=e.length;s<i;s++)t(e[s],s,i)}visit(t){const e=this._views.length;let s=0;for(;s<e&&!1!==t(this._views[s],s,e);s++);return s===e}sort(t){const e=this._views;return e.sort(t),e.forEach((t=>this._owner.appendDom(t.dom))),this}sortDom(t){const e=this._views.slice(0);return e.sort(t),e.forEach((t=>this._owner.appendDom(t.dom))),this}map(t){return this._views.map(t)}front(t){t.front(this._views)}back(t){t.back(this._views)}}const E=Object.freeze({x:0,y:0,width:0,height:0});const S={ko:{dateFormat:"yyyy.MM.dd",am:"오전",pm:"오후",notExistsDataField:"존재하지 않는 필드입니다: %1",notSpecifiedDataField:"하나 이상의 데이터필드가 설정돼야 합니다.",invalidFieldName:"잘못된 데이터필드 이름입니다: %1",invalidRowIndex:"잘못된 데이터행 index입니다: %1",invalidToIndex:"잘못된 'to' index입니다.: %1",requireSourceData:"원본 data가 반드시 지정돼야 합니다.",requireFilterName:"필터 이름이 반드시 지정돼야 합니다.",invalidDateFormat:"잘못된 시간 날짜 형식입니다: %1",invalidSizeValue:"잘못된 Size 값입니다: %1",invalidOuterDiv:"잘못된 외부 div 입니다: %1",dataMustSet:"데이터가 먼저 설정돼야 합니다.",requireTableName:"테이블모델의 이름이 지정돼야 합니다.",alreadyTableExists:"이미 존재하는 테이블모델입니다: %1"},en:{dateFormat:"M/d/yyyy",am:"AM",pm:"PM",notExistsDataField:"A data field is not exists: %1",notSpecifiedDataField:"At least one datafield must be set.",invalidFieldName:"Invalid field name: %1",invalidRowIndex:"Invalid row index: %1",invalidToIndex:"Invalid 'to' index: %1",requireSourceData:"A source data must be set.",requireFilterName:"A filter name must be set.",invalidDateFormat:"Invalid datetime format: %1",invalidSizeValue:"Invalid size value: %1",invalidOuterDiv:"Invalid outer div element: %1",dataMustSet:"A data must be set first.",requireTableName:"The name of table model is required.",alreadyTableExists:"A table model is already exists: %1"}};let C="ko",N=S[C]||S[C="ko"];const k=void 0;function D(t){return t+"px"}function L(t){return null==t||Number.isNaN(t)||""===t}const T={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeWidth:"stroke-width",strokeDasharray:"stroke-dasharray",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",fontStyle:"font-style",padding:"padding",margin:"margin"},B=function(t){const e=T[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return T[t]=e,e}return e};class M{static clearChildren(t){let e;for(;e=t.lastChild;)t.removeChild(e)}static remove(t){const e=t&&t.parentElement;return e&&e.removeChild(t),null}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setImportantStyle(t,e,s){t.setProperty(e,s,"important")}static getPadding(t){const e=getComputedStyle(t);return{left:parseFloat(e.paddingLeft)||0,right:parseFloat(e.paddingRight)||0,top:parseFloat(e.paddingTop)||0,bottom:parseFloat(e.paddingBottom)||0}}}const $=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});class R{static log(...t){this.LOGGING&&console.log(...t)}static warn(...t){this.LOGGING&&console.warn(...t)}static now(){return+new Date}static parseDate(t,e){const s=new Date(t);return isNaN(s.getTime())?e||new Date:s}static isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static dateOfYear(t){var e=t.getMonth(),s=t.getDate(),i=[0,31,59,90,120,151,181,212,243,273,304,334][e]+s;return e>1&&R.isLeapYear(t.getFullYear())&&i++,i}static incMonth(t,e){const s=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(f(s,R.month_days[R.isLeapYear(t.getFullYear())?1:0][t.getMonth()])),t}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static weekOfMonth(t,e,s){const i=t.getMonth(),r=t.getFullYear(),n=new Date(r,i,1).getDay(),o=new Date(r,i+1,0).getDate(),h=t.getDate()+n-1,a=e+Math.ceil((o+n-7)/7),l=e+Math.floor(h/7);return s||l<2+e?l:l===a?e+5:l}static weekOfYear(t,e){const s=t.getFullYear(),i=new Date(s,0,1).getDay(),r=this.dateOfYear(t)+i-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!p(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static copyObject(t){if(t&&"object"==typeof t&&!p(t))return m({},t)}static checkArray(t){return p(t)?t:void 0}static makeArray(t,e=!1){return null!=t?p(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return p(t)?t.map((t=>+t)):null!=t?[+t]:[]}static getIntArray(t,e=0){const s=[];for(let i=e,r=e+t;i<r;i++)s.push(i);return s}static isValueArray(t){if(p(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return p(t)?t:null!=t?[t]:null}static copyArray(t){return p(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let s=0,i=e.length;s<i;s++)t.push(e[s])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNumber(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNum(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}static getNumber(t,e=0){const s=parseFloat(t);return isFinite(s)?s:e}static toNumber(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,s=!1){return t=t||"",e=e||"",s&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-$}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=y(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=y(e||2,1),s=s||"0",new Array(e-t.toString(16).length+1).join(s)+t.toString(16)}static pick(...t){const e=t.length;let s;for(let i=0;i<e;i++)if(s=t[i],null!=s)return s}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const s=t.length;if(s!=e.length)return!1;for(let i=0;i<s;++i)if(t[i]!==e[i])return!1;return!0}static parseTuples(t){if(p(t)){const e=[];let s=-1/0;return t.forEach(((i,r)=>{p(i)?!isNaN(i[0])&&!isNaN(i[1])&&i[0]>s&&(e.push([+i[0],+i[1]]),s=i[0]):isNaN(i)||r!==t.length-1||e.push([1/0,+i])})),e.length>0?e:void 0}if(!isNaN(t))return[[1/0,+t]]}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static setter(t){return"set"+t[0].toUpperCase()+t.slice(1)}static deepClone(t){if(t instanceof Date)return new Date(t);if(null==t||"object"!=typeof t)return t;{const e=p(t)?[]:{};for(let s of Object.keys(t))e[s]=R.deepClone(t[s]);return e}}static getArray(t,e){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static getNumArray(t,e=0){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static dedupe(t,e){for(let s=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;s>0;s--)t[s]===t[s-1]&&t.splice(s,1);return t}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(t,e){const s=+new Date;e(),R.log(t,+new Date-s+"ms")}static clamp(t,e,s){return y(e,f(s,t))}static makeIntArray(t,e){const s=new Array(y(0,e-t));for(let i=t;i<e;i++)s[i-t]=i;return s}static shuffle(t){for(let e=t.length;e;){const s=Math.floor(Math.random()*e),i=t[--e];t[e]=t[s],t[s]=i}return t}static isDate(t){return"[object Date]"===Object.prototype.toString.call(t)}static isValidDate(t){return t.getTime()==t.getTime()}static asFunction(t){return"function"==typeof t?t:void 0}static getFieldProp(t){const e=t.indexOf(".");if(e>=0)return{field:t.substring(0,e),props:t.substring(e+1).split(".")}}static startsWith(t,e){if(t&&e)return 0===t.indexOf(e)}static endsWith(t,e){if(t&&e)return t.indexOf(e,-t.length)===t.length-e.length}static scaleNumber(t,e,s){const i=w(t);if(i>=1e3){let r=e.length;for(;r>0;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(i)*Math.LOG10E)&&(s||10*i%n==0))return{value:t/n,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}static randomLike(t){return(2654435761*(123456789^t)>>>16)/65536}}var P;R.LOGGING=!1,R.week_days=["일","월","화","수","목","금","토"],R.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],R.month_days=[[31,28,31,30,31,30,31,31,30,31,30,31],[31,29,31,30,31,30,31,31,30,31,30,31]],R.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}(),function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(P||(P={}));const z="$ProductVersion";class O extends x{constructor(t,e,s){super(),this._inited=!1,this._testing=!1,this._dirty=!0,this._toAnimation=0,this._invalidateLock=!1,this._lockDirty=!1,this._cssVars={},this._wSave=NaN,this._hSave=NaN,this.loaded=!1,this._windowResizeHandler=t=>{this._domResized()},this._domResizeHandler=t=>{this._domResized()},this._clickHandler=t=>{this._pointerHandler&&this._pointerHandler.handleClick(this.toOffset(t))},this._dblClickHandler=t=>{this._pointerHandler&&this._pointerHandler.handleDblClick(this.toOffset(t))},this._touchMoveHandler=t=>{},this._pointerDownHandler=t=>{this._pointerHandler&&this._pointerHandler.handleDown(this.toOffset(t))},this._pointerMoveHandler=t=>{this._pointerHandler&&this._pointerHandler.handleMove(this.toOffset(t))},this._pointerUpHandler=t=>{this._pointerHandler&&this._pointerHandler.handleUp(this.toOffset(t))},this._pointerCancelHandler=t=>{},this._pointerLeaveHandler=t=>{this._pointerHandler&&this._pointerHandler.handleLeave(this.toOffset(t))},this._keyPressHandler=t=>{},this._wheelHandler=t=>{},!t&&e instanceof HTMLDivElement&&(t=e.ownerDocument),this._initControl(t||document,e,s||O.CLASS_NAME),"undefined"!=typeof window&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._domResizeHandler)),this._resigterEventHandlers(this._dom),this._inited=!0,this.invalidate(!0)}_doDestroy(){this._requestTimer&&(window.requestAnimationFrame?cancelAnimationFrame(this._requestTimer):clearTimeout(this._requestTimer)),this._unresigterEventHandlers(this._dom),M.remove(this._dom),this._dom=null,this._container=null}isInited(){return this._inited}isTesting(){return this._testing}doc(){return this._dom.ownerDocument}dom(){return this._dom}svg(){return this._svg}width(){return this._container.offsetWidth}height(){return this._container.offsetHeight}contentWidth(){return this.width()-this._padding.left-this._padding.right}contentHeight(){return this.height()-this._padding.top-this._padding.bottom}contentRight(){return this.width()-this._padding.right}clipContainer(){return this._defs}setData(t,e,s){L(e)?(this._root.dom.removeAttribute("data-"+t),s&&this._dom.removeAttribute("data-"+t)):(this._root.dom.setAttribute("data-"+t,e),s&&this._dom.setAttribute("data-"+t,e))}clearDefs(){M.clearChildren(this._defs)}$_clearDefs(t){const e=this._defs.children||[];for(let s=e.length-1;s>=0;s--)e[s].hasAttribute(t)&&e[s].remove()}clearAssetDefs(){this.$_clearDefs(H.ASSET_KEY)}clearTemporaryDefs(){this.$_clearDefs(H.TEMP_KEY)}appendDom(t){return t&&this._htmlRoot.append(t),t}addElement(t){return t&&this._root.add(t)}setPointerHandler(t){this._pointerHandler=t}invalidate(t=!1){t||!this._invalidateLock&&!this._dirty&&this._inited?(this._dirty=!0,this._requestTimer||this._testing||this.$_requestRender()):this._invalidateLock&&(this._lockDirty=!0)}invalidateLayout(t=!1){this.invalidate(t)}setLock(){this._invalidateLock=!0}releaseLock(t=!0){this._invalidateLock&&(this._invalidateLock=!1),this._lockDirty&&t&&this.invalidate(),this._lockDirty=!1}lock(t){this.setLock();try{t(this)}finally{this.releaseLock()}}silentLock(t){this.setLock();try{t(this)}finally{this.releaseLock(!1)}}setResizeDelay(t){this._resizeDelay=t}getBounds(){return this._bounds}setAnimation(t){this._toAnimation=t||0}fling(t,e){}getCssVar(t){let e=this._cssVars[t];return t in this._cssVars?this._cssVars[t]:(e=getComputedStyle(this._root.dom).getPropertyValue(t),this._cssVars[t]=e,e)}clipBounds(t=NaN,e=NaN,s=NaN,i=NaN,r=0){const n=new F(this.doc(),t,e,s,i,r,r);return this._defs.appendChild(n.dom),n}clipCircle(){const t=new G(this.doc());return this._defs.appendChild(t.dom),t}addDef(t){this._defs.appendChild(t)}removeDef(t){if(g(t))for(const e in this._defs.children)if(e instanceof Element&&e.id===t){t=e;break}t instanceof Element&&this._defs.removeChild(t)}containerToElement(t,e,s){const i=this._container.getBoundingClientRect(),r=t.getBounds();return{x:e-r.x+i.x,y:s-r.y+i.y}}svgToElement(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e-r.left+i.left,y:s-r.top+i.top}}elementToSvg(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e+r.left-i.left,y:s+r.top-i.top}}_setTesting(){this._testing=!0,H.TESTING=!0}_setSize(t,e){isNaN(t)||(this._container.style.width=t+"px"),isNaN(e)||(this._container.style.height=e+"px")}$_addListener(t,e,s,i){i?t.addEventListener(e,s,{passive:!0}):t.addEventListener(e,s)}_resigterEventHandlers(t){var e;window.addEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.observe(t),this.$_addListener(t,"click",this._clickHandler),this.$_addListener(t,"dblclick",this._dblClickHandler),this.$_addListener(t,"touchmove",this._touchMoveHandler,!0),this.$_addListener(t,"pointerdown",this._pointerDownHandler),this.$_addListener(t,"pointermove",this._pointerMoveHandler),this.$_addListener(t,"pointerup",this._pointerUpHandler),this.$_addListener(t,"pointercancel",this._pointerCancelHandler),this.$_addListener(t,"pointerleave",this._pointerLeaveHandler),this.$_addListener(t,"keypress",this._keyPressHandler),this.$_addListener(t,"wheel",this._wheelHandler,!0)}_unresigterEventHandlers(t){var e,s;window.removeEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.unobserve(t),null===(s=this._resizeObserver)||void 0===s||s.disconnect(),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("touchmove",this._touchMoveHandler),t.removeEventListener("pointerdown",this._pointerDownHandler),t.removeEventListener("pointermove",this._pointerMoveHandler),t.removeEventListener("pointerup",this._pointerUpHandler),t.removeEventListener("pointercancel",this._pointerCancelHandler),t.removeEventListener("pointerleave",this._pointerLeaveHandler),t.removeEventListener("keypress",this._keyPressHandler),t.removeEventListener("wheel",this._wheelHandler)}_prepareRenderers(t){}_initControl(t,e,s){if(this._inited)return;e instanceof HTMLDivElement?this._container=e:this._container=t.getElementById(e),this._container instanceof HTMLDivElement||((t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))})(N.invalidOuterDiv,e);const i=this._container.ownerDocument,r=this._dom=i.createElement("div");m(r.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),r.className=s,this._container.appendChild(r);const n=this._svg=i.createElementNS(_,"svg");n.classList.add("rct-svg"),n.style.setProperty("overflow","visible","important"),n.setAttribute("width","100%"),n.setAttribute("height","100%");const o=i.createElement("desc");o.textContent="Created by RealChart v"+z,n.appendChild(o);const h=this._defs=i.createElementNS(_,"defs");this._initDefs(i,h),n.appendChild(h),r.appendChild(n),this._root=new V(this),n.appendChild(this._root._dom),this._htmlRoot=i.createElement("div"),r.appendChild(this._htmlRoot),m(this._htmlRoot.style,{position:"absolute"})}_initDefs(t,e){let s=t.createElementNS(_,"filter");s.setAttribute("id",O.SHADOW_FILTER);const i=t.createElementNS(_,"feGaussianBlur");i.setAttribute("stdDeviation","1.5"),i.setAttribute("in","SourceAlpha"),s.appendChild(i);const r=t.createElementNS(_,"feOffset");r.setAttribute("dx","1"),r.setAttribute("dy","1"),r.setAttribute("result","offsetblur"),s.appendChild(r);const n=t.createElementNS(_,"feFlood");n.setAttribute("flood-color","#000"),s.appendChild(n);const o=t.createElementNS(_,"feComposite");o.setAttribute("in2","offsetblur"),o.setAttribute("operator","in"),s.appendChild(o);const h=t.createElementNS(_,"feMerge"),a=t.createElementNS(_,"feMergeNode"),l=t.createElementNS(_,"feMergeNode");l.setAttribute("in","SourceGraphic"),h.appendChild(a),h.appendChild(l),s.appendChild(h),e.appendChild(s)}_render(){this.$_render()}$_requestRender(){this.orphaned||(window.requestAnimationFrame?this._requestTimer=window.requestAnimationFrame((()=>this.$_render())):this._requestTimer=setTimeout((()=>{this.$_render()}),0))}updateNow(){this.$_render()}$_render(){if(!this.orphaned)if(this._bounds=this._dom.getBoundingClientRect(),+new Date<=this._toAnimation)this.$_requestRender();else{R.LOGGING&&console.time("render chart");try{this._doBeforeRender();const t=this._dom.getBoundingClientRect(),e=this._svg.getBoundingClientRect(),s=this._svg.clientWidth,i=this._svg.clientHeight;m(this._htmlRoot.style,{left:D(e.left-t.left),top:D(e.top-t.top)});const r=this._container.firstElementChild;r.removeAttribute("style"),m(r.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),this._doRenderBackground(r,this._root,s,i);const n=this._padding=M.getPadding(this._root.dom);this._doRender({x:n.left,y:n.top,width:s-n.left-n.right,height:i-n.top-n.bottom})}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),R.LOGGING&&console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,s,i){}_domResized(){const t=this.width(),e=this.height(),s=this._resizeDelay;t===this._wSave&&e===this._hSave||(this._wSave=t,this._hSave=e,this._resizeTimer&&clearTimeout(this._resizeTimer),s>0?this._resizeTimer=setTimeout((()=>{this.invalidateLayout(),this._resizeTimer=null}),s):this.invalidateLayout())}toOffset(t){const e=this._container.getBoundingClientRect();return t.pointX=t.clientX-e.left,t.pointY=t.clientY-e.top,t}setPointerCapture(t){this._dom.setPointerCapture(t.pointerId)}releasePointerCapture(t){this._dom.releasePointerCapture(t.pointerId)}}O.CLASS_NAME="rct-control",O.SHADOW_FILTER="rr-chart-shadow-filter",O._animatable=!0;class H extends x{constructor(t,e,s=k){super(),this._visible=!0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=t.createElementNS(_,s||"g"),(this._styleName=e||"")&&this.setAttr("class",this._styleName)}_doDestroy(){this.remove()}get doc(){return this._dom.ownerDocument}get dom(){return this._dom}get parent(){return this._parent}get control(){return this._parent&&this._parent.control}get x(){return this._x}set x(t){t!==this._x&&(this._x=t,this.setAttr("x",this._x))}get tx(){return this._tx}get y(){return this._y}set y(t){t!==this._y&&(this._y=t,this.setAttr("y",this._y))}get ty(){return this._ty}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,this.setAttr("width",isNaN(t)?"":t))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,this.setAttr("height",isNaN(t)?"":t))}get tright(){return this._tx+this._dom.getBBox().width}get tbottom(){return this._ty+this._dom.getBBox().height}get visible(){return this._visible}set visible(t){this.setVis(t)}setVis(t){return t!==this._visible&&(this._visible=t,this._dom&&(this._dom.style.display=t?"":"none")),this._visible}get rotation(){return this._rotation}set rotation(t){t!=this._rotation&&(this._rotation=t,this._updateTransform())}setRotation(t,e,s){return t===this._originX&&e===this._originY&&s===this._rotation||(this._originX=t,this._originY=e,this._rotation=s,this._updateTransform()),this}getStyle(t){return window.getComputedStyle(this._dom).getPropertyValue(t)}hasStyle(t){return this.dom.classList.contains(t)}add(t){return t&&t._parent!==this&&(t._parent=this,this._dom.appendChild(t._dom),t._doAttached(this)),t}insertChild(t,e){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,e._dom),t._doAttached(this)),t}insertAfter(t,e){return t&&t._parent!==this&&(t._parent=this,e._dom.nextSibling?this._dom.insertBefore(t._dom,e._dom.nextSibling):this._dom.appendChild(t._dom),t._doAttached(this)),t}insertFirst(t){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,this._dom.firstChild),t._doAttached(this)),t}appendElement(t,e){const s=t.createElementNS(_,e);return this._dom.appendChild(s),s}insertElement(t,e,s){const i=t.createElementNS(_,e);return this._dom.insertBefore(i,s),i}remove(){return this._parent&&(this._parent._dom.removeChild(this._dom),this._parent=null,this._doDetached(this)),this}getAttr(t){return this._dom.getAttribute(t)}setAttr(t,e){return this._dom.setAttribute(t,e),this}setAttrEx(t,e){return L(e)?this._dom.removeAttribute(t):this._dom.setAttribute(t,e),this}setAttrs(t){for(let e in t)this._dom.setAttribute(e,t[e]);return this}unsetAttr(t){return this._dom.removeAttribute(t),this}getBounds(){return this._dom.getBoundingClientRect()}setBounds(t,e,s,i){return this.trans(t,e),this.resize(s,i),this}setRect(t){return this.trans(t.x,t.y),this.resize(t.width,t.height),this}getRect(){return{x:this._tx,y:this._ty,width:this.width,height:this.height}}getSize(){return{width:this.width,height:this.height}}getBBox(){return this._dom.getBBox()}getBBoxEx(){const t=this._dom.getBBox();return t.x+=this._tx,t.y+=this._ty,t}inflateBBox(t,e){const s=this._dom.getBBox();return s.x+=this._tx,s.y+=this._ty,s.x-=t,s.width+=2*t,s.y-=e,s.height+=2*e,s}controlToElement(t,e){return this.control.containerToElement(this,t,e)}svgToElement(t,e){return this.control.svgToElement(this,t,e)}elementToSvg(t,e){return this.control.elementToSvg(this,t,e)}move(t,e){return this.x=t,this.y=e,this}setPos(t,e){this._x=t,this._y=e}setPosY(t){this._y=t}isDomAnimating(){return!!this._dom.getAnimations&&this._dom.getAnimations().length>0}rotate(t){return t!==this._rotation&&(this._rotation=t,this._updateTransform()),this}internalRotate(t){this._rotation=t}scale(t){return this._scaleX===t&&this._scaleY===t||(this._scaleX=this._scaleY=t,this._updateTransform()),this}trans(t,e){return t=R.isValidNum(t)?t:this._tx,e=R.isValidNum(e)?e:this._ty,t===this._tx&&e===this._ty||(this._tx=t,this._ty=e,this._updateTransform()),this}transp(t){return this.trans(t.x,t.y)}transEx(t,e,s=0,i=!0){if(t=R.isValidNum(t)?t:this._tx,e=R.isValidNum(e)?e:this._ty,t!==this._tx||e!==this._ty){if(s>0){const r=this._dom.animate([{transform:`translate(${this._tx||0}px,${this._ty||0}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:s,fill:"none"});i&&(null==r||r.addEventListener("finish",(()=>{var t;return null===(t=this.control)||void 0===t?void 0:t.invalidateLayout()})))}this._tx=t,this._ty=e,this._updateTransform()}return this}transEx2(t,e,s=0,i=!0){const r=R.isValidNum(t)?t:this._tx,n=R.isValidNum(e)?e:this._ty;if(r===this._tx&&n===this._ty)return this;if(s>0){const t=this._rotation||0,e=`translate(${this._tx||0}px, ${this._ty||0}px)`+(t?` rotate(${t}deg)`:""),o=`translate(${r}px, ${n}px)`+(t?` rotate(${t}deg)`:"");this._dom.style.transformOrigin=`${this._originX||0}px ${this._originY||0}px`;const h=this._dom.animate([{transform:e},{transform:o}],{duration:s,fill:"none"});i&&h.addEventListener("finish",(()=>{var t;this._dom.style.transformOrigin="",null===(t=this.control)||void 0===t||t.invalidateLayout()}))}return this._tx=r,this._ty=n,this._updateTransform(),this}transX(t){return t!==this._tx&&R.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&R.isValidNum(t)&&(this._ty=t,this._updateTransform()),this}shiftY(t){return this.transY(this._ty+t)}resize(t,e,s=!0){let i=!1;return t!==this._width&&(this._width=Math.max(0,t),s&&this.setAttrEx("width",this._width),i=!0),e!==this._height&&(this._height=Math.max(0,e),s&&this.setAttrEx("height",this._height),i=!0),i}appendDom(t){return t&&this._dom.appendChild(t),t}insertDom(t,e){return t&&this._dom.insertBefore(t,e),t}clearDom(){const t=this._dom;let e;for(;e=t.lastChild;)t.removeChild(e)}containsClass(t){return this._dom.classList.contains(t)}addClass(t){return this._dom.classList.add(...t.split(" ").filter((t=>t.length>0))),this}removeClass(t){return this._dom.classList.remove(t),this}saveStyles(){this._saveStyle=this._dom.getAttribute("style")||null,this._saveClass=this._dom.getAttribute("class")}restoreStyles(){void 0!==this._saveStyle&&(this._dom.setAttribute("style",this._saveStyle),this._dom.style.display=this._visible?"":"none",delete this._saveStyle),this._saveClass&&(this._dom.setAttribute("class",this._saveClass),delete this._saveClass)}internalClearStyles(){const t=this.dom.style;for(let e in this._styles)t.removeProperty(B(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(B(s)),e=!0;return this._styles={},e&&(this._styleDirty=!0),e}clearStyle(t){let e=!1;if(t){const s=this.dom.style;for(let i of t)i in this._styles&&(s.removeProperty(B(i)),delete this._styles[i],e=!0);e&&(this._styleDirty=!0)}return e}internalSetStyles(t){if(t){const e=this.dom.style;for(let s in t)e[s]=this._styles[s]=t[s]}}internalImportantStylesOrClass(t){if(g(t))t&&this._dom.classList.add(t);else if(u(t)){const e=this.dom.style;for(let s in t)e.setProperty(B(s),this._styles[s]=t[s],"important")}}setStyles(t){let e=!1;if(t){const s=this.dom.style;for(let i in t){const r=t[i];this._styles[i]!==r&&(this._styles[i]=r,"rx"==i&&this._dom.setAttribute(i,r),s[i]=r,e=!0)}e&&(this._styleDirty=!0)}return e}resetStyles(t){const e=this.clearStyles();return this.setStyles(t)||e}_resetClass(){this._styleName?this.setAttr("class",this._styleName):this.unsetAttr("class")}clearStyleAndClass(){this.clearStyles(),this._resetClass()}internalClearStyleAndClass(){this.internalClearStyles(),this._resetClass()}setStyleOrClass(t){g(t)?(this._resetClass(),t&&this.addClass(t)):this.resetStyles(t)}internalSetStyleOrClass(t){g(t)?t&&this.addClass(t):this.internalSetStyles(t)}addStyleOrClass(t){g(t)?t&&this.addClass(t):u(t)&&this.setStyles(t)}setClass(t){this.setAttr("class",t)}setStyle(t,e){let s=!1;return e!==this._styles[t]&&(s=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),s}internalSetStyle(t,e){e!==this._styles[t]&&(this._styles[t]=e,this.dom.style[t]=e)}setColor(t){this.dom.style.fill=this.dom.style.stroke=this._styles.fill=this._styles.stroke=t}setFill(t){this.dom.style.fill=this._styles.fill=t}setStroke(t){this.dom.style.stroke=this._styles.stroke=t}setTransparent(t){this.dom.style.setProperty("fill","transparent",t?"important":""),this.dom.style.setProperty("stroke","none",t?"important":"")}textAlign(){return this._styles.textAlign}setData(t,e){var s,i;null==e?this.dom.removeAttribute("data-"+t):this.dom.setAttribute("data-"+t,(i="",void 0!==(s=e)?s:i))}unsetData(t){this.dom.removeAttribute("data-"+t)}setBoolData(t,e){e?this.dom.setAttribute("data-"+t,""):this.dom.removeAttribute("data-"+t)}getData(t){return this.dom.getAttribute("data-"+t)}hasData(t){return null!=this.getData(t)}removeLater(t,e){if(this._parent)if(t>0){const s=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});null==s||s.addEventListener("finish",(()=>{this.remove(),null==e||e(this)}))}else this.remove();return this}hide(t){if(this._parent)if(t>0){const e=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});null==e||e.addEventListener("finish",(()=>{delete this.hiding,this.setVis(!1)})),this.hiding=!0}else this.setVis(!1);return this}clipRect(t,e,s,i,r=0){const n=this.control.clipBounds(t,e,s,i,r);return this.setClip(n),n}setClip(t){t?this.setAttr("clip-path","url(#"+(t.id||t)+")"):this.unsetAttr("clip-path")}setTemporary(){return this.setAttr(H.TEMP_KEY,1),this}setCursor(t){this._dom.style.cursor=t}ignorePointer(){this._dom.style.pointerEvents="none"}contains(t){return this._dom.contains(t)}front(t,e){if(!this.parent)return;const s=this.parent._dom,i=this._dom,r=t.length;if(e){const n=e.sort(((e,s)=>t.indexOf(e)-t.indexOf(s)))[e.length-1];this!==n&&(i.remove(),n===t[r-1]?s.appendChild(i):s.insertBefore(i,t[t.indexOf(n)+1].dom))}else r>1&&i!==s.lastElementChild&&(i.remove(),s.appendChild(i))}back(t){if(!this.parent)return;if(t.length>1){const e=t.indexOf(this);this._dom.remove(),e<t.length-1?this.parent.dom.insertBefore(this._dom,t[e+1].dom):this.parent.dom.appendChild(this._dom)}}invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}sort(t){t.forEach((t=>this._dom.appendChild(t._dom)))}getParent(t){let e=this._parent;for(;e;){if(e instanceof t)return e;e=e._parent}}_testing(){return H.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){this._dom.setAttribute("transform",this.getTransform())}getTransform(){const t=this._dom;let e=this._tx,s=this._ty,i=[];(R.isValidNum(e)||R.isValidNum(s))&&(e=e||0,s=s||0,i.push("translate("+e+","+s+")")),this._rotation&&i.push("rotate("+this._rotation+" "+R.pick(this._originX,t.getAttribute("x"),0)+" "+R.pick(this._originY,t.getAttribute("y")||0)+")"),R.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")");const r=R.getNumber(this._scaleX,1),n=R.getNumber(this._scaleY,1);return 1===r&&1===n||i.push("scale("+r+" "+n+")"),i.length?i.join(" "):""}}H.DEBUGGING=!1,H.TESTING=!1,H.ASSET_KEY="_asset_",H.TEMP_KEY="_temp_";class V extends H{constructor(t){super(t.doc(),"rct-root"),this._control=t}get control(){return this._control}}class I extends H{constructor(t){super(t,k,"clipPath");const e=this._id=R.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class F extends I{constructor(t,e=NaN,s=NaN,i=NaN,r=NaN,n=0,o=0){super(t);const h=this._rect=new H(t,null,"rect");h.setAttr("fill","none"),n>0&&h.setAttr("rx",String(n)),o>0&&h.setAttr("ry",String(o)),isNaN(e)||h.setBounds(e,s,i,r),this.add(h)}setBounds(t,e,s,i){return this._rect.x=t,this._rect.y=e,this._rect.resize(s,i),this}resize(t,e,s){return this._rect.resize(t,e)}get x(){return this._rect.x}set x(t){this._rect.x=t}get y(){return this._rect.y}set y(t){this._rect.y=t}get width(){return this._rect.width}set width(t){this._rect.width=t}get height(){return this._rect.height}set height(t){this._rect.height=t}}class G extends I{constructor(t){super(t),this.add(this._circle=new H(t,null,"circle"))}setCircle(t,e,s){this._circle.setAttrs({cx:t,cy:e,r:s})}}class j extends H{static create(t,e,s,i,r,n,o=0){return new j(t,e,{x:s,y:i,width:r,height:n,r:o})}constructor(t,e=k,s=k){super(t,e,"rect"),this.rect=s}get rect(){return this._rect&&{...this._rect}}set rect(t){if(t!==this._rect&&(this._rect=t&&{...t},t)){this.setRect(t);let e=t.rx||t.r,s=t.ry||t.r;e>0&&this.dom.setAttribute("rx",String(e)),s>0&&this.dom.setAttribute("rx",String(s))}}resizeRect(t,e){const s=this.getStyle("border-radius");return this.resize(t,e),s&&this.dom.setAttribute("rx",s),this}setBounds(t,e,s,i,r=0){return this.rect={x:t,y:e,width:s,height:i,r:r},this}setBox(t,e,s,i){this.rect=i<0?{x:t,y:e+i,width:s,height:-i}:{x:t,y:e,width:s,height:i}}setRadius(t){t>0&&(this._rect&&(this._rect.rx=this._rect.ry=t),this.dom.setAttribute("rx",String(t)),this.dom.setAttribute("ry",String(t)))}}class Y{static isBright(t){return new Y(t).isBright()}static getContrast(t,e,s){return new Y(t).getContrast(e,s)}static interpolate(t,e,s){const i=new Y(t),r=new Y(e),n=1-s,o=Math.round(i.r*s+r.r*n),h=Math.round(i.g*s+r.g*n),a=Math.round(i.b*s+r.b*n),l=i.a*s+r.a*(1-s);return l<1?`rgba(${o},${h},${a},${l})`:`rgb(${o},${h},${a})`}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&(R.startsWith(t,"rgb(")&&R.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):R.startsWith(t,"rgba(")&&R.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):R.startsWith(t,"#")&&this.$_parseNumber(t.substr(1)))}get rgba(){return"rgba("+[this.r,this.g,this.b,this.a].join(",")+")"}isBright(){return.299*this.r+.587*this.g+.114*this.b>140}getContrast(t,e){return this.isBright()?t||"#000000":e||"#FFFFFF"}brighten(t,e=null){return(e=e||new Y(null)).r=Math.ceil(this.r+(255-this.r)*t),e.g=Math.ceil(this.g+(255-this.g)*t),e.b=Math.ceil(this.b+(255-this.b)*t),e.a=this.a,e}toString(){return this.rgba}$_parseRgb(t){const e=t.split(/\,\s*/);e.length>=3&&(this.r=+e[0],this.g=+e[1],this.b=+e[2],e.length>=4?this.a=+e[3]:this.a=1)}$_parseNumber(t){const e=t.length;let s;e>6?(s=parseInt(t.substr(0,6),16),this.a=parseInt(t.substring(6),16)/255):e>0&&(3===e&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),s=parseInt(t,16)),this.r=(16711680&s)>>16,this.g=(65280&s)>>8,this.b=255&s}}var X,W,q;Y.BLACK="#000",Y.WHITE="#fff",function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(X||(X={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(W||(W={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(q||(q={}));class U extends H{constructor(t,e=void 0){super(t,e,"text"),this._layout=W.TOP,this._overflow=q.WRAP,this._dirty=!0,this._text="",this.anchor=X.MIDDLE}get text(){return this._text}set text(t){(t=t||"")!==this._text&&(this._dirty=!0,this.dom.textContent=this._text=t,this.layoutText())}get anchor(){return this.getAttr("text-anchor")}set anchor(t){t!==this.anchor&&this.setAttr("text-anchor",t)}get layout(){return this._layout}set layout(t){t!==this._layout&&(this._layout=t,this.layoutText())}get overflow(){return this._overflow}set overflow(t){t!==this._overflow&&(this._overflow=t,this.layoutText())}get opacity(){return this.getAttr("fill-opacity")}set opacity(t){this.setAttr("fill-opacity",t)}getAscent(t){return.72*t}layoutText(t){const e=this.getBBox(),s=this.getAscent(isNaN(t)?e.height:t);let i;switch(this._layout){case W.MIDDLE:i=Math.floor(s/2);break;case W.BOTTOM:i=0;break;default:i=Math.ceil(s)}this.y=i}isFitIn(t){return this.calcWidth()>=t}calcWidth(){const t=this._text.length;return t&&this.dom.getSubStringLength(0,t)}calcRangeWidth(t=0,e=Number.MAX_SAFE_INTEGER){return t=y(0,t),(e=f(this._text.length,e))>t?this.dom.getSubStringLength(t,e-t):0}truncate(t,e){let s=this._text;if(!s)return;const i=this.dom;let r,n=0,o=s.length;do{r=Math.ceil((n+o)/2);i.getSubStringLength(0,r)>t?o=r-1:n=r}while(n<o);for(this.text=s.substring(0,n)+"…";n>0&&this.calcWidth()>t;)this.text=s.substring(0,--n)+"…"}setContrast(t,e,s){return this.setStyleOrClass(Y.isBright(getComputedStyle(t).fill)?e:s),this}clearDom(){super.clearDom(),this._dirty=!0}setStyles(t){const e=super.setStyles(t);return e&&this.layoutText(),e}setStyle(t,e){let s=super.setStyle(t,e);return s&&this.layoutText(),s}getBBox(){return(this._dirty||this._styleDirty)&&(this._bounds=this.dom.getBBox(),this._dirty=this._styleDirty=!1),this._bounds}getBBoundsTest(){return(this._dirty||this._styleDirty)&&(this._bounds={x:this.x,y:this.y,width:100,height:30},this._dirty=this._styleDirty=!1),this._bounds}stain(){this._dirty=!0}}class K{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new K(t,t,t,t):new K(t,t,e,e):new K(t,e,s,i)}static createFrom(t){const e=t.split(/\s*[\s,]+\s*/g);return this.create.call(null,...e.map((t=>+t)))}constructor(t=0,e=0,s=0,i=0){this.top=t,this.bottom=e,this.left=s,this.right=i}clone(){return new K(this.top,this.bottom,this.left,this.right)}applyPadding(t){return this.left=v(t.paddingLeft,0),this.right=v(t.paddingRight,0),this.top=v(t.paddingTop,0),this.bottom=v(t.paddingBottom,0),this}applyMargin(t){return this.left=v(t.marginLeft,0),this.right=v(t.marginRight,0),this.top=v(t.marginTop,0),this.bottom=v(t.marginBottom,0),this}shrink(t){return{x:t.x+this.left,y:t.y+this.top,width:t.width-this.left-this.right,height:t.height-this.top-this.bottom}}}K.Empty=Object.freeze(new K),K.Temp=new K;class Z extends H{constructor(t,e=k){super(t,e,"g"),this._doInitChildren(t)}setAttr(t,e){return Z.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}Z.IGNORE_ATTRS={width:"",height:""};class J extends H{constructor(t,e=k){super(t,e,"g"),H.DEBUGGING&&(this.add(this._debugRect=new j(t,"rct-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}get model(){return this._model}_prepareStyleOrClass(t){this.setStyleOrClass(t._style)}setModel(t){t!==this.model&&(this._model=t,this.options=t._op)}measure(t,e,s,i,r){this._prepareStyleOrClass(e),this.setModel(e);const n=this._doMeasure(t,this.model,s,i,r);return this.mw=n.width,this.mh=n.height,n}layout(t){return this._doLayout(t),H.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new j(this.doc,"rct-debug")),this.width>1&&this.height>1&&this._debugRect.setRect(this._getDebugRect())):this._debugRect&&(this._debugRect.remove(),this._debugRect=null),this}resizeByMeasured(){return this.resize(this.mw,this.mh),this}_getDebugRect(){return{x:0,y:0,width:this.width,height:this.height}}_doMeasure(t,e,s,i,r){return{width:s,height:i}}_doLayout(t){}_invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}}class Q extends J{constructor(t,e,s){super(t,e),this._margins=new K,this._paddings=new K,this.add(this._background=new j(t,s))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,s,i,r){this._prepareStyleOrClass(e),this.setModel(e),this._setBackgroundStyle(this._background);let n=getComputedStyle(this._background.dom);const o=this._paddings;o.applyPadding(n);const h=this._doMeasure(t,e,s,i,r);if(h.width+=o.left+o.right,h.height+=o.top+o.bottom,this._marginable()){const t=this._margins;n=getComputedStyle(this.dom),t.applyMargin(n),this.mw=h.width+=t.left+t.right,this.mh=h.height+=t.top+t.bottom}return this.mw=h.width,this.mh=h.height,h}layout(t){if(super.layout(t),this._marginable()){const t=this._margins;this._background.setBounds(t.left+this._getBackOffset(),t.top,this.width-t.left-t.right,this.height-t.top-t.bottom)}else this._resetBackBounds()&&this._background.setBounds(0,0,this.width,this.height);return this}_marginable(){return!0}_resetBackBounds(){return!0}_getBackOffset(){return 0}_deflatePaddings(t){const e=this._paddings;t.width-=e.left+e.right,t.height-=e.top+e.bottom}}class tt extends J{constructor(t){super(t,"rct-legend-item"),this.add(this._back=new j(t)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new U(t,"rct-legend-item-label")),this._label.anchor=X.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,s,i,r){var n,o;const h=e.source;this._label.setBoolData("hidden",!h.visible),this._marker.setBoolData("hidden",!h.visible),this._label.setBoolData("empty",null===(n=h.isEmpty)||void 0===n?void 0:n.call(h)),this._marker.setBoolData("empty",null===(o=h.isEmpty)||void 0===o?void 0:o.call(h)),this._label.text=e.text()||"…";const a=this._rMarker=this._marker.setVis(e.legend.options.markerVisible)?this._marker.getBBox():E,l={width:(d=this._label.getBBox()).width,height:d.height};var d;return this._gap=v(e.legend.options.markerGap,0),{width:a.width+this._gap+l.width,height:y(a.height,l.height)}}_doLayout(t){const e=this._rMarker,s=v(t,e.width);this._back.setBounds(0,0,this.width,this.height),this._marker.visible&&this._marker.trans((s-e.width)/2,(this.height-e.height)/2),this._label.trans(s+this._gap,(this.height-this._label.getBBox().height)/2)}}class et extends Q{constructor(t){super(t,et.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new A(this,tt)}legendByDom(t){const e=this._itemViews.elementOf(t);return e&&e.model}legendOfSeries(t){return this._itemViews.find((e=>e.model.source===t))}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,s,i,r){const n=e.options,o=e.items(),h=this._vertical="vertical"===e.getLayout();return this._ipr=v(n.itemsPerLine,Number.MAX_SAFE_INTEGER),this._gap="body"!==e._location?v(n.gap,0):0,h?i=e.getMaxHeight(i):s=e.getMaxWidth(s),this.$_prepareItems(t,o),this.$_measure(t,e,h,this._ipr,s,i)}_doLayout(){const t=this.model.options,e=this._rowViews,s=t.useTextColor,i=this._sizes,r=t.itemsAlign,n=t.lineGap||0,o=t.itemGap||0,h=this._margins,a=this._paddings,l=this._vertical,d=h.left+a.left,c=h.top+a.top;let _,u=d,p=c;this._itemViews.forEach((t=>{const e=t.model.source,i=e.legendColor();t._marker.setColor(i),s&&e.visible?t._label.setFill(i):t._label.setFill("")})),e.forEach(((t,e)=>{l?(t.forEach((t=>{t.mw=i[e],t.resizeByMeasured().layout(this._wMarkers[e])})),p=c,"center"!==r&&"end"!==r||(_=t.map((t=>t.height)).reduce(((t,e)=>t+e))+o*(t.length-1)+h.top+h.bottom+a.top+a.bottom,p+="center"===r?(this.height-_)/2:this.height-_),t.forEach((t=>{t.trans(u,p),p+=t.height+o})),u+=i[e]+n):(t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),u=d,"center"!==r&&"end"!==r||(_=t.map((t=>t.width)).reduce(((t,e)=>t+e))+o*(t.length-1)+h.left+h.right+a.left+a.right,u+="center"===r?(this.width-_)/2:this.width-_),t.forEach((t=>{t.trans(u,p),u+=t.width+o})),p+=i[e]+n)}))}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,s,i,r,n){const o=e.options,h=e.items(),a=this._itemViews,l=o.itemGap||0,d=o.lineGap||0,c=e.getMarkerSize(),_=a.count,u=this._rowViews=[],p=this._sizes=[];let g,m,f,w;a.forEach(((e,s)=>{e.setMarker(h[s].source.legendMarker(t,c)),e.measure(t,h[s],r,n,1)}));let v=0,b=0;if(s){for(;v<_;)w=a.get(v),b%i==0?(u.push(f=[w]),m=w.mh,b++,v++):(m+=l+w.mh,m<=n?(f.push(w),b++,v++):b=0);this._wMarkers=[],g=m=0,u.forEach(((t,e)=>{let s=0,i=0,r=0;t.forEach((t=>{i+=t.mh,s=y(s,t.mw),r=y(r,t._rMarker.width),t._col=e})),i+=l*(t.length-1),m=y(m,i),g+=s,p.push(s),this._wMarkers.push(r)})),g+=d*(u.length-1)}else{for(;v<_;)w=a.get(v),b%i==0?(u.push(f=[w]),g=w.mw,b++,v++):(g+=l+w.mw,g<=r?(f.push(w),b++,v++):b=0);g=m=0,u.forEach((t=>{let e=0,s=0;t.forEach((t=>{e+=t.mw,s=y(s,t.mh)})),e+=l*(t.length-1),g=y(g,e),m+=s,p.push(s)})),m+=d*(u.length-1)}return{width:g,height:m}}}et.LEGEND_CLASS="rct-legend";class st extends e.SectionView{constructor(){super(...arguments),this.views=[],this._gap=0}isEmpty(){return 0===this.views.length}prepare(t,s,i,r){const n=this.views,o=[];for(this.isX=i,r._axes.forEach((t=>{t.checkVisible()&&s.isValidAxis(t)&&o.push(t)}));n.length<o.length;){const s=new e.AxisView(t);this.add(s),n.push(s)}for(;n.length>o.length;)n.pop().remove();if(n.forEach(((t,e)=>{t.setModel(o[e])})),this.axes=o,this.setVis(n.length>0)){const t=n[0].model;this._gap=t.chart.getAxesGap()}}prepareGuides(t,e,s){const i=this.views,r=this.axes;i.forEach(((s,i)=>{const n=r[i];e.forEach((e=>{e.forEach((e=>{e.isConnected(n)&&s.setVis(this.visible)&&(s.prepareGuides(t,e.row,e.col,e._guideContainer,e._frontGuideContainer),n._isHorz||(e._axes||(e._axes=[]),e._axes.push(n)))}))}))})),e.forEach((e=>{e.forEach((e=>{e._axes&&(e._gridRowContainer.addAll(t,e._axes),e._axes=[])}))}))}checkHeights(t,e,s){return this.views.length>0?this.$_checkHeights(this.views,t,e,s):0}$_checkHeights(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkHeight(e,s,i)})),r+=(this.views.length-1)*this._gap),r}checkWidths(t,e,s){return this.views.length>0?this.$_checkWidths(this.views,t,e,s):0}$_checkWidths(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkWidth(e,s,i)})),r+=(this.views.length-1)*this._gap),r}getScrollView(t){var e;for(const s of this.views)if(null===(e=s._scrollView)||void 0===e?void 0:e.contains(t))return s._scrollView}setMargins(t,e,s,i){this.views.forEach((r=>r.setMargins(t,e,s,i)))}_setInverted(t){super._setInverted(t),this.isHorz=t&&!this.isX||!t&&this.isX}_doMeasure(t,e,s,i,r){const n=this.axes;if(this.isHorz){let e=0;return this.views.forEach(((o,h)=>{e+=o.measure(t,n[h],s,i,r).height})),{width:s,height:e}}{let e=0;return this.views.forEach(((o,h)=>{e+=o.measure(t,n[h],s,i,r).width})),{width:e,height:i}}}_doLayout(t){const e=this.views,s=this.width,i=this.height,r=e.length;let n=0,o=r-1;if(this.isHorz){let t,h,a=0;for(;n<r;n++){const t=e[n];if(t.model._posValue()<1)break;t.trans(0,a),a+=t.mh}for(t=a,a=i;o>=0;o--){const t=e[o];if(t.model._posValue()>-1)break;a-=t.mh,t.trans(0,a)}h=a;const l=h-t;let d=0;for(let t=n;t<=o;t++)d+=e[t].mh;t+=(l-d)/2;for(let s=n;s<=o;s++){const i=e[s];i.trans(0,t),t+=i.mh}e.forEach((t=>{t.resize(s,t.mh),t.model._calcPoints(s,999),t.layout()}))}else{let t,h,a=0;for(;n<r;n++){const t=e[n];if(t.model._posValue()>-1)break;t.trans(a,0),a+=t.mw}for(t=a,a=s;o>=0;o--){const t=e[o];if(t.model._posValue()<1)break;a-=t.mw,t.trans(a,0)}h=a;const l=h-t;let d=0;for(let t=n;t<=o;t++)d+=e[t].mw;t+=(l-d)/2;for(let s=n;s<=o;s++){const i=e[s];i.trans(t,0),t+=i.mw}e.forEach((t=>{t.resize(t.mw,i),t.model._calcPoints(i,999),t.layout()}))}}}class it extends e.SectionView{constructor(t,e){super(t,"rct-axis-container"),this.isX=e,this.sections=[]}prepare(t,e,s,i){const r=this.isX?s.getRow(i):s.getColumn(i);for(;this.sections.length<r.length;){const e=new st(t);this.add(e),this.sections.push(e)}for(;this.sections.length>r.length;)this.sections.pop().remove();this.sections.forEach(((s,n)=>{this.isX?(s.row=i,s.col=n):(s.col=i,s.row=n),s.prepare(t,e,this.isX,r[n])}))}prepareGuides(t,e,s,i){const r=this.isX?s.getRow(i):s.getColumn(i);for(;this.sections.length<r.length;){const e=new st(t);this.add(e),this.sections.push(e)}for(;this.sections.length>r.length;)this.sections.pop().remove();this.sections.forEach(((r,n)=>{this.isX?(r.row=i,r.col=n):(r.col=i,r.row=n),r.prepareGuides(t,e,s)}))}checkWidths(t,e,s){return this.sections.length>0?this._isHorz?this.sections.reduce(((i,r)=>i+r.checkWidths(t,e,s)),0):this.sections.reduce(((i,r)=>Math.max(i,r.checkWidths(t,e,s))),0):0}checkHeights(t,e,s){return this.sections.length>0?this._isHorz?this.sections.reduce(((i,r)=>Math.max(i,r.checkHeights(t,e,s))),0):this.sections.reduce(((i,r)=>i+r.checkHeights(t,e,s)),0):0}_setInverted(t){super._setInverted(t),this._isHorz=t&&!this.isX||!t&&this.isX}_doMeasure(t,s,i,r,n){let o=0,h=0;return this._isHorz?this.sections.forEach((o=>{h=e.maxv(h,o.measure(t,s,i,r,n).height)})):this.sections.forEach((h=>{o=e.maxv(o,h.measure(t,s,i,r,n).width)})),{width:o,height:h}}_doLayout(t){this._isHorz?this.height>0&&this.sections.forEach(((e,s)=>{e.resize(t[2*(s+1)]-t[2*(s+1)-1],this.height),e.trans(t[2*s+1]-t[1],0),e.layout()})):this.width>0&&this.sections.forEach(((e,s)=>{e.resize(this.width,t[2*(s+1)]-t[2*(s+1)-1]),e.trans(0,this.height-(t[2*(s+1)]-t[1])),e.layout()}))}}class rt extends e.BodyView{constructor(t,e){super(t,e),this.row=0,this.col=0,this.add(this._legendView=new et(t))}getCol(){return this.col}getRow(){return this.row}getTooltipPos(){return{x:this.parent.parent.tx+this.tx,y:this.parent.parent.ty+this.ty}}prepareRender(t,s){const i=s.chart,r=s.depth.visible,n=this.row,o=this.col,h=i._split.getPane(n,o).body;this._animatable=e.RcControl._animatable&&i.animatable(),this._prepareSeries(t,s,i._getSeries().getPaneSeries(n,o),r),this._prepareGauges(t,i,i._getGauges().getPaneVisibles(n,o)),this._prepareAnnotations(t,h.getAnnotations().concat(i._getAnnotations().getPaneVisibles(n,o)))}_doMeasure(t,e,s,i,r){return this._legendView.setVis(e.pane.legend.visible)&&this._legendView.measure(t,e.pane.legend,s,i,r),super._doMeasure(t,e,s,i,r)}_doLayout(){super._doLayout();const t=this._legendView;if(t.visible){this._seriesViews.forEach((e=>{if(e.needDecoreateLegend()){const s=t.legendOfSeries(e.model);s&&e.decoreateLegend(s)}}));const e=t.model.options,s=e.align,i=e.verticalAlign;let r=0,n=0,o=+e.offsetX||0;switch(s){case"right":r+=this.width-t.mw-o;break;case"center":r+=(this.width-t.mw)/2+o;break;default:r+=o}switch(o=+e.offsetY||0,i){case"bottom":n+=this.height-t.mh-o;break;case"middle":n+=(this.height-t.mh)/2+o;break;default:n+=o}t.trans(r,n).resize(t.mw,t.mh),t.layout()}}}class nt extends e.PaneContainer{constructor(t,e){super(t,nt.STYLE_NAME),this._bodies=[],this._xContainers=[],this._yContainers=[],this._owner=e}get bodies(){return this._bodies}bodyViewOf(t){return this._bodies.find((e=>e.contains(t)))}prepare(t,e){e.chart,this.$_init(t),this._model=e,this.$_prepareBodies(t,e)}measure(t,e,s,i,r){const n=e.chart,o=this._inverted=e.chart.isInverted(),h=e._xAxes,a=e._yAxes,l=s,d=i;this.$_prepareAxes(t,h,!0),this.$_prepareAxes(t,a,!1),e.measureAxes(s,i,o,r),o?(s-=this._xContainers.reduce(((e,r)=>e+r.checkWidths(t,s,i)),0),i-=this._yContainers.reduce(((e,r)=>e+r.checkHeights(t,s,i)),0)):(i-=this._xContainers.reduce(((e,r)=>e+r.checkHeights(t,s,i)),0),s-=this._yContainers.reduce(((e,r)=>e+r.checkWidths(t,s,i)),0)),e.measureAxes(s,i,o,r),this._xContainers.forEach((e=>e.measure(t,n,s,i,r))),this._yContainers.forEach((e=>e.measure(t,n,s,i,r))),s=l,i=d,o?(s-=this._xContainers.reduce(((t,e)=>t+e.mw),0),i-=this._yContainers.reduce(((t,e)=>t+e.mh),0)):(i-=this._xContainers.reduce(((t,e)=>t+e.mh),0),s-=this._yContainers.reduce(((t,e)=>t+e.mw),0)),r++,e.measureAxes(s,i,o,r),this.$_prepareAxisGuides(t,h,!0),this.$_prepareAxisGuides(t,a,!1),this._xContainers.forEach((e=>{e.measure(t,n,s,i,r)})),this._yContainers.forEach((e=>{e.measure(t,n,s,i,r)}));const c=e.getXLens(o?i:s),_=e.getYLens(o?s:i);e.completeAxesPoints(c,_)}layout(){const t=this._model,e=this.width,s=this.height;this._back.resize(e,s),this.$_calcExtents(t,e,s),this.$_layoutAxes(t,!0,e,s),this.$_layoutAxes(t,!1,e,s),this.$_layoutBodies(t,e,s)}seriesByDom(t){for(const e of this._bodies){const s=e.seriesByDom(t);if(s)return s}}getSeries(t){for(const e of this.bodies){const s=e.findSeries(t);if(s)return s}}legendByDom(t){for(const e of this.bodies){const s=e._legendView.legendByDom(t);if(s)return s}}$_init(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)))}$_prepareBodies(t,e){e.chart;const s=e.paneCount,i=e.rowCount,r=e.colCount,n=this._bodies,o=this._bodyMap=[];for(;n.length<s;){const e=new rt(t,this._owner);this._bodyContainer.add(e),n.push(e)}for(;n.length>s;)n.pop().remove();for(let t=0;t<i;t++){const e=[];for(let s=0;s<r;s++){const i=n[t*r+s];e.push(i),i.row=t,i.col=s}o.push(e)}n.forEach((s=>{s.prepareRender(t,e.getPane(s.row,s.col).body),s.prepareGuideContainers(),s._gridRowContainer.prepare()}))}$_prepareAxes(t,e,s){const i=this._model.chart,r=s?this._xContainers:this._yContainers,n=s?e.rows():e.cols();for(;r.length<n;){const e=new it(t,s);this._axisContainer.add(e),r.push(e)}for(;r.length>n;)r.pop().remove();r.forEach(((s,r)=>{s.prepare(t,i,e,r)}))}$_prepareAxisGuides(t,e,s){(s?this._xContainers:this._yContainers).forEach(((s,i)=>{s.prepareGuides(t,this._bodyMap,e,i)}))}$_calc(t,e,s,i){const r=s.length,n=new Array(2*(r+1)),o=e-t.reduce(((t,e)=>t+e[i]),0),h=this._model._calcSizes(s,o);let a=0,l=0;for(l=0;l<r;l++)n[2*l]=a,n[2*l+1]=a+=t[l][i],a+=h[l];return n[2*l]=a,n[2*l+1]=a+t[l][i],n}$_calcExtents(t,e,s){this._inverted?(this._rowPoints=this.$_calc(this._xContainers,e,t.rowSizes(),"mw"),this._colPoints=this.$_calc(this._yContainers,s,t.colSizes(),"mh")):(this._rowPoints=this.$_calc(this._xContainers,s,t.rowSizes(),"mh"),this._colPoints=this.$_calc(this._yContainers,e,t.colSizes(),"mw"))}$_layoutAxes(t,e,s,i){const r=this.control._padding,n=this._rowPoints,o=this._colPoints,h=e?this._xContainers:this._yContainers;if(this._inverted)if(e){const t=o[1],e=o[o.length-2]-t;h.forEach(((t,s)=>{t.resize(t.mw,e),t.trans(n[2*s],i-o[o.length-2]),t.layout(o)}))}else{const t=n[1],e=n[n.length-2]-t;h.forEach(((s,h)=>{const a=s.sections;for(let t=0,e=a.length;t<e;t++){const s=a[t],i=0===t?r.left:0,o=t===e-1?r.right:0;let h=0,l=0;e>1&&(h=n[2*t+1]-n[2*t],l=n[2*(t+1)+1]-n[2*(t+1)],0===t?a[t+1].isEmpty()?l=n[2*(t+1)]-n[2*(t+1)-1]:l/=2:t===e-1?a[t-1].isEmpty()?h=n[2*(t-1)]-n[2*(t-1)-1]:h/=2:(a[t-1].isEmpty()?h=n[2*(t-1)]-n[2*(t-1)-1]:h/=2,a[t+1].isEmpty()?l=n[2*(t+1)]-n[2*(t+1)-1]:l/=2)),s.setMargins(i,h,l,o)}s.resize(e,s.mh),s.trans(t,i-o[2*h+1]),s.layout(n)}))}else if(e){const t=o[1];s=o[o.length-2]-t,h.forEach(((e,a)=>{const l=e.sections;for(let t=0,e=l.length;t<e;t++){const s=l[t],i=0===a?r.left:0,d=a===h.length-1?r.right:0;let c=0,_=0;e>1&&(c=o[2*t+1]-o[2*t],_=o[2*(t+1)+1]-o[2*(t+1)],0===t?l[t+1].isEmpty()?_=o[2*(t+1)]-o[2*(t+1)-1]:_/=2:t===e-1?l[t-1].isEmpty()?c=o[2*(t-1)]-o[2*(t-1)-1]:c/=2:(l[t-1].isEmpty()?c=o[2*(t-1)]-o[2*(t-1)-1]:c/=2,l[t+1].isEmpty()?_=o[2*(t+1)]-n[2*(t+1)-1]:_/=2)),s.setMargins(i,c,_,d)}e.resize(s,e.mh),e.trans(t,i-n[2*a+1]),e.layout(o)}))}else{const t=n[n.length-2],e=t-n[1];h.forEach(((s,r)=>{s.resize(s.mw,e),s.trans(o[2*r],i-t),s.layout(n)}))}}$_layoutBodies(t,e,s){const i=t.rowCount,r=t.colCount,n=this._rowPoints,o=this._colPoints,h=this._bodies;if(this._inverted)for(let e=0;e<i;e++){const s=n[2*(e+1)-1],i=n[2*(e+1)];for(let n=0;n<r;n++){const a=h[e*r+n],l=o[2*n+1],d=o[2*(n+1)];a.measure(this.doc,t.getPane(e,n).body,i-s,d-l,1),a.resize(i-s,d-l),a.trans(s,this.height-d),a.layout()}}else for(let e=0;e<i;e++){const i=n[2*(e+1)-1],a=n[2*(e+1)];for(let n=0;n<r;n++){const l=h[e*r+n],d=o[2*(n+1)-1],c=o[2*(n+1)];l.measure(this.doc,t.getPane(e,n).body,c-d,a-i,1),l.resize(c-d,a-i),l.trans(d,s-a),l.layout()}}}}function ot(t){(function(t){return t.Series&&t.SeriesView})(t)&&(t.ChartObject.registerSplitClass(c),t.ChartView.registerPaneClass(nt))}nt.STYLE_NAME="rct-panes",ot(i),t.Split=c,t.default=ot,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).RealChartSplit={},t.RealChart)}(this,(function(t,e){"use strict";function s(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(s){if("default"!==s){var i=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:function(){return t[s]}})}})),e.default=t,Object.freeze(e)}var i=s(e);class r{constructor(t,e){this.row=t,this.col=e,this._axes=[]}sort(t,e){const s=e&&!t||!e&&t;this._axes.length>1&&(s?this._axes.sort(((t,e)=>{const s=t._posValue(),i=e._posValue();return s===i?s<0?e._index-t._index:s>0?t._index-e._index:t.row!==e.row?e.row-t.row:t.row<this.row?e._index-t._index:t._index-e._index:i-s})):this._axes.sort(((t,e)=>{const s=t._posValue(),i=e._posValue();return s===i?s<0?t._index-e._index:s>0?e._index-t._index:t.col!==e.col?t.col-t.col:t.col<this.col?t._index-e._index:e._index-t._index:s-i})))}}class n{constructor(t,e){this.chart=t,this.isX=e}rows(){return this._matrix.length}cols(){return this._matrix[0].length}_prepare(t,e,s,i){this._doPrepare(t,e,s),this._matrix.forEach((t=>{t.forEach((t=>t.sort(this.isX,i)))}))}get(t,e){return this._matrix[t][e]}getRow(t){return this._matrix[t]}getColumn(t){return this._matrix.map((e=>e[t]))}_buildTicks(t,e){const s=this.isX;this._matrix.forEach(((i,r)=>{i.forEach(((i,r)=>{i._axes.forEach((i=>{!i.isBased()&&(e<2||s)&&i._buildTicks(t[s?i.options.col:i.options.row],e)}))}))})),this._matrix.forEach(((i,r)=>{i.forEach(((i,r)=>{i._axes.forEach((i=>{i.isBased()&&(e<2||s)&&i._buildTicks(t[s?i.options.col:i.options.row],e)}))}))}))}_calcPoints(t,e){const s=this.isX;this._matrix.forEach((i=>{i.forEach(((i,r)=>{i._axes.forEach((i=>{if(e<2||s){const r=s?i.options.col:i.options.row;i._calcPoints(t[r],e)}}))}))}))}}class o extends n{constructor(t){super(t,!0)}_doPrepare(t,e,s){const i=this._matrix=new Array(e+1);for(let t=0;t<i.length;t++){i[t]=[];for(let e=0;e<s;e++)i[t].push(new r(t,e))}t.forEach((t=>{var s,r;const n=t.options.position;let o=t.row;"opposite"===n?(o++,t._runPos=n):o<e-1&&"between"===n?(o++,t._runPos="normal"):t._runPos=n,null===(r=null===(s=i[o])||void 0===s?void 0:s[t.col])||void 0===r||r._axes.push(t)}))}}class h extends n{constructor(t){super(t,!1)}_doPrepare(t,e,s){const i=this._matrix=new Array(e);for(let t=0;t<i.length;t++){i[t]=[];for(let e=0;e<=s;e++)i[t].push(new r(t,e))}t.forEach((t=>{var e,r;const n=t.options.position;let o=t.col;"opposite"===n?(o++,t._runPos=n):t.col<s-1&&"between"===n?(o++,t._runPos="normal"):t._runPos=n,null===(r=null===(e=i[t.row])||void 0===e?void 0:e[o])||void 0===r||r._axes.push(t)}))}}class a extends e.Body{constructor(t){super(t.chart),this.pane=t}contains(t){return t.col===this.pane.col||t.row===this.pane.row}}a.defaults=e.extend(e.Body.defaults,{extended:!0,radius:void 0,centerX:void 0,centerY:void 0});class l extends e.Legend{constructor(t){super(t.chart),this.pane=t}_doPrepareRender(t){super._doPrepareRender(t),this._location="body"}_getLegendSources(){return this.options.visible?this.chart._getSeries().getLegendSources(this.pane.row,this.pane.col):[]}}class d extends e.ChartItem{constructor(t,e,s){super(t),this.row=e,this.col=s}_doInit(t){t.body=(this._body=new a(this)).init(),t.legend=(this._legend=new l(this)).init()}get body(){return this._body}get legend(){return this._legend}_prepareRender(){this._body._prepareRender(),this._legend._prepareRender()}}class c extends e.ChartItem{constructor(t){super(t),this._cols=1,this._rows=1,this._paneDic={},this._panes=[],this._xAxes=new o(t),this._yAxes=new h(t)}get count(){return this._rows*this._cols}get rowCount(){return this._rows}get colCount(){return this._cols}get paneCount(){return this._rows*this._cols}colSizes(){return this._colSizes}rowSizes(){return this._rowSizes}getPane(t,e){return this._panes[t][e]}getRow(t){return this._panes[t]}getColumn(t){return this._panes.map((e=>e[t]))}getAxisOf(t,e){var s,i;const r=this.chart,n=t.body;if(n){const o=n.pane;return e?r._getXAxes().get(t.options.xAxis)||this._xAxes.get(o.row,o.col)._axes[0]||(null===(s=r._getSeries().getPaneSeries(o.row,o.col)[0])||void 0===s?void 0:s._xAxisObj):r._getXAxes().get(t.options.yAxis)||this._yAxes.get(n.pane.row,n.pane.col)._axes[0]||(null===(i=r._getSeries().getPaneSeries(o.row,o.col)[0])||void 0===i?void 0:i._yAxisObj)}}isValidAxis(t){return t&&t.row<this._rows&&t.col<this._cols}_doLoadProp(t,e){return["panes","cols","rows"].indexOf(t)>=0||super._doLoadProp(t,e)}_doSetSimple(t){if(e.isArray(t)&&t.length>0){const s=e.maxv(1,+t[0]),i=e.maxv(1,e.pickNum(+t[1],s));return s>0&&i>0&&(this.$_parsePanes(s,i),this.visible=!0),!0}return super._doSetSimple(t)}_load(t){return super._load(t),e.isObject(t)&&(this.$_parsePanes(t.rows,t.cols),this._paneDic=this.$_loadPanes(t.panes)),this}_doPrepareRender(t){this._panes=this.$_collectPanes(t),this._panes.forEach((t=>t.forEach((t=>t._prepareRender()))))}_calcSizes(t,s){const i=t.length,r=new Array(i);let n=0;if(i>1){let o=s,h=0;for(n=0;n<i;n++){const s=t[n];e.isNumber(s)?o-=r[n]=Math.max(0,Math.min(o,s)):h+=s.size}if(h>0)for(n=0;n<i;n++){const s=t[n];e.isNumber(s)||(r[n]=o*s.size/h)}}else r[n]=s;return r}getXLens(t){return this._calcSizes(this._colSizes,t)}getYLens(t){return this._calcSizes(this._rowSizes,t)}measureAxes(t,e,s,i){const r=this.getXLens(s?e:t),n=this.getYLens(s?t:e);this._xAxes._buildTicks(r,i),this._yAxes._buildTicks(n,i),this.$_calcAxesPoints(r,n,i)}$_calcAxesPoints(t,e,s){this._xAxes._calcPoints(t,s),this._yAxes._calcPoints(e,s)}completeAxesPoints(t,e){this.$_calcAxesPoints(t,e,101)}getBodyAnnotation(t){for(const e in this._paneDic){const s=this._paneDic[e].body.getAnnotation(t);if(s)return s}}prepareRender(t,e){const s=this.chart.isInverted();this._prepareRender(),this._xAxes._prepare(t,this._rows,this._cols,s),this._yAxes._prepare(e,this._rows,this._cols,s)}$_parseSizes(t){let s;return s=e.isArray(t)&&t.length>0?t.slice(0):t>0?new Array(t).fill("*"):["*"],s.map((t=>{if(e.isString(t)){const s=t.trim();return{size:"*"===s?1:e.pickNum(parseFloat(s),1)}}return e.pickNum(+t,1)}))}$_parsePanes(t,e){this._colSizes=this.$_parseSizes(e),this._rowSizes=this.$_parseSizes(t),this._cols=this._colSizes.length,this._rows=this._rowSizes.length}$_loadPanes(t){const s=this.chart,i=this._op.extendBody?s._body._config:void 0,r={};if(t=e.isArray(t)?t:e.isObject(t)?[t]:null,e.isArray(t)&&t.forEach((t=>{const e=+t.row||0,n=+t.col||0;if(n>=0&&n<this._cols&&e>=0&&e<this._rows){const o=new d(s,e,n);let h=t;o.init(),!i||t&&t.body&&!1===t.body.extended||(t?(h=Object.assign({},t),t.body?!1!==t.body.extended&&(h.body=Object.assign({},i,t.body)):h.body=i):h={body:i}),o._load(h),r[e+","+n]=o}})),i)for(let t=0;t<this._rows;t++)for(let e=0;e<this._cols;e++){const n=t+","+e;if(!r[n]){const o=new d(s,t,e);o.init(),o._load({body:i}),r[n]=o}}return r}$_collectPanes(t){const e=[];for(let s=0;s<this._rows;s++){const i=[];for(let e=0;e<this._cols;e++){const r=this._paneDic[s+","+e]||new d(t,s,e)._initObject();i.push(r)}e.push(i)}return e}}c.defaults=e.extend(e.ChartItem.defaults,{visible:!1,extendBody:!0,gap:0});const _="http://www.w3.org/2000/svg",u=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},p=Array.isArray,g=function(t){return"string"==typeof t},m=Object.assign,f=Math.min,y=Math.max,w=Math.abs,v=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t};let b=0;class x{static destroy(t){return t&&t.destroy()}constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(b++))}destroy(){return this.$_destroyed||this.$_destroying||(this.$_destroying=!0,this._doDestroy(),this.$_destroyed=!0),null}_doDestroy(){}get destroying(){return this.$_destroying}get orphaned(){return this.$_destroying||this.$_destroyed}get hash(){return this.$_hash}isMe(t){return t===this.$_hash}toString(){return this.constructor.name}toBool(t){return"string"==typeof t?"true"===t:t}toNum(t,e=NaN){return t=parseFloat(t),isNaN(t)?e:t}}class A extends x{constructor(t,e,s,i=0){super(),this.removeDelay=0,this._pool=[],this._views=[],this._removes=[],this._owner=t,this._creator=e,this._styleName=s,this.removeDelay=i}_doDestroy(){this.freeAll(),this._owner=null,this._creator=null,super._doDestroy()}get isEmpty(){return 0===this._views.length}get count(){return this._views.length}get first(){return this._views[0]}get last(){return this._views[this._views.length-1]}get(t){return this._views[t]}getAll(){return this._views.slice()}pull(t){let e=this._views[t];return e||(e=this._pool.pop()||new this._creator(this._owner.doc,this._styleName),this._owner.add(e),this._views.push(e)),e}_internalItems(){return this._views}elementOf(t){for(let e of this._views)if(e.contains(t))return e}find(t){return this._views.find(t)}setRemoveDelay(t){return this.removeDelay=t,this}removeLater(t,e){const s=this._views.indexOf(t);s>=0&&(t.removeLater(e,(t=>{this._pool.push(t)})),this._views.splice(s,1))}$_create(t,e=-1,s=0){let i=this._pool.pop();return i||(i=new this._creator(t,this._styleName)),i}prepare(t,e,s){const i=this._owner.doc,r=this._owner,n=this._pool,o=this._views;for(;o.length>t;)n.push(o.pop().remove());for(;o.length<t;){const e=this.$_create(i);o.push(e),null==s||s(e,o.length-1,t),r.add(e)}return e&&this.forEach(e),this}borrow(){const t=this._pool.pop()||new this._creator(this._owner.doc,this._styleName);return this._owner.add(t),t}free(t,e=0){if(t){e>0?t.removeLater(e):t.remove(),this._pool.push(t);const s=this._views.indexOf(t);s>=0&&this._views.splice(s,1)}}freeAll(t,e=0){for(let s=(t=t||this._views).length-1;s>=0;s--)this.free(t[s],e)}freeHiddens(){const t=this._views;for(let e=t.length-1;e>=0;e--)!t[e].visible&&this.free(t[e],0)}freeFrom(t){const e=this._views;for(let s=e.length-1;s>=t;s--)this.free(e[s],0)}forEach(t){const e=this._views;for(let s=0,i=e.length;s<i;s++)t(e[s],s,i)}visit(t){const e=this._views.length;let s=0;for(;s<e&&!1!==t(this._views[s],s,e);s++);return s===e}sort(t){const e=this._views;return e.sort(t),e.forEach((t=>this._owner.appendDom(t.dom))),this}sortDom(t){const e=this._views.slice(0);return e.sort(t),e.forEach((t=>this._owner.appendDom(t.dom))),this}map(t){return this._views.map(t)}front(t){t.front(this._views)}back(t){t.back(this._views)}}const E=Object.freeze({x:0,y:0,width:0,height:0});const S={ko:{dateFormat:"yyyy.MM.dd",am:"오전",pm:"오후",notExistsDataField:"존재하지 않는 필드입니다: %1",notSpecifiedDataField:"하나 이상의 데이터필드가 설정돼야 합니다.",invalidFieldName:"잘못된 데이터필드 이름입니다: %1",invalidRowIndex:"잘못된 데이터행 index입니다: %1",invalidToIndex:"잘못된 'to' index입니다.: %1",requireSourceData:"원본 data가 반드시 지정돼야 합니다.",requireFilterName:"필터 이름이 반드시 지정돼야 합니다.",invalidDateFormat:"잘못된 시간 날짜 형식입니다: %1",invalidSizeValue:"잘못된 Size 값입니다: %1",invalidOuterDiv:"잘못된 외부 div 입니다: %1",dataMustSet:"데이터가 먼저 설정돼야 합니다.",requireTableName:"테이블모델의 이름이 지정돼야 합니다.",alreadyTableExists:"이미 존재하는 테이블모델입니다: %1"},en:{dateFormat:"M/d/yyyy",am:"AM",pm:"PM",notExistsDataField:"A data field is not exists: %1",notSpecifiedDataField:"At least one datafield must be set.",invalidFieldName:"Invalid field name: %1",invalidRowIndex:"Invalid row index: %1",invalidToIndex:"Invalid 'to' index: %1",requireSourceData:"A source data must be set.",requireFilterName:"A filter name must be set.",invalidDateFormat:"Invalid datetime format: %1",invalidSizeValue:"Invalid size value: %1",invalidOuterDiv:"Invalid outer div element: %1",dataMustSet:"A data must be set first.",requireTableName:"The name of table model is required.",alreadyTableExists:"A table model is already exists: %1"}};let C="ko",N=S[C]||S[C="ko"];const k=void 0;function D(t){return t+"px"}function L(t){return null==t||Number.isNaN(t)||""===t}const T={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeWidth:"stroke-width",strokeDasharray:"stroke-dasharray",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",fontStyle:"font-style",padding:"padding",margin:"margin"},B=function(t){const e=T[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return T[t]=e,e}return e};class M{static clearChildren(t){let e;for(;e=t.lastChild;)t.removeChild(e)}static remove(t){const e=t&&t.parentElement;return e&&e.removeChild(t),null}static htmlEncode(t){return document.createElement("a").appendChild(document.createTextNode(t)).parentNode.innerHTML}static setAttrs(t,e){for(const s in e)t.setAttribute(s,e[s])}static setImportantStyle(t,e,s){t.setProperty(e,s,"important")}static getPadding(t){const e=getComputedStyle(t);return{left:parseFloat(e.paddingLeft)||0,right:parseFloat(e.paddingRight)||0,top:parseFloat(e.paddingTop)||0,bottom:parseFloat(e.paddingBottom)||0}}static hasFill(t){const e=window.getComputedStyle(t).fill;return e&&"none"!==e}static setVisible(t,e,s=""){return t.style.display=e?s:"none",e}static setClipPath(t,e){t.setAttribute("clip-path",`url(#${e instanceof SVGClipPathElement?e.id:e})`)}static createClipRect(t,e){const s=t.createElementNS(_,"clipPath");return s.id=e,s.append(t.createElementNS(_,"rect")),s}static setRect(t,e){return this.setBounds(t,e.x,e.y,e.width,e.height)}static setBounds(t,e,s,i,r){return t.setAttribute("x",e),t.setAttribute("y",s),t.setAttribute("width",i),t.setAttribute("height",r),t}}const $=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});class R{static log(...t){this.LOGGING&&console.log(...t)}static warn(...t){this.LOGGING&&console.warn(...t)}static now(){return+new Date}static parseDate(t,e){const s=new Date(t);return isNaN(s.getTime())?e||new Date:s}static isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}static dateOfYear(t){var e=t.getMonth(),s=t.getDate(),i=[0,31,59,90,120,151,181,212,243,273,304,334][e]+s;return e>1&&R.isLeapYear(t.getFullYear())&&i++,i}static incMonth(t,e){const s=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(f(s,R.month_days[R.isLeapYear(t.getFullYear())?1:0][t.getMonth()])),t}static minDate(t,e){return null!==t?t:null!==e?e:t.getTime()<e.getTime()?t:e}static maxDate(t,e){return null!==t?e:null!==e||t.getTime()>e.getTime()?t:e}static weekOfMonth(t,e,s){const i=t.getMonth(),r=t.getFullYear(),n=new Date(r,i,1).getDay(),o=new Date(r,i+1,0).getDate(),h=t.getDate()+n-1,a=e+Math.ceil((o+n-7)/7),l=e+Math.floor(h/7);return s||l<2+e?l:l===a?e+5:l}static weekOfYear(t,e){const s=t.getFullYear(),i=new Date(s,0,1).getDay(),r=this.dateOfYear(t)+i-1;return e+Math.floor(r/7)}static isObject(t){return t&&"object"==typeof t&&!p(t)}static isValidObject(t){if(this.isObject(t))for(let e in t)if(t.hasOwnProperty(e))return!0}static copyObject(t){if(t&&"object"==typeof t&&!p(t))return m({},t)}static checkArray(t){return p(t)?t:void 0}static makeArray(t,e=!1){return null!=t?p(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return p(t)?t.map((t=>+t)):null!=t?[+t]:[]}static getIntArray(t,e=0){const s=[];for(let i=e,r=e+t;i<r;i++)s.push(i);return s}static isValueArray(t){if(p(t)){for(let e=t.length-1;e>=0;e--)if(null!=t[e]&&"object"==typeof t[e])return!1;return!0}return!1}static toArray(t){return p(t)?t:null!=t?[t]:null}static copyArray(t){return p(t)?t.slice(0):null!=t?[t]:void 0}static push(t,e){if(e&&e.length>0)for(let s=0,i=e.length;s<i;s++)t.push(e[s])}static isDefined(t){return null!=t}static isNotDefined(t){return null==t}static isNumber(t){return"number"==typeof t}static canNumber(t){return!isNaN(t)&&!isNaN(parseFloat(t))}static isValidNum(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}static getNumber(t,e=0){const s=parseFloat(t);return isFinite(s)?s:e}static toNumber(t,e=0){return isNaN(t)||null===t||""===t?e:+t}static compareText(t,e,s=!1){return t=t||"",e=e||"",s&&(t=t.toLocaleLowerCase(),e=e.toLocaleLowerCase()),t>e?1:t<e?-1:0}static getTimeF(){return(new Date).getTime()/1e3}static getTimer(){return(new Date).getTime()-$}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=y(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=y(e||2,1),s=s||"0",new Array(e-t.toString(16).length+1).join(s)+t.toString(16)}static pick(...t){const e=t.length;let s;for(let i=0;i<e;i++)if(s=t[i],null!=s)return s}static toStr(t){return Number.isNaN(t)||null==t?"":String(t)}static equalNumbers(t,e){return isNaN(t)==isNaN(e)&&!isNaN(t)&&t==e}static equalArrays(t,e){if(t===e)return!0;if(null==t||null==e)return!1;const s=t.length;if(s!=e.length)return!1;for(let i=0;i<s;++i)if(t[i]!==e[i])return!1;return!0}static parseTuples(t){if(p(t)){const e=[];let s=-1/0;return t.forEach(((i,r)=>{p(i)?!isNaN(i[0])&&!isNaN(i[1])&&i[0]>s&&(e.push([+i[0],+i[1]]),s=i[0]):isNaN(i)||r!==t.length-1||e.push([1/0,+i])})),e.length>0?e:void 0}if(!isNaN(t))return[[1/0,+t]]}static isEmpty(t){if(t)for(let e in t)return!1;return!0}static isNotEmpty(t){if(t)for(let e in t)return!0;return!1}static setter(t){return"set"+t[0].toUpperCase()+t.slice(1)}static deepClone(t){if(t instanceof Date)return new Date(t);if(null==t||"object"!=typeof t)return t;{const e=p(t)?[]:{};for(let s of Object.keys(t))e[s]=R.deepClone(t[s]);return e}}static getArray(t,e){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static getNumArray(t,e=0){const s=[];for(let i=0;i<t;i++)s.push(e);return s}static dedupe(t,e){for(let s=(t=t.sort(e||((t,e)=>t>e?1:t<e?-1:0))).length-1;s>0;s--)t[s]===t[s-1]&&t.splice(s,1);return t}static sortNum(t){return t.sort(((t,e)=>t-e))}static logElapsed(t,e){const s=+new Date;e(),R.log(t,+new Date-s+"ms")}static clamp(t,e,s){return y(e,f(s,t))}static makeIntArray(t,e){const s=new Array(y(0,e-t));for(let i=t;i<e;i++)s[i-t]=i;return s}static shuffle(t){for(let e=t.length;e;){const s=Math.floor(Math.random()*e),i=t[--e];t[e]=t[s],t[s]=i}return t}static isDate(t){return"[object Date]"===Object.prototype.toString.call(t)}static isValidDate(t){return t.getTime()==t.getTime()}static asFunction(t){return"function"==typeof t?t:void 0}static getFieldProp(t){const e=t.indexOf(".");if(e>=0)return{field:t.substring(0,e),props:t.substring(e+1).split(".")}}static startsWith(t,e){if(t&&e)return 0===t.indexOf(e)}static endsWith(t,e){if(t&&e)return t.indexOf(e,-t.length)===t.length-e.length}static scaleNumber(t,e,s){const i=w(t);if(i>=1e3){let r=e.length;for(;r>0;){const n=Math.pow(1e3,r--);if(n<=Math.pow(10,Math.log(i)*Math.LOG10E)&&(s||10*i%n==0))return{value:t/n,symbol:e[r]}}}}static jitter(t,e){return t+(2*Math.random()-1)*e}static randomLike(t){return(2654435761*(123456789^t)>>>16)/65536}}var P;R.LOGGING=!1,R.week_days=["일","월","화","수","목","금","토"],R.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],R.month_days=[[31,28,31,30,31,30,31,31,30,31,30,31],[31,29,31,30,31,30,31,31,30,31,30,31]],R.uniqueKey=function(){let t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"rr-chart-"+t+e++}}(),function(t){t.Developer="developer",t.Evaluation="evaluation",t.Limited="limited",t.Enterprise="enterprise"}(P||(P={}));const z="$ProductVersion";class O extends x{constructor(t,e,s){super(),this._inited=!1,this._testing=!1,this._dirty=!0,this._toAnimation=0,this._invalidateLock=!1,this._lockDirty=!1,this._cssVars={},this._wSave=NaN,this._hSave=NaN,this.loaded=!1,this._windowResizeHandler=t=>{this._domResized()},this._domResizeHandler=t=>{this._domResized()},this._clickHandler=t=>{this._pointerHandler&&this._pointerHandler.handleClick(this.toOffset(t))},this._dblClickHandler=t=>{this._pointerHandler&&this._pointerHandler.handleDblClick(this.toOffset(t))},this._touchMoveHandler=t=>{},this._pointerDownHandler=t=>{this._pointerHandler&&this._pointerHandler.handleDown(this.toOffset(t))},this._pointerMoveHandler=t=>{this._pointerHandler&&this._pointerHandler.handleMove(this.toOffset(t))},this._pointerUpHandler=t=>{this._pointerHandler&&this._pointerHandler.handleUp(this.toOffset(t))},this._pointerCancelHandler=t=>{},this._pointerLeaveHandler=t=>{this._pointerHandler&&this._pointerHandler.handleLeave(this.toOffset(t))},this._keyPressHandler=t=>{},this._wheelHandler=t=>{},!t&&e instanceof HTMLDivElement&&(t=e.ownerDocument),this._initControl(t||document,e,s||O.CLASS_NAME),"undefined"!=typeof window&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._domResizeHandler)),this._resigterEventHandlers(this._dom),this._inited=!0,this.invalidate(!0)}_doDestroy(){this._requestTimer&&(window.requestAnimationFrame?cancelAnimationFrame(this._requestTimer):clearTimeout(this._requestTimer)),this._unresigterEventHandlers(this._dom),M.remove(this._dom),this._dom=null,this._container=null}isInited(){return this._inited}isTesting(){return this._testing}doc(){return this._dom.ownerDocument}dom(){return this._dom}svg(){return this._svg}width(){return this._container.offsetWidth}height(){return this._container.offsetHeight}contentWidth(){return this.width()-this._padding.left-this._padding.right}contentHeight(){return this.height()-this._padding.top-this._padding.bottom}contentRight(){return this.width()-this._padding.right}clipContainer(){return this._defs}setData(t,e,s){L(e)?(this._root.dom.removeAttribute("data-"+t),s&&this._dom.removeAttribute("data-"+t)):(this._root.dom.setAttribute("data-"+t,e),s&&this._dom.setAttribute("data-"+t,e))}clearDefs(){M.clearChildren(this._defs)}$_clearDefs(t){const e=this._defs.children||[];for(let s=e.length-1;s>=0;s--)e[s].hasAttribute(t)&&e[s].remove()}clearAssetDefs(){this.$_clearDefs(H.ASSET_KEY)}clearTemporaryDefs(){this.$_clearDefs(H.TEMP_KEY)}appendDom(t){return t&&this._htmlRoot.append(t),t}addElement(t){return t&&this._root.add(t)}setPointerHandler(t){this._pointerHandler=t}invalidate(t=!1){t||!this._invalidateLock&&!this._dirty&&this._inited?(this._dirty=!0,this._requestTimer||this._testing||this.$_requestRender()):this._invalidateLock&&(this._lockDirty=!0)}invalidateLayout(t=!1){this.invalidate(t)}setLock(){this._invalidateLock=!0}releaseLock(t=!0){this._invalidateLock&&(this._invalidateLock=!1),this._lockDirty&&t&&this.invalidate(),this._lockDirty=!1}lock(t){this.setLock();try{t(this)}finally{this.releaseLock()}}silentLock(t){this.setLock();try{t(this)}finally{this.releaseLock(!1)}}setResizeDelay(t){this._resizeDelay=t}getBounds(){return this._bounds}setAnimation(t){this._toAnimation=t||0}fling(t,e){}getCssVar(t){let e=this._cssVars[t];return t in this._cssVars?this._cssVars[t]:(e=getComputedStyle(this._root.dom).getPropertyValue(t),this._cssVars[t]=e,e)}clipBounds(t=NaN,e=NaN,s=NaN,i=NaN,r=0){const n=new F(this.doc(),t,e,s,i,r,r);return this._defs.appendChild(n.dom),n}clipCircle(){const t=new G(this.doc());return this._defs.appendChild(t.dom),t}addDef(t){this._defs.appendChild(t)}removeDef(t){if(g(t))for(const e in this._defs.children)if(e instanceof Element&&e.id===t){t=e;break}t instanceof Element&&this._defs.removeChild(t)}containerToElement(t,e,s){const i=this._container.getBoundingClientRect(),r=t.getBounds();return{x:e-r.x+i.x,y:s-r.y+i.y}}svgToElement(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e-r.left+i.left,y:s-r.top+i.top}}elementToSvg(t,e,s){const i=this._svg.getBoundingClientRect(),r=t.getBounds();return{x:e+r.left-i.left,y:s+r.top-i.top}}_setTesting(){this._testing=!0,H.TESTING=!0}_setSize(t,e){isNaN(t)||(this._container.style.width=t+"px"),isNaN(e)||(this._container.style.height=e+"px")}$_addListener(t,e,s,i){i?t.addEventListener(e,s,{passive:!0}):t.addEventListener(e,s)}_resigterEventHandlers(t){var e;window.addEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.observe(t),this.$_addListener(t,"click",this._clickHandler),this.$_addListener(t,"dblclick",this._dblClickHandler),this.$_addListener(t,"touchmove",this._touchMoveHandler,!0),this.$_addListener(t,"pointerdown",this._pointerDownHandler),this.$_addListener(t,"pointermove",this._pointerMoveHandler),this.$_addListener(t,"pointerup",this._pointerUpHandler),this.$_addListener(t,"pointercancel",this._pointerCancelHandler),this.$_addListener(t,"pointerleave",this._pointerLeaveHandler),this.$_addListener(t,"keypress",this._keyPressHandler),this.$_addListener(t,"wheel",this._wheelHandler,!0)}_unresigterEventHandlers(t){var e,s;window.removeEventListener("resize",this._windowResizeHandler),null===(e=this._resizeObserver)||void 0===e||e.unobserve(t),null===(s=this._resizeObserver)||void 0===s||s.disconnect(),t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblClickHandler),t.removeEventListener("touchmove",this._touchMoveHandler),t.removeEventListener("pointerdown",this._pointerDownHandler),t.removeEventListener("pointermove",this._pointerMoveHandler),t.removeEventListener("pointerup",this._pointerUpHandler),t.removeEventListener("pointercancel",this._pointerCancelHandler),t.removeEventListener("pointerleave",this._pointerLeaveHandler),t.removeEventListener("keypress",this._keyPressHandler),t.removeEventListener("wheel",this._wheelHandler)}_prepareRenderers(t){}_initControl(t,e,s){if(this._inited)return;e instanceof HTMLDivElement?this._container=e:this._container=t.getElementById(e),this._container instanceof HTMLDivElement||((t,e)=>{throw new Error(((t,e)=>t.replace("%1",e))(t,e))})(N.invalidOuterDiv,e);const i=this._container.ownerDocument,r=this._dom=i.createElement("div");m(r.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),r.className=s,this._container.appendChild(r);const n=this._svg=i.createElementNS(_,"svg");n.classList.add("rct-svg"),n.style.setProperty("overflow","visible","important"),n.setAttribute("width","100%"),n.setAttribute("height","100%");const o=i.createElement("desc");o.textContent="Created by RealChart v"+z,n.appendChild(o);const h=this._defs=i.createElementNS(_,"defs");this._initDefs(i,h),n.appendChild(h),r.appendChild(n),this._root=new V(this),n.appendChild(this._root._dom),this._htmlRoot=i.createElement("div"),r.appendChild(this._htmlRoot),m(this._htmlRoot.style,{position:"absolute"})}_initDefs(t,e){let s=t.createElementNS(_,"filter");s.setAttribute("id",O.SHADOW_FILTER);const i=t.createElementNS(_,"feGaussianBlur");i.setAttribute("stdDeviation","1.5"),i.setAttribute("in","SourceAlpha"),s.appendChild(i);const r=t.createElementNS(_,"feOffset");r.setAttribute("dx","1"),r.setAttribute("dy","1"),r.setAttribute("result","offsetblur"),s.appendChild(r);const n=t.createElementNS(_,"feFlood");n.setAttribute("flood-color","#000"),s.appendChild(n);const o=t.createElementNS(_,"feComposite");o.setAttribute("in2","offsetblur"),o.setAttribute("operator","in"),s.appendChild(o);const h=t.createElementNS(_,"feMerge"),a=t.createElementNS(_,"feMergeNode"),l=t.createElementNS(_,"feMergeNode");l.setAttribute("in","SourceGraphic"),h.appendChild(a),h.appendChild(l),s.appendChild(h),e.appendChild(s)}_render(){this.$_render()}$_requestRender(){this.orphaned||(window.requestAnimationFrame?this._requestTimer=window.requestAnimationFrame((()=>this.$_render())):this._requestTimer=setTimeout((()=>{this.$_render()}),0))}updateNow(){this.$_render()}$_render(){if(!this.orphaned)if(this._bounds=this._dom.getBoundingClientRect(),+new Date<=this._toAnimation)this.$_requestRender();else{R.LOGGING&&console.time("render chart");try{this._doBeforeRender();const t=this._dom.getBoundingClientRect(),e=this._svg.getBoundingClientRect(),s=this._svg.clientWidth,i=this._svg.clientHeight;m(this._htmlRoot.style,{left:D(e.left-t.left),top:D(e.top-t.top)});const r=this._container.firstElementChild;r.removeAttribute("style"),m(r.style,{position:"relative",width:"100%",height:"100%",boxSizing:"border-box",overflow:"hidden","-webkit-touch-callout":"none","-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),this._doRenderBackground(r,this._root,s,i);const n=this._padding=M.getPadding(this._root.dom);this._doRender({x:n.left,y:n.top,width:s-n.left-n.right,height:i-n.top-n.bottom})}finally{this.loaded=!0,this._dirty=!1,this._requestTimer=null,this._doAfterRender(),R.LOGGING&&console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,s,i){}_domResized(){const t=this.width(),e=this.height(),s=this._resizeDelay;t===this._wSave&&e===this._hSave||(this._wSave=t,this._hSave=e,this._resizeTimer&&clearTimeout(this._resizeTimer),s>0?this._resizeTimer=setTimeout((()=>{this.invalidateLayout(),this._resizeTimer=null}),s):this.invalidateLayout())}toOffset(t){const e=this._container.getBoundingClientRect();return t.pointX=t.clientX-e.left,t.pointY=t.clientY-e.top,t}setPointerCapture(t){this._dom.setPointerCapture(t.pointerId)}releasePointerCapture(t){this._dom.releasePointerCapture(t.pointerId)}}O.CLASS_NAME="rct-control",O.SHADOW_FILTER="rr-chart-shadow-filter",O._animatable=!0;class H extends x{constructor(t,e,s=k){super(),this._visible=!0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=t.createElementNS(_,s||"g"),(this._styleName=e||"")&&this.setAttr("class",this._styleName)}_doDestroy(){this.remove()}get doc(){return this._dom.ownerDocument}get dom(){return this._dom}get parent(){return this._parent}get control(){return this._parent&&this._parent.control}get x(){return this._x}set x(t){t!==this._x&&(this._x=t,this.setAttr("x",this._x))}get tx(){return this._tx}get y(){return this._y}set y(t){t!==this._y&&(this._y=t,this.setAttr("y",this._y))}get ty(){return this._ty}get width(){return this._width}set width(t){t!==this._width&&(this._width=t,isNaN(t)?this.removeAttr("width"):this.setAttr("width",t))}get height(){return this._height}set height(t){t!==this._height&&(this._height=t,isNaN(t)?this.removeAttr("height"):this.setAttr("height",t))}get tright(){return this._tx+this._dom.getBBox().width}get tbottom(){return this._ty+this._dom.getBBox().height}get visible(){return this._visible}set visible(t){this.setVis(t)}setVis(t){return t!==this._visible&&(this._visible=t,this._dom&&(this._dom.style.display=t?"":"none")),this._visible}get rotation(){return this._rotation}set rotation(t){t!=this._rotation&&(this._rotation=t,this._updateTransform())}setRotation(t,e,s){return t===this._originX&&e===this._originY&&s===this._rotation||(this._originX=t,this._originY=e,this._rotation=s,this._updateTransform()),this}getStyle(t){return window.getComputedStyle(this._dom).getPropertyValue(t)}hasStyle(t){return this.dom.classList.contains(t)}add(t){return t&&t._parent!==this&&(t._parent=this,this._dom.appendChild(t._dom),t._doAttached(this)),t}insertChild(t,e){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,e._dom),t._doAttached(this)),t}insertAfter(t,e){return t&&t._parent!==this&&(t._parent=this,e._dom.nextSibling?this._dom.insertBefore(t._dom,e._dom.nextSibling):this._dom.appendChild(t._dom),t._doAttached(this)),t}insertFirst(t){return t&&t._parent!==this&&(t._parent=this,this._dom.insertBefore(t._dom,this._dom.firstChild),t._doAttached(this)),t}appendElement(t,e){const s=t.createElementNS(_,e);return this._dom.appendChild(s),s}insertElement(t,e,s){const i=t.createElementNS(_,e);return this._dom.insertBefore(i,s),i}remove(){return this._parent&&(this._parent._dom.removeChild(this._dom),this._parent=null,this._doDetached(this)),this}getAttr(t){return this._dom.getAttribute(t)}removeAttr(t){return this._dom.removeAttribute(t),this}setAttr(t,e){return this._dom.setAttribute(t,e),this}setAttrEx(t,e){return L(e)?this._dom.removeAttribute(t):this._dom.setAttribute(t,e),this}setAttrs(t){for(let e in t)this._dom.setAttribute(e,t[e]);return this}unsetAttr(t){return this._dom.removeAttribute(t),this}getBounds(){return this._dom.getBoundingClientRect()}setBounds(t,e,s,i){return this.trans(t,e),this.resize(s,i),this}setRect(t){return this.trans(t.x,t.y),this.resize(t.width,t.height),this}getRect(){return{x:this._tx,y:this._ty,width:this.width,height:this.height}}getSize(){return{width:this.width,height:this.height}}getBBox(){return this._dom.getBBox()}getBBoxEx(){const t=this._dom.getBBox();return t.x+=this._tx,t.y+=this._ty,t}inflateBBox(t,e){const s=this._dom.getBBox();return s.x+=this._tx,s.y+=this._ty,s.x-=t,s.width+=2*t,s.y-=e,s.height+=2*e,s}controlToElement(t,e){return this.control.containerToElement(this,t,e)}svgToElement(t,e){return this.control.svgToElement(this,t,e)}elementToSvg(t,e){return this.control.elementToSvg(this,t,e)}move(t,e){return this.x=t,this.y=e,this}setPos(t,e){this._x=t,this._y=e}setPosY(t){this._y=t}isDomAnimating(){return!!this._dom.getAnimations&&this._dom.getAnimations().length>0}rotate(t){return t!==this._rotation&&(this._rotation=t,this._updateTransform()),this}internalRotate(t){this._rotation=t}scale(t,e=NaN){return e=isNaN(e)?t:e,this._scaleX===t&&this._scaleY===e||(this._scaleX=t,this._scaleY=e,this._updateTransform()),this}trans(t,e){return t=R.isValidNum(t)?t:this._tx,e=R.isValidNum(e)?e:this._ty,t===this._tx&&e===this._ty||(this._tx=t,this._ty=e,this._updateTransform()),this}transp(t){return this.trans(t.x,t.y)}transEx(t,e,s=0,i=!0){if(t=R.isValidNum(t)?t:this._tx,e=R.isValidNum(e)?e:this._ty,t!==this._tx||e!==this._ty){if(s>0){const r=this._dom.animate([{transform:`translate(${this._tx||0}px,${this._ty||0}px)`},{transform:`translate(${t}px,${e}px)`}],{duration:s,fill:"none"});i&&(null==r||r.addEventListener("finish",(()=>{var t;return null===(t=this.control)||void 0===t?void 0:t.invalidateLayout()})))}this._tx=t,this._ty=e,this._updateTransform()}return this}transEx2(t,e,s=0,i=!0){const r=R.isValidNum(t)?t:this._tx,n=R.isValidNum(e)?e:this._ty;if(r===this._tx&&n===this._ty)return this;if(s>0){const t=this._rotation||0,e=`translate(${this._tx||0}px, ${this._ty||0}px)`+(t?` rotate(${t}deg)`:""),o=`translate(${r}px, ${n}px)`+(t?` rotate(${t}deg)`:"");this._dom.style.transformOrigin=`${this._originX||0}px ${this._originY||0}px`;const h=this._dom.animate([{transform:e},{transform:o}],{duration:s,fill:"none"});i&&h.addEventListener("finish",(()=>{var t;this._dom.style.transformOrigin="",null===(t=this.control)||void 0===t||t.invalidateLayout()}))}return this._tx=r,this._ty=n,this._updateTransform(),this}transX(t){return t!==this._tx&&R.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&R.isValidNum(t)&&(this._ty=t,this._updateTransform()),this}shiftY(t){return this.transY(this._ty+t)}resize(t,e,s=!0){let i=!1;return t!==this._width&&(this._width=Math.max(0,t),s&&this.setAttrEx("width",this._width),i=!0),e!==this._height&&(this._height=Math.max(0,e),s&&this.setAttrEx("height",this._height),i=!0),i}appendDom(t){return t&&this._dom.appendChild(t),t}insertDom(t,e){return t&&this._dom.insertBefore(t,e),t}clearDom(){const t=this._dom;let e;for(;e=t.lastChild;)t.removeChild(e)}containsClass(t){return this._dom.classList.contains(t)}addClass(t){return this._dom.classList.add(...t.split(" ").filter((t=>t.length>0))),this}removeClass(t){return this._dom.classList.remove(t),this}saveStyles(){this._saveStyle=this._dom.getAttribute("style")||"",this._saveClass=this._dom.getAttribute("class")}restoreStyles(){void 0!==this._saveStyle&&(this._dom.setAttribute("style",this._saveStyle),this._dom.style.display=this._visible?"":"none",delete this._saveStyle),this._saveClass&&(this._dom.setAttribute("class",this._saveClass),delete this._saveClass)}internalClearStyles(){const t=this.dom.style;for(let e in this._styles)t.removeProperty(B(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(B(s)),e=!0;return this._styles={},e&&(this._styleDirty=!0),e}clearStyle(t){let e=!1;if(t){const s=this.dom.style;for(let i of t)i in this._styles&&(s.removeProperty(B(i)),delete this._styles[i],e=!0);e&&(this._styleDirty=!0)}return e}internalSetStyles(t){if(t){const e=this.dom.style;for(let s in t)e[s]=this._styles[s]=t[s]}}internalImportantStylesOrClass(t){if(g(t))t&&this._dom.classList.add(t);else if(u(t)){const e=this.dom.style;for(let s in t)e.setProperty(B(s),this._styles[s]=t[s],"important")}}setStyles(t){let e=!1;if(t){const s=this.dom.style;for(let i in t){const r=t[i];this._styles[i]!==r&&(this._styles[i]=r,"rx"==i&&this._dom.setAttribute(i,r),s[i]=r,e=!0)}e&&(this._styleDirty=!0)}return e}resetStyles(t){const e=this.clearStyles();return this.setStyles(t)||e}_resetClass(){this._styleName?this.setAttr("class",this._styleName):this.unsetAttr("class")}clearStyleAndClass(){this.clearStyles(),this._resetClass()}internalClearStyleAndClass(){this.internalClearStyles(),this._resetClass()}setStyleOrClass(t){g(t)?(this._resetClass(),t&&this.addClass(t)):this.resetStyles(t)}internalSetStyleOrClass(t){g(t)?t&&this.addClass(t):this.internalSetStyles(t)}addStyleOrClass(t){g(t)?t&&this.addClass(t):u(t)&&this.setStyles(t)}setClass(t){this.setAttr("class",t)}setStyle(t,e){let s=!1;return e!==this._styles[t]&&(s=this._styleDirty=!0,this._styles[t]=e,this.dom.style[t]=e),s}internalSetStyle(t,e){e!==this._styles[t]&&(this._styles[t]=e,this.dom.style[t]=e)}setColor(t){this.dom.style.fill=this.dom.style.stroke=this._styles.fill=this._styles.stroke=t}setFill(t){this.dom.style.fill=this._styles.fill=t}setStroke(t){this.dom.style.stroke=this._styles.stroke=t}setTransparent(t){this.dom.style.setProperty("fill","transparent",t?"important":""),this.dom.style.setProperty("stroke","none",t?"important":"")}textAlign(){return this._styles.textAlign}setData(t,e){var s,i;null==e?this.dom.removeAttribute("data-"+t):this.dom.setAttribute("data-"+t,(i="",void 0!==(s=e)?s:i))}unsetData(t){this.dom.removeAttribute("data-"+t)}setBoolData(t,e){e?this.dom.setAttribute("data-"+t,""):this.dom.removeAttribute("data-"+t)}getData(t){return this.dom.getAttribute("data-"+t)}hasData(t){return null!=this.getData(t)}removeLater(t,e){if(this._parent)if(t>0){const s=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});null==s||s.addEventListener("finish",(()=>{this.remove(),null==e||e(this)}))}else this.remove();return this}hide(t){if(this._parent)if(t>0){const e=this._dom.animate([{},{opacity:0}],{duration:t,fill:"none"});null==e||e.addEventListener("finish",(()=>{delete this.hiding,this.setVis(!1)})),this.hiding=!0}else this.setVis(!1);return this}clipRect(t,e,s,i,r=0){const n=this.control.clipBounds(t,e,s,i,r);return this.setClip(n),n}setClip(t){t?this.setAttr("clip-path","url(#"+(t.id||t)+")"):this.unsetAttr("clip-path")}setTemporary(){return this.setAttr(H.TEMP_KEY,1),this}setCursor(t){this._dom.style.cursor=t}ignorePointer(){this._dom.style.pointerEvents="none"}contains(t){return this._dom.contains(t)}front(t,e){if(!this.parent)return;const s=this.parent._dom,i=this._dom,r=t.length;if(e){const n=e.sort(((e,s)=>t.indexOf(e)-t.indexOf(s)))[e.length-1];this!==n&&(i.remove(),n===t[r-1]?s.appendChild(i):s.insertBefore(i,t[t.indexOf(n)+1].dom))}else r>1&&i!==s.lastElementChild&&(i.remove(),s.appendChild(i))}back(t){if(!this.parent)return;if(t.length>1){const e=t.indexOf(this);this._dom.remove(),e<t.length-1?this.parent.dom.insertBefore(this._dom,t[e+1].dom):this.parent.dom.appendChild(this._dom)}}invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}sort(t){t.forEach((t=>this._dom.appendChild(t._dom)))}getParent(t){let e=this._parent;for(;e;){if(e instanceof t)return e;e=e._parent}}_testing(){return H.TESTING}_doAttached(t){}_doDetached(t){}_updateTransform(){this._dom.setAttribute("transform",this.getTransform())}getTransform(){const t=this._dom;let e=this._tx,s=this._ty,i=[];(R.isValidNum(e)||R.isValidNum(s))&&(e=e||0,s=s||0,i.push("translate("+e+","+s+")")),this._rotation&&i.push("rotate("+this._rotation+" "+R.pick(this._originX,t.getAttribute("x"),0)+" "+R.pick(this._originY,t.getAttribute("y")||0)+")"),R.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")");const r=R.getNumber(this._scaleX,1),n=R.getNumber(this._scaleY,1);return 1===r&&1===n||i.push("scale("+r+" "+n+")"),i.length?i.join(" "):""}}H.DEBUGGING=!1,H.TESTING=!1,H.ASSET_KEY="_asset_",H.TEMP_KEY="_temp_";class V extends H{constructor(t){super(t.doc(),"rct-root"),this._control=t}get control(){return this._control}}class I extends H{constructor(t){super(t,k,"clipPath");const e=this._id=R.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class F extends I{constructor(t,e=NaN,s=NaN,i=NaN,r=NaN,n=0,o=0){super(t);const h=this._rect=new H(t,null,"rect");h.setAttr("fill","none"),n>0&&h.setAttr("rx",String(n)),o>0&&h.setAttr("ry",String(o)),isNaN(e)||h.setBounds(e,s,i,r),this.add(h)}setBounds(t,e,s,i){return this._rect.x=t,this._rect.y=e,this._rect.resize(s,i),this}resize(t,e,s){return this._rect.resize(t,e)}get x(){return this._rect.x}set x(t){this._rect.x=t}get y(){return this._rect.y}set y(t){this._rect.y=t}get width(){return this._rect.width}set width(t){this._rect.width=t}get height(){return this._rect.height}set height(t){this._rect.height=t}}class G extends I{constructor(t){super(t),this.add(this._circle=new H(t,null,"circle"))}setCircle(t,e,s){this._circle.setAttrs({cx:t,cy:e,r:s})}}class j extends H{static create(t,e,s,i,r,n,o=0){return new j(t,e,{x:s,y:i,width:r,height:n,r:o})}constructor(t,e=k,s=k){super(t,e,"rect"),this.rect=s}get rect(){return this._rect&&{...this._rect}}set rect(t){if(t!==this._rect&&(this._rect=t&&{...t},t)){this.setRect(t);let e=t.rx||t.r,s=t.ry||t.r;e>0&&this.dom.setAttribute("rx",String(e)),s>0&&this.dom.setAttribute("rx",String(s))}}resizeRect(t,e){const s=this.getStyle("border-radius");return this.resize(t,e),s&&this.dom.setAttribute("rx",s),this}setBounds(t,e,s,i,r=0){return this.rect={x:t,y:e,width:s,height:i,r:r},this}setBox(t,e,s,i){this.rect=i<0?{x:t,y:e+i,width:s,height:-i}:{x:t,y:e,width:s,height:i}}setRadius(t){t>0&&(this._rect&&(this._rect.rx=this._rect.ry=t),this.dom.setAttribute("rx",String(t)),this.dom.setAttribute("ry",String(t)))}}class Y{static isBright(t){return new Y(t).isBright()}static getContrast(t,e,s){return new Y(t).getContrast(e,s)}static interpolate(t,e,s){const i=new Y(t),r=new Y(e),n=1-s,o=Math.round(i.r*s+r.r*n),h=Math.round(i.g*s+r.g*n),a=Math.round(i.b*s+r.b*n),l=i.a*s+r.a*(1-s);return l<1?`rgba(${o},${h},${a},${l})`:`rgb(${o},${h},${a})`}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&(R.startsWith(t,"rgb(")&&R.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):R.startsWith(t,"rgba(")&&R.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):R.startsWith(t,"#")&&this.$_parseNumber(t.substr(1)))}get rgba(){return"rgba("+[this.r,this.g,this.b,this.a].join(",")+")"}isBright(){return.299*this.r+.587*this.g+.114*this.b>140}getContrast(t,e){return this.isBright()?t||"#000000":e||"#FFFFFF"}brighten(t,e=null){return(e=e||new Y(null)).r=Math.ceil(this.r+(255-this.r)*t),e.g=Math.ceil(this.g+(255-this.g)*t),e.b=Math.ceil(this.b+(255-this.b)*t),e.a=this.a,e}toString(){return this.rgba}$_parseRgb(t){const e=t.split(/\,\s*/);e.length>=3&&(this.r=+e[0],this.g=+e[1],this.b=+e[2],e.length>=4?this.a=+e[3]:this.a=1)}$_parseNumber(t){const e=t.length;let s;e>6?(s=parseInt(t.substr(0,6),16),this.a=parseInt(t.substring(6),16)/255):e>0&&(3===e&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),s=parseInt(t,16)),this.r=(16711680&s)>>16,this.g=(65280&s)>>8,this.b=255&s}}var X,W,q;Y.BLACK="#000",Y.WHITE="#fff",function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(X||(X={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(W||(W={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(q||(q={}));class U extends H{constructor(t,e=void 0){super(t,e,"text"),this._layout=W.TOP,this._overflow=q.WRAP,this._dirty=!0,this._text="",this.anchor=X.MIDDLE}get text(){return this._text}set text(t){(t=t||"")!==this._text&&(this._dirty=!0,this.dom.textContent=this._text=t,this.layoutText())}get anchor(){return this.getAttr("text-anchor")}set anchor(t){t!==this.anchor&&this.setAttr("text-anchor",t)}get layout(){return this._layout}set layout(t){t!==this._layout&&(this._layout=t,this.layoutText())}get overflow(){return this._overflow}set overflow(t){t!==this._overflow&&(this._overflow=t,this.layoutText())}get opacity(){return this.getAttr("fill-opacity")}set opacity(t){this.setAttr("fill-opacity",t)}getAscent(t){return.72*t}layoutText(t){const e=this.getBBox(),s=this.getAscent(isNaN(t)?e.height:t);let i;switch(this._layout){case W.MIDDLE:i=Math.floor(s/2);break;case W.BOTTOM:i=0;break;default:i=Math.ceil(s)}this.y=i}isFitIn(t){return this.calcWidth()>=t}calcWidth(){const t=this._text.length;return t&&this.dom.getSubStringLength(0,t)}calcRangeWidth(t=0,e=Number.MAX_SAFE_INTEGER){return t=y(0,t),(e=f(this._text.length,e))>t?this.dom.getSubStringLength(t,e-t):0}truncate(t,e){let s=this._text;if(!s)return;const i=this.dom;let r,n=0,o=s.length;do{r=Math.ceil((n+o)/2);i.getSubStringLength(0,r)>t?o=r-1:n=r}while(n<o);for(this.text=s.substring(0,n)+"…";n>0&&this.calcWidth()>t;)this.text=s.substring(0,--n)+"…"}setContrast(t,e,s){return this.setStyleOrClass(Y.isBright(getComputedStyle(t).fill)?e:s),this}clearDom(){super.clearDom(),this._dirty=!0}setStyles(t){const e=super.setStyles(t);return e&&this.layoutText(),e}setStyle(t,e){let s=super.setStyle(t,e);return s&&this.layoutText(),s}getBBox(){return(this._dirty||this._styleDirty)&&(this._bounds=this.dom.getBBox(),this._dirty=this._styleDirty=!1),this._bounds}getBBoundsTest(){return(this._dirty||this._styleDirty)&&(this._bounds={x:this.x,y:this.y,width:100,height:30},this._dirty=this._styleDirty=!1),this._bounds}stain(){this._dirty=!0}}class K{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new K(t,t,t,t):new K(t,t,e,e):new K(t,e,s,i)}static createFrom(t){const e=t.split(/\s*[\s,]+\s*/g);return this.create.call(null,...e.map((t=>+t)))}constructor(t=0,e=0,s=0,i=0){this.top=t,this.bottom=e,this.left=s,this.right=i}clone(){return new K(this.top,this.bottom,this.left,this.right)}applyPadding(t){return this.left=v(t.paddingLeft,0),this.right=v(t.paddingRight,0),this.top=v(t.paddingTop,0),this.bottom=v(t.paddingBottom,0),this}applyMargin(t){return this.left=v(t.marginLeft,0),this.right=v(t.marginRight,0),this.top=v(t.marginTop,0),this.bottom=v(t.marginBottom,0),this}shrink(t){return{x:t.x+this.left,y:t.y+this.top,width:t.width-this.left-this.right,height:t.height-this.top-this.bottom}}}K.Empty=Object.freeze(new K),K.Temp=new K;class Z extends H{constructor(t,e=k){super(t,e,"g"),this._doInitChildren(t)}setAttr(t,e){return Z.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}Z.IGNORE_ATTRS={width:"",height:""};class J extends H{constructor(t,e=k){super(t,e,"g"),H.DEBUGGING&&(this.add(this._debugRect=new j(t,"rct-debug")),this._debugRect.setAttr("pointerEvents","none"))}chart(){return this.model.chart}get model(){return this._model}_prepareStyleOrClass(t){this.setStyleOrClass(t._style)}setModel(t){t!==this.model&&(this._model=t,this.options=t._op)}measure(t,e,s,i,r){this._prepareStyleOrClass(e),this.setModel(e);const n=this._doMeasure(t,this.model,s,i,r);return this.mw=n.width,this.mh=n.height,n}layout(t){return this._doLayout(t),H.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new j(this.doc,"rct-debug")),this.width>1&&this.height>1&&this._debugRect.setRect(this._getDebugRect())):this._debugRect&&(this._debugRect.remove(),this._debugRect=null),this}resizeByMeasured(){return this.resize(this.mw,this.mh),this}_getDebugRect(){return{x:0,y:0,width:this.width,height:this.height}}_doMeasure(t,e,s,i,r){return{width:s,height:i}}_doLayout(t){}_invalidate(){var t;null===(t=this.control)||void 0===t||t.invalidateLayout()}}class Q extends J{constructor(t,e,s){super(t,e),this._margins=new K,this._paddings=new K,this.add(this._background=new j(t,s))}_getDebugRect(){return this._margins.shrink(super._getDebugRect())}measure(t,e,s,i,r){this._prepareStyleOrClass(e),this.setModel(e),this._setBackgroundStyle(this._background);let n=getComputedStyle(this._background.dom);const o=this._paddings;o.applyPadding(n);const h=this._doMeasure(t,e,s,i,r);if(h.width+=o.left+o.right,h.height+=o.top+o.bottom,this._marginable()){const t=this._margins;n=getComputedStyle(this.dom),t.applyMargin(n),this.mw=h.width+=t.left+t.right,this.mh=h.height+=t.top+t.bottom}return this.mw=h.width,this.mh=h.height,h}layout(t){if(super.layout(t),this._marginable()){const t=this._margins;this._background.setBounds(t.left+this._getBackOffset(),t.top,this.width-t.left-t.right,this.height-t.top-t.bottom)}else this._resetBackBounds()&&this._background.setBounds(0,0,this.width,this.height);return this}_marginable(){return!0}_resetBackBounds(){return!0}_getBackOffset(){return 0}_deflatePaddings(t){const e=this._paddings;t.width-=e.left+e.right,t.height-=e.top+e.bottom}}class tt extends J{constructor(t){super(t,"rct-legend-item"),this.add(this._back=new j(t)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new U(t,"rct-legend-item-label")),this._label.anchor=X.START}setMarker(t){t!==this._marker&&(this._marker&&this._marker.remove(),this.insertFirst(this._marker=t))}_doMeasure(t,e,s,i,r){var n,o;const h=e.source;this._label.setBoolData("hidden",!h.visible),this._marker.setBoolData("hidden",!h.visible),this._label.setBoolData("empty",null===(n=h.isEmpty)||void 0===n?void 0:n.call(h)),this._marker.setBoolData("empty",null===(o=h.isEmpty)||void 0===o?void 0:o.call(h)),this._label.text=e.text()||"…";const a=this._rMarker=this._marker.setVis(e.legend.options.markerVisible)?this._marker.getBBox():E,l={width:(d=this._label.getBBox()).width,height:d.height};var d;return this._gap=v(e.legend.options.markerGap,0),{width:a.width+this._gap+l.width,height:y(a.height,l.height)}}_doLayout(t){const e=this._rMarker,s=v(t,e.width);this._back.setBounds(0,0,this.width,this.height),this._marker.visible&&this._marker.trans((s-e.width)/2,(this.height-e.height)/2),this._label.trans(s+this._gap,(this.height-this._label.getBBox().height)/2)}}class et extends Q{constructor(t){super(t,et.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new A(this,tt)}legendByDom(t){const e=this._itemViews.elementOf(t);return e&&e.model}legendOfSeries(t){return this._itemViews.find((e=>e.model.source===t))}_setBackgroundStyle(t){t.setStyleOrClass(this.model.options.backgroundStyle)}_doMeasure(t,e,s,i,r){const n=e.options,o=e.items(),h=this._vertical="vertical"===e.getLayout();return this._ipr=v(n.itemsPerLine,Number.MAX_SAFE_INTEGER),this._gap="body"!==e._location?v(n.gap,0):0,h?i=e.getMaxHeight(i):s=e.getMaxWidth(s),this.$_prepareItems(t,o),this.$_measure(t,e,h,this._ipr,s,i)}_doLayout(){const t=this.model.options,e=this._rowViews,s=t.useTextColor,i=this._sizes,r=t.itemsAlign,n=t.lineGap||0,o=t.itemGap||0,h=this._margins,a=this._paddings,l=this._vertical,d=h.left+a.left,c=h.top+a.top;let _,u=d,p=c;this._itemViews.forEach((t=>{const e=t.model.source,i=e.legendColor(),r=e.legendStroke();t._marker.setColor(i),r&&t._marker.setStroke(r),s&&e.visible?t._label.setFill(i):t._label.setFill("")})),e.forEach(((t,e)=>{l?(t.forEach((t=>{t.mw=i[e],t.resizeByMeasured().layout(this._wMarkers[e])})),p=c,"center"!==r&&"end"!==r||(_=t.map((t=>t.height)).reduce(((t,e)=>t+e))+o*(t.length-1)+h.top+h.bottom+a.top+a.bottom,p+="center"===r?(this.height-_)/2:this.height-_),t.forEach((t=>{t.trans(u,p),p+=t.height+o})),u+=i[e]+n):(t.forEach((t=>{t.resizeByMeasured().layout(NaN)})),u=d,"center"!==r&&"end"!==r||(_=t.map((t=>t.width)).reduce(((t,e)=>t+e))+o*(t.length-1)+h.left+h.right+a.left+a.right,u+="center"===r?(this.width-_)/2:this.width-_),t.forEach((t=>{t.trans(u,p),u+=t.width+o})),p+=i[e]+n)}))}$_prepareItems(t,e){this._itemViews.prepare(e.length)}$_measure(t,e,s,i,r,n){const o=e.options,h=e.items(),a=this._itemViews,l=o.itemGap||0,d=o.lineGap||0,c=e.getMarkerSize(),_=a.count,u=this._rowViews=[],p=this._sizes=[];let g,m,f,w;a.forEach(((e,s)=>{e.setMarker(h[s].source.legendMarker(t,c)),e.measure(t,h[s],r,n,1)}));let v=0,b=0;if(s){for(;v<_;)w=a.get(v),b%i==0?(u.push(f=[w]),m=w.mh,b++,v++):(m+=l+w.mh,m<=n?(f.push(w),b++,v++):b=0);this._wMarkers=[],g=m=0,u.forEach(((t,e)=>{let s=0,i=0,r=0;t.forEach((t=>{i+=t.mh,s=y(s,t.mw),r=y(r,t._rMarker.width),t._col=e})),i+=l*(t.length-1),m=y(m,i),g+=s,p.push(s),this._wMarkers.push(r)})),g+=d*(u.length-1)}else{for(;v<_;)w=a.get(v),b%i==0?(u.push(f=[w]),g=w.mw,b++,v++):(g+=l+w.mw,g<=r?(f.push(w),b++,v++):b=0);g=m=0,u.forEach((t=>{let e=0,s=0;t.forEach((t=>{e+=t.mw,s=y(s,t.mh)})),e+=l*(t.length-1),g=y(g,e),m+=s,p.push(s)})),m+=d*(u.length-1)}return{width:g,height:m}}}et.LEGEND_CLASS="rct-legend";class st extends e.SectionView{constructor(){super(...arguments),this.views=[],this._gap=0}isEmpty(){return 0===this.views.length}prepare(t,s,i,r){const n=this.views,o=[];for(this.isX=i,r._axes.forEach((t=>{t.checkVisible()&&s.isValidAxis(t)&&o.push(t)}));n.length<o.length;){const s=new e.AxisView(t);this.add(s),n.push(s)}for(;n.length>o.length;)n.pop().remove();if(n.forEach(((t,e)=>{t.setModel(o[e])})),this.axes=o,this.setVis(n.length>0)){const t=n[0].model;this._gap=t.chart.getAxesGap()}}prepareGuides(t,e,s){const i=this.views,r=this.axes;i.forEach(((s,i)=>{const n=r[i];e.forEach((e=>{e.forEach((e=>{e.isConnected(n)&&s.setVis(this.visible)&&(s.prepareGuides(t,e.row,e.col,e._guideContainer,e._frontGuideContainer),n._isHorz||(e._axes||(e._axes=[]),e._axes.push(n)))}))}))})),e.forEach((e=>{e.forEach((e=>{e._axes&&(e._gridRowContainer.addAll(t,e._axes),e._axes=[])}))}))}checkHeights(t,e,s){return this.views.length>0?this.$_checkHeights(this.views,t,e,s):0}$_checkHeights(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkHeight(e,s,i)})),r+=(this.views.length-1)*this._gap),r}checkWidths(t,e,s){return this.views.length>0?this.$_checkWidths(this.views,t,e,s):0}$_checkWidths(t,e,s,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkWidth(e,s,i)})),r+=(this.views.length-1)*this._gap),r}getScrollView(t){var e;for(const s of this.views)if(null===(e=s._scrollView)||void 0===e?void 0:e.contains(t))return s._scrollView}setMargins(t,e,s,i){this.views.forEach((r=>r.setMargins(t,e,s,i)))}_setInverted(t){super._setInverted(t),this.isHorz=t&&!this.isX||!t&&this.isX}_doMeasure(t,e,s,i,r){const n=this.axes;if(this.isHorz){let e=0;return this.views.forEach(((o,h)=>{e+=o.measure(t,n[h],s,i,r).height})),{width:s,height:e}}{let e=0;return this.views.forEach(((o,h)=>{e+=o.measure(t,n[h],s,i,r).width})),{width:e,height:i}}}_doLayout(t){const e=this.views,s=this.width,i=this.height,r=e.length;let n=0,o=r-1;if(this.isHorz){let t,h,a=0;for(;n<r;n++){const t=e[n];if(t.model._posValue()<1)break;t.trans(0,a),a+=t.mh}for(t=a,a=i;o>=0;o--){const t=e[o];if(t.model._posValue()>-1)break;a-=t.mh,t.trans(0,a)}h=a;const l=h-t;let d=0;for(let t=n;t<=o;t++)d+=e[t].mh;t+=(l-d)/2;for(let s=n;s<=o;s++){const i=e[s];i.trans(0,t),t+=i.mh}e.forEach((t=>{t.resize(s,t.mh),t.model._calcPoints(s,999),t.layout()}))}else{let t,h,a=0;for(;n<r;n++){const t=e[n];if(t.model._posValue()>-1)break;t.trans(a,0),a+=t.mw}for(t=a,a=s;o>=0;o--){const t=e[o];if(t.model._posValue()<1)break;a-=t.mw,t.trans(a,0)}h=a;const l=h-t;let d=0;for(let t=n;t<=o;t++)d+=e[t].mw;t+=(l-d)/2;for(let s=n;s<=o;s++){const i=e[s];i.trans(t,0),t+=i.mw}e.forEach((t=>{t.resize(t.mw,i),t.model._calcPoints(i,999),t.layout()}))}}}class it extends e.SectionView{constructor(t,e){super(t,"rct-axis-container"),this.isX=e,this.sections=[]}prepare(t,e,s,i,r){const n=this.isX?s.getRow(i):s.getColumn(i);for(;this.sections.length<n.length;){const e=new st(t);this.add(e),this.sections.push(e)}for(;this.sections.length>n.length;)this.sections.pop().remove();this.sections.forEach(((s,r)=>{this.isX?(s.row=i,s.col=r):(s.col=i,s.row=r),s.prepare(t,e,this.isX,n[r])})),this._setInverted(r)}prepareGuides(t,e,s,i){const r=this.isX?s.getRow(i):s.getColumn(i);for(;this.sections.length<r.length;){const e=new st(t);this.add(e),this.sections.push(e)}for(;this.sections.length>r.length;)this.sections.pop().remove();this.sections.forEach(((r,n)=>{this.isX?(r.row=i,r.col=n):(r.col=i,r.row=n),r.prepareGuides(t,e,s)}))}checkWidths(t,e,s){return this.sections.length>0?this._isHorz?this.sections.reduce(((i,r)=>i+r.checkWidths(t,e,s)),0):this.sections.reduce(((i,r)=>Math.max(i,r.checkWidths(t,e,s))),0):0}checkHeights(t,e,s){return this.sections.length>0?this._isHorz?this.sections.reduce(((i,r)=>Math.max(i,r.checkHeights(t,e,s))),0):this.sections.reduce(((i,r)=>i+r.checkHeights(t,e,s)),0):0}_setInverted(t){super._setInverted(t),this._isHorz=t&&!this.isX||!t&&this.isX}_doMeasure(t,s,i,r,n){let o=0,h=0;return this._isHorz?this.sections.forEach((o=>{h=e.maxv(h,o.measure(t,s,i,r,n).height)})):this.sections.forEach((h=>{o=e.maxv(o,h.measure(t,s,i,r,n).width)})),{width:o,height:h}}_doLayout(t){this._isHorz?this.height>0&&this.sections.forEach(((e,s)=>{e.resize(t[2*(s+1)]-t[2*(s+1)-1],this.height),e.trans(t[2*s+1]-t[1],0),e.layout()})):this.width>0&&this.sections.forEach(((e,s)=>{e.resize(this.width,t[2*(s+1)]-t[2*(s+1)-1]),e.trans(0,this.height-(t[2*(s+1)]-t[1])),e.layout()}))}}class rt extends e.BodyView{constructor(t,e){super(t,e),this.row=0,this.col=0,this.add(this._legendView=new et(t))}getCol(){return this.col}getRow(){return this.row}getTooltipPos(){return{x:this.parent.parent.tx+this.tx,y:this.parent.parent.ty+this.ty}}prepareRender(t,s){const i=s.chart,r=s.depth.visible,n=this.row,o=this.col,h=i._split.getPane(n,o).body;this._animatable=e.RcControl._animatable&&i.animatable(),this._prepareSeries(t,s,i._getSeries().getPaneSeries(n,o),r),this._prepareGauges(t,i,i._getGauges().getPaneVisibles(n,o)),this._prepareAnnotations(t,h.getAnnotations().concat(i._getAnnotations().getPaneVisibles(n,o)))}_doMeasure(t,e,s,i,r){return this._legendView.setVis(e.pane.legend.visible)&&this._legendView.measure(t,e.pane.legend,s,i,r),super._doMeasure(t,e,s,i,r)}_doLayout(){super._doLayout();const t=this._legendView;if(t.visible){this._seriesViews.forEach((e=>{if(e.needDecoreateLegend()){const s=t.legendOfSeries(e.model);s&&e.decoreateLegend(s)}}));const e=t.model.options,s=e.align,i=e.verticalAlign;let r=0,n=0,o=+e.offsetX||0;switch(s){case"right":r+=this.width-t.mw-o;break;case"center":r+=(this.width-t.mw)/2+o;break;default:r+=o}switch(o=+e.offsetY||0,i){case"bottom":n+=this.height-t.mh-o;break;case"middle":n+=(this.height-t.mh)/2+o;break;default:n+=o}t.trans(r,n).resize(t.mw,t.mh),t.layout()}}}class nt extends e.PaneContainer{constructor(t,e){super(t,nt.STYLE_NAME),this._bodies=[],this._xContainers=[],this._yContainers=[],this._owner=e}get bodies(){return this._bodies}bodyViewOf(t){return this._bodies.find((e=>e.contains(t)))}prepare(t,e){e.chart,this.$_init(t),this._model=e,this.$_prepareBodies(t,e)}measure(t,e,s,i,r){const n=e.chart,o=this._inverted=e.chart.isInverted(),h=e._xAxes,a=e._yAxes,l=s,d=i;this.$_prepareAxes(t,h,!0,o),this.$_prepareAxes(t,a,!1,o),e.measureAxes(s,i,o,r),o?(s-=this._xContainers.reduce(((e,r)=>e+r.checkWidths(t,s,i)),0),i-=this._yContainers.reduce(((e,r)=>e+r.checkHeights(t,s,i)),0)):(i-=this._xContainers.reduce(((e,r)=>e+r.checkHeights(t,s,i)),0),s-=this._yContainers.reduce(((e,r)=>e+r.checkWidths(t,s,i)),0)),e.measureAxes(s,i,o,r),this._xContainers.forEach((e=>e.measure(t,n,s,i,r))),this._yContainers.forEach((e=>e.measure(t,n,s,i,r))),s=l,i=d,o?(s-=this._xContainers.reduce(((t,e)=>t+e.mw),0),i-=this._yContainers.reduce(((t,e)=>t+e.mh),0)):(i-=this._xContainers.reduce(((t,e)=>t+e.mh),0),s-=this._yContainers.reduce(((t,e)=>t+e.mw),0)),r++,e.measureAxes(s,i,o,r),this.$_prepareAxisGuides(t,h,!0),this.$_prepareAxisGuides(t,a,!1),this._xContainers.forEach((e=>{e.measure(t,n,s,i,r)})),this._yContainers.forEach((e=>{e.measure(t,n,s,i,r)}));const c=e.getXLens(o?i:s),_=e.getYLens(o?s:i);e.completeAxesPoints(c,_)}layout(){const t=this._model,e=this.width,s=this.height;this._back.resize(e,s),this.$_calcExtents(t,e,s),this.$_layoutAxes(t,!0,e,s),this.$_layoutAxes(t,!1,e,s),this.$_layoutBodies(t,e,s)}seriesByDom(t){for(const e of this._bodies){const s=e.seriesByDom(t);if(s)return s}}getSeries(t){for(const e of this.bodies){const s=e.findSeries(t);if(s)return s}}legendByDom(t){for(const e of this.bodies){const s=e._legendView.legendByDom(t);if(s)return s}}$_init(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)))}$_prepareBodies(t,e){e.chart;const s=e.paneCount,i=e.rowCount,r=e.colCount,n=this._bodies,o=this._bodyMap=[];for(;n.length<s;){const e=new rt(t,this._owner);this._bodyContainer.add(e),n.push(e)}for(;n.length>s;)n.pop().remove();for(let t=0;t<i;t++){const e=[];for(let s=0;s<r;s++){const i=n[t*r+s];e.push(i),i.row=t,i.col=s}o.push(e)}n.forEach((s=>{s.prepareRender(t,e.getPane(s.row,s.col).body),s.prepareGuideContainers(),s._gridRowContainer.prepare()}))}$_prepareAxes(t,e,s,i){const r=this._model.chart,n=s?this._xContainers:this._yContainers,o=s?e.rows():e.cols();for(;n.length<o;){const e=new it(t,s);this._axisContainer.add(e),n.push(e)}for(;n.length>o;)n.pop().remove();n.forEach(((s,n)=>{s.prepare(t,r,e,n,i)}))}$_prepareAxisGuides(t,e,s){(s?this._xContainers:this._yContainers).forEach(((s,i)=>{s.prepareGuides(t,this._bodyMap,e,i)}))}$_calc(t,e,s,i){const r=s.length,n=new Array(2*(r+1)),o=e-t.reduce(((t,e)=>t+e[i]),0),h=this._model._calcSizes(s,o);let a=0,l=0;for(l=0;l<r;l++)n[2*l]=a,n[2*l+1]=a+=t[l][i],a+=h[l];return n[2*l]=a,n[2*l+1]=a+t[l][i],n}$_calcExtents(t,e,s){this._inverted?(this._rowPoints=this.$_calc(this._xContainers,e,t.rowSizes(),"mw"),this._colPoints=this.$_calc(this._yContainers,s,t.colSizes(),"mh")):(this._rowPoints=this.$_calc(this._xContainers,s,t.rowSizes(),"mh"),this._colPoints=this.$_calc(this._yContainers,e,t.colSizes(),"mw"))}$_layoutAxes(t,e,s,i){const r=this.control._padding,n=this._rowPoints,o=this._colPoints,h=e?this._xContainers:this._yContainers;if(this._inverted)if(e){const t=o[1],e=o[o.length-2]-t;h.forEach(((t,s)=>{t.resize(t.mw,e),t.trans(n[2*s],i-o[o.length-2]),t.layout(o)}))}else{const t=n[1],e=n[n.length-2]-t;h.forEach(((s,h)=>{const a=s.sections;for(let t=0,e=a.length;t<e;t++){const s=a[t],i=0===t?r.left:0,o=t===e-1?r.right:0;let h=0,l=0;e>1&&(h=n[2*t+1]-n[2*t],l=n[2*(t+1)+1]-n[2*(t+1)],0===t?a[t+1].isEmpty()?l=n[2*(t+1)]-n[2*(t+1)-1]:l/=2:t===e-1?a[t-1].isEmpty()?h=n[2*(t-1)]-n[2*(t-1)-1]:h/=2:(a[t-1].isEmpty()?h=n[2*(t-1)]-n[2*(t-1)-1]:h/=2,a[t+1].isEmpty()?l=n[2*(t+1)]-n[2*(t+1)-1]:l/=2)),s.setMargins(i,h,l,o)}s.resize(e,s.mh),s.trans(t,i-o[2*h+1]),s.layout(n)}))}else if(e){const t=o[1];s=o[o.length-2]-t,h.forEach(((e,a)=>{const l=e.sections;for(let t=0,e=l.length;t<e;t++){const s=l[t],i=0===a?r.left:0,d=a===h.length-1?r.right:0;let c=0,_=0;e>1&&(c=o[2*t+1]-o[2*t],_=o[2*(t+1)+1]-o[2*(t+1)],0===t?l[t+1].isEmpty()?_=o[2*(t+1)]-o[2*(t+1)-1]:_/=2:t===e-1?l[t-1].isEmpty()?c=o[2*(t-1)]-o[2*(t-1)-1]:c/=2:(l[t-1].isEmpty()?c=o[2*(t-1)]-o[2*(t-1)-1]:c/=2,l[t+1].isEmpty()?_=o[2*(t+1)]-n[2*(t+1)-1]:_/=2)),s.setMargins(i,c,_,d)}e.resize(s,e.mh),e.trans(t,i-n[2*a+1]),e.layout(o)}))}else{const t=n[n.length-2],e=t-n[1];h.forEach(((s,r)=>{s.resize(s.mw,e),s.trans(o[2*r],i-t),s.layout(n)}))}}$_layoutBodies(t,e,s){const i=t.rowCount,r=t.colCount,n=this._rowPoints,o=this._colPoints,h=this._bodies;if(this._inverted)for(let e=0;e<i;e++){const s=n[2*(e+1)-1],i=n[2*(e+1)];for(let n=0;n<r;n++){const a=h[e*r+n],l=o[2*n+1],d=o[2*(n+1)];a.measure(this.doc,t.getPane(e,n).body,i-s,d-l,1),a.resize(i-s,d-l),a.trans(s,this.height-d),a.layout()}}else for(let e=0;e<i;e++){const i=n[2*(e+1)-1],a=n[2*(e+1)];for(let n=0;n<r;n++){const l=h[e*r+n],d=o[2*(n+1)-1],c=o[2*(n+1)];l.measure(this.doc,t.getPane(e,n).body,c-d,a-i,1),l.resize(c-d,a-i),l.trans(d,s-a),l.layout()}}}}function ot(t){(function(t){return t.Series&&t.SeriesView})(t)&&(t.ChartObject.registerSplitClass(c),t.ChartView.registerPaneClass(nt))}nt.STYLE_NAME="rct-panes",ot(i),t.Split=c,t.default=ot,Object.defineProperty(t,"__esModule",{value:!0})}));