Skip to content

Commit

Permalink
Pull request #5387: Feature/DXCF-5643 web multiple scales add layout …
Browse files Browse the repository at this point in the history
…support

Merge in DXCHARTS/dxchart5 from feature/DXCF-5643-web-multiple-scales-add-layout-support to master

* commit '2f5c22e5170a7b600e78a7fffb0cda11aadc5bfb':
  [DXCF-5643] [Web] Multiple scales - add layout support // pr fix
  [DXCF-5643] [Web] Multiple scales - add layout support // pr fix
  [DXCF-5643] [Web] Multiple scales - add layout support // reverse order entry config
  [DXCF-5643] [Web] Multiple scales - add layout support // fix scales set from layout
  [DXCF-5643] [Web] Multiple scales - add layout support // init
  [DXCF-5643] [Web] Multiple scales - add layout support // fix merge check
  [DXCF-5643] [Web] Multiple scales - add layout support // init
  [DXCF-5643] [Web] Multiple scales - add layout support // init
  [DXCF-5643] [Web] Multiple scales - add layout support // init
  [DXCF-5643] [Web] Multiple scales - add layout support // init
  [DXCF-5643] [Web] Multiple scales - add layout support // init
  [DXCF-5643] [Web] Multiple scales - add layout support // init
  [DXCF-5643] [Web] Multiple scales - add layout support // init
  [DXCF-5643] [Web] Multiple scales - add layout support // init
  [DXCF-5643] [Web] Multiple scales - add layout support // init
  [DXCF-5643] [Web] Multiple scales - add layout support // init
  [DXCF-5643] [Web] Multiple scales - add layout support // init

GitOrigin-RevId: 1453c2a19dfcdeeadd0371401fa1609c1b235db9
  • Loading branch information
Keelaro1 authored and dxcity committed Jan 13, 2025
1 parent 153c4f4 commit ee7a292
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 24 deletions.
9 changes: 9 additions & 0 deletions src/chart/canvas/canvas-bounds-container.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
/*
* Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
Expand Down Expand Up @@ -838,6 +843,10 @@ export class CanvasBoundsContainer {
return canvasBounds.width > 0 && canvasBounds.height > 0;
}

public isAllBoundsAvailable() {
return Object.values(this.bounds).every(el => el.width >= 0 && el.height >= 0);
}

/**
* Resizes a pane vertically.
* @param {string} uuid - The unique identifier of the pane.
Expand Down
10 changes: 0 additions & 10 deletions src/chart/chart.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
/*
* Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
/*
* Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
/*
* Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
Expand Down
10 changes: 0 additions & 10 deletions src/chart/components/events/events.drawer.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
/*
* Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
/*
* Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
/*
* Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
Expand Down
15 changes: 12 additions & 3 deletions src/chart/components/pane/pane-manager.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,15 +299,24 @@ export class PaneManager extends ChartBaseElement {
paneUUID?: string,
extent?: YExtentComponent,
direction?: MoveDataSeriesToPaneDirection,
// in some cases pane should not be deleted right after data series move,
// because the next data series could be moved to it
forceKeepPane?: boolean,
index = 0,
) {
const pane = paneUUID && this.panes[paneUUID];

if (!pane) {
const order = direction && direction === 'above' ? index : this.panesOrder.length + index;
const newPane = this.createPane(paneUUID, { order });
newPane.moveDataSeriesToExistingExtentComponent(dataSeries, initialPane, initialExtent, newPane.mainExtent);
initialPane.yExtentComponents.length === 0 && this.removePane(initialPane.uuid);
newPane.moveDataSeriesToExistingExtentComponent(
dataSeries,
initialPane,
initialExtent,
newPane.mainExtent,
forceKeepPane,
);
!forceKeepPane && initialPane.yExtentComponents.length === 0 && this.removePane(initialPane.uuid);
return;
}

Expand All @@ -321,7 +330,7 @@ export class PaneManager extends ChartBaseElement {
initialExtent.yAxis.state.align,
);
}
initialPane.yExtentComponents.length === 0 && this.removePane(initialPane.uuid);
!forceKeepPane && initialPane.yExtentComponents.length === 0 && this.removePane(initialPane.uuid);
}

/**
Expand Down
10 changes: 9 additions & 1 deletion src/chart/components/pane/pane.component.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
/*
* Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
Expand Down Expand Up @@ -295,9 +300,12 @@ export class PaneComponent extends ChartBaseElement {
initialPane: PaneComponent,
initialExtent: YExtentComponent,
extentComponent: YExtentComponent,
// in some cases extent should not be deleted right after data series move,
// because the next data series could be moved to it
forceKeepExtent?: boolean,
) {
dataSeries.forEach(series => series.moveToExtent(extentComponent));
initialExtent.dataSeries.size === 0 && initialPane.removeExtentComponent(initialExtent);
!forceKeepExtent && initialExtent.dataSeries.size === 0 && initialPane.removeExtentComponent(initialExtent);
this.yExtentComponentsChangedSubject.next();
}

Expand Down
7 changes: 7 additions & 0 deletions src/chart/utils/object.utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
/*
* Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
Expand Down Expand Up @@ -95,3 +100,5 @@ export function deepEqual(objA: object, objB: object): boolean {

return true;
}

export const isEmpty = (obj: object) => Object.keys(obj).length === 0 && obj.constructor === Object;

0 comments on commit ee7a292

Please sign in to comment.