realchart
Version:
Wooritech charting library
8 lines (6 loc) • 18.2 kB
JavaScript
/**
* RealChart Split v1.4.12
* Copyright (C) 2023-2026 WooriTech Inc.
* All Rights Reserved.
*/
import{extend as e,Body as s,ChartItem as t,isArray as i,maxv as o,pickNum as r,isObject as n,isNumber as h,isString as a,Legend as c,PaneContainer as l,RectElement as _,LayerElement as d,SectionView as u,BodyView as p,LegendView as g,RcControl as f}from"./index.mjs";class w{constructor(e,s){this.row=e,this.col=s,this._axes=[]}sort(e,s){const t=s&&!e||!s&&e;this._axes.length>1&&(t?this._axes.sort(((e,s)=>{const t=e._posValue(),i=s._posValue();return t===i?t<0?s._index-e._index:t>0?e._index-s._index:e.row!==s.row?s.row-e.row:e.row<this.row?s._index-e._index:e._index-s._index:i-t})):this._axes.sort(((e,s)=>{const t=e._posValue(),i=s._posValue();return t===i?t<0?e._index-s._index:t>0?s._index-e._index:e.col!==s.col?e.col-e.col:e.col<this.col?e._index-s._index:s._index-e._index:t-i})))}}class x{constructor(e,s){this.chart=e,this.isX=s}rows(){return this._matrix.length}cols(){return this._matrix[0].length}_prepare(e,s,t,i){this._doPrepare(e,s,t),this._matrix.forEach((e=>{e.forEach((e=>e.sort(this.isX,i)))}))}get(e,s){return this._matrix[e][s]}getRow(e){return this._matrix[e]}getColumn(e){return this._matrix.map((s=>s[e]))}_buildTicks(e,s){const t=this.isX;this._matrix.forEach(((i,o)=>{i.forEach(((i,o)=>{i._axes.forEach((i=>{!i.isBased()&&(s<2||t)&&i._buildTicks(e[t?i.options.col:i.options.row],s)}))}))})),this._matrix.forEach(((i,o)=>{i.forEach(((i,o)=>{i._axes.forEach((i=>{i.isBased()&&(s<2||t)&&i._buildTicks(e[t?i.options.col:i.options.row],s)}))}))}))}_calcPoints(e,s){const t=this.isX;this._matrix.forEach((i=>{i.forEach(((i,o)=>{i._axes.forEach((i=>{if(s<2||t){const o=t?i.options.col:i.options.row;i._calcPoints(e[o],s)}}))}))}))}}class m extends x{constructor(e){super(e,!0)}_doPrepare(e,s,t){const i=this._matrix=new Array(s+1);for(let e=0;e<i.length;e++){i[e]=[];for(let s=0;s<t;s++)i[e].push(new w(e,s))}e.forEach((e=>{var t,o;const r=e.options.position;let n=e.row;"opposite"===r?(n++,e._runPos=r):n<s-1&&"between"===r?(n++,e._runPos="normal"):e._runPos=r,null===(o=null===(t=i[n])||void 0===t?void 0:t[e.col])||void 0===o||o._axes.push(e)}))}}class y extends x{constructor(e){super(e,!1)}_doPrepare(e,s,t){const i=this._matrix=new Array(s);for(let e=0;e<i.length;e++){i[e]=[];for(let s=0;s<=t;s++)i[e].push(new w(e,s))}e.forEach((e=>{var s,o;const r=e.options.position;let n=e.col;"opposite"===r?(n++,e._runPos=r):e.col<t-1&&"between"===r?(n++,e._runPos="normal"):e._runPos=r,null===(o=null===(s=i[e.row])||void 0===s?void 0:s[n])||void 0===o||o._axes.push(e)}))}}class b extends s{constructor(e){super(e.chart),this.pane=e}contains(e){return e.col===this.pane.col||e.row===this.pane.row}}b.defaults=e(s.defaults,{extended:!0,radius:void 0,centerX:void 0,centerY:void 0});class E extends c{constructor(e){super(e.chart),this.pane=e}_doPrepareRender(e){super._doPrepareRender(e),this._location="body"}_getLegendSources(){return this.options.visible?this.chart._getSeries().getLegendSources(this.pane.row,this.pane.col):[]}}class v extends t{constructor(e,s,t){super(e),this.row=s,this.col=t}_doInit(e){e.body=(this._body=new b(this)).init(),e.legend=(this._legend=new E(this)).init()}get body(){return this._body}get legend(){return this._legend}_prepareRender(){this._body._prepareRender(),this._legend._prepareRender()}}class A extends t{constructor(e){super(e),this._cols=1,this._rows=1,this._paneDic={},this._panes=[],this._xAxes=new m(e),this._yAxes=new y(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,s){return this._panes[e][s]}getRow(e){return this._panes[e]}getColumn(e){return this._panes.map((s=>s[e]))}getAxisOf(e,s){var t,i;const o=this.chart,r=e.body;if(r){const n=r.pane;return s?o._getXAxes().get(e.options.xAxis)||this._xAxes.get(n.row,n.col)._axes[0]||(null===(t=o._getSeries().getPaneSeries(n.row,n.col)[0])||void 0===t?void 0:t._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,s){return["panes","cols","rows"].indexOf(e)>=0||super._doLoadProp(e,s)}_doSetSimple(e){if(i(e)&&e.length>0){const s=o(1,+e[0]),t=o(1,r(+e[1],s));return s>0&&t>0&&(this.$_parsePanes(s,t),this.visible=!0),!0}return super._doSetSimple(e)}_load(e){return super._load(e),n(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 t=e.length,i=new Array(t);let o=0;if(t>1){let r=s,n=0;for(o=0;o<t;o++){const s=e[o];h(s)?r-=i[o]=Math.max(0,Math.min(r,s)):n+=s.size}if(n>0)for(o=0;o<t;o++){const s=e[o];h(s)||(i[o]=r*s.size/n)}}else i[o]=s;return i}getXLens(e){return this._calcSizes(this._colSizes,e)}getYLens(e){return this._calcSizes(this._rowSizes,e)}measureAxes(e,s,t,i){const o=this.getXLens(t?s:e),r=this.getYLens(t?e:s);this._xAxes._buildTicks(o,i),this._yAxes._buildTicks(r,i),this.$_calcAxesPoints(o,r,i)}$_calcAxesPoints(e,s,t){this._xAxes._calcPoints(e,t),this._yAxes._calcPoints(s,t)}completeAxesPoints(e,s){this.$_calcAxesPoints(e,s,101)}getBodyAnnotation(e){for(const s in this._paneDic){const t=this._paneDic[s].body.getAnnotation(e);if(t)return t}}prepareRender(e,s){const t=this.chart.isInverted();this._prepareRender(),this._xAxes._prepare(e,this._rows,this._cols,t),this._yAxes._prepare(s,this._rows,this._cols,t)}$_parseSizes(e){let s;return s=i(e)&&e.length>0?e.slice(0):e>0?new Array(e).fill("*"):["*"],s.map((e=>{if(a(e)){const s=e.trim();return{size:"*"===s?1:r(parseFloat(s),1)}}return r(+e,1)}))}$_parsePanes(e,s){this._colSizes=this.$_parseSizes(s),this._rowSizes=this.$_parseSizes(e),this._cols=this._colSizes.length,this._rows=this._rowSizes.length}$_loadPanes(e){const s=this.chart,t=this._op.extendBody?s._body._config:void 0,o={};if(e=i(e)?e:n(e)?[e]:null,i(e)&&e.forEach((e=>{const i=+e.row||0,r=+e.col||0;if(r>=0&&r<this._cols&&i>=0&&i<this._rows){const n=new v(s,i,r);let h=e;n.init(),!t||e&&e.body&&!1===e.body.extended||(e?(h=Object.assign({},e),e.body?!1!==e.body.extended&&(h.body=Object.assign({},t,e.body)):h.body=t):h={body:t}),n._load(h),o[i+","+r]=n}})),t)for(let e=0;e<this._rows;e++)for(let i=0;i<this._cols;i++){const r=e+","+i;if(!o[r]){const n=new v(s,e,i);n.init(),n._load({body:t}),o[r]=n}}return o}$_collectPanes(e){const s=[];for(let t=0;t<this._rows;t++){const i=[];for(let s=0;s<this._cols;s++){const o=this._paneDic[t+","+s]||new v(e,t,s)._initObject();i.push(o)}s.push(i)}return s}}A.defaults=e(t.defaults,{visible:!1,extendBody:!0,gap:0});class P extends u{constructor(){super(...arguments),this.views=[],this._gap=0}isEmpty(){return 0===this.views.length}prepare(e,s,t,i,o){const r=this.views,n=[];for(this.isX=i,o._axes.forEach((e=>{e.checkVisible()&&t.isValidAxis(e)&&n.push(e)}));r.length<n.length;){const t=s.createAxisView(e);this.add(t),r.push(t)}for(;r.length>n.length;)r.pop().remove();if(r.forEach(((e,s)=>{e.setModel(n[s])})),this.axes=n,this.setVis(r.length>0)){const e=r[0].model;this._gap=e.chart.getAxesGap()}}prepareGuides(e,s,t){const i=this.views,o=this.axes;i.forEach(((t,i)=>{const r=o[i];s.forEach((s=>{s.forEach((s=>{s.isConnected(r)&&t.setVis(this.visible)&&(t.prepareGuides(e,s.row,s.col,s._guideContainer,s._frontGuideContainer),r._isHorz||(s._axes||(s._axes=[]),s._axes.push(r)))}))}))})),s.forEach((s=>{s.forEach((s=>{s._axes&&(s._gridRowContainer.addAll(e,s._axes),s._axes=[])}))}))}checkHeights(e,s,t){return this.views.length>0?this.$_checkHeights(this.views,e,s,t):0}$_checkHeights(e,s,t,i){let o=0;return e&&(e.forEach((e=>{o+=e.checkHeight(s,t,i)})),o+=(this.views.length-1)*this._gap),o}checkWidths(e,s,t){return this.views.length>0?this.$_checkWidths(this.views,e,s,t):0}$_checkWidths(e,s,t,i){let o=0;return e&&(e.forEach((e=>{o+=e.checkWidth(s,t,i)})),o+=(this.views.length-1)*this._gap),o}getScrollView(e){var s;for(const t of this.views)if(null===(s=t._scrollView)||void 0===s?void 0:s.contains(e))return t._scrollView}setMargins(e,s,t,i){this.views.forEach((o=>o.setMargins(e,s,t,i)))}_setInverted(e){super._setInverted(e),this.isHorz=e&&!this.isX||!e&&this.isX}_doMeasure(e,s,t,i,o){const r=this.axes;if(this.isHorz){let s=0;return this.views.forEach(((n,h)=>{s+=n.measure(e,r[h],t,i,o).height})),{width:t,height:s}}{let s=0;return this.views.forEach(((n,h)=>{s+=n.measure(e,r[h],t,i,o).width})),{width:s,height:i}}}_doLayout(e){const s=this.views,t=this.width,i=this.height,o=s.length;let r=0,n=o-1;if(this.isHorz){let e,h,a=0;for(;r<o;r++){const e=s[r];if(e.model._posValue()<1)break;e.trans(0,a),a+=e.mh}for(e=a,a=i;n>=0;n--){const e=s[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+=s[e].mh;e+=(c-l)/2;for(let t=r;t<=n;t++){const i=s[t];i.trans(0,e),e+=i.mh}s.forEach((e=>{e.resize(t,e.mh),e.model._calcPoints(t,999),e.layout()}))}else{let e,h,a=0;for(;r<o;r++){const e=s[r];if(e.model._posValue()>-1)break;e.trans(a,0),a+=e.mw}for(e=a,a=t;n>=0;n--){const e=s[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+=s[e].mw;e+=(c-l)/2;for(let t=r;t<=n;t++){const i=s[t];i.trans(e,0),e+=i.mw}s.forEach((e=>{e.resize(e.mw,i),e.model._calcPoints(i,999),e.layout()}))}}}class C extends u{constructor(e,s){super(e,"rct-axis-container"),this.isX=s,this.sections=[]}prepare(e,s,t,i,o,r){const n=this.isX?i.getRow(o):i.getColumn(o);for(;this.sections.length<n.length;){const s=new P(e);this.add(s),this.sections.push(s)}for(;this.sections.length>n.length;)this.sections.pop().remove();this.sections.forEach(((i,r)=>{this.isX?(i.row=o,i.col=r):(i.col=o,i.row=r),i.prepare(e,s,t,this.isX,n[r])})),this._setInverted(r)}prepareGuides(e,s,t,i){const o=this.isX?t.getRow(i):t.getColumn(i);for(;this.sections.length<o.length;){const s=new P(e);this.add(s),this.sections.push(s)}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,s,t)}))}checkWidths(e,s,t){return this.sections.length>0?this._isHorz?this.sections.reduce(((i,o)=>i+o.checkWidths(e,s,t)),0):this.sections.reduce(((i,o)=>Math.max(i,o.checkWidths(e,s,t))),0):0}checkHeights(e,s,t){return this.sections.length>0?this._isHorz?this.sections.reduce(((i,o)=>Math.max(i,o.checkHeights(e,s,t))),0):this.sections.reduce(((i,o)=>i+o.checkHeights(e,s,t)),0):0}_setInverted(e){super._setInverted(e),this._isHorz=e&&!this.isX||!e&&this.isX}_doMeasure(e,s,t,i,r){let n=0,h=0;return this._isHorz?this.sections.forEach((n=>{h=o(h,n.measure(e,s,t,i,r).height)})):this.sections.forEach((h=>{n=o(n,h.measure(e,s,t,i,r).width)})),{width:n,height:h}}_doLayout(e){this._isHorz?this.height>0&&this.sections.forEach(((s,t)=>{s.resize(e[2*(t+1)]-e[2*(t+1)-1],this.height),s.trans(e[2*t+1]-e[1],0),s.layout()})):this.width>0&&this.sections.forEach(((s,t)=>{s.resize(this.width,e[2*(t+1)]-e[2*(t+1)-1]),s.trans(0,this.height-(e[2*(t+1)]-e[1])),s.layout()}))}}class z extends p{constructor(e,s){super(e,s),this.row=0,this.col=0,this.add(this._legendView=new g(e))}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(e,s){const t=s.chart,i=s.depth.visible,o=this.row,r=this.col,n=t._split.getPane(o,r).body;this._animatable=f._animatable&&t.animatable(),this._prepareSeries(e,s,t._getSeries().getPaneSeries(o,r),i),this._prepareGauges(e,t,t._getGauges().getPaneVisibles(o,r)),this._prepareAnnotations(e,n.getAnnotations().concat(t._getAnnotations().getPaneVisibles(o,r)))}_doMeasure(e,s,t,i,o){return this._legendView.setVis(s.pane.legend.visible)&&this._legendView.measure(e,s.pane.legend,t,i,o),super._doMeasure(e,s,t,i,o)}_doLayout(){super._doLayout();const e=this._legendView;if(e.visible){this._seriesViews.forEach((s=>{if(s.needDecoreateLegend()){const t=e.legendOfSeries(s.model);t&&s.decoreateLegend(t)}}));const s=e.model.options,t=s.align,i=s.verticalAlign;let o=0,r=0,n=+s.offsetX||0;switch(t){case"right":o+=this.width-e.mw-n;break;case"center":o+=(this.width-e.mw)/2+n;break;default:o+=n}switch(n=+s.offsetY||0,i){case"bottom":r+=this.height-e.mh-n;break;case"middle":r+=(this.height-e.mh)/2+n;break;default:r+=n}e.trans(o,r).resize(e.mw,e.mh),e.layout()}}}class S extends l{constructor(e,s){super(e,S.STYLE_NAME),this._bodies=[],this._xContainers=[],this._yContainers=[],this._owner=s}get bodies(){return this._bodies}bodyViewOf(e){return this._bodies.find((s=>s.contains(e)))}prepare(e,s){s.chart,this.$_init(e),this._model=s,this.$_prepareBodies(e,s)}measure(e,s,t,i,o){const r=s.chart,n=this._inverted=s.chart.isInverted(),h=s._xAxes,a=s._yAxes,c=t,l=i;this.$_prepareAxes(e,h,!0,n),this.$_prepareAxes(e,a,!1,n),s.measureAxes(t,i,n,o),n?(t-=this._xContainers.reduce(((s,o)=>s+o.checkWidths(e,t,i)),0),i-=this._yContainers.reduce(((s,o)=>s+o.checkHeights(e,t,i)),0)):(i-=this._xContainers.reduce(((s,o)=>s+o.checkHeights(e,t,i)),0),t-=this._yContainers.reduce(((s,o)=>s+o.checkWidths(e,t,i)),0)),s.measureAxes(t,i,n,o),this._xContainers.forEach((s=>s.measure(e,r,t,i,o))),this._yContainers.forEach((s=>s.measure(e,r,t,i,o))),t=c,i=l,n?(t-=this._xContainers.reduce(((e,s)=>e+s.mw),0),i-=this._yContainers.reduce(((e,s)=>e+s.mh),0)):(i-=this._xContainers.reduce(((e,s)=>e+s.mh),0),t-=this._yContainers.reduce(((e,s)=>e+s.mw),0)),o++,s.measureAxes(t,i,n,o),this.$_prepareAxisGuides(e,h,!0),this.$_prepareAxisGuides(e,a,!1),this._xContainers.forEach((s=>{s.measure(e,r,t,i,o)})),this._yContainers.forEach((s=>{s.measure(e,r,t,i,o)}));const _=s.getXLens(n?i:t),d=s.getYLens(n?t:i);s.completeAxesPoints(_,d)}layout(){const e=this._model,s=this.width,t=this.height;this._back.resize(s,t),this.$_calcExtents(e,s,t),this.$_layoutAxes(e,!0,s,t),this.$_layoutAxes(e,!1,s,t),this.$_layoutBodies(e,s,t)}seriesByDom(e){for(const s of this._bodies){const t=s.seriesByDom(e);if(t)return t}}annotationByDom(e){for(const s of this._bodies){const t=s.annotationByDom(e);if(t)return t}}getSeries(e){for(const s of this.bodies){const t=s.findSeries(e);if(t)return t}}legendByDom(e){for(const s of this.bodies){const t=s._legendView.legendByDom(e);if(t)return t}}$_init(e){this._back||(this.add(this._back=new _(e)),this._back.setStyles({fill:"none"}),this.add(this._bodyContainer=new d(e,void 0)),this.add(this._axisContainer=new d(e,void 0)))}$_prepareBodies(e,s){s.chart;const t=s.paneCount,i=s.rowCount,o=s.colCount,r=this._bodies,n=this._bodyMap=[];for(;r.length<t;){const s=new z(e,this._owner);this._bodyContainer.add(s),r.push(s)}for(;r.length>t;)r.pop().remove();for(let e=0;e<i;e++){const s=[];for(let t=0;t<o;t++){const i=r[e*o+t];s.push(i),i.row=e,i.col=t}n.push(s)}r.forEach((t=>{t.prepareRender(e,s.getPane(t.row,t.col).body),t.prepareGuideContainers(),t._gridRowContainer.prepare()}))}$_prepareAxes(e,s,t,i){const o=this._model.chart,r=t?this._xContainers:this._yContainers,n=t?s.rows():s.cols();for(;r.length<n;){const s=new C(e,t);this._axisContainer.add(s),r.push(s)}for(;r.length>n;)r.pop().remove();r.forEach(((t,r)=>{t.prepare(e,this._owner,o,s,r,i)}))}$_prepareAxisGuides(e,s,t){(t?this._xContainers:this._yContainers).forEach(((t,i)=>{t.prepareGuides(e,this._bodyMap,s,i)}))}$_calc(e,s,t,i){const o=t.length,r=new Array(2*(o+1)),n=s-e.reduce(((e,s)=>e+s[i]),0),h=this._model._calcSizes(t,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,s,t){this._inverted?(this._rowPoints=this.$_calc(this._xContainers,s,e.rowSizes(),"mw"),this._colPoints=this.$_calc(this._yContainers,t,e.colSizes(),"mh")):(this._rowPoints=this.$_calc(this._xContainers,t,e.rowSizes(),"mh"),this._colPoints=this.$_calc(this._yContainers,s,e.colSizes(),"mw"))}$_layoutAxes(e,s,t,i){const o=this.control._padding,r=this._rowPoints,n=this._colPoints,h=s?this._xContainers:this._yContainers;if(this._inverted)if(s){const e=n[1],s=n[n.length-2]-e;h.forEach(((e,t)=>{e.resize(e.mw,s),e.trans(r[2*t],i-n[n.length-2]),e.layout(n)}))}else{const e=r[1],s=r[r.length-2]-e;h.forEach(((t,h)=>{const a=t.sections;for(let e=0,s=a.length;e<s;e++){const t=a[e],i=0===e?o.left:0,n=e===s-1?o.right:0;let h=0,c=0;s>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===s-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)),t.setMargins(i,h,c,n)}t.resize(s,t.mh),t.trans(e,i-n[2*h+1]),t.layout(r)}))}else if(s){const e=n[1];t=n[n.length-2]-e,h.forEach(((s,a)=>{const c=s.sections;for(let e=0,s=c.length;e<s;e++){const t=c[e],i=0===a?o.left:0,l=a===h.length-1?o.right:0;let _=0,d=0;s>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===s-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)),t.setMargins(i,_,d,l)}s.resize(t,s.mh),s.trans(e,i-r[2*a+1]),s.layout(n)}))}else{const e=r[r.length-2],s=e-r[1];h.forEach(((t,o)=>{t.resize(t.mw,s),t.trans(n[2*o],i-e),t.layout(r)}))}}$_layoutBodies(e,s,t){const i=e.rowCount,o=e.colCount,r=this._rowPoints,n=this._colPoints,h=this._bodies;if(this._inverted)for(let s=0;s<i;s++){const t=r[2*(s+1)-1],i=r[2*(s+1)];for(let r=0;r<o;r++){const a=h[s*o+r],c=n[2*r+1],l=n[2*(r+1)];a.measure(this.doc,e.getPane(s,r).body,i-t,l-c,1),a.resize(i-t,l-c),a.trans(t,this.height-l),a.layout()}}else for(let s=0;s<i;s++){const i=r[2*(s+1)-1],a=r[2*(s+1)];for(let r=0;r<o;r++){const c=h[s*o+r],l=n[2*(r+1)-1],_=n[2*(r+1)];c.measure(this.doc,e.getPane(s,r).body,_-l,a-i,1),c.resize(_-l,a-i),c.trans(l,t-a),c.layout()}}}}function $(e){(function(e){return e.Series&&e.SeriesView})(e)&&(e.ChartObject.registerSplitClass(A),e.ChartView.registerPaneClass(S))}S.STYLE_NAME="rct-panes";export{A as Split,$ as default,$ as registerSplit};