Skip to content

Commit

Permalink
Pull request #5400: Feature/DXCF-5569 web multiple scales syncing for…
Browse files Browse the repository at this point in the history
… multi chart layouts

Merge in DXCHARTS/dxchart5 from feature/DXCF-5569-web-multiple-scales-syncing-for-multi-chart-layouts to master

* commit 'aca4c582a6b2d70025451deda1442114909e9102':
  [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // pr fix
  [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // fix standard deviation channel default overlaying value
  [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // pr fix
  [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // pr fix
  [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // pr fix
  [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // copy
  [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // init
  [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // init
  [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // init
  [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // init
  [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // init
  [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // init
  [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // init
  [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // init
  [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // init
  [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // init

GitOrigin-RevId: ce5d2b3906c623565cb321611b5d25bdddc38301
  • Loading branch information
Keelaro1 authored and dxcity committed Jan 13, 2025
1 parent 5795634 commit f96214b
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 21 deletions.
8 changes: 6 additions & 2 deletions src/chart/components/chart/chart-area-pan.handler.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (C) 2019 - 2025 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 @@ -47,8 +52,7 @@ interface ChartPanningOptions {
* @param {CanvasBoundsContainer} canvasBoundsContainer - An instance of the CanvasBoundsContainer class.
* @param {CanvasAnimation} canvasAnimation - An instance of the CanvasAnimation class.
* @param {ChartPanComponent} chartPanComponent - An instance of the ChartPanComponent class.
*/
*/
export class ChartAreaPanHandler extends ChartBaseElement {
private currentPoint: Point = { x: 0, y: 0 };
// number of candles delta changed during X dragging: 1, 5 or -3 for ex.
Expand Down
27 changes: 16 additions & 11 deletions src/chart/components/pane/pane-manager.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited
* Copyright (C) 2019 - 2025 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/.
*/
Expand Down Expand Up @@ -36,6 +36,16 @@ import { ChartResizeHandler } from '../../inputhandlers/chart-resize.handler';

export type MoveDataSeriesToPaneDirection = 'above' | 'below';

interface MoveDataSeriesToPaneOptions {
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
isForceKeepPane?: boolean;
index?: number;
}

export class PaneManager extends ChartBaseElement {
public panes: Record<string, PaneComponent> = {};
public paneRemovedSubject: Subject<PaneComponent> = new Subject();
Expand Down Expand Up @@ -296,14 +306,9 @@ export class PaneManager extends ChartBaseElement {
dataSeries: DataSeriesModel[],
initialPane: PaneComponent,
initialExtent: YExtentComponent,
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,
options: MoveDataSeriesToPaneOptions,
) {
const { paneUUID, extent, direction, isForceKeepPane, index = 0 } = options;
const pane = paneUUID && this.panes[paneUUID];

if (!pane) {
Expand All @@ -314,9 +319,9 @@ export class PaneManager extends ChartBaseElement {
initialPane,
initialExtent,
newPane.mainExtent,
forceKeepPane,
isForceKeepPane,
);
!forceKeepPane && initialPane.yExtentComponents.length === 0 && this.removePane(initialPane.uuid);
!isForceKeepPane && initialPane.yExtentComponents.length === 0 && this.removePane(initialPane.uuid);
return;
}

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

/**
Expand Down
11 changes: 3 additions & 8 deletions src/chart/components/pane/pane.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
/*
* 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
* Copyright (C) 2019 - 2025 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/.
*/
Expand Down Expand Up @@ -302,10 +297,10 @@ export class PaneComponent extends ChartBaseElement {
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,
isForceKeepExtent?: boolean,
) {
dataSeries.forEach(series => series.moveToExtent(extentComponent));
!forceKeepExtent && initialExtent.dataSeries.size === 0 && initialPane.removeExtentComponent(initialExtent);
!isForceKeepExtent && initialExtent.dataSeries.size === 0 && initialPane.removeExtentComponent(initialExtent);
this.yExtentComponentsChangedSubject.next();
}

Expand Down
5 changes: 5 additions & 0 deletions src/chart/components/resizer/bar-resizer.component.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (C) 2019 - 2025 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
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (C) 2019 - 2025 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
7 changes: 7 additions & 0 deletions src/chart/components/y_axis/y-axis.component.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (C) 2019 - 2025 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 @@ -57,6 +62,7 @@ export class YAxisComponent extends ChartBaseElement {
public yAxisScaleHandler: YAxisScaleHandler;
public model: YAxisModel;
public axisTypeSetSubject: Subject<PriceAxisType> = new Subject<PriceAxisType>();
public axisAlignSetSubject: Subject<YAxisAlign> = new Subject<YAxisAlign>();
public readonly state: YAxisConfig;

constructor(
Expand Down Expand Up @@ -266,6 +272,7 @@ export class YAxisComponent extends ChartBaseElement {
public setYAxisAlign(align: YAxisAlign) {
this.state.align = align;
this.canvasBoundsContainer.updateYAxisWidths();
this.axisAlignSetSubject.next(align);
this.eventBus.fireDraw();
}

Expand Down
5 changes: 5 additions & 0 deletions src/chart/model/data-series.model.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (C) 2019 - 2025 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

0 comments on commit f96214b

Please sign in to comment.