realchart
Version:
Wooritech charting library
8 lines (6 loc) • 18.8 kB
JavaScript
/**
* RealChart Split v1.4.12
* Copyright (C) 2023-2026 WooriTech Inc.
* All Rights Reserved.
*/
!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.Legend{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 l extends t.ChartItem{constructor(e,t,s){super(e),this.row=t,this.col=s}_doInit(e){e.body=(this._body=new a(this)).init(),e.legend=(this._legend=new c(this)).init()}get body(){return this._body}get legend(){return this._legend}_prepareRender(){this._body._prepareRender(),this._legend._prepareRender()}}class _ 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 l(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 l(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 l(e,s,t)._initObject();i.push(o)}t.push(i)}return t}}_.defaults=t.extend(t.ChartItem.defaults,{visible:!1,extendBody:!0,gap:0});class d extends t.SectionView{constructor(){super(...arguments),this.views=[],this._gap=0}isEmpty(){return 0===this.views.length}prepare(e,t,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=t.createAxisView(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 u extends t.SectionView{constructor(e,t){super(e,"rct-axis-container"),this.isX=t,this.sections=[]}prepare(e,t,s,i,o,r){const n=this.isX?i.getRow(o):i.getColumn(o);for(;this.sections.length<n.length;){const t=new d(e);this.add(t),this.sections.push(t)}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,t,s,this.isX,n[r])})),this._setInverted(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 d(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 p extends t.BodyView{constructor(e,s){super(e,s),this.row=0,this.col=0,this.add(this._legendView=new t.LegendView(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 i=s.chart,o=s.depth.visible,r=this.row,n=this.col,h=i._split.getPane(r,n).body;this._animatable=t.RcControl._animatable&&i.animatable(),this._prepareSeries(e,s,i._getSeries().getPaneSeries(r,n),o),this._prepareGauges(e,i,i._getGauges().getPaneVisibles(r,n)),this._prepareAnnotations(e,h.getAnnotations().concat(i._getAnnotations().getPaneVisibles(r,n)))}_doMeasure(e,t,s,i,o){return this._legendView.setVis(t.pane.legend.visible)&&this._legendView.measure(e,t.pane.legend,s,i,o),super._doMeasure(e,t,s,i,o)}_doLayout(){super._doLayout();const e=this._legendView;if(e.visible){this._seriesViews.forEach((t=>{if(t.needDecoreateLegend()){const s=e.legendOfSeries(t.model);s&&t.decoreateLegend(s)}}));const t=e.model.options,s=t.align,i=t.verticalAlign;let o=0,r=0,n=+t.offsetX||0;switch(s){case"right":o+=this.width-e.mw-n;break;case"center":o+=(this.width-e.mw)/2+n;break;default:o+=n}switch(n=+t.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 g extends t.PaneContainer{constructor(e,t){super(e,g.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,n),this.$_prepareAxes(e,a,!1,n),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}}annotationByDom(e){for(const t of this._bodies){const s=t.annotationByDom(e);if(s)return s}}getSeries(e){for(const t of this.bodies){const s=t.findSeries(e);if(s)return s}}legendByDom(e){for(const t of this.bodies){const s=t._legendView.legendByDom(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){t.chart;const s=t.paneCount,i=t.rowCount,o=t.colCount,r=this._bodies,n=this._bodyMap=[];for(;r.length<s;){const t=new p(e,this._owner);this._bodyContainer.add(t),r.push(t)}for(;r.length>s;)r.pop().remove();for(let e=0;e<i;e++){const t=[];for(let s=0;s<o;s++){const i=r[e*o+s];t.push(i),i.row=e,i.col=s}n.push(t)}r.forEach((s=>{s.prepareRender(e,t.getPane(s.row,s.col).body),s.prepareGuideContainers(),s._gridRowContainer.prepare()}))}$_prepareAxes(e,t,s,i){const o=this._model.chart,r=s?this._xContainers:this._yContainers,n=s?t.rows():t.cols();for(;r.length<n;){const t=new u(e,s);this._axisContainer.add(t),r.push(t)}for(;r.length>n;)r.pop().remove();r.forEach(((s,r)=>{s.prepare(e,this._owner,o,t,r,i)}))}$_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(_),e.ChartView.registerPaneClass(g))}g.STYLE_NAME="rct-panes",f(i),e.Split=_,e.default=f,Object.defineProperty(e,"__esModule",{value:!0})}));