realchart 1.4.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/gauge.d.ts +56 -60
- package/gauge.js +2 -2
- package/gauge.mjs +2 -2
- package/heatmap.d.ts +2 -2
- package/heatmap.js +1 -1
- package/heatmap.mjs +1 -1
- package/index.d.ts +1800 -1553
- package/index.js +2 -2
- package/index.mjs +2 -2
- package/package.json +1 -1
- package/realchart-style.css +8 -3
- package/split.d.ts +15 -8
- package/split.js +2 -2
- package/split.mjs +2 -2
- package/treemap.d.ts +3 -3
- package/treemap.js +1 -1
- package/treemap.mjs +1 -1
- package/vector.d.ts +2 -2
- package/vector.js +1 -1
- package/vector.mjs +1 -1
- package/wordcloud.d.ts +2 -2
- package/wordcloud.js +2 -2
- package/wordcloud.mjs +2 -2
package/package.json
CHANGED
package/realchart-style.css
CHANGED
|
@@ -154,7 +154,8 @@
|
|
|
154
154
|
--rct-axis-baseline-stroke: #333;
|
|
155
155
|
--rct-axis-tick-stroke: #555;
|
|
156
156
|
--rct-axis-label-fill: #333;
|
|
157
|
-
--rct-axis-
|
|
157
|
+
--rct-axis-unit-label-fill: #333;
|
|
158
|
+
--rct-axis-grid-line-stroke: #eaeaea;
|
|
158
159
|
--rct-axis-grid-line-stroke-start: none;
|
|
159
160
|
--rct-axis-grid-line-stroke-end: none;
|
|
160
161
|
--rct-axis-grid-line-stroke-width: 1px;
|
|
@@ -181,8 +182,8 @@
|
|
|
181
182
|
--rct-credits-fill: #777;
|
|
182
183
|
|
|
183
184
|
/* polar */
|
|
184
|
-
--rct-polar-xaxis-grid-line-stroke: #
|
|
185
|
-
--rct-polar-yaxis-grid-line-stroke: #
|
|
185
|
+
--rct-polar-xaxis-grid-line-stroke: #cacaca;
|
|
186
|
+
--rct-polar-yaxis-grid-line-stroke: #cacaca;
|
|
186
187
|
--rct-polar-axis-labels-fill: #555;
|
|
187
188
|
|
|
188
189
|
/* linear gauge */
|
|
@@ -465,6 +466,10 @@
|
|
|
465
466
|
font-size: 14px;
|
|
466
467
|
fill: var(--rct-axis-label-fill);
|
|
467
468
|
}
|
|
469
|
+
.rct-axis-unit-label {
|
|
470
|
+
font-size: 13px;
|
|
471
|
+
fill: var(--rct-axis-unit-label-fill);
|
|
472
|
+
}
|
|
468
473
|
.rct-axis-grid {
|
|
469
474
|
fill: none;
|
|
470
475
|
}
|
package/split.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as RealChart from 'realchart';
|
|
2
|
-
import { IChart, AxisCollection, Axis, ChartItem, SplitOptions, ISplit, Annotation, IAxis, PaneOptions,
|
|
2
|
+
import { IChart, AxisCollection, Axis, ChartItem, SplitOptions, ISplit, Annotation, IAxis, PaneOptions, Body, PaneBodyOptions, GaugeBase, Series, Legend } from 'realchart';
|
|
3
|
+
import { ILegendSource } from 'realchart/out/realchart/js/src/model/Legend';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
|
-
* @
|
|
6
|
+
* @private
|
|
6
7
|
*
|
|
7
8
|
* section view 하나에 배치되는 축들.
|
|
8
9
|
*/
|
|
@@ -38,18 +39,24 @@ declare class PaneBody extends Body<PaneBodyOptions> {
|
|
|
38
39
|
constructor(pane: Pane);
|
|
39
40
|
contains(obj: GaugeBase | Series): boolean;
|
|
40
41
|
}
|
|
42
|
+
declare class PaneLegend extends Legend {
|
|
43
|
+
pane: Pane;
|
|
44
|
+
constructor(pane: Pane);
|
|
45
|
+
protected _doPrepareRender(chart: IChart): void;
|
|
46
|
+
protected _getLegendSources(): ILegendSource[];
|
|
47
|
+
}
|
|
41
48
|
declare class Pane extends ChartItem<PaneOptions> {
|
|
42
49
|
row: number;
|
|
43
50
|
col: number;
|
|
44
51
|
private _body;
|
|
52
|
+
private _legend;
|
|
45
53
|
constructor(chart: IChart, row: number, col: number);
|
|
46
|
-
protected _doInitChildren(op:
|
|
47
|
-
[child: string]: ChartItemOptions;
|
|
48
|
-
}): void;
|
|
54
|
+
protected _doInitChildren(op: PaneOptions): void;
|
|
49
55
|
/**
|
|
50
56
|
* Body 모델.
|
|
51
57
|
*/
|
|
52
58
|
get body(): PaneBody;
|
|
59
|
+
get legend(): PaneLegend;
|
|
53
60
|
_prepareRender(): void;
|
|
54
61
|
}
|
|
55
62
|
interface IRelativeSize {
|
|
@@ -58,10 +65,10 @@ interface IRelativeSize {
|
|
|
58
65
|
/**
|
|
59
66
|
* 다중 분할 panes.<br/>
|
|
60
67
|
* 각 pane에 해당하는 x, y축이 반드시 존재해야 한다.
|
|
61
|
-
* axis는 {@
|
|
62
|
-
* 시리즈는 {@
|
|
68
|
+
* axis는 {@link https://realchart.co.kr/config/config/base/axis#row row}, {@link https://realchart.co.kr/config/config/base/axis#col col} 속성으로 위치를 지정한다.
|
|
69
|
+
* 시리즈는 {@link https://realchart.co.kr/config/config/base/series#row row}, {@link https://realchart.co.kr/config/config/base/series#col col} 속성으로 지정하거나, 아니면 axis 위치에 따라 자동으로 결정된다.
|
|
63
70
|
* // 현재 문서 구조로 SeriesGroup을 가리킬 수 없음.
|
|
64
|
-
* // 시리즈그룹은 {@
|
|
71
|
+
* // 시리즈그룹은 {@link SeriesGroup.row row}, {@link SeriesGroup.col col} 속성으로 지정하거나, 아니면 axis 위치에 따라 자동으로 결정된다.
|
|
65
72
|
*
|
|
66
73
|
* @modules split
|
|
67
74
|
*/
|
package/split.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* RealChart Split v1.4.
|
|
3
|
+
* RealChart Split v1.4.1
|
|
4
4
|
* Copyright (C) 2023-2025 WooriTech Inc.
|
|
5
5
|
* All Rights Reserved.
|
|
6
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).RealChartSplit={},e.RealChart)}(this,(function(e,t){"use strict";function s(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var i=s(t);class o{constructor(e,t){this.row=e,this.col=t,this._axes=[]}sort(e,t){const s=t&&!e||!t&&e;this._axes.length>1&&(s?this._axes.sort(((e,t)=>{const s=e._posValue(),i=t._posValue();return s===i?s<0?t._index-e._index:s>0?e._index-t._index:e.row!==t.row?t.row-e.row:e.row<this.row?t._index-e._index:e._index-t._index:i-s})):this._axes.sort(((e,t)=>{const s=e._posValue(),i=t._posValue();return s===i?s<0?e._index-t._index:s>0?t._index-e._index:e.col!==t.col?e.col-e.col:e.col<this.col?e._index-t._index:t._index-e._index:s-i})))}}class r{constructor(e,t){this.chart=e,this.isX=t}rows(){return this._matrix.length}cols(){return this._matrix[0].length}_prepare(e,t,s,i){this._doPrepare(e,t,s),this._matrix.forEach((e=>{e.forEach((e=>e.sort(this.isX,i)))}))}get(e,t){return this._matrix[e][t]}getRow(e){return this._matrix[e]}getColumn(e){return this._matrix.map((t=>t[e]))}_buildTicks(e,t){const s=this.isX;this._matrix.forEach(((i,o)=>{i.forEach(((i,o)=>{i._axes.forEach((i=>{!i.isBased()&&(t<2||s)&&i._buildTicks(e[s?i.options.col:i.options.row],t)}))}))})),this._matrix.forEach(((i,o)=>{i.forEach(((i,o)=>{i._axes.forEach((i=>{i.isBased()&&(t<2||s)&&i._buildTicks(e[s?i.options.col:i.options.row],t)}))}))}))}_calcPoints(e,t){const s=this.isX;this._matrix.forEach((i=>{i.forEach(((i,o)=>{i._axes.forEach((i=>{if(t<2||s){const o=s?i.options.col:i.options.row;i._calcPoints(e[o],t)}}))}))}))}}class n extends r{constructor(e){super(e,!0)}_doPrepare(e,t,s){const i=this._matrix=new Array(t+1);for(let e=0;e<i.length;e++){i[e]=[];for(let t=0;t<s;t++)i[e].push(new o(e,t))}e.forEach((e=>{var s,o;const r=e.options.position;let n=e.row;"opposite"===r?(n++,e._runPos=r):n<t-1&&"between"===r?(n++,e._runPos="normal"):e._runPos=r,null===(o=null===(s=i[n])||void 0===s?void 0:s[e.col])||void 0===o||o._axes.push(e)}))}}class h extends r{constructor(e){super(e,!1)}_doPrepare(e,t,s){const i=this._matrix=new Array(t);for(let e=0;e<i.length;e++){i[e]=[];for(let t=0;t<=s;t++)i[e].push(new o(e,t))}e.forEach((e=>{var t,o;const r=e.options.position;let n=e.col;"opposite"===r?(n++,e._runPos=r):e.col<s-1&&"between"===r?(n++,e._runPos="normal"):e._runPos=r,null===(o=null===(t=i[e.row])||void 0===t?void 0:t[n])||void 0===o||o._axes.push(e)}))}}class a extends t.Body{constructor(e){super(e.chart),this.pane=e}contains(e){return e.col===this.pane.col||e.row===this.pane.row}}a.defaults=t.extend(t.Body.defaults,{extended:!0,radius:void 0,centerX:void 0,centerY:void 0});class c extends t.ChartItem{constructor(e,t,s){super(e),this.row=t,this.col=s}_doInitChildren(e){e.body=(this._body=new a(this)).init()}get body(){return this._body}_prepareRender(){this.body._prepareRender()}}class l extends t.ChartItem{constructor(e){super(e),this._cols=1,this._rows=1,this._paneDic={},this._panes=[],this._xAxes=new n(e),this._yAxes=new h(e)}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(e,t){return this._panes[e][t]}getRow(e){return this._panes[e]}getColumn(e){return this._panes.map((t=>t[e]))}getAxisOf(e,t){var s,i;const o=this.chart,r=e.body;if(r){const n=r.pane;return t?o._getXAxes().get(e.options.xAxis)||this._xAxes.get(n.row,n.col)._axes[0]||(null===(s=o._getSeries().getPaneSeries(n.row,n.col)[0])||void 0===s?void 0:s._xAxisObj):o._getXAxes().get(e.options.yAxis)||this._yAxes.get(r.pane.row,r.pane.col)._axes[0]||(null===(i=o._getSeries().getPaneSeries(n.row,n.col)[0])||void 0===i?void 0:i._yAxisObj)}}isValidAxis(e){return e&&e.row<this._rows&&e.col<this._cols}_doLoadProp(e,t){return["panes","cols","rows"].indexOf(e)>=0||super._doLoadProp(e,t)}_doSetSimple(e){if(t.isArray(e)&&e.length>0){const s=t.maxv(1,+e[0]),i=t.maxv(1,t.pickNum(+e[1],s));return s>0&&i>0&&(this.$_parsePanes(s,i),this.visible=!0),!0}return super._doSetSimple(e)}_load(e){return super._load(e),t.isObject(e)&&(this.$_parsePanes(e.rows,e.cols),this._paneDic=this.$_loadPanes(e.panes)),this}_doPrepareRender(e){this._panes=this.$_collectPanes(e),this._panes.forEach((e=>e.forEach((e=>e._prepareRender()))))}_calcSizes(e,s){const i=e.length,o=new Array(i);let r=0;if(i>1){let n=s,h=0;for(r=0;r<i;r++){const s=e[r];t.isNumber(s)?n-=o[r]=Math.max(0,Math.min(n,s)):h+=s.size}if(h>0)for(r=0;r<i;r++){const s=e[r];t.isNumber(s)||(o[r]=n*s.size/h)}}else o[r]=s;return o}getXLens(e){return this._calcSizes(this._colSizes,e)}getYLens(e){return this._calcSizes(this._rowSizes,e)}measureAxes(e,t,s,i){const o=this.getXLens(s?t:e),r=this.getYLens(s?e:t);this._xAxes._buildTicks(o,i),this._yAxes._buildTicks(r,i),this.$_calcAxesPoints(o,r,i)}$_calcAxesPoints(e,t,s){this._xAxes._calcPoints(e,s),this._yAxes._calcPoints(t,s)}completeAxesPoints(e,t){this.$_calcAxesPoints(e,t,101)}getBodyAnnotation(e){for(const t in this._paneDic){const s=this._paneDic[t].body.getAnnotation(e);if(s)return s}}prepareRender(e,t){const s=this.chart.isInverted();this._prepareRender(),this._xAxes._prepare(e,this._rows,this._cols,s),this._yAxes._prepare(t,this._rows,this._cols,s)}$_parseSizes(e){let s;return s=t.isArray(e)&&e.length>0?e.slice(0):e>0?new Array(e).fill("*"):["*"],s.map((e=>{if(t.isString(e)){const s=e.trim();return{size:"*"===s?1:t.pickNum(parseFloat(s),1)}}return t.pickNum(+e,1)}))}$_parsePanes(e,t){this._colSizes=this.$_parseSizes(t),this._rowSizes=this.$_parseSizes(e),this._cols=this._colSizes.length,this._rows=this._rowSizes.length}$_loadPanes(e){const s=this.chart,i=this._op.extendBody?s._body._config:void 0,o={};if(e=t.isArray(e)?e:t.isObject(e)?[e]:null,t.isArray(e)&&e.forEach((e=>{const t=+e.row||0,r=+e.col||0;if(r>=0&&r<this._cols&&t>=0&&t<this._rows){const n=new c(s,t,r);let h=e;n.init(),!i||e&&e.body&&!1===e.body.extended||(e?(h=Object.assign({},e),e.body?!1!==e.body.extended&&(h.body=Object.assign({},i,e.body)):h.body=i):h={body:i}),n._load(h),o[t+","+r]=n}})),i)for(let e=0;e<this._rows;e++)for(let t=0;t<this._cols;t++){const r=e+","+t;if(!o[r]){const n=new c(s,e,t);n.init(),n._load({body:i}),o[r]=n}}return o}$_collectPanes(e){const t=[];for(let s=0;s<this._rows;s++){const i=[];for(let t=0;t<this._cols;t++){const o=this._paneDic[s+","+t]||new c(e,s,t)._initObject();i.push(o)}t.push(i)}return t}}l.defaults=t.extend(t.ChartItem.defaults,{visible:!1,extendBody:!0,gap:0});class _ extends t.SectionView{constructor(){super(...arguments),this.views=[],this._gap=0}isEmpty(){return 0===this.views.length}prepare(e,s,i,o){const r=this.views,n=[];for(this.isX=i,o._axes.forEach((e=>{e.checkVisible()&&s.isValidAxis(e)&&n.push(e)}));r.length<n.length;){const s=new t.AxisView(e);this.add(s),r.push(s)}for(;r.length>n.length;)r.pop().remove();if(r.forEach(((e,t)=>{e.setModel(n[t])})),this.axes=n,this.setVis(r.length>0)){const e=r[0].model;this._gap=e.chart.getAxesGap()}}prepareGuides(e,t,s){const i=this.views,o=this.axes;i.forEach(((s,i)=>{const r=o[i];t.forEach((t=>{t.forEach((t=>{t.isConnected(r)&&s.setVis(this.visible)&&(s.prepareGuides(e,t.row,t.col,t._guideContainer,t._frontGuideContainer),r._isHorz||(t._axes||(t._axes=[]),t._axes.push(r)))}))}))})),t.forEach((t=>{t.forEach((t=>{t._axes&&(t._gridRowContainer.addAll(e,t._axes),t._axes=[])}))}))}checkHeights(e,t,s){return this.views.length>0?this.$_checkHeights(this.views,e,t,s):0}$_checkHeights(e,t,s,i){let o=0;return e&&(e.forEach((e=>{o+=e.checkHeight(t,s,i)})),o+=(this.views.length-1)*this._gap),o}checkWidths(e,t,s){return this.views.length>0?this.$_checkWidths(this.views,e,t,s):0}$_checkWidths(e,t,s,i){let o=0;return e&&(e.forEach((e=>{o+=e.checkWidth(t,s,i)})),o+=(this.views.length-1)*this._gap),o}getScrollView(e){var t;for(const s of this.views)if(null===(t=s._scrollView)||void 0===t?void 0:t.contains(e))return s._scrollView}setMargins(e,t,s,i){this.views.forEach((o=>o.setMargins(e,t,s,i)))}_setInverted(e){super._setInverted(e),this.isHorz=e&&!this.isX||!e&&this.isX}_doMeasure(e,t,s,i,o){const r=this.axes;if(this.isHorz){let t=0;return this.views.forEach(((n,h)=>{t+=n.measure(e,r[h],s,i,o).height})),{width:s,height:t}}{let t=0;return this.views.forEach(((n,h)=>{t+=n.measure(e,r[h],s,i,o).width})),{width:t,height:i}}}_doLayout(e){const t=this.views,s=this.width,i=this.height,o=t.length;let r=0,n=o-1;if(this.isHorz){let e,h,a=0;for(;r<o;r++){const e=t[r];if(e.model._posValue()<1)break;e.trans(0,a),a+=e.mh}for(e=a,a=i;n>=0;n--){const e=t[n];if(e.model._posValue()>-1)break;a-=e.mh,e.trans(0,a)}h=a;const c=h-e;let l=0;for(let e=r;e<=n;e++)l+=t[e].mh;e+=(c-l)/2;for(let s=r;s<=n;s++){const i=t[s];i.trans(0,e),e+=i.mh}t.forEach((e=>{e.resize(s,e.mh),e.model._calcPoints(s,999),e.layout()}))}else{let e,h,a=0;for(;r<o;r++){const e=t[r];if(e.model._posValue()>-1)break;e.trans(a,0),a+=e.mw}for(e=a,a=s;n>=0;n--){const e=t[n];if(e.model._posValue()<1)break;a-=e.mw,e.trans(a,0)}h=a;const c=h-e;let l=0;for(let e=r;e<=n;e++)l+=t[e].mw;e+=(c-l)/2;for(let s=r;s<=n;s++){const i=t[s];i.trans(e,0),e+=i.mw}t.forEach((e=>{e.resize(e.mw,i),e.model._calcPoints(i,999),e.layout()}))}}}class d extends t.SectionView{constructor(e,t){super(e,"rct-axis-container"),this.isX=t,this.sections=[]}prepare(e,t,s,i){const o=this.isX?s.getRow(i):s.getColumn(i);for(;this.sections.length<o.length;){const t=new _(e);this.add(t),this.sections.push(t)}for(;this.sections.length>o.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(e,t,this.isX,o[r])}))}prepareGuides(e,t,s,i){const o=this.isX?s.getRow(i):s.getColumn(i);for(;this.sections.length<o.length;){const t=new _(e);this.add(t),this.sections.push(t)}for(;this.sections.length>o.length;)this.sections.pop().remove();this.sections.forEach(((o,r)=>{this.isX?(o.row=i,o.col=r):(o.col=i,o.row=r),o.prepareGuides(e,t,s)}))}checkWidths(e,t,s){return this.sections.length>0?this._isHorz?this.sections.reduce(((i,o)=>i+o.checkWidths(e,t,s)),0):this.sections.reduce(((i,o)=>Math.max(i,o.checkWidths(e,t,s))),0):0}checkHeights(e,t,s){return this.sections.length>0?this._isHorz?this.sections.reduce(((i,o)=>Math.max(i,o.checkHeights(e,t,s))),0):this.sections.reduce(((i,o)=>i+o.checkHeights(e,t,s)),0):0}_setInverted(e){super._setInverted(e),this._isHorz=e&&!this.isX||!e&&this.isX}_doMeasure(e,s,i,o,r){let n=0,h=0;return this._isHorz?this.sections.forEach((n=>{h=t.maxv(h,n.measure(e,s,i,o,r).height)})):this.sections.forEach((h=>{n=t.maxv(n,h.measure(e,s,i,o,r).width)})),{width:n,height:h}}_doLayout(e){this._isHorz?this.height>0&&this.sections.forEach(((t,s)=>{t.resize(e[2*(s+1)]-e[2*(s+1)-1],this.height),t.trans(e[2*s+1]-e[1],0),t.layout()})):this.width>0&&this.sections.forEach(((t,s)=>{t.resize(this.width,e[2*(s+1)]-e[2*(s+1)-1]),t.trans(0,this.height-(e[2*(s+1)]-e[1])),t.layout()}))}}class u extends t.BodyView{constructor(){super(...arguments),this.row=0,this.col=0}getCol(){return this.col}getRow(){return this.row}prepareRender(e,s){const i=this.row,o=this.col,r=s._split.getPane(i,o).body;this._animatable=t.RcControl._animatable&&s.animatable(),this._prepareSeries(e,s,s._getSeries().getPaneSeries(i,o)),this._prepareGauges(e,s,s._getGauges().getPaneVisibles(i,o)),this._prepareAnnotations(e,r.getAnnotations().concat(s._getAnnotations().getPaneVisibles(i,o)))}getTooltipPos(){return{x:this.parent.parent.tx+this.tx,y:this.parent.parent.ty+this.ty}}}class p extends t.PaneContainer{constructor(e,t){super(e,p.STYLE_NAME),this._bodies=[],this._xContainers=[],this._yContainers=[],this._owner=t}get bodies(){return this._bodies}bodyViewOf(e){return this._bodies.find((t=>t.contains(e)))}prepare(e,t){t.chart,this.$_init(e),this._model=t,this.$_prepareBodies(e,t)}measure(e,t,s,i,o){const r=t.chart,n=this._inverted=t.chart.isInverted(),h=t._xAxes,a=t._yAxes,c=s,l=i;this.$_prepareAxes(e,h,!0),this.$_prepareAxes(e,a,!1),t.measureAxes(s,i,n,o),n?(s-=this._xContainers.reduce(((t,o)=>t+o.checkWidths(e,s,i)),0),i-=this._yContainers.reduce(((t,o)=>t+o.checkHeights(e,s,i)),0)):(i-=this._xContainers.reduce(((t,o)=>t+o.checkHeights(e,s,i)),0),s-=this._yContainers.reduce(((t,o)=>t+o.checkWidths(e,s,i)),0)),t.measureAxes(s,i,n,o),this._xContainers.forEach((t=>t.measure(e,r,s,i,o))),this._yContainers.forEach((t=>t.measure(e,r,s,i,o))),s=c,i=l,n?(s-=this._xContainers.reduce(((e,t)=>e+t.mw),0),i-=this._yContainers.reduce(((e,t)=>e+t.mh),0)):(i-=this._xContainers.reduce(((e,t)=>e+t.mh),0),s-=this._yContainers.reduce(((e,t)=>e+t.mw),0)),o++,t.measureAxes(s,i,n,o),this.$_prepareAxisGuides(e,h,!0),this.$_prepareAxisGuides(e,a,!1),this._xContainers.forEach((t=>{t.measure(e,r,s,i,o)})),this._yContainers.forEach((t=>{t.measure(e,r,s,i,o)}));const _=t.getXLens(n?i:s),d=t.getYLens(n?s:i);t.completeAxesPoints(_,d)}layout(){const e=this._model,t=this.width,s=this.height;this._back.resize(t,s),this.$_calcExtents(e,t,s),this.$_layoutAxes(e,!0,t,s),this.$_layoutAxes(e,!1,t,s),this.$_layoutBodies(e,t,s)}seriesByDom(e){for(const t of this._bodies){const s=t.seriesByDom(e);if(s)return s}}getSeries(e){for(const t of this.bodies){const s=t.findSeries(e);if(s)return s}}$_init(e){this._back||(this.add(this._back=new t.RectElement(e)),this._back.setStyles({fill:"none"}),this.add(this._bodyContainer=new t.LayerElement(e,void 0)),this.add(this._axisContainer=new t.LayerElement(e,void 0)))}$_prepareBodies(e,t){const s=t.chart,i=t.paneCount,o=t.rowCount,r=t.colCount,n=this._bodies,h=this._bodyMap=[];for(;n.length<i;){const t=new u(e,this._owner);this._bodyContainer.add(t),n.push(t)}for(;n.length>i;)n.pop().remove();for(let e=0;e<o;e++){const t=[];for(let s=0;s<r;s++){const i=n[e*r+s];t.push(i),i.row=e,i.col=s}h.push(t)}n.forEach((t=>{t.prepareRender(e,s),t.prepareGuideContainers(),t._gridRowContainer.prepare()}))}$_prepareAxes(e,t,s){const i=this._model.chart,o=s?this._xContainers:this._yContainers,r=s?t.rows():t.cols();for(;o.length<r;){const t=new d(e,s);this._axisContainer.add(t),o.push(t)}for(;o.length>r;)o.pop().remove();o.forEach(((s,o)=>{s.prepare(e,i,t,o)}))}$_prepareAxisGuides(e,t,s){(s?this._xContainers:this._yContainers).forEach(((s,i)=>{s.prepareGuides(e,this._bodyMap,t,i)}))}$_calc(e,t,s,i){const o=s.length,r=new Array(2*(o+1)),n=t-e.reduce(((e,t)=>e+t[i]),0),h=this._model._calcSizes(s,n);let a=0,c=0;for(c=0;c<o;c++)r[2*c]=a,r[2*c+1]=a+=e[c][i],a+=h[c];return r[2*c]=a,r[2*c+1]=a+e[c][i],r}$_calcExtents(e,t,s){this._inverted?(this._rowPoints=this.$_calc(this._xContainers,t,e.rowSizes(),"mw"),this._colPoints=this.$_calc(this._yContainers,s,e.colSizes(),"mh")):(this._rowPoints=this.$_calc(this._xContainers,s,e.rowSizes(),"mh"),this._colPoints=this.$_calc(this._yContainers,t,e.colSizes(),"mw"))}$_layoutAxes(e,t,s,i){const o=this.control._padding,r=this._rowPoints,n=this._colPoints,h=t?this._xContainers:this._yContainers;if(this._inverted)if(t){const e=n[1],t=n[n.length-2]-e;h.forEach(((e,s)=>{e.resize(e.mw,t),e.trans(r[2*s],i-n[n.length-2]),e.layout(n)}))}else{const e=r[1],t=r[r.length-2]-e;h.forEach(((s,h)=>{const a=s.sections;for(let e=0,t=a.length;e<t;e++){const s=a[e],i=0===e?o.left:0,n=e===t-1?o.right:0;let h=0,c=0;t>1&&(h=r[2*e+1]-r[2*e],c=r[2*(e+1)+1]-r[2*(e+1)],0===e?a[e+1].isEmpty()?c=r[2*(e+1)]-r[2*(e+1)-1]:c/=2:e===t-1?a[e-1].isEmpty()?h=r[2*(e-1)]-r[2*(e-1)-1]:h/=2:(a[e-1].isEmpty()?h=r[2*(e-1)]-r[2*(e-1)-1]:h/=2,a[e+1].isEmpty()?c=r[2*(e+1)]-r[2*(e+1)-1]:c/=2)),s.setMargins(i,h,c,n)}s.resize(t,s.mh),s.trans(e,i-n[2*h+1]),s.layout(r)}))}else if(t){const e=n[1];s=n[n.length-2]-e,h.forEach(((t,a)=>{const c=t.sections;for(let e=0,t=c.length;e<t;e++){const s=c[e],i=0===a?o.left:0,l=a===h.length-1?o.right:0;let _=0,d=0;t>1&&(_=n[2*e+1]-n[2*e],d=n[2*(e+1)+1]-n[2*(e+1)],0===e?c[e+1].isEmpty()?d=n[2*(e+1)]-n[2*(e+1)-1]:d/=2:e===t-1?c[e-1].isEmpty()?_=n[2*(e-1)]-n[2*(e-1)-1]:_/=2:(c[e-1].isEmpty()?_=n[2*(e-1)]-n[2*(e-1)-1]:_/=2,c[e+1].isEmpty()?d=n[2*(e+1)]-r[2*(e+1)-1]:d/=2)),s.setMargins(i,_,d,l)}t.resize(s,t.mh),t.trans(e,i-r[2*a+1]),t.layout(n)}))}else{const e=r[r.length-2],t=e-r[1];h.forEach(((s,o)=>{s.resize(s.mw,t),s.trans(n[2*o],i-e),s.layout(r)}))}}$_layoutBodies(e,t,s){const i=e.rowCount,o=e.colCount,r=this._rowPoints,n=this._colPoints,h=this._bodies;if(this._inverted)for(let t=0;t<i;t++){const s=r[2*(t+1)-1],i=r[2*(t+1)];for(let r=0;r<o;r++){const a=h[t*o+r],c=n[2*r+1],l=n[2*(r+1)];a.measure(this.doc,e.getPane(t,r).body,i-s,l-c,1),a.resize(i-s,l-c),a.trans(s,this.height-l),a.layout()}}else for(let t=0;t<i;t++){const i=r[2*(t+1)-1],a=r[2*(t+1)];for(let r=0;r<o;r++){const c=h[t*o+r],l=n[2*(r+1)-1],_=n[2*(r+1)];c.measure(this.doc,e.getPane(t,r).body,_-l,a-i,1),c.resize(_-l,a-i),c.trans(l,s-a),c.layout()}}}}function f(e){(function(e){return e.Series&&e.SeriesView})(e)&&(e.ChartObject.registerSplitClass(l),e.ChartView.registerPaneClass(p))}p.STYLE_NAME="rct-panes",f(i),e.Split=l,e.default=f,Object.defineProperty(e,"__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}_doInitChildren(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 x=0;class b{static destroy(t){return t&&t.destroy()}constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(x++))}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 b{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.dom.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){return this._views=this._views.sort(t),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 R=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});class ${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&&$.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,$.month_days[$.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()-R}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]=$.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(),$.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;$.LOGGING=!1,$.week_days=["일","월","화","수","목","금","토"],$.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],$.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]],$.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 b{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._domResize=!1,this.loaded=!1,this._windowResizeHandler=t=>{this._domResized()},this._domResizeHandler=t=>{this._domResize&&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)}}setDomResize(t){t!=this._domResize&&(this._domResize=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{$.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(),$.LOGGING&&console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,s,i){}_domResized(){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 b{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=$.isValidNum(t)?t:this._tx,e=$.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=$.isValidNum(t)?t:this._tx,e=$.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=$.isValidNum(t)?t:this._tx,n=$.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&&$.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&$.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(){null!=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=[];($.isValidNum(e)||$.isValidNum(s))&&(e=e||0,s=s||0,i.push("translate("+e+","+s+")")),this._rotation&&i.push("rotate("+this._rotation+" "+$.pick(this._originX,t.getAttribute("x"),0)+" "+$.pick(this._originY,t.getAttribute("y")||0)+")"),$.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")");const r=$.getNumber(this._scaleX,1),n=$.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=$.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)}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&($.startsWith(t,"rgb(")&&$.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):$.startsWith(t,"rgba(")&&$.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):$.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;!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,x=0;if(s){for(;v<_;)w=a.get(v),x%i==0?(u.push(f=[w]),m=w.mh,x++,v++):(m+=l+w.mh,m<=n?(f.push(w),x++,v++):x=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),x%i==0?(u.push(f=[w]),g=w.mw,x++,v++):(g+=l+w.mw,g<=r?(f.push(w),x++,v++):x=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=this.row,r=this.col,n=s._split.getPane(i,r).body;this._animatable=e.RcControl._animatable&&s.animatable(),this._prepareSeries(t,s,s._getSeries().getPaneSeries(i,r)),this._prepareGauges(t,s,s._getGauges().getPaneVisibles(i,r)),this._prepareAnnotations(t,n.getAnnotations().concat(s._getAnnotations().getPaneVisibles(i,r)))}_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){const s=e.chart,i=e.paneCount,r=e.rowCount,n=e.colCount,o=this._bodies,h=this._bodyMap=[];for(;o.length<i;){const e=new rt(t,this._owner);this._bodyContainer.add(e),o.push(e)}for(;o.length>i;)o.pop().remove();for(let t=0;t<r;t++){const e=[];for(let s=0;s<n;s++){const i=o[t*n+s];e.push(i),i.row=t,i.col=s}h.push(e)}o.forEach((e=>{e.prepareRender(t,s),e.prepareGuideContainers(),e._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})}));
|
package/split.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* RealChart Split v1.4.
|
|
3
|
+
* RealChart Split v1.4.1
|
|
4
4
|
* Copyright (C) 2023-2025 WooriTech Inc.
|
|
5
5
|
* All Rights Reserved.
|
|
6
6
|
*/
|
|
7
|
-
import{extend as s,Body as t,ChartItem as e,isArray as i,maxv as o,pickNum as r,isObject as n,isNumber as h,isString as a,PaneContainer as c,RectElement as l,LayerElement as _,SectionView as d,BodyView as u,RcControl as p,AxisView as g}from"./index.mjs";class x{constructor(s,t){this.row=s,this.col=t,this._axes=[]}sort(s,t){const e=t&&!s||!t&&s;this._axes.length>1&&(e?this._axes.sort(((s,t)=>{const e=s._posValue(),i=t._posValue();return e===i?e<0?t._index-s._index:e>0?s._index-t._index:s.row!==t.row?t.row-s.row:s.row<this.row?t._index-s._index:s._index-t._index:i-e})):this._axes.sort(((s,t)=>{const e=s._posValue(),i=t._posValue();return e===i?e<0?s._index-t._index:e>0?t._index-s._index:s.col!==t.col?s.col-s.col:s.col<this.col?s._index-t._index:t._index-s._index:e-i})))}}class f{constructor(s,t){this.chart=s,this.isX=t}rows(){return this._matrix.length}cols(){return this._matrix[0].length}_prepare(s,t,e,i){this._doPrepare(s,t,e),this._matrix.forEach((s=>{s.forEach((s=>s.sort(this.isX,i)))}))}get(s,t){return this._matrix[s][t]}getRow(s){return this._matrix[s]}getColumn(s){return this._matrix.map((t=>t[s]))}_buildTicks(s,t){const e=this.isX;this._matrix.forEach(((i,o)=>{i.forEach(((i,o)=>{i._axes.forEach((i=>{!i.isBased()&&(t<2||e)&&i._buildTicks(s[e?i.options.col:i.options.row],t)}))}))})),this._matrix.forEach(((i,o)=>{i.forEach(((i,o)=>{i._axes.forEach((i=>{i.isBased()&&(t<2||e)&&i._buildTicks(s[e?i.options.col:i.options.row],t)}))}))}))}_calcPoints(s,t){const e=this.isX;this._matrix.forEach((i=>{i.forEach(((i,o)=>{i._axes.forEach((i=>{if(t<2||e){const o=e?i.options.col:i.options.row;i._calcPoints(s[o],t)}}))}))}))}}class w extends f{constructor(s){super(s,!0)}_doPrepare(s,t,e){const i=this._matrix=new Array(t+1);for(let s=0;s<i.length;s++){i[s]=[];for(let t=0;t<e;t++)i[s].push(new x(s,t))}s.forEach((s=>{var e,o;const r=s.options.position;let n=s.row;"opposite"===r?(n++,s._runPos=r):n<t-1&&"between"===r?(n++,s._runPos="normal"):s._runPos=r,null===(o=null===(e=i[n])||void 0===e?void 0:e[s.col])||void 0===o||o._axes.push(s)}))}}class m extends f{constructor(s){super(s,!1)}_doPrepare(s,t,e){const i=this._matrix=new Array(t);for(let s=0;s<i.length;s++){i[s]=[];for(let t=0;t<=e;t++)i[s].push(new x(s,t))}s.forEach((s=>{var t,o;const r=s.options.position;let n=s.col;"opposite"===r?(n++,s._runPos=r):s.col<e-1&&"between"===r?(n++,s._runPos="normal"):s._runPos=r,null===(o=null===(t=i[s.row])||void 0===t?void 0:t[n])||void 0===o||o._axes.push(s)}))}}class y extends t{constructor(s){super(s.chart),this.pane=s}contains(s){return s.col===this.pane.col||s.row===this.pane.row}}y.defaults=s(t.defaults,{extended:!0,radius:void 0,centerX:void 0,centerY:void 0});class b extends e{constructor(s,t,e){super(s),this.row=t,this.col=e}_doInitChildren(s){s.body=(this._body=new y(this)).init()}get body(){return this._body}_prepareRender(){this.body._prepareRender()}}class E extends e{constructor(s){super(s),this._cols=1,this._rows=1,this._paneDic={},this._panes=[],this._xAxes=new w(s),this._yAxes=new m(s)}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(s,t){return this._panes[s][t]}getRow(s){return this._panes[s]}getColumn(s){return this._panes.map((t=>t[s]))}getAxisOf(s,t){var e,i;const o=this.chart,r=s.body;if(r){const n=r.pane;return t?o._getXAxes().get(s.options.xAxis)||this._xAxes.get(n.row,n.col)._axes[0]||(null===(e=o._getSeries().getPaneSeries(n.row,n.col)[0])||void 0===e?void 0:e._xAxisObj):o._getXAxes().get(s.options.yAxis)||this._yAxes.get(r.pane.row,r.pane.col)._axes[0]||(null===(i=o._getSeries().getPaneSeries(n.row,n.col)[0])||void 0===i?void 0:i._yAxisObj)}}isValidAxis(s){return s&&s.row<this._rows&&s.col<this._cols}_doLoadProp(s,t){return["panes","cols","rows"].indexOf(s)>=0||super._doLoadProp(s,t)}_doSetSimple(s){if(i(s)&&s.length>0){const t=o(1,+s[0]),e=o(1,r(+s[1],t));return t>0&&e>0&&(this.$_parsePanes(t,e),this.visible=!0),!0}return super._doSetSimple(s)}_load(s){return super._load(s),n(s)&&(this.$_parsePanes(s.rows,s.cols),this._paneDic=this.$_loadPanes(s.panes)),this}_doPrepareRender(s){this._panes=this.$_collectPanes(s),this._panes.forEach((s=>s.forEach((s=>s._prepareRender()))))}_calcSizes(s,t){const e=s.length,i=new Array(e);let o=0;if(e>1){let r=t,n=0;for(o=0;o<e;o++){const t=s[o];h(t)?r-=i[o]=Math.max(0,Math.min(r,t)):n+=t.size}if(n>0)for(o=0;o<e;o++){const t=s[o];h(t)||(i[o]=r*t.size/n)}}else i[o]=t;return i}getXLens(s){return this._calcSizes(this._colSizes,s)}getYLens(s){return this._calcSizes(this._rowSizes,s)}measureAxes(s,t,e,i){const o=this.getXLens(e?t:s),r=this.getYLens(e?s:t);this._xAxes._buildTicks(o,i),this._yAxes._buildTicks(r,i),this.$_calcAxesPoints(o,r,i)}$_calcAxesPoints(s,t,e){this._xAxes._calcPoints(s,e),this._yAxes._calcPoints(t,e)}completeAxesPoints(s,t){this.$_calcAxesPoints(s,t,101)}getBodyAnnotation(s){for(const t in this._paneDic){const e=this._paneDic[t].body.getAnnotation(s);if(e)return e}}prepareRender(s,t){const e=this.chart.isInverted();this._prepareRender(),this._xAxes._prepare(s,this._rows,this._cols,e),this._yAxes._prepare(t,this._rows,this._cols,e)}$_parseSizes(s){let t;return t=i(s)&&s.length>0?s.slice(0):s>0?new Array(s).fill("*"):["*"],t.map((s=>{if(a(s)){const t=s.trim();return{size:"*"===t?1:r(parseFloat(t),1)}}return r(+s,1)}))}$_parsePanes(s,t){this._colSizes=this.$_parseSizes(t),this._rowSizes=this.$_parseSizes(s),this._cols=this._colSizes.length,this._rows=this._rowSizes.length}$_loadPanes(s){const t=this.chart,e=this._op.extendBody?t._body._config:void 0,o={};if(s=i(s)?s:n(s)?[s]:null,i(s)&&s.forEach((s=>{const i=+s.row||0,r=+s.col||0;if(r>=0&&r<this._cols&&i>=0&&i<this._rows){const n=new b(t,i,r);let h=s;n.init(),!e||s&&s.body&&!1===s.body.extended||(s?(h=Object.assign({},s),s.body?!1!==s.body.extended&&(h.body=Object.assign({},e,s.body)):h.body=e):h={body:e}),n._load(h),o[i+","+r]=n}})),e)for(let s=0;s<this._rows;s++)for(let i=0;i<this._cols;i++){const r=s+","+i;if(!o[r]){const n=new b(t,s,i);n.init(),n._load({body:e}),o[r]=n}}return o}$_collectPanes(s){const t=[];for(let e=0;e<this._rows;e++){const i=[];for(let t=0;t<this._cols;t++){const o=this._paneDic[e+","+t]||new b(s,e,t)._initObject();i.push(o)}t.push(i)}return t}}E.defaults=s(e.defaults,{visible:!1,extendBody:!0,gap:0});class v extends d{constructor(){super(...arguments),this.views=[],this._gap=0}isEmpty(){return 0===this.views.length}prepare(s,t,e,i){const o=this.views,r=[];for(this.isX=e,i._axes.forEach((s=>{s.checkVisible()&&t.isValidAxis(s)&&r.push(s)}));o.length<r.length;){const t=new g(s);this.add(t),o.push(t)}for(;o.length>r.length;)o.pop().remove();if(o.forEach(((s,t)=>{s.setModel(r[t])})),this.axes=r,this.setVis(o.length>0)){const s=o[0].model;this._gap=s.chart.getAxesGap()}}prepareGuides(s,t,e){const i=this.views,o=this.axes;i.forEach(((e,i)=>{const r=o[i];t.forEach((t=>{t.forEach((t=>{t.isConnected(r)&&e.setVis(this.visible)&&(e.prepareGuides(s,t.row,t.col,t._guideContainer,t._frontGuideContainer),r._isHorz||(t._axes||(t._axes=[]),t._axes.push(r)))}))}))})),t.forEach((t=>{t.forEach((t=>{t._axes&&(t._gridRowContainer.addAll(s,t._axes),t._axes=[])}))}))}checkHeights(s,t,e){return this.views.length>0?this.$_checkHeights(this.views,s,t,e):0}$_checkHeights(s,t,e,i){let o=0;return s&&(s.forEach((s=>{o+=s.checkHeight(t,e,i)})),o+=(this.views.length-1)*this._gap),o}checkWidths(s,t,e){return this.views.length>0?this.$_checkWidths(this.views,s,t,e):0}$_checkWidths(s,t,e,i){let o=0;return s&&(s.forEach((s=>{o+=s.checkWidth(t,e,i)})),o+=(this.views.length-1)*this._gap),o}getScrollView(s){var t;for(const e of this.views)if(null===(t=e._scrollView)||void 0===t?void 0:t.contains(s))return e._scrollView}setMargins(s,t,e,i){this.views.forEach((o=>o.setMargins(s,t,e,i)))}_setInverted(s){super._setInverted(s),this.isHorz=s&&!this.isX||!s&&this.isX}_doMeasure(s,t,e,i,o){const r=this.axes;if(this.isHorz){let t=0;return this.views.forEach(((n,h)=>{t+=n.measure(s,r[h],e,i,o).height})),{width:e,height:t}}{let t=0;return this.views.forEach(((n,h)=>{t+=n.measure(s,r[h],e,i,o).width})),{width:t,height:i}}}_doLayout(s){const t=this.views,e=this.width,i=this.height,o=t.length;let r=0,n=o-1;if(this.isHorz){let s,h,a=0;for(;r<o;r++){const s=t[r];if(s.model._posValue()<1)break;s.trans(0,a),a+=s.mh}for(s=a,a=i;n>=0;n--){const s=t[n];if(s.model._posValue()>-1)break;a-=s.mh,s.trans(0,a)}h=a;const c=h-s;let l=0;for(let s=r;s<=n;s++)l+=t[s].mh;s+=(c-l)/2;for(let e=r;e<=n;e++){const i=t[e];i.trans(0,s),s+=i.mh}t.forEach((s=>{s.resize(e,s.mh),s.model._calcPoints(e,999),s.layout()}))}else{let s,h,a=0;for(;r<o;r++){const s=t[r];if(s.model._posValue()>-1)break;s.trans(a,0),a+=s.mw}for(s=a,a=e;n>=0;n--){const s=t[n];if(s.model._posValue()<1)break;a-=s.mw,s.trans(a,0)}h=a;const c=h-s;let l=0;for(let s=r;s<=n;s++)l+=t[s].mw;s+=(c-l)/2;for(let e=r;e<=n;e++){const i=t[e];i.trans(s,0),s+=i.mw}t.forEach((s=>{s.resize(s.mw,i),s.model._calcPoints(i,999),s.layout()}))}}}class A extends d{constructor(s,t){super(s,"rct-axis-container"),this.isX=t,this.sections=[]}prepare(s,t,e,i){const o=this.isX?e.getRow(i):e.getColumn(i);for(;this.sections.length<o.length;){const t=new v(s);this.add(t),this.sections.push(t)}for(;this.sections.length>o.length;)this.sections.pop().remove();this.sections.forEach(((e,r)=>{this.isX?(e.row=i,e.col=r):(e.col=i,e.row=r),e.prepare(s,t,this.isX,o[r])}))}prepareGuides(s,t,e,i){const o=this.isX?e.getRow(i):e.getColumn(i);for(;this.sections.length<o.length;){const t=new v(s);this.add(t),this.sections.push(t)}for(;this.sections.length>o.length;)this.sections.pop().remove();this.sections.forEach(((o,r)=>{this.isX?(o.row=i,o.col=r):(o.col=i,o.row=r),o.prepareGuides(s,t,e)}))}checkWidths(s,t,e){return this.sections.length>0?this._isHorz?this.sections.reduce(((i,o)=>i+o.checkWidths(s,t,e)),0):this.sections.reduce(((i,o)=>Math.max(i,o.checkWidths(s,t,e))),0):0}checkHeights(s,t,e){return this.sections.length>0?this._isHorz?this.sections.reduce(((i,o)=>Math.max(i,o.checkHeights(s,t,e))),0):this.sections.reduce(((i,o)=>i+o.checkHeights(s,t,e)),0):0}_setInverted(s){super._setInverted(s),this._isHorz=s&&!this.isX||!s&&this.isX}_doMeasure(s,t,e,i,r){let n=0,h=0;return this._isHorz?this.sections.forEach((n=>{h=o(h,n.measure(s,t,e,i,r).height)})):this.sections.forEach((h=>{n=o(n,h.measure(s,t,e,i,r).width)})),{width:n,height:h}}_doLayout(s){this._isHorz?this.height>0&&this.sections.forEach(((t,e)=>{t.resize(s[2*(e+1)]-s[2*(e+1)-1],this.height),t.trans(s[2*e+1]-s[1],0),t.layout()})):this.width>0&&this.sections.forEach(((t,e)=>{t.resize(this.width,s[2*(e+1)]-s[2*(e+1)-1]),t.trans(0,this.height-(s[2*(e+1)]-s[1])),t.layout()}))}}class C extends u{constructor(){super(...arguments),this.row=0,this.col=0}getCol(){return this.col}getRow(){return this.row}prepareRender(s,t){const e=this.row,i=this.col,o=t._split.getPane(e,i).body;this._animatable=p._animatable&&t.animatable(),this._prepareSeries(s,t,t._getSeries().getPaneSeries(e,i)),this._prepareGauges(s,t,t._getGauges().getPaneVisibles(e,i)),this._prepareAnnotations(s,o.getAnnotations().concat(t._getAnnotations().getPaneVisibles(e,i)))}getTooltipPos(){return{x:this.parent.parent.tx+this.tx,y:this.parent.parent.ty+this.ty}}}class P extends c{constructor(s,t){super(s,P.STYLE_NAME),this._bodies=[],this._xContainers=[],this._yContainers=[],this._owner=t}get bodies(){return this._bodies}bodyViewOf(s){return this._bodies.find((t=>t.contains(s)))}prepare(s,t){t.chart,this.$_init(s),this._model=t,this.$_prepareBodies(s,t)}measure(s,t,e,i,o){const r=t.chart,n=this._inverted=t.chart.isInverted(),h=t._xAxes,a=t._yAxes,c=e,l=i;this.$_prepareAxes(s,h,!0),this.$_prepareAxes(s,a,!1),t.measureAxes(e,i,n,o),n?(e-=this._xContainers.reduce(((t,o)=>t+o.checkWidths(s,e,i)),0),i-=this._yContainers.reduce(((t,o)=>t+o.checkHeights(s,e,i)),0)):(i-=this._xContainers.reduce(((t,o)=>t+o.checkHeights(s,e,i)),0),e-=this._yContainers.reduce(((t,o)=>t+o.checkWidths(s,e,i)),0)),t.measureAxes(e,i,n,o),this._xContainers.forEach((t=>t.measure(s,r,e,i,o))),this._yContainers.forEach((t=>t.measure(s,r,e,i,o))),e=c,i=l,n?(e-=this._xContainers.reduce(((s,t)=>s+t.mw),0),i-=this._yContainers.reduce(((s,t)=>s+t.mh),0)):(i-=this._xContainers.reduce(((s,t)=>s+t.mh),0),e-=this._yContainers.reduce(((s,t)=>s+t.mw),0)),o++,t.measureAxes(e,i,n,o),this.$_prepareAxisGuides(s,h,!0),this.$_prepareAxisGuides(s,a,!1),this._xContainers.forEach((t=>{t.measure(s,r,e,i,o)})),this._yContainers.forEach((t=>{t.measure(s,r,e,i,o)}));const _=t.getXLens(n?i:e),d=t.getYLens(n?e:i);t.completeAxesPoints(_,d)}layout(){const s=this._model,t=this.width,e=this.height;this._back.resize(t,e),this.$_calcExtents(s,t,e),this.$_layoutAxes(s,!0,t,e),this.$_layoutAxes(s,!1,t,e),this.$_layoutBodies(s,t,e)}seriesByDom(s){for(const t of this._bodies){const e=t.seriesByDom(s);if(e)return e}}getSeries(s){for(const t of this.bodies){const e=t.findSeries(s);if(e)return e}}$_init(s){this._back||(this.add(this._back=new l(s)),this._back.setStyles({fill:"none"}),this.add(this._bodyContainer=new _(s,void 0)),this.add(this._axisContainer=new _(s,void 0)))}$_prepareBodies(s,t){const e=t.chart,i=t.paneCount,o=t.rowCount,r=t.colCount,n=this._bodies,h=this._bodyMap=[];for(;n.length<i;){const t=new C(s,this._owner);this._bodyContainer.add(t),n.push(t)}for(;n.length>i;)n.pop().remove();for(let s=0;s<o;s++){const t=[];for(let e=0;e<r;e++){const i=n[s*r+e];t.push(i),i.row=s,i.col=e}h.push(t)}n.forEach((t=>{t.prepareRender(s,e),t.prepareGuideContainers(),t._gridRowContainer.prepare()}))}$_prepareAxes(s,t,e){const i=this._model.chart,o=e?this._xContainers:this._yContainers,r=e?t.rows():t.cols();for(;o.length<r;){const t=new A(s,e);this._axisContainer.add(t),o.push(t)}for(;o.length>r;)o.pop().remove();o.forEach(((e,o)=>{e.prepare(s,i,t,o)}))}$_prepareAxisGuides(s,t,e){(e?this._xContainers:this._yContainers).forEach(((e,i)=>{e.prepareGuides(s,this._bodyMap,t,i)}))}$_calc(s,t,e,i){const o=e.length,r=new Array(2*(o+1)),n=t-s.reduce(((s,t)=>s+t[i]),0),h=this._model._calcSizes(e,n);let a=0,c=0;for(c=0;c<o;c++)r[2*c]=a,r[2*c+1]=a+=s[c][i],a+=h[c];return r[2*c]=a,r[2*c+1]=a+s[c][i],r}$_calcExtents(s,t,e){this._inverted?(this._rowPoints=this.$_calc(this._xContainers,t,s.rowSizes(),"mw"),this._colPoints=this.$_calc(this._yContainers,e,s.colSizes(),"mh")):(this._rowPoints=this.$_calc(this._xContainers,e,s.rowSizes(),"mh"),this._colPoints=this.$_calc(this._yContainers,t,s.colSizes(),"mw"))}$_layoutAxes(s,t,e,i){const o=this.control._padding,r=this._rowPoints,n=this._colPoints,h=t?this._xContainers:this._yContainers;if(this._inverted)if(t){const s=n[1],t=n[n.length-2]-s;h.forEach(((s,e)=>{s.resize(s.mw,t),s.trans(r[2*e],i-n[n.length-2]),s.layout(n)}))}else{const s=r[1],t=r[r.length-2]-s;h.forEach(((e,h)=>{const a=e.sections;for(let s=0,t=a.length;s<t;s++){const e=a[s],i=0===s?o.left:0,n=s===t-1?o.right:0;let h=0,c=0;t>1&&(h=r[2*s+1]-r[2*s],c=r[2*(s+1)+1]-r[2*(s+1)],0===s?a[s+1].isEmpty()?c=r[2*(s+1)]-r[2*(s+1)-1]:c/=2:s===t-1?a[s-1].isEmpty()?h=r[2*(s-1)]-r[2*(s-1)-1]:h/=2:(a[s-1].isEmpty()?h=r[2*(s-1)]-r[2*(s-1)-1]:h/=2,a[s+1].isEmpty()?c=r[2*(s+1)]-r[2*(s+1)-1]:c/=2)),e.setMargins(i,h,c,n)}e.resize(t,e.mh),e.trans(s,i-n[2*h+1]),e.layout(r)}))}else if(t){const s=n[1];e=n[n.length-2]-s,h.forEach(((t,a)=>{const c=t.sections;for(let s=0,t=c.length;s<t;s++){const e=c[s],i=0===a?o.left:0,l=a===h.length-1?o.right:0;let _=0,d=0;t>1&&(_=n[2*s+1]-n[2*s],d=n[2*(s+1)+1]-n[2*(s+1)],0===s?c[s+1].isEmpty()?d=n[2*(s+1)]-n[2*(s+1)-1]:d/=2:s===t-1?c[s-1].isEmpty()?_=n[2*(s-1)]-n[2*(s-1)-1]:_/=2:(c[s-1].isEmpty()?_=n[2*(s-1)]-n[2*(s-1)-1]:_/=2,c[s+1].isEmpty()?d=n[2*(s+1)]-r[2*(s+1)-1]:d/=2)),e.setMargins(i,_,d,l)}t.resize(e,t.mh),t.trans(s,i-r[2*a+1]),t.layout(n)}))}else{const s=r[r.length-2],t=s-r[1];h.forEach(((e,o)=>{e.resize(e.mw,t),e.trans(n[2*o],i-s),e.layout(r)}))}}$_layoutBodies(s,t,e){const i=s.rowCount,o=s.colCount,r=this._rowPoints,n=this._colPoints,h=this._bodies;if(this._inverted)for(let t=0;t<i;t++){const e=r[2*(t+1)-1],i=r[2*(t+1)];for(let r=0;r<o;r++){const a=h[t*o+r],c=n[2*r+1],l=n[2*(r+1)];a.measure(this.doc,s.getPane(t,r).body,i-e,l-c,1),a.resize(i-e,l-c),a.trans(e,this.height-l),a.layout()}}else for(let t=0;t<i;t++){const i=r[2*(t+1)-1],a=r[2*(t+1)];for(let r=0;r<o;r++){const c=h[t*o+r],l=n[2*(r+1)-1],_=n[2*(r+1)];c.measure(this.doc,s.getPane(t,r).body,_-l,a-i,1),c.resize(_-l,a-i),c.trans(l,e-a),c.layout()}}}}function z(s){(function(s){return s.Series&&s.SeriesView})(s)&&(s.ChartObject.registerSplitClass(E),s.ChartView.registerPaneClass(P))}P.STYLE_NAME="rct-panes";export{E as Split,z as default,z as registerSplit};
|
|
7
|
+
import{extend as t,Body as e,ChartItem as s,isArray as i,maxv as r,pickNum as n,isObject as o,isNumber as h,isString as a,Legend as l,PaneContainer as d,RectElement as c,LayerElement as _,SectionView as u,BodyView as p,RcControl as g,AxisView as m}from"./index.mjs";class f{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 y{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 w extends y{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 f(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 v extends y{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 f(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 x extends e{constructor(t){super(t.chart),this.pane=t}contains(t){return t.col===this.pane.col||t.row===this.pane.row}}x.defaults=t(e.defaults,{extended:!0,radius:void 0,centerX:void 0,centerY:void 0});class b extends l{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 A extends s{constructor(t,e,s){super(t),this.row=e,this.col=s}_doInitChildren(t){t.body=(this._body=new x(this)).init(),t.legend=(this._legend=new b(this)).init()}get body(){return this._body}get legend(){return this._legend}_prepareRender(){this._body._prepareRender(),this._legend._prepareRender()}}class E extends s{constructor(t){super(t),this._cols=1,this._rows=1,this._paneDic={},this._panes=[],this._xAxes=new w(t),this._yAxes=new v(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(i(t)&&t.length>0){const e=r(1,+t[0]),s=r(1,n(+t[1],e));return e>0&&s>0&&(this.$_parsePanes(e,s),this.visible=!0),!0}return super._doSetSimple(t)}_load(t){return super._load(t),o(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,e){const s=t.length,i=new Array(s);let r=0;if(s>1){let n=e,o=0;for(r=0;r<s;r++){const e=t[r];h(e)?n-=i[r]=Math.max(0,Math.min(n,e)):o+=e.size}if(o>0)for(r=0;r<s;r++){const e=t[r];h(e)||(i[r]=n*e.size/o)}}else i[r]=e;return i}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 e;return e=i(t)&&t.length>0?t.slice(0):t>0?new Array(t).fill("*"):["*"],e.map((t=>{if(a(t)){const e=t.trim();return{size:"*"===e?1:n(parseFloat(e),1)}}return n(+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 e=this.chart,s=this._op.extendBody?e._body._config:void 0,r={};if(t=i(t)?t:o(t)?[t]:null,i(t)&&t.forEach((t=>{const i=+t.row||0,n=+t.col||0;if(n>=0&&n<this._cols&&i>=0&&i<this._rows){const o=new A(e,i,n);let h=t;o.init(),!s||t&&t.body&&!1===t.body.extended||(t?(h=Object.assign({},t),t.body?!1!==t.body.extended&&(h.body=Object.assign({},s,t.body)):h.body=s):h={body:s}),o._load(h),r[i+","+n]=o}})),s)for(let t=0;t<this._rows;t++)for(let i=0;i<this._cols;i++){const n=t+","+i;if(!r[n]){const o=new A(e,t,i);o.init(),o._load({body:s}),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 A(t,s,e)._initObject();i.push(r)}e.push(i)}return e}}E.defaults=t(s.defaults,{visible:!1,extendBody:!0,gap:0});const S="http://www.w3.org/2000/svg",C=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},k=Array.isArray,N=function(t){return"string"==typeof t},D=Object.assign,L=Math.min,T=Math.max,B=Math.abs,M=function(t,e){return t=parseFloat(t),isNaN(t)?parseFloat(e):t};let R=0;class ${static destroy(t){return t&&t.destroy()}constructor(t){this.$_destroyed=!1,this.$_destroying=!1,t||(this.$_hash=String(R++))}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 z extends ${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.dom.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){return this._views=this._views.sort(t),this}map(t){return this._views.map(t)}front(t){t.front(this._views)}back(t){t.back(this._views)}}const P=Object.freeze({x:0,y:0,width:0,height:0});const O={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 H="ko",V=O[H]||O[H="ko"];const F=void 0;function I(t){return t+"px"}function G(t){return null==t||Number.isNaN(t)||""===t}const Y={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"},X=function(t){const e=Y[t];if(!e){let e=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return Y[t]=e,e}return e};class W{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 j=(new Date).getTime();"undefined"==typeof window||Element.prototype.animate||(Element.prototype.animate=function(t){});class q{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&&q.isLeapYear(t.getFullYear())&&i++,i}static incMonth(t,e){const s=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(L(s,q.month_days[q.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&&!k(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&&!k(t))return D({},t)}static checkArray(t){return k(t)?t:void 0}static makeArray(t,e=!1){return null!=t?k(t)?t:[t]:e?[]:void 0}static makeNumArray(t){return k(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(k(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 k(t)?t:null!=t?[t]:null}static copyArray(t){return k(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()-j}static isWhiteSpace(t){return!t||!t.trim()}static pad(t,e,s){return e=T(e||2,1),s=s||"0",new Array(e-String(t).length+1).join(s)+t}static pad16(t,e,s){return e=T(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(k(t)){const e=[];let s=-1/0;return t.forEach(((i,r)=>{k(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=k(t)?[]:{};for(let s of Object.keys(t))e[s]=q.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(),q.log(t,+new Date-s+"ms")}static clamp(t,e,s){return T(e,L(s,t))}static makeIntArray(t,e){const s=new Array(T(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=B(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 U;q.LOGGING=!1,q.week_days=["일","월","화","수","목","금","토"],q.long_week_days=["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],q.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]],q.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"}(U||(U={}));const K="$ProductVersion";class Z extends ${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._domResize=!1,this.loaded=!1,this._windowResizeHandler=t=>{this._domResized()},this._domResizeHandler=t=>{this._domResize&&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||Z.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),W.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){G(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(){W.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(J.ASSET_KEY)}clearTemporaryDefs(){this.$_clearDefs(J.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)}}setDomResize(t){t!=this._domResize&&(this._domResize=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 et(this.doc(),t,e,s,i,r,r);return this._defs.appendChild(n.dom),n}clipCircle(){const t=new st(this.doc());return this._defs.appendChild(t.dom),t}addDef(t){this._defs.appendChild(t)}removeDef(t){if(N(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,J.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))})(V.invalidOuterDiv,e);const i=this._container.ownerDocument,r=this._dom=i.createElement("div");D(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(S,"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"+K,n.appendChild(o);const h=this._defs=i.createElementNS(S,"defs");this._initDefs(i,h),n.appendChild(h),r.appendChild(n),this._root=new Q(this),n.appendChild(this._root._dom),this._htmlRoot=i.createElement("div"),r.appendChild(this._htmlRoot),D(this._htmlRoot.style,{position:"absolute"})}_initDefs(t,e){let s=t.createElementNS(S,"filter");s.setAttribute("id",Z.SHADOW_FILTER);const i=t.createElementNS(S,"feGaussianBlur");i.setAttribute("stdDeviation","1.5"),i.setAttribute("in","SourceAlpha"),s.appendChild(i);const r=t.createElementNS(S,"feOffset");r.setAttribute("dx","1"),r.setAttribute("dy","1"),r.setAttribute("result","offsetblur"),s.appendChild(r);const n=t.createElementNS(S,"feFlood");n.setAttribute("flood-color","#000"),s.appendChild(n);const o=t.createElementNS(S,"feComposite");o.setAttribute("in2","offsetblur"),o.setAttribute("operator","in"),s.appendChild(o);const h=t.createElementNS(S,"feMerge"),a=t.createElementNS(S,"feMergeNode"),l=t.createElementNS(S,"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{q.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;D(this._htmlRoot.style,{left:I(e.left-t.left),top:I(e.top-t.top)});const r=this._container.firstElementChild;r.removeAttribute("style"),D(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=W.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(),q.LOGGING&&console.timeEnd("render chart")}}}_doBeforeRender(){}_doAfterRender(){}_doRenderBackground(t,e,s,i){}_domResized(){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)}}Z.CLASS_NAME="rct-control",Z.SHADOW_FILTER="rr-chart-shadow-filter",Z._animatable=!0;class J extends ${constructor(t,e,s=F){super(),this._visible=!0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._styles={},this._styleDirty=!1,this._dom=t.createElementNS(S,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(S,e);return this._dom.appendChild(s),s}insertElement(t,e,s){const i=t.createElementNS(S,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 G(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=q.isValidNum(t)?t:this._tx,e=q.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=q.isValidNum(t)?t:this._tx,e=q.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=q.isValidNum(t)?t:this._tx,n=q.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&&q.isValidNum(t)&&(this._tx=t,this._updateTransform()),this}transY(t){return t!==this._ty&&q.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(){null!=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(X(e));this._styles={}}clearStyles(){const t=this.dom.style;let e=!1;for(let s in this._styles)t.removeProperty(X(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(X(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(N(t))t&&this._dom.classList.add(t);else if(C(t)){const e=this.dom.style;for(let s in t)e.setProperty(X(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){N(t)?(this._resetClass(),t&&this.addClass(t)):this.resetStyles(t)}internalSetStyleOrClass(t){N(t)?t&&this.addClass(t):this.internalSetStyles(t)}addStyleOrClass(t){N(t)?t&&this.addClass(t):C(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(J.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 J.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=[];(q.isValidNum(e)||q.isValidNum(s))&&(e=e||0,s=s||0,i.push("translate("+e+","+s+")")),this._rotation&&i.push("rotate("+this._rotation+" "+q.pick(this._originX,t.getAttribute("x"),0)+" "+q.pick(this._originY,t.getAttribute("y")||0)+")"),q.isNotEmpty(this._matrix)&&i.push("matrix("+this._matrix.join(",")+")");const r=q.getNumber(this._scaleX,1),n=q.getNumber(this._scaleY,1);return 1===r&&1===n||i.push("scale("+r+" "+n+")"),i.length?i.join(" "):""}}J.DEBUGGING=!1,J.TESTING=!1,J.ASSET_KEY="_asset_",J.TEMP_KEY="_temp_";class Q extends J{constructor(t){super(t.doc(),"rct-root"),this._control=t}get control(){return this._control}}class tt extends J{constructor(t){super(t,F,"clipPath");const e=this._id=q.uniqueKey()+"-";this.setAttr("id",e)}get id(){return this._id}}class et extends tt{constructor(t,e=NaN,s=NaN,i=NaN,r=NaN,n=0,o=0){super(t);const h=this._rect=new J(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 st extends tt{constructor(t){super(t),this.add(this._circle=new J(t,null,"circle"))}setCircle(t,e,s){this._circle.setAttrs({cx:t,cy:e,r:s})}}class it extends J{static create(t,e,s,i,r,n,o=0){return new it(t,e,{x:s,y:i,width:r,height:n,r:o})}constructor(t,e=F,s=F){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 rt{static isBright(t){return new rt(t).isBright()}static getContrast(t,e,s){return new rt(t).getContrast(e,s)}constructor(t){this.r=0,this.g=0,this.b=0,this.a=1,(t=t&&t.trim())&&(q.startsWith(t,"rgb(")&&q.endsWith(t,")")?this.$_parseRgb(t.substring(4,t.length-1)):q.startsWith(t,"rgba(")&&q.endsWith(t,")")?this.$_parseRgb(t.substring(5,t.length-1)):q.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 rt(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 nt,ot,ht;!function(t){t.START="start",t.MIDDLE="middle",t.END="end"}(nt||(nt={})),function(t){t.TOP="top",t.MIDDLE="middle",t.BOTTOM="bottom"}(ot||(ot={})),function(t){t.TRUNCATE="truncate",t.WRAP="wrap",t.ELLIPSIS="ellipsis"}(ht||(ht={}));class at extends J{constructor(t,e=void 0){super(t,e,"text"),this._layout=ot.TOP,this._overflow=ht.WRAP,this._dirty=!0,this._text="",this.anchor=nt.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 ot.MIDDLE:i=Math.floor(s/2);break;case ot.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=T(0,t),(e=L(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(rt.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 lt{static create(t,e,s,i){return isNaN(s)?isNaN(e)?new lt(t,t,t,t):new lt(t,t,e,e):new lt(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 lt(this.top,this.bottom,this.left,this.right)}applyPadding(t){return this.left=M(t.paddingLeft,0),this.right=M(t.paddingRight,0),this.top=M(t.paddingTop,0),this.bottom=M(t.paddingBottom,0),this}applyMargin(t){return this.left=M(t.marginLeft,0),this.right=M(t.marginRight,0),this.top=M(t.marginTop,0),this.bottom=M(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}}}lt.Empty=Object.freeze(new lt),lt.Temp=new lt;class dt extends J{constructor(t,e=F){super(t,e,"g"),this._doInitChildren(t)}setAttr(t,e){return dt.IGNORE_ATTRS.hasOwnProperty(t)||super.setAttr(t,e),this}_doInitChildren(t){}}dt.IGNORE_ATTRS={width:"",height:""};class ct extends J{constructor(t,e=F){super(t,e,"g"),J.DEBUGGING&&(this.add(this._debugRect=new it(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),J.DEBUGGING?(this._debugRect||this.insertFirst(this._debugRect=new it(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 _t extends ct{constructor(t,e,s){super(t,e),this._margins=new lt,this._paddings=new lt,this.add(this._background=new it(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 ut extends ct{constructor(t){super(t,"rct-legend-item"),this.add(this._back=new it(t)),this._back.setFill("transparent"),this._back.setStroke("none"),this.add(this._label=new at(t,"rct-legend-item-label")),this._label.anchor=nt.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():P,l={width:(d=this._label.getBBox()).width,height:d.height};var d;return this._gap=M(e.legend.options.markerGap,0),{width:a.width+this._gap+l.width,height:T(a.height,l.height)}}_doLayout(t){const e=this._rMarker,s=M(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 pt extends _t{constructor(t){super(t,pt.LEGEND_CLASS,"rct-legend-background"),this._itemViews=new z(this,ut)}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=M(n.itemsPerLine,Number.MAX_SAFE_INTEGER),this._gap="body"!==e._location?M(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,y;a.forEach(((e,s)=>{e.setMarker(h[s].source.legendMarker(t,c)),e.measure(t,h[s],r,n,1)}));let w=0,v=0;if(s){for(;w<_;)y=a.get(w),v%i==0?(u.push(f=[y]),m=y.mh,v++,w++):(m+=l+y.mh,m<=n?(f.push(y),v++,w++):v=0);this._wMarkers=[],g=m=0,u.forEach(((t,e)=>{let s=0,i=0,r=0;t.forEach((t=>{i+=t.mh,s=T(s,t.mw),r=T(r,t._rMarker.width),t._col=e})),i+=l*(t.length-1),m=T(m,i),g+=s,p.push(s),this._wMarkers.push(r)})),g+=d*(u.length-1)}else{for(;w<_;)y=a.get(w),v%i==0?(u.push(f=[y]),g=y.mw,v++,w++):(g+=l+y.mw,g<=r?(f.push(y),v++,w++):v=0);g=m=0,u.forEach((t=>{let e=0,s=0;t.forEach((t=>{e+=t.mw,s=T(s,t.mh)})),e+=l*(t.length-1),g=T(g,e),m+=s,p.push(s)})),m+=d*(u.length-1)}return{width:g,height:m}}}pt.LEGEND_CLASS="rct-legend";class gt extends u{constructor(){super(...arguments),this.views=[],this._gap=0}isEmpty(){return 0===this.views.length}prepare(t,e,s,i){const r=this.views,n=[];for(this.isX=s,i._axes.forEach((t=>{t.checkVisible()&&e.isValidAxis(t)&&n.push(t)}));r.length<n.length;){const e=new m(t);this.add(e),r.push(e)}for(;r.length>n.length;)r.pop().remove();if(r.forEach(((t,e)=>{t.setModel(n[e])})),this.axes=n,this.setVis(r.length>0)){const t=r[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 mt extends u{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 gt(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 gt(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,e,s,i,n){let o=0,h=0;return this._isHorz?this.sections.forEach((o=>{h=r(h,o.measure(t,e,s,i,n).height)})):this.sections.forEach((h=>{o=r(o,h.measure(t,e,s,i,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 ft extends p{constructor(t,e){super(t,e),this.row=0,this.col=0,this.add(this._legendView=new pt(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,e){const s=this.row,i=this.col,r=e._split.getPane(s,i).body;this._animatable=g._animatable&&e.animatable(),this._prepareSeries(t,e,e._getSeries().getPaneSeries(s,i)),this._prepareGauges(t,e,e._getGauges().getPaneVisibles(s,i)),this._prepareAnnotations(t,r.getAnnotations().concat(e._getAnnotations().getPaneVisibles(s,i)))}_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 yt extends d{constructor(t,e){super(t,yt.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 c(t)),this._back.setStyles({fill:"none"}),this.add(this._bodyContainer=new _(t,void 0)),this.add(this._axisContainer=new _(t,void 0)))}$_prepareBodies(t,e){const s=e.chart,i=e.paneCount,r=e.rowCount,n=e.colCount,o=this._bodies,h=this._bodyMap=[];for(;o.length<i;){const e=new ft(t,this._owner);this._bodyContainer.add(e),o.push(e)}for(;o.length>i;)o.pop().remove();for(let t=0;t<r;t++){const e=[];for(let s=0;s<n;s++){const i=o[t*n+s];e.push(i),i.row=t,i.col=s}h.push(e)}o.forEach((e=>{e.prepareRender(t,s),e.prepareGuideContainers(),e._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 mt(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 wt(t){(function(t){return t.Series&&t.SeriesView})(t)&&(t.ChartObject.registerSplitClass(E),t.ChartView.registerPaneClass(yt))}yt.STYLE_NAME="rct-panes";export{E as Split,wt as default,wt as registerSplit};
|
package/treemap.d.ts
CHANGED
|
@@ -38,8 +38,8 @@ declare class TreeNode {
|
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
40
|
* Treemap 시리즈.<br/>
|
|
41
|
-
* {@
|
|
42
|
-
* {@
|
|
41
|
+
* {@link https://realchart.co.kr/docs/api/options/SeriesOptions#type type}은 {@link https://realchart.co.kr/config/config/series/treemap treemap}이고,
|
|
42
|
+
* {@link options 설정} 모델은 {@link https://realchart.co.kr/docs/api/options/TreemapSeriesOptions TreemapSeriesOptions}이다.
|
|
43
43
|
*
|
|
44
44
|
* @modules treemap
|
|
45
45
|
*/
|
|
@@ -55,7 +55,7 @@ declare class TreemapSeries extends Series<TreemapSeriesOptions> {
|
|
|
55
55
|
* TODO: 구현할 것!
|
|
56
56
|
*/
|
|
57
57
|
/**
|
|
58
|
-
* @
|
|
58
|
+
* @private
|
|
59
59
|
*/
|
|
60
60
|
buildMap(width: number, height: number): {
|
|
61
61
|
roots: TreeNode[];
|
package/treemap.js
CHANGED
package/treemap.mjs
CHANGED
package/vector.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { ConnectableSeries, VectorSeriesOptions, DataPoint, RcElement } from 're
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Vector 시리즈 모델.<br/>
|
|
6
|
-
* {@
|
|
7
|
-
* {@
|
|
6
|
+
* {@link https://realchart.co.kr/docs/api/options/SeriesOptions#type type}은 {@link https://realchart.co.kr/config/config/series/vecotor vector}이고,
|
|
7
|
+
* {@link options 설정} 모델은 {@link https://realchart.co.kr/docs/api/options/VectorSeriesOptions VectorSeriesOptions}이다.
|
|
8
8
|
*
|
|
9
9
|
* @modules Vector
|
|
10
10
|
*/
|
package/vector.js
CHANGED
package/vector.mjs
CHANGED
package/wordcloud.d.ts
CHANGED
|
@@ -13,8 +13,8 @@ declare class WordCloudOthersPoint extends WordCloudSeriesPoint {
|
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* Word cloud 시리즈 모델.<br/>
|
|
16
|
-
* {@
|
|
17
|
-
* {@
|
|
16
|
+
* {@link https://realchart.co.kr/docs/api/options/SeriesOptions#type type}은 {@link https://realchart.co.kr/config/config/series/wordcloud wordcloud}이고,
|
|
17
|
+
* {@link options 설정} 모델은 {@link https://realchart.co.kr/docs/api/options/WordCloudSeriesOptions WordCloudSeriesOptions}이다.
|
|
18
18
|
*
|
|
19
19
|
* @modules wordcloud
|
|
20
20
|
*/
|