Skip to content

Commit

Permalink
Pull request #5361: Feature/DXCF-5570 web multiple scales multiple sc…
Browse files Browse the repository at this point in the history
…ale 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: e9960e3ecf402fd0b2f8a69ee9f530725996d992
  • Loading branch information
artskar authored and dxcity committed Dec 11, 2024
1 parent 337fd39 commit eecdfda
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/chart/components/events/events.drawer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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];
Expand Down
6 changes: 4 additions & 2 deletions src/chart/components/pane/pane-manager.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export class PaneManager extends ChartBaseElement {
/**
* Creates sub-plot on the chart with y-axis
* @param uuid
* @param {AtLeastOne<YExtentCreationOptions>} options
* @returns
*/
public createPane(uuid = generateUuid(), options?: AtLeastOne<YExtentCreationOptions>): PaneComponent {
Expand Down Expand Up @@ -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;
Expand Down
15 changes: 6 additions & 9 deletions src/chart/components/pane/pane.component.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit eecdfda

Please sign in to comment.