realchart 1.3.18 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "realchart",
3
- "version": "1.3.18",
3
+ "version": "1.4.0",
4
4
  "description": "Wooritech charting library",
5
5
  "main": "./index.js",
6
6
  "module": "./index.mjs",
@@ -36,6 +36,12 @@
36
36
  "import": "./pictogram.mjs",
37
37
  "default": "./pictogram.mjs"
38
38
  },
39
+ "./race": {
40
+ "types": "./race.d.ts",
41
+ "require": "./race.js",
42
+ "import": "./race.mjs",
43
+ "default": "./race.mjs"
44
+ },
39
45
  "./split": {
40
46
  "types": "./split.d.ts",
41
47
  "require": "./split.js",
package/split.d.ts CHANGED
@@ -1,8 +1,20 @@
1
1
  import * as RealChart from 'realchart';
2
- import { IChart, AxisCollection, Axis, ChartItem, SplitOptions, ISplit, Annotation, PaneOptions, ChartItemOptions, Body, PaneBodyOptions, GaugeBase, Series } from 'realchart';
2
+ import { IChart, AxisCollection, Axis, ChartItem, SplitOptions, ISplit, Annotation, IAxis, PaneOptions, ChartItemOptions, Body, PaneBodyOptions, GaugeBase, Series } from 'realchart';
3
3
 
4
+ /**
5
+ * @internal
6
+ *
7
+ * section view 하나에 배치되는 축들.
8
+ */
4
9
  declare class PaneAxes {
10
+ row: number;
11
+ col: number;
5
12
  _axes: Axis[];
13
+ constructor(row: number, col: number);
14
+ /**
15
+ * section view에서 (left, top) -> (right, bottom) 순서대로 배치할 수 있게 배치한다.
16
+ */
17
+ sort(isX: boolean, inverted: boolean): void;
6
18
  }
7
19
  declare abstract class PaneAxisMatrix {
8
20
  chart: IChart;
@@ -11,19 +23,19 @@ declare abstract class PaneAxisMatrix {
11
23
  constructor(chart: IChart, isX: boolean);
12
24
  rows(): number;
13
25
  cols(): number;
14
- abstract _prepare(axes: AxisCollection, rows: number, cols: number): void;
26
+ _prepare(axes: AxisCollection, rows: number, cols: number, inverted: boolean): void;
15
27
  get(row: number, col: number): PaneAxes;
16
28
  getRow(row: number): PaneAxes[];
17
29
  getColumn(col: number): PaneAxes[];
18
- _buildTicks(lens: number[]): void;
30
+ _buildTicks(lens: number[], phase: number): void;
19
31
  _calcPoints(lens: number[], phase: number): void;
32
+ protected abstract _doPrepare(axes: AxisCollection, rows: number, cols: number): void;
20
33
  }
21
34
 
22
35
  declare class PaneBody extends Body<PaneBodyOptions> {
23
36
  pane: Pane;
24
37
  static defaults: PaneBodyOptions;
25
38
  constructor(pane: Pane);
26
- base(): Body;
27
39
  contains(obj: GaugeBase | Series): boolean;
28
40
  }
29
41
  declare class Pane extends ChartItem<PaneOptions> {
@@ -38,17 +50,11 @@ declare class Pane extends ChartItem<PaneOptions> {
38
50
  * Body 모델.
39
51
  */
40
52
  get body(): PaneBody;
41
- /**
42
- */
43
- width: number;
44
- /**
45
- */
46
- height: number;
47
- /**
48
- */
49
- inverted: boolean;
50
53
  _prepareRender(): void;
51
54
  }
55
+ interface IRelativeSize {
56
+ size: number;
57
+ }
52
58
  /**
53
59
  * 다중 분할 panes.<br/>
54
60
  * 각 pane에 해당하는 x, y축이 반드시 존재해야 한다.
@@ -64,37 +70,38 @@ declare class Split extends ChartItem<SplitOptions> implements ISplit {
64
70
  constructor(chart: IChart);
65
71
  private _cols;
66
72
  private _rows;
67
- private _widths;
68
- private _heights;
69
- private _panes;
73
+ private _colSizes;
74
+ private _rowSizes;
75
+ private _paneDic;
70
76
  _xAxes: PaneAxisMatrix;
71
77
  _yAxes: PaneAxisMatrix;
72
- _vcols: number;
73
- _vrows: number;
74
- private _vwidths;
75
- private _vheights;
76
- private _vpanes;
77
- count(): number;
78
- rowCount(): number;
79
- colCount(): number;
80
- paneCount(): number;
78
+ private _panes;
79
+ get count(): number;
80
+ get rowCount(): number;
81
+ get colCount(): number;
82
+ get paneCount(): number;
83
+ colSizes(): (number | IRelativeSize)[];
84
+ rowSizes(): (number | IRelativeSize)[];
81
85
  getPane(row: number, col: number): Pane;
82
86
  getRow(row: number): Pane[];
83
87
  getColumn(col: number): Pane[];
88
+ getAxisOf(annotation: Annotation, isX: boolean): IAxis;
89
+ isValidAxis(axis: IAxis): boolean;
84
90
  protected _doLoadProp(prop: string, value: any): boolean;
85
91
  protected _doSetSimple(source: any): boolean;
86
92
  _load(source: any): ChartItem;
87
93
  protected _doPrepareRender(chart: IChart): void;
94
+ _calcSizes(exts: (number | IRelativeSize)[], len: number): number[];
88
95
  getXLens(length: number): number[];
89
96
  getYLens(length: number): number[];
90
- layoutAxes(width: number, height: number, inverted: boolean, phase: number): void;
97
+ measureAxes(width: number, height: number, inverted: boolean, phase: number): void;
91
98
  private $_calcAxesPoints;
92
- calcAxesPoints(xLens: number[], yLens: number[]): void;
99
+ completeAxesPoints(xLens: number[], yLens: number[]): void;
93
100
  /**
94
- * body들의 표시 크기를 계산한다.
101
+ * @private
102
+ * chart에서 호출됨.
95
103
  */
96
- calcSizes(width: number, height: number): void;
97
- getAnnotation(name: string): Annotation;
104
+ getBodyAnnotation(name: string): Annotation;
98
105
  prepareRender(xAxes: AxisCollection, yAxes: AxisCollection): void;
99
106
  /**
100
107
  * number | (`${number}*` | '*')[] // '*'은 '1*'과 동일.
@@ -106,7 +113,6 @@ declare class Split extends ChartItem<SplitOptions> implements ISplit {
106
113
  * 축이 연결되지 않은 pane들은 skip한다.
107
114
  */
108
115
  private $_collectPanes;
109
- private $_calcSizes;
110
116
  }
111
117
 
112
118
  declare function registerSplit(chart: typeof RealChart): void;
package/split.js CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
- * RealChart Split v1.3.18
3
+ * RealChart Split v1.4.0
4
4
  * Copyright (C) 2023-2025 WooriTech Inc.
5
5
  * All Rights Reserved.
6
6
  */
7
- !function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("realchart")):"function"==typeof define&&define.amd?define(["exports","realchart"],s):s((t="undefined"!=typeof globalThis?globalThis:t||self).RealChartSplit={},t.RealChart)}(this,(function(t,s){"use strict";function e(t){var s=Object.create(null);return t&&Object.keys(t).forEach((function(e){if("default"!==e){var i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(s,e,i.get?i:{enumerable:!0,get:function(){return t[e]}})}})),s.default=t,Object.freeze(s)}var i=e(s);class r{constructor(){this._axes=[]}}class o{constructor(t,s){this.chart=t,this.isX=s}rows(){return this._matrix.length}cols(){return this._matrix[0].length}get(t,s){return this._matrix[t][s]}getRow(t){return this._matrix[t]}getColumn(t){return this._matrix.map((s=>s[t]))}_buildTicks(t){const s=this.isX;this._matrix.forEach(((e,i)=>{e.forEach(((e,i)=>{e._axes.forEach((e=>{e.isBased()||e._buildTicks(t[s?e.options.col:e.options.row])}))}))})),this._matrix.forEach(((e,i)=>{e.forEach(((e,i)=>{e._axes.forEach((e=>{e.isBased()&&e._buildTicks(t[s?e.options.col:e.options.row])}))}))}))}_calcPoints(t,s){const e=this.isX;this._matrix.forEach((i=>{i.forEach(((i,r)=>{i._axes.forEach((i=>{const r=e?i.options.col:i.options.row;i._calcPoints(t[r],s)}))}))}))}}class n extends o{constructor(t){super(t,!0)}_prepare(t,s,e){const i=this._matrix=new Array(s+1);for(let t=0;t<i.length;t++){i[t]=[];for(let s=0;s<e;s++)i[t].push(new r)}t.forEach((t=>{const e=t.options.position;let r=t._row;"opposite"===e?(r++,t._runPos=e):r<s-1&&"between"===e?(r++,t._runPos="normal"):t._runPos=e,i[r][t._col]._axes.push(t)}))}}class h extends o{constructor(t){super(t,!1)}_prepare(t,s,e){const i=this._matrix=new Array(s);for(let t=0;t<i.length;t++){i[t]=[];for(let s=0;s<=e;s++)i[t].push(new r)}t.forEach((t=>{const s=t.options.position;let r=t._col;"opposite"===s?(r++,t._runPos=s):t._col<e-1&&"between"===s?(r++,t._runPos="normal"):t._runPos=s,i[t._row][r]._axes.push(t)}))}}class a extends s.Body{constructor(t){super(t.chart),this.pane=t}base(){return this.chart._body}contains(t){return t.options.col===this.pane.col||t.options.row===this.pane.row}}a.defaults=s.extend(s.Body.defaults,{radius:void 0,centerX:void 0,centerY:void 0});class c extends s.ChartItem{constructor(t,s,e){super(t),this.row=s,this.col=e}_doInitChildren(t){t.body=(this._body=new a(this)).init()}get body(){return this._body}_prepareRender(){this.body._prepareRender()}}class l extends s.ChartItem{constructor(t){super(t),this._cols=1,this._rows=1,this._panes={},this._vcols=1,this._vrows=1,this._vpanes=[],this._xAxes=new n(t),this._yAxes=new h(t)}count(){return this._vrows*this._vcols}rowCount(){return this._vrows}colCount(){return this._vcols}paneCount(){return this._vrows*this._vcols}getPane(t,s){return this._vpanes[t][s]}getRow(t){return this._vpanes[t]}getColumn(t){return this._vpanes.map((s=>s[t]))}_doLoadProp(t,s){return["panes","cols","rows"].indexOf(t)>=0||super._doLoadProp(t,s)}_doSetSimple(t){if(s.isArray(t)&&t.length>0){const e=this._op;return e.rows=s.maxv(1,+t[0]),e.cols=s.maxv(1,s.pickNum(+t[1],e.rows)),e.rows>0&&e.cols>0&&(this.$_parsePanes(e.rows,e.cols),this.visible=!0),!0}return super._doSetSimple(t)}_load(t){return super._load(t),s.isObject(t)&&(this.$_parsePanes(this._op.rows=t.rows,this._op.cols=t.cols),this._panes=this.$_loadPanes(t.panes)),this}_doPrepareRender(t){this._vpanes=this.$_collectPanes(t),this._vpanes.forEach((t=>t.forEach((t=>t._prepareRender()))))}getXLens(t){return new Array(this._vcols).fill(t/this._vcols)}getYLens(t){return new Array(this._vrows).fill(t/this._vrows)}layoutAxes(t,s,e,i){const r=this.getXLens(e?s:t),o=this.getYLens(e?t:s);this._xAxes._buildTicks(r),this._yAxes._buildTicks(o),this.$_calcAxesPoints(r,o,0)}$_calcAxesPoints(t,s,e){this._xAxes._calcPoints(t,e),this._yAxes._calcPoints(s,e)}calcAxesPoints(t,s){this.$_calcAxesPoints(t,s,101)}calcSizes(t,s){this._widths=this.$_calcSizes(t,this._widths),this._heights=this.$_calcSizes(s,this._heights)}getAnnotation(t){for(const s in this._panes){const e=this._panes[s].body.getAnnotation(t);if(e)return e}}prepareRender(t,s){this._prepareRender(),this._xAxes._prepare(t,this._vrows,this._vcols),this._yAxes._prepare(s,this._vrows,this._vcols)}$_parseSizes(t){let e;return e=s.isArray(t)&&t.length>0?t.slice(0):t>0?new Array(t).fill("*"):["*"],e.map((t=>{if(s.isString(t)){const s=t.trim();return{size:"*"===s?1:parseFloat(s)}}return+t||{size:1}}))}$_parsePanes(t,s){this._widths=this.$_parseSizes(s),this._heights=this.$_parseSizes(t),this._cols=this._widths.length,this._rows=this._heights.length}$_loadPanes(t){const e={};return t=s.isArray(t)?t:s.isObject(t)?[t]:null,s.isArray(t)&&t.forEach((t=>{const s=+t.row||0,i=+t.col||0;if(i>=0&&i<this._cols&&s>=0&&s<this._rows){const r=new c(this.chart,s,i);r.init(),r._load(t),e[s+","+i]=r}})),e}$_collectPanes(t){const s=t._getXAxes()._internalItems(),e=t._getYAxes()._internalItems(),i=[],r=[],o=[];s.concat(e).forEach((t=>{const s=t.options.row||0,e=t.options.col||0;t._row=s,t._col=e,e>=0&&e<this._cols&&i.indexOf(e)<0&&i.push(e),s>=0&&s<this._rows&&r.indexOf(s)<0&&r.push(s)})),i.sort(),r.sort();for(let s=0;s<r.length;s++){const e=[];for(let r=0;r<i.length;r++){const i=this._panes[s+","+r]||new c(t,s,r)._initObject();e.push(i)}o.push(e)}return this._vrows=o.length,this._vcols=o[0].length,o}$_calcSizes(t,s){}}l.defaults=s.extend(s.ChartItem.defaults,{visible:!1,gap:0});class _ extends s.SectionView{constructor(){super(...arguments),this.views=[],this._gap=0}isEmpty(){return 0===this.views.length}prepare(t,e,i,r,o){const n=this.views,h=[];for(this.isX=e,i&&i._axes.forEach((t=>{h.push(t)}));n.length<h.length;){const e=new s.AxisView(t);this.add(e),n.push(e)}for(;n.length>h.length;)n.pop().remove();if(n.forEach(((t,s)=>{h[s]._runPos,t.model=h[s]})),this.axes=h,this.setVis(n.length>0)){const t=n[0].model;this._gap=t.chart.getAxesGap()}}prepareGuides(t,s,e){const i=this.views,r=this.axes;i.forEach(((e,i)=>{const o=r[i];s.forEach((s=>{s.forEach((s=>{s.isConnected(o)&&e.setVis(this.visible)&&e.prepareGuides(t,s.row,s.col,s._guideContainer,s._frontGuideContainer)}))}))}))}checkHeights(t,s,e){return this.views.length>0?this.$_checkHeights(this.views,t,s,e):0}$_checkHeights(t,s,e,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkHeight(s,e,i)})),r+=(this.views.length-1)*this._gap),r}checkWidths(t,s,e){return this.views.length>0?this.$_checkWidths(this.views,t,s,e):0}$_checkWidths(t,s,e,i){let r=0;return t&&(t.forEach((t=>{r+=t.checkWidth(s,e,i)})),r+=(this.views.length-1)*this._gap),r}getScrollView(t){var s;for(const e of this.views)if(null===(s=e._scrollView)||void 0===s?void 0:s.contains(t))return e._scrollView}setMargins(t,s,e,i){this.views.forEach((r=>r.setMargins(t,s,e,i)))}_setInverted(t){super._setInverted(t),this.isHorz=t&&!this.isX||!t&&this.isX}_doMeasure(t,s,e,i,r){const o=this.axes;if(this.isHorz){let s=0;return this.views.forEach(((n,h)=>{s+=n.measure(t,o[h],e,i,r).height})),{width:e,height:s}}{let s=0;return this.views.forEach(((n,h)=>{s+=n.measure(t,o[h],e,i,r).width})),{width:s,height:i}}}_doLayout(t){this.isHorz?this.views.forEach((t=>{t.resize(this.width,t.mh),t.layout()})):this.views.forEach((t=>{t.resize(t.mw,this.height),t.transX(this.width-t.mw),t.layout()}))}}class u extends s.SectionView{constructor(t,s){super(t,"rct-axis-container"),this.isX=s,this.sections=[]}prepare(t,s,e,i){const r=this.isX?e.getRow(i):e.getColumn(i);for(;this.sections.length<r.length;){const s=new _(t);this.add(s),this.sections.push(s)}for(;this.sections.length>r.length;)this.sections.pop().remove();this.sections.forEach(((o,n)=>{this.isX?(o.row=i,o.col=n):(o.col=i,o.row=n),o.prepare(t,this.isX,r[n],s,e)}))}prepareGuides(t,s,e,i){const r=this.isX?e.getRow(i):e.getColumn(i);for(;this.sections.length<r.length;){const s=new _(t);this.add(s),this.sections.push(s)}for(;this.sections.length>r.length;)this.sections.pop().remove();this.sections.forEach(((r,o)=>{this.isX?(r.row=i,r.col=o):(r.col=i,r.row=o),r.prepareGuides(t,s,e)}))}checkWidths(t,s,e){return this.sections.length>0?this.sections.reduce(((i,r)=>i+r.checkWidths(t,s,e)),0):0}checkHeights(t,s,e){return this.sections.length>0?this.sections.reduce(((i,r)=>i+r.checkHeights(t,s,e)),0):0}_setInverted(t){super._setInverted(t),this._isHorz=t&&!this.isX||!t&&this.isX}_doMeasure(t,e,i,r,o){let n=0,h=0;return this._isHorz?this.sections.forEach((n=>{h=s.maxv(h,n.measure(t,e,i,r,o).height)})):this.sections.forEach((h=>{n=s.maxv(n,h.measure(t,e,i,r,o).width)})),{width:n,height:h}}_doLayout(t){this._isHorz?this.height>0&&this.sections.forEach(((s,e)=>{s.resize(t[2*(e+1)]-t[2*(e+1)-1],this.height),s.trans(t[2*e+1]-t[1],0),s.layout()})):this.width>0&&this.sections.forEach(((s,e)=>{s.resize(this.width,t[2*(e+1)]-t[2*(e+1)-1]),s.trans(0,this.height-(t[2*(e+1)]-t[1])),s.layout()}))}}class p extends s.BodyView{constructor(){super(...arguments),this.row=0,this.col=0}prepareRender(t,e){const i=this.row,r=this.col,o=e._split.getPane(i,r).body,n=e._getSeries().getPaneSeries(i,r),h=e._getGauges().getPaneVisibles(i,r);this._animatable=s.RcControl._animatable&&e.animatable(),this._prepareSeries(t,e,n),this._prepareGauges(t,e,h),this._prepareAnnotations(t,o.getAnnotations())}getTooltipPos(){return{x:this.parent.parent.tx+this.tx,y:this.parent.parent.ty+this.ty}}}class d extends s.PaneContainer{constructor(t,s){super(t,d.STYLE_NAME),this._bodies=[],this._xContainers=[],this._yContainers=[],this._owner=s}get bodies(){return this._bodies}bodyViewOf(t){return this._bodies.find((s=>s.contains(t)))}prepare(t,s){s.chart,this.$_init(t),this._model=s,this.$_prepareBodies(t,s)}measure(t,s,e,i,r){const o=s.chart,n=this._inverted=s.chart.isInverted(),h=s._xAxes,a=s._yAxes,c=e,l=i;this.$_prepareAxes(t,h,!0),this.$_prepareAxes(t,a,!1),s.layoutAxes(e,i,n,r),n?(e-=this._xContainers.reduce(((s,r)=>s+r.checkWidths(t,e,i)),0),i-=this._yContainers.reduce(((s,r)=>s+r.checkHeights(t,e,i)),0)):(i-=this._xContainers.reduce(((s,r)=>s+r.checkHeights(t,e,i)),0),e-=this._yContainers.reduce(((s,r)=>s+r.checkWidths(t,e,i)),0)),s.layoutAxes(e,i,n,r),this._xContainers.forEach((s=>s.measure(t,o,e,i,r))),this._yContainers.forEach((s=>s.measure(t,o,e,i,r))),e=c,i=l,n?(e-=this._xContainers.reduce(((t,s)=>t+s.mw),0),i-=this._yContainers.reduce(((t,s)=>t+s.mh),0)):(i-=this._xContainers.reduce(((t,s)=>t+s.mh),0),e-=this._yContainers.reduce(((t,s)=>t+s.mw),0)),s.layoutAxes(e,i,n,r),this.$_prepareAxisGuides(t,h,!0),this.$_prepareAxisGuides(t,h,!1),this._xContainers.forEach((s=>s.measure(t,o,e,i,r))),this._yContainers.forEach((s=>s.measure(t,o,e,i,r)));const _=s.getXLens(n?i:e),u=s.getYLens(n?e:i);s.calcAxesPoints(_,u)}layout(){const t=this._model,s=this.width,e=this.height;this._back.resize(s,e),this.$_calcExtents(t,s,e),this.$_layoutAxes(t,!0,s,e),this.$_layoutAxes(t,!1,s,e),this.$_layoutBodies(t,s,e)}seriesByDom(t){for(const s of this._bodies){const e=s.seriesByDom(t);if(e)return e}}getSeries(t){for(const s of this.bodies){const e=s.findSeries(t);if(e)return e}}$_init(t){this._back||(this.add(this._back=new s.RectElement(t)),this._back.setStyles({fill:"none"}),this.add(this._bodyContainer=new s.LayerElement(t,void 0)),this.add(this._axisContainer=new s.LayerElement(t,void 0)))}$_prepareBodies(t,s){const e=s.chart,i=s.paneCount(),r=this._bodies,o=this._bodyMap=[];for(;r.length<i;){const s=new p(t,this._owner);this._bodyContainer.add(s),r.push(s)}for(;r.length>i;)r.pop().remove();for(let t=0;t<s.rowCount();t++){const e=[];for(let i=0;i<s.colCount();i++){const o=r[t*s.colCount()+i];e.push(o),o.row=t,o.col=i}o.push(e)}r.forEach((s=>{s.prepareRender(t,e),s.prepareGuideContainers(),s._gridRowContainer.prepare()}))}$_prepareAxes(t,s,e){const i=e?this._xContainers:this._yContainers,r=e?s.rows():s.cols();for(;i.length<r;){const s=new u(t,e);this._axisContainer.add(s),i.push(s)}for(;i.length>r;)i.pop().remove();i.forEach(((e,i)=>{e.prepare(t,this._bodyMap,s,i)}))}$_prepareAxisGuides(t,s,e){(e?this._xContainers:this._yContainers).forEach(((e,i)=>{e.prepareGuides(t,this._bodyMap,s,i)}))}$_calc(t,s,e,i){const r=new Array(2*(s+1)),o=e-t.reduce(((t,s)=>t+s[i]),0),n=new Array(s);let h=0,a=0;for(a=0;a<s;a++)n[a]=o/s;for(a=0;a<s;a++)r[2*a]=h,r[2*a+1]=h+=t[a][i],h+=n[a];return r[2*a]=h,r[2*a+1]=h+t[a][i],r}$_calcExtents(t,s,e){this._inverted?(this._rowPoints=this.$_calc(this._xContainers,t.rowCount(),s,"mw"),this._colPoints=this.$_calc(this._yContainers,t.colCount(),e,"mh")):(this._rowPoints=this.$_calc(this._xContainers,t.rowCount(),e,"mh"),this._colPoints=this.$_calc(this._yContainers,t.colCount(),s,"mw"))}$_layoutAxes(t,s,e,i){const r=this.control._padding,o=this._rowPoints,n=this._colPoints,h=s?this._xContainers:this._yContainers;if(this._inverted)if(s){const t=n[1],s=n[n.length-2]-t;h.forEach(((t,e)=>{t.resize(t.mw,s),t.trans(o[2*e],i-n[n.length-2]),t.layout(n)}))}else{const t=o[1],s=o[o.length-2]-t;h.forEach(((e,h)=>{const a=e.sections;for(let t=0,s=a.length;t<s;t++){const e=a[t],i=0===t?r.left:0,n=t===s-1?r.right:0;let h=0,c=0;s>1&&(h=o[2*t+1]-o[2*t],c=o[2*(t+1)+1]-o[2*(t+1)],0===t?a[t+1].isEmpty()?c=o[2*(t+1)]-o[2*(t+1)-1]:c/=2:t===s-1?a[t-1].isEmpty()?h=o[2*(t-1)]-o[2*(t-1)-1]:h/=2:(a[t-1].isEmpty()?h=o[2*(t-1)]-o[2*(t-1)-1]:h/=2,a[t+1].isEmpty()?c=o[2*(t+1)]-o[2*(t+1)-1]:c/=2)),e.setMargins(i,h,c,n)}e.resize(s,e.mh),e.trans(t,i-n[2*h+1]),e.layout(o)}))}else if(s){const t=n[1];e=n[n.length-2]-t,h.forEach(((s,a)=>{const c=s.sections;for(let t=0,s=c.length;t<s;t++){const e=c[t],i=0===a?r.left:0,l=a===h.length-1?r.right:0;let _=0,u=0;s>1&&(_=n[2*t+1]-n[2*t],u=n[2*(t+1)+1]-n[2*(t+1)],0===t?c[t+1].isEmpty()?u=n[2*(t+1)]-n[2*(t+1)-1]:u/=2:t===s-1?c[t-1].isEmpty()?_=n[2*(t-1)]-n[2*(t-1)-1]:_/=2:(c[t-1].isEmpty()?_=n[2*(t-1)]-n[2*(t-1)-1]:_/=2,c[t+1].isEmpty()?u=n[2*(t+1)]-o[2*(t+1)-1]:u/=2)),e.setMargins(i,_,u,l)}s.resize(e,s.mh),s.trans(t,i-o[2*a+1]),s.layout(n)}))}else{const t=o[o.length-2],s=t-o[1];h.forEach(((e,r)=>{e.resize(e.mw,s),e.trans(n[2*r],i-t),e.layout(o)}))}}$_layoutBodies(t,s,e){t.chart._body;const i=t.rowCount(),r=t.colCount(),o=this._rowPoints,n=this._colPoints,h=this._bodies;if(this._inverted)for(let s=0;s<i;s++){const e=o[2*(s+1)-1],i=o[2*(s+1)];for(let o=0;o<r;o++){const a=h[s*r+o],c=n[2*o+1],l=n[2*(o+1)];a.measure(this.doc,t.getPane(s,o).body,i-e,l-c,1),a.resize(i-e,l-c),a.trans(e,this.height-l),a.layout()}}else for(let s=0;s<i;s++){const i=o[2*(s+1)-1],a=o[2*(s+1)];for(let o=0;o<r;o++){const c=h[s*r+o],l=n[2*(o+1)-1],_=n[2*(o+1)];c.measure(this.doc,t.getPane(s,o).body,_-l,a-i,1),c.resize(_-l,a-i),c.trans(l,e-a),c.layout()}}}}function f(t){(function(t){return t.Series&&t.SeriesView})(t)&&(t.ChartObject.registerSplitClass(l),t.ChartView.registerPaneClass(d))}d.STYLE_NAME="rct-panes",f(i),t.Split=l,t.default=f,Object.defineProperty(t,"__esModule",{value:!0})}));
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})}));
package/split.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
- * RealChart Split v1.3.18
3
+ * RealChart Split v1.4.0
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,isString as h,PaneContainer as a,RectElement as c,LayerElement as _,SectionView as l,BodyView as p,RcControl as u,AxisView as d}from"./index.mjs";class w{constructor(){this._axes=[]}}class g{constructor(s,t){this.chart=s,this.isX=t}rows(){return this._matrix.length}cols(){return this._matrix[0].length}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){const t=this.isX;this._matrix.forEach(((e,i)=>{e.forEach(((e,i)=>{e._axes.forEach((e=>{e.isBased()||e._buildTicks(s[t?e.options.col:e.options.row])}))}))})),this._matrix.forEach(((e,i)=>{e.forEach(((e,i)=>{e._axes.forEach((e=>{e.isBased()&&e._buildTicks(s[t?e.options.col:e.options.row])}))}))}))}_calcPoints(s,t){const e=this.isX;this._matrix.forEach((i=>{i.forEach(((i,o)=>{i._axes.forEach((i=>{const o=e?i.options.col:i.options.row;i._calcPoints(s[o],t)}))}))}))}}class f extends g{constructor(s){super(s,!0)}_prepare(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 w)}s.forEach((s=>{const e=s.options.position;let o=s._row;"opposite"===e?(o++,s._runPos=e):o<t-1&&"between"===e?(o++,s._runPos="normal"):s._runPos=e,i[o][s._col]._axes.push(s)}))}}class x extends g{constructor(s){super(s,!1)}_prepare(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 w)}s.forEach((s=>{const t=s.options.position;let o=s._col;"opposite"===t?(o++,s._runPos=t):s._col<e-1&&"between"===t?(o++,s._runPos="normal"):s._runPos=t,i[s._row][o]._axes.push(s)}))}}class y extends t{constructor(s){super(s.chart),this.pane=s}base(){return this.chart._body}contains(s){return s.options.col===this.pane.col||s.options.row===this.pane.row}}y.defaults=s(t.defaults,{radius:void 0,centerX:void 0,centerY:void 0});class m 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 v extends e{constructor(s){super(s),this._cols=1,this._rows=1,this._panes={},this._vcols=1,this._vrows=1,this._vpanes=[],this._xAxes=new f(s),this._yAxes=new x(s)}count(){return this._vrows*this._vcols}rowCount(){return this._vrows}colCount(){return this._vcols}paneCount(){return this._vrows*this._vcols}getPane(s,t){return this._vpanes[s][t]}getRow(s){return this._vpanes[s]}getColumn(s){return this._vpanes.map((t=>t[s]))}_doLoadProp(s,t){return["panes","cols","rows"].indexOf(s)>=0||super._doLoadProp(s,t)}_doSetSimple(s){if(i(s)&&s.length>0){const t=this._op;return t.rows=o(1,+s[0]),t.cols=o(1,r(+s[1],t.rows)),t.rows>0&&t.cols>0&&(this.$_parsePanes(t.rows,t.cols),this.visible=!0),!0}return super._doSetSimple(s)}_load(s){return super._load(s),n(s)&&(this.$_parsePanes(this._op.rows=s.rows,this._op.cols=s.cols),this._panes=this.$_loadPanes(s.panes)),this}_doPrepareRender(s){this._vpanes=this.$_collectPanes(s),this._vpanes.forEach((s=>s.forEach((s=>s._prepareRender()))))}getXLens(s){return new Array(this._vcols).fill(s/this._vcols)}getYLens(s){return new Array(this._vrows).fill(s/this._vrows)}layoutAxes(s,t,e,i){const o=this.getXLens(e?t:s),r=this.getYLens(e?s:t);this._xAxes._buildTicks(o),this._yAxes._buildTicks(r),this.$_calcAxesPoints(o,r,0)}$_calcAxesPoints(s,t,e){this._xAxes._calcPoints(s,e),this._yAxes._calcPoints(t,e)}calcAxesPoints(s,t){this.$_calcAxesPoints(s,t,101)}calcSizes(s,t){this._widths=this.$_calcSizes(s,this._widths),this._heights=this.$_calcSizes(t,this._heights)}getAnnotation(s){for(const t in this._panes){const e=this._panes[t].body.getAnnotation(s);if(e)return e}}prepareRender(s,t){this._prepareRender(),this._xAxes._prepare(s,this._vrows,this._vcols),this._yAxes._prepare(t,this._vrows,this._vcols)}$_parseSizes(s){let t;return t=i(s)&&s.length>0?s.slice(0):s>0?new Array(s).fill("*"):["*"],t.map((s=>{if(h(s)){const t=s.trim();return{size:"*"===t?1:parseFloat(t)}}return+s||{size:1}}))}$_parsePanes(s,t){this._widths=this.$_parseSizes(t),this._heights=this.$_parseSizes(s),this._cols=this._widths.length,this._rows=this._heights.length}$_loadPanes(s){const t={};return s=i(s)?s:n(s)?[s]:null,i(s)&&s.forEach((s=>{const e=+s.row||0,i=+s.col||0;if(i>=0&&i<this._cols&&e>=0&&e<this._rows){const o=new m(this.chart,e,i);o.init(),o._load(s),t[e+","+i]=o}})),t}$_collectPanes(s){const t=s._getXAxes()._internalItems(),e=s._getYAxes()._internalItems(),i=[],o=[],r=[];t.concat(e).forEach((s=>{const t=s.options.row||0,e=s.options.col||0;s._row=t,s._col=e,e>=0&&e<this._cols&&i.indexOf(e)<0&&i.push(e),t>=0&&t<this._rows&&o.indexOf(t)<0&&o.push(t)})),i.sort(),o.sort();for(let t=0;t<o.length;t++){const e=[];for(let o=0;o<i.length;o++){const i=this._panes[t+","+o]||new m(s,t,o)._initObject();e.push(i)}r.push(e)}return this._vrows=r.length,this._vcols=r[0].length,r}$_calcSizes(s,t){}}v.defaults=s(e.defaults,{visible:!1,gap:0});class E extends l{constructor(){super(...arguments),this.views=[],this._gap=0}isEmpty(){return 0===this.views.length}prepare(s,t,e,i,o){const r=this.views,n=[];for(this.isX=t,e&&e._axes.forEach((s=>{n.push(s)}));r.length<n.length;){const t=new d(s);this.add(t),r.push(t)}for(;r.length>n.length;)r.pop().remove();if(r.forEach(((s,t)=>{n[t]._runPos,s.model=n[t]})),this.axes=n,this.setVis(r.length>0)){const s=r[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)}))}))}))}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){this.isHorz?this.views.forEach((s=>{s.resize(this.width,s.mh),s.layout()})):this.views.forEach((s=>{s.resize(s.mw,this.height),s.transX(this.width-s.mw),s.layout()}))}}class C extends l{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 E(s);this.add(t),this.sections.push(t)}for(;this.sections.length>o.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.prepare(s,this.isX,o[n],t,e)}))}prepareGuides(s,t,e,i){const o=this.isX?e.getRow(i):e.getColumn(i);for(;this.sections.length<o.length;){const t=new E(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.sections.reduce(((i,o)=>i+o.checkWidths(s,t,e)),0):0}checkHeights(s,t,e){return this.sections.length>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 b extends p{constructor(){super(...arguments),this.row=0,this.col=0}prepareRender(s,t){const e=this.row,i=this.col,o=t._split.getPane(e,i).body,r=t._getSeries().getPaneSeries(e,i),n=t._getGauges().getPaneVisibles(e,i);this._animatable=u._animatable&&t.animatable(),this._prepareSeries(s,t,r),this._prepareGauges(s,t,n),this._prepareAnnotations(s,o.getAnnotations())}getTooltipPos(){return{x:this.parent.parent.tx+this.tx,y:this.parent.parent.ty+this.ty}}}class A extends a{constructor(s,t){super(s,A.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,_=i;this.$_prepareAxes(s,h,!0),this.$_prepareAxes(s,a,!1),t.layoutAxes(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.layoutAxes(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=_,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)),t.layoutAxes(e,i,n,o),this.$_prepareAxisGuides(s,h,!0),this.$_prepareAxisGuides(s,h,!1),this._xContainers.forEach((t=>t.measure(s,r,e,i,o))),this._yContainers.forEach((t=>t.measure(s,r,e,i,o)));const l=t.getXLens(n?i:e),p=t.getYLens(n?e:i);t.calcAxesPoints(l,p)}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 c(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=this._bodies,r=this._bodyMap=[];for(;o.length<i;){const t=new b(s,this._owner);this._bodyContainer.add(t),o.push(t)}for(;o.length>i;)o.pop().remove();for(let s=0;s<t.rowCount();s++){const e=[];for(let i=0;i<t.colCount();i++){const r=o[s*t.colCount()+i];e.push(r),r.row=s,r.col=i}r.push(e)}o.forEach((t=>{t.prepareRender(s,e),t.prepareGuideContainers(),t._gridRowContainer.prepare()}))}$_prepareAxes(s,t,e){const i=e?this._xContainers:this._yContainers,o=e?t.rows():t.cols();for(;i.length<o;){const t=new C(s,e);this._axisContainer.add(t),i.push(t)}for(;i.length>o;)i.pop().remove();i.forEach(((e,i)=>{e.prepare(s,this._bodyMap,t,i)}))}$_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=new Array(2*(t+1)),r=e-s.reduce(((s,t)=>s+t[i]),0),n=new Array(t);let h=0,a=0;for(a=0;a<t;a++)n[a]=r/t;for(a=0;a<t;a++)o[2*a]=h,o[2*a+1]=h+=s[a][i],h+=n[a];return o[2*a]=h,o[2*a+1]=h+s[a][i],o}$_calcExtents(s,t,e){this._inverted?(this._rowPoints=this.$_calc(this._xContainers,s.rowCount(),t,"mw"),this._colPoints=this.$_calc(this._yContainers,s.colCount(),e,"mh")):(this._rowPoints=this.$_calc(this._xContainers,s.rowCount(),e,"mh"),this._colPoints=this.$_calc(this._yContainers,s.colCount(),t,"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,_=a===h.length-1?o.right:0;let l=0,p=0;t>1&&(l=n[2*s+1]-n[2*s],p=n[2*(s+1)+1]-n[2*(s+1)],0===s?c[s+1].isEmpty()?p=n[2*(s+1)]-n[2*(s+1)-1]:p/=2:s===t-1?c[s-1].isEmpty()?l=n[2*(s-1)]-n[2*(s-1)-1]:l/=2:(c[s-1].isEmpty()?l=n[2*(s-1)]-n[2*(s-1)-1]:l/=2,c[s+1].isEmpty()?p=n[2*(s+1)]-r[2*(s+1)-1]:p/=2)),e.setMargins(i,l,p,_)}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){s.chart._body;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],_=n[2*(r+1)];a.measure(this.doc,s.getPane(t,r).body,i-e,_-c,1),a.resize(i-e,_-c),a.trans(e,this.height-_),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],_=n[2*(r+1)-1],l=n[2*(r+1)];c.measure(this.doc,s.getPane(t,r).body,l-_,a-i,1),c.resize(l-_,a-i),c.trans(_,e-a),c.layout()}}}}function P(s){(function(s){return s.Series&&s.SeriesView})(s)&&(s.ChartObject.registerSplitClass(v),s.ChartView.registerPaneClass(A))}A.STYLE_NAME="rct-panes";export{v as Split,P as default,P as registerSplit};
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};
package/treemap.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /**
3
- * RealChart Treemap v1.3.18
3
+ * RealChart Treemap v1.4.0
4
4
  * Copyright (C) 2023-2025 WooriTech Inc.
5
5
  * All Rights Reserved.
6
6
  */
package/treemap.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /**
3
- * RealChart Treemap v1.3.18
3
+ * RealChart Treemap v1.4.0
4
4
  * Copyright (C) 2023-2025 WooriTech Inc.
5
5
  * All Rights Reserved.
6
6
  */
package/vector.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /**
3
- * RealChart Vector v1.3.18
3
+ * RealChart Vector v1.4.0
4
4
  * Copyright (C) 2023-2025 WooriTech Inc.
5
5
  * All Rights Reserved.
6
6
  */
package/vector.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /**
3
- * RealChart Vector v1.3.18
3
+ * RealChart Vector v1.4.0
4
4
  * Copyright (C) 2023-2025 WooriTech Inc.
5
5
  * All Rights Reserved.
6
6
  */
package/wordcloud.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /**
3
- * RealChart Wordcloud v1.3.18
3
+ * RealChart Wordcloud v1.4.0
4
4
  * Copyright (C) 2023-2025 WooriTech Inc.
5
5
  * All Rights Reserved.
6
6
  */
package/wordcloud.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /**
3
- * RealChart Wordcloud v1.3.18
3
+ * RealChart Wordcloud v1.4.0
4
4
  * Copyright (C) 2023-2025 WooriTech Inc.
5
5
  * All Rights Reserved.
6
6
  */