From 4797cacbb46fc081df8a3c2082d91c3301cda69a Mon Sep 17 00:00:00 2001 From: Vladislav Poddubskii Date: Fri, 29 Nov 2024 08:45:20 +0000 Subject: [PATCH] Pull request #5361: Feature/DXCF-5570 web multiple scales multiple scale operations should support undo redo actions Merge in DXCHARTS/dxchart5 from feature/DXCF-5570-web-multiple-scales-multiple-scale-operations-should-support-undo-redo-actions to master * commit '9ea7c5c325beabc51e46a27b1441aba5d4d7267e': [DXCF-5570] [Web] Multiple scales - multiple scale operations should support undo/redo actions // comment removed [DXCF-5570] [Web] Multiple scales - multiple scale operations should support undo/redo actions // merge issue fix [DXCF-5570] [Web] Multiple scales - multiple scale operations should support undo/redo actions // legend apearence for redo undo fix [DXCF-5570] [Web] Multiple scales - multiple scale operations should support undo/redo actions // redo undo pane for indicators when it removes [DXCF-5570] [Web] Multiple scales - multiple scale operations should support undo/redo actions // code style fixes, studies-scale move to new or existing scale fix [DXCF-5570] [Web] Multiple scales - multiple scale operations should support undo/redo actions // some of redo undo operations for scales [DXCF-5565] [Web] Multiple scales - implement external (supported) API to manipulate multiple scales from user-land code // init [DXCF-5565] [Web] Multiple scales - implement external (supported) API to manipulate multiple scales from user-land code // init [DXCF-5567] [Web] Multiple scales - hide scale mode buttons if more than one scale // pr fix [DXCF-5567] [Web] Multiple scales - hide scale mode buttons if more than one scale // init [DXCF-5567] [Web] Multiple scales - hide scale mode buttons if more than one scale // init [DXCF-5567] [Web] Multiple scales - hide scale mode buttons if more than one scale // init GitOrigin-RevId: 6feee4a60ef31f2a967a027163e90e6a554cc685 --- src/chart/components/events/events.drawer.ts | 4 ++-- .../components/pane/pane-manager.component.ts | 6 ++++-- src/chart/components/pane/pane.component.ts | 15 ++++++--------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/chart/components/events/events.drawer.ts b/src/chart/components/events/events.drawer.ts index d6e3ed3..600c92f 100644 --- a/src/chart/components/events/events.drawer.ts +++ b/src/chart/components/events/events.drawer.ts @@ -124,7 +124,7 @@ export class EventsDrawer implements Drawer { * @param {number} x - The x coordinate of the event. * @param {Bounds} bounds - The bounds of the event. * @param {EventWithId} event - The event to draw. - * @param {string} color - The color of the event. + * @param {EventColors} colors - The colors of the event. * @returns {void} */ drawDefaultEvent( @@ -193,7 +193,7 @@ export class EventsDrawer implements Drawer { * Returns the size of an event based on its style * @param {EconomicEvent} event - The event to get the size of * @returns {number} - The size of the event - + */ export function getEventSize(event: EconomicEvent) { return eventsSizesDict[event.style]; diff --git a/src/chart/components/pane/pane-manager.component.ts b/src/chart/components/pane/pane-manager.component.ts index 14fb3cd..8f6c45e 100644 --- a/src/chart/components/pane/pane-manager.component.ts +++ b/src/chart/components/pane/pane-manager.component.ts @@ -143,6 +143,7 @@ export class PaneManager extends ChartBaseElement { /** * Creates sub-plot on the chart with y-axis * @param uuid + * @param {AtLeastOne} options * @returns */ public createPane(uuid = generateUuid(), options?: AtLeastOne): PaneComponent { @@ -298,12 +299,13 @@ export class PaneManager extends ChartBaseElement { paneUUID?: string, extent?: YExtentComponent, direction?: MoveDataSeriesToPaneDirection, + index = 0, ) { const pane = paneUUID && this.panes[paneUUID]; if (!pane) { - const order = direction && direction === 'above' ? 0 : this.panesOrder.length; - const newPane = this.createPane(undefined, { order }); + 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); return; diff --git a/src/chart/components/pane/pane.component.ts b/src/chart/components/pane/pane.component.ts index 408dd10..e4e9381 100644 --- a/src/chart/components/pane/pane.component.ts +++ b/src/chart/components/pane/pane.component.ts @@ -1,8 +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. @@ -132,8 +127,10 @@ export class PaneComponent extends ChartBaseElement { /** * Creates a new GridComponent instance with the provided parameters. * @param {string} uuid - The unique identifier of the pane. - * @param {ScaleModel} scaleModel - The scale model used to calculate the scale of the grid. - * @param {NumericYAxisLabelsGenerator} yAxisLabelsGenerator - The generator used to create the labels for the y-axis. + * @param {ScaleModel} scale - The scale model used to calculate the scale of the grid. + * @param {YAxisConfig} yAxisState - y Axis Config + * @param {() => NumericAxisLabel[]} yAxisLabelsGetter + * @param {() => Unit} yAxisBaselineGetter * @returns {GridComponent} - The newly created GridComponent instance. */ private createGridComponent( @@ -165,8 +162,8 @@ export class PaneComponent extends ChartBaseElement { * Creates a handler for Y-axis panning of the chart. * @private * @param {string} uuid - The unique identifier of the chart pane. - * @param {ScaleModel} scaleModel - The scale model of the chart. - * @returns {Unsubscriber} + * @param {ScaleModel} scale - The scale model of the chart. + * @returns [Unsubscriber, DragNDropYComponent] */ private createYPanHandler(uuid: string, scale: ScaleModel): [Unsubscriber, DragNDropYComponent] { const chartPaneId = CanvasElement.PANE_UUID(uuid);