1
1
/*
2
- * Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited
2
+ * Copyright (C) 2019 - 2025 Devexperts Solutions IE Limited
3
3
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4
4
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
5
5
*/
@@ -36,6 +36,16 @@ import { ChartResizeHandler } from '../../inputhandlers/chart-resize.handler';
36
36
37
37
export type MoveDataSeriesToPaneDirection = 'above' | 'below' ;
38
38
39
+ interface MoveDataSeriesToPaneOptions {
40
+ paneUUID ?: string ;
41
+ extent ?: YExtentComponent ;
42
+ direction ?: MoveDataSeriesToPaneDirection ;
43
+ // in some cases pane should not be deleted right after data series move,
44
+ // because the next data series could be moved to it
45
+ isForceKeepPane ?: boolean ;
46
+ index ?: number ;
47
+ }
48
+
39
49
export class PaneManager extends ChartBaseElement {
40
50
public panes : Record < string , PaneComponent > = { } ;
41
51
public paneRemovedSubject : Subject < PaneComponent > = new Subject ( ) ;
@@ -296,14 +306,9 @@ export class PaneManager extends ChartBaseElement {
296
306
dataSeries : DataSeriesModel [ ] ,
297
307
initialPane : PaneComponent ,
298
308
initialExtent : YExtentComponent ,
299
- paneUUID ?: string ,
300
- extent ?: YExtentComponent ,
301
- direction ?: MoveDataSeriesToPaneDirection ,
302
- // in some cases pane should not be deleted right after data series move,
303
- // because the next data series could be moved to it
304
- forceKeepPane ?: boolean ,
305
- index = 0 ,
309
+ options : MoveDataSeriesToPaneOptions ,
306
310
) {
311
+ const { paneUUID, extent, direction, isForceKeepPane, index = 0 } = options ;
307
312
const pane = paneUUID && this . panes [ paneUUID ] ;
308
313
309
314
if ( ! pane ) {
@@ -314,9 +319,9 @@ export class PaneManager extends ChartBaseElement {
314
319
initialPane ,
315
320
initialExtent ,
316
321
newPane . mainExtent ,
317
- forceKeepPane ,
322
+ isForceKeepPane ,
318
323
) ;
319
- ! forceKeepPane && initialPane . yExtentComponents . length === 0 && this . removePane ( initialPane . uuid ) ;
324
+ ! isForceKeepPane && initialPane . yExtentComponents . length === 0 && this . removePane ( initialPane . uuid ) ;
320
325
return ;
321
326
}
322
327
@@ -330,7 +335,7 @@ export class PaneManager extends ChartBaseElement {
330
335
initialExtent . yAxis . state . align ,
331
336
) ;
332
337
}
333
- ! forceKeepPane && initialPane . yExtentComponents . length === 0 && this . removePane ( initialPane . uuid ) ;
338
+ ! isForceKeepPane && initialPane . yExtentComponents . length === 0 && this . removePane ( initialPane . uuid ) ;
334
339
}
335
340
336
341
/**
0 commit comments