@devexperts/dxcharts-lite 2.4.6 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chart/__tests__/model/date-time.formatter.test.d.ts +6 -0
- package/dist/chart/__tests__/model/date-time.formatter.test.js +30 -0
- package/dist/chart/canvas/canvas-bounds-container.d.ts +7 -3
- package/dist/chart/canvas/canvas-bounds-container.js +149 -105
- package/dist/chart/canvas/canvas-chart-html.js +7 -7
- package/dist/chart/canvas/y-axis-bounds.container.js +4 -0
- package/dist/chart/chart.config.js +4 -4
- package/dist/chart/components/chart/chart-area-pan.handler.d.ts +1 -5
- package/dist/chart/components/chart/chart-area-pan.handler.js +1 -8
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop-x.component.d.ts +0 -6
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop-x.component.js +0 -8
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop-y.component.d.ts +0 -5
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop-y.component.js +0 -7
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop.component.d.ts +0 -11
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop.component.js +0 -16
- package/dist/chart/components/pan/chart-pan.component.d.ts +3 -14
- package/dist/chart/components/pan/chart-pan.component.js +7 -21
- package/dist/chart/components/pane/pane-hit-test.controller.js +1 -1
- package/dist/chart/components/pane/pane-manager.component.d.ts +29 -0
- package/dist/chart/components/pane/pane-manager.component.js +71 -8
- package/dist/chart/components/pane/pane.component.d.ts +5 -17
- package/dist/chart/components/pane/pane.component.js +11 -28
- package/dist/chart/components/resizer/bar-resizer.component.d.ts +1 -1
- package/dist/chart/components/resizer/bar-resizer.component.js +3 -1
- package/dist/chart/components/volumes/volumes.component.d.ts +1 -1
- package/dist/chart/components/volumes/volumes.component.js +18 -11
- package/dist/chart/components/y_axis/y-axis-scale.handler.js +3 -3
- package/dist/chart/components/y_axis/y-axis.component.js +1 -1
- package/dist/chart/drawers/chart-type-drawers/area.drawer.js +1 -1
- package/dist/chart/drawers/data-series.drawer.js +1 -1
- package/dist/chart/inputhandlers/hover-producer.component.d.ts +1 -1
- package/dist/chart/inputhandlers/main-canvas-touch.handler.d.ts +9 -2
- package/dist/chart/inputhandlers/main-canvas-touch.handler.js +18 -2
- package/dist/chart/model/baseline.model.d.ts +3 -0
- package/dist/chart/model/baseline.model.js +5 -0
- package/dist/chart/model/chart-base-element.d.ts +2 -0
- package/dist/chart/model/chart-base-element.js +2 -0
- package/dist/chart/model/data-series.model.d.ts +1 -1
- package/dist/chart/model/data-series.model.js +1 -1
- package/dist/chart/model/date-time.formatter.d.ts +20 -3
- package/dist/chart/model/date-time.formatter.js +62 -14
- package/dist/chart/model/scale.model.d.ts +12 -3
- package/dist/chart/model/scale.model.js +36 -7
- package/dist/chart/model/scaling/constrait.functions.d.ts +1 -16
- package/dist/chart/model/scaling/constrait.functions.js +1 -29
- package/dist/chart/model/time-zone.model.js +3 -1
- package/dist/dxchart.min.js +11 -11
- package/package.json +1 -1
|
@@ -15,9 +15,4 @@ export declare class DragNDropYComponent extends DragNDropComponent {
|
|
|
15
15
|
* @returns {void}
|
|
16
16
|
*/
|
|
17
17
|
protected doActivate(): void;
|
|
18
|
-
/**
|
|
19
|
-
* This method overrides the doDeactivate method of the parent class and calls the parent method before executing its own code.
|
|
20
|
-
* It is a protected method, which means it can only be accessed within the class and its subclasses.
|
|
21
|
-
*/
|
|
22
|
-
protected doDeactivate(): void;
|
|
23
18
|
}
|
|
@@ -19,11 +19,4 @@ export class DragNDropYComponent extends DragNDropComponent {
|
|
|
19
19
|
this.addRxSubscription(this.canvasInputListener.observeYDrag().subscribe(this.onDragTick));
|
|
20
20
|
this.addRxSubscription(this.canvasInputListener.observeYDragEnd().subscribe(this.onDragEnd));
|
|
21
21
|
}
|
|
22
|
-
/**
|
|
23
|
-
* This method overrides the doDeactivate method of the parent class and calls the parent method before executing its own code.
|
|
24
|
-
* It is a protected method, which means it can only be accessed within the class and its subclasses.
|
|
25
|
-
*/
|
|
26
|
-
doDeactivate() {
|
|
27
|
-
super.doDeactivate();
|
|
28
|
-
}
|
|
29
22
|
}
|
|
@@ -29,17 +29,6 @@ export declare class DragNDropComponent extends ChartBaseElement {
|
|
|
29
29
|
dragging: boolean;
|
|
30
30
|
draggedPixels: number;
|
|
31
31
|
constructor(hitTest: HitBoundsTest, dragCallbacks: DragNDropComponentCallbacks, canvasInputListener: CanvasInputListenerComponent, chartPanComponent: ChartPanComponent, dragComponentOptions: DragComponentOptions);
|
|
32
|
-
/**
|
|
33
|
-
* Calls the parent class's doActivate method and performs any additional activation logic.
|
|
34
|
-
* This method is protected and can only be accessed by the class itself and its subclasses.
|
|
35
|
-
*/
|
|
36
|
-
protected doActivate(): void;
|
|
37
|
-
/**
|
|
38
|
-
* This method overrides the doDeactivate method of the parent class and calls it using the super keyword.
|
|
39
|
-
* It is a protected method that can only be accessed within the class and its subclasses.
|
|
40
|
-
* This method is responsible for deactivating the current object.
|
|
41
|
-
*/
|
|
42
|
-
protected doDeactivate(): void;
|
|
43
32
|
protected onDragStart: (point: Point) => void;
|
|
44
33
|
protected onDragTick: (yDelta: number) => void;
|
|
45
34
|
protected onDragEnd: () => void;
|
|
@@ -40,24 +40,8 @@ export class DragNDropComponent extends ChartBaseElement {
|
|
|
40
40
|
if (this.dragging) {
|
|
41
41
|
this.dragging = false;
|
|
42
42
|
this.dragCallbacks.onDragEnd && this.dragCallbacks.onDragEnd(this.draggedPixels);
|
|
43
|
-
this.chartPanComponent.activateChartPanHandlers();
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
45
|
};
|
|
47
46
|
}
|
|
48
|
-
/**
|
|
49
|
-
* Calls the parent class's doActivate method and performs any additional activation logic.
|
|
50
|
-
* This method is protected and can only be accessed by the class itself and its subclasses.
|
|
51
|
-
*/
|
|
52
|
-
doActivate() {
|
|
53
|
-
super.doActivate();
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* This method overrides the doDeactivate method of the parent class and calls it using the super keyword.
|
|
57
|
-
* It is a protected method that can only be accessed within the class and its subclasses.
|
|
58
|
-
* This method is responsible for deactivating the current object.
|
|
59
|
-
*/
|
|
60
|
-
doDeactivate() {
|
|
61
|
-
super.doDeactivate();
|
|
62
|
-
}
|
|
63
47
|
}
|
|
@@ -7,12 +7,13 @@ import { CanvasAnimation } from '../../animation/canvas-animation';
|
|
|
7
7
|
import { CanvasBoundsContainer } from '../../canvas/canvas-bounds-container';
|
|
8
8
|
import { FullChartConfig } from '../../chart.config';
|
|
9
9
|
import EventBus from '../../events/event-bus';
|
|
10
|
-
import { ChartBaseElement
|
|
10
|
+
import { ChartBaseElement } from '../../model/chart-base-element';
|
|
11
11
|
import { CanvasInputListenerComponent } from '../../inputlisteners/canvas-input-listener.component';
|
|
12
12
|
import { ScaleModel } from '../../model/scale.model';
|
|
13
13
|
import { ChartAreaPanHandler } from '../chart/chart-area-pan.handler';
|
|
14
14
|
import { BaseType, ChartBaseModel } from '../chart/chart-base.model';
|
|
15
15
|
import { HitTestCanvasModel } from '../../model/hit-test-canvas.model';
|
|
16
|
+
import { MainCanvasTouchHandler } from '../../inputhandlers/main-canvas-touch.handler';
|
|
16
17
|
export declare class ChartPanComponent extends ChartBaseElement {
|
|
17
18
|
private eventBus;
|
|
18
19
|
private mainScale;
|
|
@@ -23,21 +24,9 @@ export declare class ChartPanComponent extends ChartBaseElement {
|
|
|
23
24
|
private mainCanvasParent;
|
|
24
25
|
chartBaseModel: ChartBaseModel<BaseType>;
|
|
25
26
|
private hitTestCanvasModel;
|
|
26
|
-
chartPanComponents: Array<ChartEntity>;
|
|
27
27
|
chartAreaPanHandler: ChartAreaPanHandler;
|
|
28
|
+
mainCanvasTouchHandler: MainCanvasTouchHandler;
|
|
28
29
|
constructor(eventBus: EventBus, mainScale: ScaleModel, canvasBoundsContainer: CanvasBoundsContainer, config: FullChartConfig, canvasAnimation: CanvasAnimation, canvasInputListener: CanvasInputListenerComponent, mainCanvasParent: Element, chartBaseModel: ChartBaseModel<BaseType>, hitTestCanvasModel: HitTestCanvasModel);
|
|
29
|
-
/**
|
|
30
|
-
* Activates the chart pan handlers.
|
|
31
|
-
* @protected
|
|
32
|
-
* @returns {void}
|
|
33
|
-
*/
|
|
34
|
-
protected doActivate(): void;
|
|
35
|
-
/**
|
|
36
|
-
* This method is used to deactivate the pan handlers.
|
|
37
|
-
* @returns {void}
|
|
38
|
-
* @protected
|
|
39
|
-
*/
|
|
40
|
-
protected doDeactivate(): void;
|
|
41
30
|
/**
|
|
42
31
|
* Activates user mouse handlers on main chart view.
|
|
43
32
|
* @function
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { ChartBaseElement } from '../../model/chart-base-element';
|
|
7
7
|
import { ChartAreaPanHandler } from '../chart/chart-area-pan.handler';
|
|
8
|
+
import { MainCanvasTouchHandler } from '../../inputhandlers/main-canvas-touch.handler';
|
|
8
9
|
export class ChartPanComponent extends ChartBaseElement {
|
|
9
10
|
constructor(eventBus, mainScale, canvasBoundsContainer, config, canvasAnimation, canvasInputListener, mainCanvasParent, chartBaseModel, hitTestCanvasModel) {
|
|
10
11
|
super();
|
|
@@ -17,25 +18,10 @@ export class ChartPanComponent extends ChartBaseElement {
|
|
|
17
18
|
this.mainCanvasParent = mainCanvasParent;
|
|
18
19
|
this.chartBaseModel = chartBaseModel;
|
|
19
20
|
this.hitTestCanvasModel = hitTestCanvasModel;
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Activates the chart pan handlers.
|
|
26
|
-
* @protected
|
|
27
|
-
* @returns {void}
|
|
28
|
-
*/
|
|
29
|
-
doActivate() {
|
|
30
|
-
this.activateChartPanHandlers();
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* This method is used to deactivate the pan handlers.
|
|
34
|
-
* @returns {void}
|
|
35
|
-
* @protected
|
|
36
|
-
*/
|
|
37
|
-
doDeactivate() {
|
|
38
|
-
this.deactivatePanHandlers();
|
|
21
|
+
this.chartAreaPanHandler = new ChartAreaPanHandler(this.eventBus, this.config, this.mainScale, this.canvasInputListener, this.canvasBoundsContainer, this.canvasAnimation, this, this.hitTestCanvasModel);
|
|
22
|
+
this.addChildEntity(this.chartAreaPanHandler);
|
|
23
|
+
this.mainCanvasTouchHandler = new MainCanvasTouchHandler(this.chartAreaPanHandler, this.mainScale, this.canvasInputListener, this.mainCanvasParent);
|
|
24
|
+
this.addChildEntity(this.mainCanvasTouchHandler);
|
|
39
25
|
}
|
|
40
26
|
/**
|
|
41
27
|
* Activates user mouse handlers on main chart view.
|
|
@@ -46,13 +32,13 @@ export class ChartPanComponent extends ChartBaseElement {
|
|
|
46
32
|
* @returns {void}
|
|
47
33
|
*/
|
|
48
34
|
activateChartPanHandlers() {
|
|
49
|
-
this.
|
|
35
|
+
this.activate();
|
|
50
36
|
}
|
|
51
37
|
/**
|
|
52
38
|
* Deactivates all the pan handlers of the chart.
|
|
53
39
|
*/
|
|
54
40
|
deactivatePanHandlers() {
|
|
55
|
-
this.
|
|
41
|
+
this.deactivate();
|
|
56
42
|
}
|
|
57
43
|
setChartPanningOptions(horizontal, vertical) {
|
|
58
44
|
this.chartAreaPanHandler.chartPanningOptions = { horizontal, vertical };
|
|
@@ -41,7 +41,7 @@ export class PaneHitTestController {
|
|
|
41
41
|
* @returns {void}
|
|
42
42
|
*/
|
|
43
43
|
onHover(model) {
|
|
44
|
-
this.allDataSeries.forEach(d => (d.
|
|
44
|
+
this.allDataSeries.forEach(d => (d.highlighted = d.htId === (model === null || model === void 0 ? void 0 : model.htId)));
|
|
45
45
|
this.canvasModel.fireDraw();
|
|
46
46
|
}
|
|
47
47
|
onMouseDown(model) {
|
|
@@ -71,11 +71,40 @@ export declare class PaneManager extends ChartBaseElement {
|
|
|
71
71
|
* @returns
|
|
72
72
|
*/
|
|
73
73
|
createPane(uuid?: string, options?: AtLeastOne<YExtentCreationOptions>): PaneComponent;
|
|
74
|
+
/**
|
|
75
|
+
* Moves the canvas bounds container up by calling the movePaneUp method with the uuid of the current object.
|
|
76
|
+
* @returns {void}
|
|
77
|
+
*/
|
|
78
|
+
movePaneUp(uuid: string): void;
|
|
79
|
+
/**
|
|
80
|
+
* Moves the canvas bounds container down by calling the movePaneDown method with the uuid of the current object.
|
|
81
|
+
* @returns {void}
|
|
82
|
+
*/
|
|
83
|
+
movePaneDown(uuid: string): void;
|
|
84
|
+
/**
|
|
85
|
+
* Checks if the current pane can move up.
|
|
86
|
+
* @returns {boolean} - Returns true if the current pane can move up, otherwise false.
|
|
87
|
+
*/
|
|
88
|
+
canMovePaneUp(uuid: string): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Checks if the current pane can move down.
|
|
91
|
+
*
|
|
92
|
+
* @returns {boolean} - Returns true if the current pane is not the last one in the canvasBoundsContainer, otherwise returns false.
|
|
93
|
+
*/
|
|
94
|
+
canMovePaneDown(uuid: string): boolean;
|
|
74
95
|
/**
|
|
75
96
|
* Removes pane from the chart and all related components
|
|
76
97
|
* @param uuid
|
|
77
98
|
*/
|
|
78
99
|
removePane(uuid: string): void;
|
|
100
|
+
/**
|
|
101
|
+
* Hides a pane from the chart and all related components
|
|
102
|
+
*/
|
|
103
|
+
hidePane(paneUUID: string): void;
|
|
104
|
+
/**
|
|
105
|
+
* Shows a pane, use if the pane is hidden
|
|
106
|
+
*/
|
|
107
|
+
showPane(paneUUID: string): void;
|
|
79
108
|
/**
|
|
80
109
|
* Adds cursors to the chart elements based on the provided uuid and cursor type.
|
|
81
110
|
* @private
|
|
@@ -12,7 +12,7 @@ import { BarResizerComponent } from '../resizer/bar-resizer.component';
|
|
|
12
12
|
import { createDefaultYExtentHighLowProvider, } from './extent/y-extent-component';
|
|
13
13
|
import { PaneHitTestController } from './pane-hit-test.controller';
|
|
14
14
|
import { PaneComponent } from './pane.component';
|
|
15
|
-
import { flatMap } from '../../utils/array.utils';
|
|
15
|
+
import { firstOf, flatMap, lastOf } from '../../utils/array.utils';
|
|
16
16
|
export class PaneManager extends ChartBaseElement {
|
|
17
17
|
/**
|
|
18
18
|
* Returns order of panes in the chart from top to bottom.
|
|
@@ -53,7 +53,7 @@ export class PaneManager extends ChartBaseElement {
|
|
|
53
53
|
}
|
|
54
54
|
addBounds(uuid, order) {
|
|
55
55
|
this.canvasBoundsContainer.addPaneBounds(uuid, order);
|
|
56
|
-
return () => this.canvasBoundsContainer.
|
|
56
|
+
return () => this.canvasBoundsContainer.removePaneBounds(uuid);
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
59
|
* Adds a resizer to the canvas bounds container for the given uuid.
|
|
@@ -110,19 +110,82 @@ export class PaneManager extends ChartBaseElement {
|
|
|
110
110
|
this.paneAddedSubject.next(this.panes);
|
|
111
111
|
return paneComponent;
|
|
112
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* Moves the canvas bounds container up by calling the movePaneUp method with the uuid of the current object.
|
|
115
|
+
* @returns {void}
|
|
116
|
+
*/
|
|
117
|
+
movePaneUp(uuid) {
|
|
118
|
+
this.canvasBoundsContainer.movePaneUp(uuid);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Moves the canvas bounds container down by calling the movePaneDown method with the uuid of the current object.
|
|
122
|
+
* @returns {void}
|
|
123
|
+
*/
|
|
124
|
+
movePaneDown(uuid) {
|
|
125
|
+
this.canvasBoundsContainer.movePaneDown(uuid);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Checks if the current pane can move up.
|
|
129
|
+
* @returns {boolean} - Returns true if the current pane can move up, otherwise false.
|
|
130
|
+
*/
|
|
131
|
+
canMovePaneUp(uuid) {
|
|
132
|
+
var _a, _b;
|
|
133
|
+
const firstVisiblePane = firstOf(this.canvasBoundsContainer.panesOrder.filter(uuid => { var _a, _b; return (_b = (_a = this.panes[uuid]) === null || _a === void 0 ? void 0 : _a.visible) !== null && _b !== void 0 ? _b : false; }));
|
|
134
|
+
return uuid !== firstVisiblePane && ((_b = (_a = this.panes[uuid]) === null || _a === void 0 ? void 0 : _a.visible) !== null && _b !== void 0 ? _b : false);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Checks if the current pane can move down.
|
|
138
|
+
*
|
|
139
|
+
* @returns {boolean} - Returns true if the current pane is not the last one in the canvasBoundsContainer, otherwise returns false.
|
|
140
|
+
*/
|
|
141
|
+
canMovePaneDown(uuid) {
|
|
142
|
+
var _a, _b;
|
|
143
|
+
const lastVisiblePane = lastOf(this.canvasBoundsContainer.panesOrder.filter(uuid => { var _a, _b; return (_b = (_a = this.panes[uuid]) === null || _a === void 0 ? void 0 : _a.visible) !== null && _b !== void 0 ? _b : false; }));
|
|
144
|
+
return uuid !== lastVisiblePane && ((_b = (_a = this.panes[uuid]) === null || _a === void 0 ? void 0 : _a.visible) !== null && _b !== void 0 ? _b : false);
|
|
145
|
+
}
|
|
113
146
|
/**
|
|
114
147
|
* Removes pane from the chart and all related components
|
|
115
148
|
* @param uuid
|
|
116
149
|
*/
|
|
117
150
|
removePane(uuid) {
|
|
118
151
|
const pane = this.panes[uuid];
|
|
119
|
-
if (pane
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
152
|
+
if (pane === undefined) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
this.paneRemovedSubject.next(pane);
|
|
156
|
+
pane.disable();
|
|
157
|
+
pane.yExtentComponents.forEach(yExtentComponent => yExtentComponent.disable());
|
|
158
|
+
delete this.panes[uuid];
|
|
159
|
+
this.recalculateState();
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Hides a pane from the chart and all related components
|
|
163
|
+
*/
|
|
164
|
+
hidePane(paneUUID) {
|
|
165
|
+
const pane = this.panes[paneUUID];
|
|
166
|
+
// hide pane only if we have more than one visible pane
|
|
167
|
+
if (pane === undefined || !pane.visible) {
|
|
168
|
+
return;
|
|
125
169
|
}
|
|
170
|
+
const paneResizerId = CanvasElement.PANE_UUID_RESIZER(paneUUID);
|
|
171
|
+
const resizer = this.userInputListenerComponents.find(el => el instanceof BarResizerComponent && el.id === paneResizerId);
|
|
172
|
+
resizer === null || resizer === void 0 ? void 0 : resizer.disable();
|
|
173
|
+
this.canvasBoundsContainer.hidePaneBounds(paneUUID);
|
|
174
|
+
this.recalculateState();
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Shows a pane, use if the pane is hidden
|
|
178
|
+
*/
|
|
179
|
+
showPane(paneUUID) {
|
|
180
|
+
const pane = this.panes[paneUUID];
|
|
181
|
+
const paneResizerId = CanvasElement.PANE_UUID_RESIZER(paneUUID);
|
|
182
|
+
if (pane === undefined || pane.visible) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
const resizer = this.userInputListenerComponents.find(el => el instanceof BarResizerComponent && el.id === paneResizerId);
|
|
186
|
+
resizer === null || resizer === void 0 ? void 0 : resizer.enable();
|
|
187
|
+
this.canvasBoundsContainer.showPaneBounds(paneUUID);
|
|
188
|
+
this.recalculateState();
|
|
126
189
|
}
|
|
127
190
|
/**
|
|
128
191
|
* Adds cursors to the chart elements based on the provided uuid and cursor type.
|
|
@@ -44,7 +44,6 @@ export declare class PaneComponent extends ChartBaseElement {
|
|
|
44
44
|
seriesAddedSubject: Subject<DataSeriesModel>;
|
|
45
45
|
seriesRemovedSubject: Subject<DataSeriesModel>;
|
|
46
46
|
private hitTestCanvasModel;
|
|
47
|
-
private _paneOrder;
|
|
48
47
|
/**
|
|
49
48
|
* Pane hit test (without Y-Axis and resizer)
|
|
50
49
|
*/
|
|
@@ -53,6 +52,7 @@ export declare class PaneComponent extends ChartBaseElement {
|
|
|
53
52
|
get scale(): ScaleModel;
|
|
54
53
|
get yAxis(): YAxisComponent;
|
|
55
54
|
get dataSeries(): DataSeriesModel<import("../../model/data-series.model").DataSeriesPoint, import("../../model/data-series.model").VisualSeriesPoint>[];
|
|
55
|
+
get visible(): boolean;
|
|
56
56
|
mainExtent: YExtentComponent;
|
|
57
57
|
constructor(chartBaseModel: ChartBaseModel<'candle'>, mainCanvasModel: CanvasModel, yAxisLabelsCanvasModel: CanvasModel, dynamicObjectsCanvasModel: CanvasModel, hitTestController: PaneHitTestController, config: FullChartConfig, mainScale: ScaleModel, drawingManager: DrawingManager, chartPanComponent: ChartPanComponent, canvasInputListener: CanvasInputListenerComponent, canvasAnimation: CanvasAnimation, cursorHandler: CursorHandler, eventBus: EventBus, canvasBoundsContainer: CanvasBoundsContainer, uuid: string, seriesAddedSubject: Subject<DataSeriesModel>, seriesRemovedSubject: Subject<DataSeriesModel>, hitTestCanvasModel: HitTestCanvasModel, options?: AtLeastOne<YExtentCreationOptions>);
|
|
58
58
|
/**
|
|
@@ -96,22 +96,6 @@ export declare class PaneComponent extends ChartBaseElement {
|
|
|
96
96
|
* Returns the bounds of the pane component.
|
|
97
97
|
*/
|
|
98
98
|
getBounds(): Bounds;
|
|
99
|
-
/**
|
|
100
|
-
* Hides the pane by removing its bounds from the canvasBoundsContainer and firing a draw event.
|
|
101
|
-
* @function
|
|
102
|
-
* @name hide
|
|
103
|
-
* @memberof PaneComponent
|
|
104
|
-
* @returns {void}
|
|
105
|
-
*/
|
|
106
|
-
hide(): void;
|
|
107
|
-
/**
|
|
108
|
-
* Adds the bounds of the pane to the canvas bounds container and fires a draw event.
|
|
109
|
-
* @function
|
|
110
|
-
* @name show
|
|
111
|
-
* @memberof PaneComponent
|
|
112
|
-
* @returns {void}
|
|
113
|
-
*/
|
|
114
|
-
show(): void;
|
|
115
99
|
/**
|
|
116
100
|
* Creates a new DataSeriesModel object.
|
|
117
101
|
* @returns {DataSeriesModel} - The newly created DataSeriesModel object.
|
|
@@ -140,22 +124,26 @@ export declare class PaneComponent extends ChartBaseElement {
|
|
|
140
124
|
/**
|
|
141
125
|
* Moves the canvas bounds container up by calling the movePaneUp method with the uuid of the current object.
|
|
142
126
|
* @returns {void}
|
|
127
|
+
* @deprecated Use `paneManager.movePaneUp()` instead
|
|
143
128
|
*/
|
|
144
129
|
moveUp(): void;
|
|
145
130
|
/**
|
|
146
131
|
* Moves the canvas bounds container down by calling the movePaneDown method with the uuid of the current object.
|
|
147
132
|
* @returns {void}
|
|
133
|
+
* @deprecated Use `paneManager.movePaneDown()` instead
|
|
148
134
|
*/
|
|
149
135
|
moveDown(): void;
|
|
150
136
|
/**
|
|
151
137
|
* Checks if the current pane can move up.
|
|
152
138
|
* @returns {boolean} - Returns true if the current pane can move up, otherwise false.
|
|
139
|
+
* @deprecated Use `paneManager.canMovePaneUp()` instead
|
|
153
140
|
*/
|
|
154
141
|
canMoveUp(): boolean;
|
|
155
142
|
/**
|
|
156
143
|
* Checks if the current pane can move down.
|
|
157
144
|
*
|
|
158
145
|
* @returns {boolean} - Returns true if the current pane is not the last one in the canvasBoundsContainer, otherwise returns false.
|
|
146
|
+
* @deprecated Use `paneManager.canMovePaneDown()` instead
|
|
159
147
|
*/
|
|
160
148
|
canMoveDown(): boolean;
|
|
161
149
|
valueFormatter: (value: Unit, dataSeries?: DataSeriesModel) => string;
|
|
@@ -22,6 +22,9 @@ export class PaneComponent extends ChartBaseElement {
|
|
|
22
22
|
get dataSeries() {
|
|
23
23
|
return flatMap(this.yExtentComponents, c => Array.from(c.dataSeries));
|
|
24
24
|
}
|
|
25
|
+
get visible() {
|
|
26
|
+
return this.canvasBoundsContainer.graphsHeightRatio[this.uuid] > 0;
|
|
27
|
+
}
|
|
25
28
|
constructor(chartBaseModel, mainCanvasModel, yAxisLabelsCanvasModel, dynamicObjectsCanvasModel, hitTestController, config, mainScale, drawingManager, chartPanComponent, canvasInputListener, canvasAnimation, cursorHandler, eventBus, canvasBoundsContainer, uuid, seriesAddedSubject, seriesRemovedSubject, hitTestCanvasModel, options) {
|
|
26
29
|
super();
|
|
27
30
|
this.chartBaseModel = chartBaseModel;
|
|
@@ -42,7 +45,6 @@ export class PaneComponent extends ChartBaseElement {
|
|
|
42
45
|
this.seriesAddedSubject = seriesAddedSubject;
|
|
43
46
|
this.seriesRemovedSubject = seriesRemovedSubject;
|
|
44
47
|
this.hitTestCanvasModel = hitTestCanvasModel;
|
|
45
|
-
this._paneOrder = 0;
|
|
46
48
|
this.yExtentComponents = [];
|
|
47
49
|
this.getYAxisBounds = () => {
|
|
48
50
|
return this.canvasBoundsContainer.getBounds(CanvasElement.PANE_UUID_Y_AXIS(this.uuid));
|
|
@@ -176,29 +178,6 @@ export class PaneComponent extends ChartBaseElement {
|
|
|
176
178
|
getBounds() {
|
|
177
179
|
return this.mainExtent.getBounds();
|
|
178
180
|
}
|
|
179
|
-
/**
|
|
180
|
-
* Hides the pane by removing its bounds from the canvasBoundsContainer and firing a draw event.
|
|
181
|
-
* @function
|
|
182
|
-
* @name hide
|
|
183
|
-
* @memberof PaneComponent
|
|
184
|
-
* @returns {void}
|
|
185
|
-
*/
|
|
186
|
-
hide() {
|
|
187
|
-
this._paneOrder = this.canvasBoundsContainer.panesOrder.indexOf(this.uuid);
|
|
188
|
-
this.canvasBoundsContainer.removedPaneBounds(this.uuid);
|
|
189
|
-
this.eventBus.fireDraw();
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Adds the bounds of the pane to the canvas bounds container and fires a draw event.
|
|
193
|
-
* @function
|
|
194
|
-
* @name show
|
|
195
|
-
* @memberof PaneComponent
|
|
196
|
-
* @returns {void}
|
|
197
|
-
*/
|
|
198
|
-
show() {
|
|
199
|
-
this.canvasBoundsContainer.addPaneBounds(this.uuid, this._paneOrder);
|
|
200
|
-
this.eventBus.fireDraw();
|
|
201
|
-
}
|
|
202
181
|
/**
|
|
203
182
|
* Creates a new DataSeriesModel object.
|
|
204
183
|
* @returns {DataSeriesModel} - The newly created DataSeriesModel object.
|
|
@@ -239,6 +218,7 @@ export class PaneComponent extends ChartBaseElement {
|
|
|
239
218
|
/**
|
|
240
219
|
* Moves the canvas bounds container up by calling the movePaneUp method with the uuid of the current object.
|
|
241
220
|
* @returns {void}
|
|
221
|
+
* @deprecated Use `paneManager.movePaneUp()` instead
|
|
242
222
|
*/
|
|
243
223
|
moveUp() {
|
|
244
224
|
this.canvasBoundsContainer.movePaneUp(this.uuid);
|
|
@@ -246,6 +226,7 @@ export class PaneComponent extends ChartBaseElement {
|
|
|
246
226
|
/**
|
|
247
227
|
* Moves the canvas bounds container down by calling the movePaneDown method with the uuid of the current object.
|
|
248
228
|
* @returns {void}
|
|
229
|
+
* @deprecated Use `paneManager.movePaneDown()` instead
|
|
249
230
|
*/
|
|
250
231
|
moveDown() {
|
|
251
232
|
this.canvasBoundsContainer.movePaneDown(this.uuid);
|
|
@@ -253,19 +234,21 @@ export class PaneComponent extends ChartBaseElement {
|
|
|
253
234
|
/**
|
|
254
235
|
* Checks if the current pane can move up.
|
|
255
236
|
* @returns {boolean} - Returns true if the current pane can move up, otherwise false.
|
|
237
|
+
* @deprecated Use `paneManager.canMovePaneUp()` instead
|
|
256
238
|
*/
|
|
257
239
|
canMoveUp() {
|
|
258
|
-
const
|
|
259
|
-
return this.uuid !==
|
|
240
|
+
const firstVisiblePane = firstOf(this.canvasBoundsContainer.panesOrder.filter(uuid => this.canvasBoundsContainer.graphsHeightRatio[uuid] > 0));
|
|
241
|
+
return this.uuid !== firstVisiblePane && this.visible;
|
|
260
242
|
}
|
|
261
243
|
/**
|
|
262
244
|
* Checks if the current pane can move down.
|
|
263
245
|
*
|
|
264
246
|
* @returns {boolean} - Returns true if the current pane is not the last one in the canvasBoundsContainer, otherwise returns false.
|
|
247
|
+
* @deprecated Use `paneManager.canMovePaneDown()` instead
|
|
265
248
|
*/
|
|
266
249
|
canMoveDown() {
|
|
267
|
-
const
|
|
268
|
-
return this.uuid !==
|
|
250
|
+
const lastVisiblePane = lastOf(this.canvasBoundsContainer.panesOrder.filter(uuid => this.canvasBoundsContainer.graphsHeightRatio[uuid] > 0));
|
|
251
|
+
return this.uuid !== lastVisiblePane && this.visible;
|
|
269
252
|
}
|
|
270
253
|
get regularFormatter() {
|
|
271
254
|
return this.mainExtent.formatters.regular;
|
|
@@ -22,7 +22,7 @@ import { HitTestCanvasModel } from '../../model/hit-test-canvas.model';
|
|
|
22
22
|
* @doc-tags chart-core,resizer
|
|
23
23
|
*/
|
|
24
24
|
export declare class BarResizerComponent extends ChartBaseElement {
|
|
25
|
-
|
|
25
|
+
readonly id: string;
|
|
26
26
|
private boundsProvider;
|
|
27
27
|
private hitTest;
|
|
28
28
|
private dragTickCb;
|
|
@@ -39,6 +39,7 @@ export class BarResizerComponent extends ChartBaseElement {
|
|
|
39
39
|
this.initialY = this.boundsProvider().y;
|
|
40
40
|
// Stop redrawing hit test
|
|
41
41
|
this.hitTestCanvasModel.hitTestDrawersPredicateSubject.next(false);
|
|
42
|
+
this.chartPanComponent.deactivatePanHandlers();
|
|
42
43
|
};
|
|
43
44
|
this.onYDragEnd = () => {
|
|
44
45
|
this.config.components.crossTool.type = 'cross-and-labels';
|
|
@@ -46,6 +47,7 @@ export class BarResizerComponent extends ChartBaseElement {
|
|
|
46
47
|
this.canvasBoundsContainer.graphsHeightRatioChangedSubject.next(this.canvasBoundsContainer.graphsHeightRatio);
|
|
47
48
|
// Continue redrawing hit test
|
|
48
49
|
this.hitTestCanvasModel.hitTestDrawersPredicateSubject.next(true);
|
|
50
|
+
this.chartPanComponent.activateChartPanHandlers();
|
|
49
51
|
};
|
|
50
52
|
this.onYDragTick = (dragInfo) => {
|
|
51
53
|
const { delta: yDelta, draggedPixels } = dragInfo;
|
|
@@ -75,7 +77,7 @@ export class BarResizerComponent extends ChartBaseElement {
|
|
|
75
77
|
const dragNDropYComponent = new DragNDropYComponent(this.hitTest, {
|
|
76
78
|
onDragTick: this.onYDragTick,
|
|
77
79
|
onDragStart: this.onYDragStart,
|
|
78
|
-
onDragEnd: this.onYDragEnd
|
|
80
|
+
onDragEnd: this.onYDragEnd,
|
|
79
81
|
}, this.canvasInputListener, this.chartPanComponent, {
|
|
80
82
|
dragPredicate: this.dragPredicate,
|
|
81
83
|
});
|
|
@@ -25,7 +25,7 @@ export class VolumesComponent extends ChartBaseElement {
|
|
|
25
25
|
this.addChildEntity(volumesModel);
|
|
26
26
|
this.separateVolumes = new SeparateVolumesComponent(chartComponent, drawingManager, config, volumesModel, paneManager);
|
|
27
27
|
this.volumesDrawer = new VolumesDrawer(config, this.volumesModel, chartComponent.chartModel, () => { var _a, _b; return (this.config.components.volumes.showSeparately ? (_b = (_a = this.separateVolumes.pane) === null || _a === void 0 ? void 0 : _a.scale) !== null && _b !== void 0 ? _b : scale : scale); }, this.volumesColorByChartTypeMap, () => true);
|
|
28
|
-
config.components.volumes.visible && this.
|
|
28
|
+
config.components.volumes.visible && this.syncVolumesDynamicObject();
|
|
29
29
|
this.addChildEntity(this.separateVolumes);
|
|
30
30
|
this.registerDefaultVolumeColorResolvers();
|
|
31
31
|
this.volumeVisibilityChangedSubject.next(config.components.volumes.visible);
|
|
@@ -58,6 +58,7 @@ export class VolumesComponent extends ChartBaseElement {
|
|
|
58
58
|
this.separateVolumes.deactiveSeparateVolumes();
|
|
59
59
|
}
|
|
60
60
|
this.volumeIsSeparateModeChangedSubject.next(separate);
|
|
61
|
+
this.syncVolumesDynamicObject();
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
64
|
/**
|
|
@@ -84,9 +85,6 @@ export class VolumesComponent extends ChartBaseElement {
|
|
|
84
85
|
setVisible(visible = true) {
|
|
85
86
|
this.config.components.volumes.visible = visible;
|
|
86
87
|
this.volumeVisibilityChangedSubject.next(visible);
|
|
87
|
-
visible
|
|
88
|
-
? this.addVolumesToDynamicObjects()
|
|
89
|
-
: this.dynamicObjectsComponent.model.removeObject(this.volumesModel.id);
|
|
90
88
|
if (this.config.components.volumes.showSeparately) {
|
|
91
89
|
if (visible) {
|
|
92
90
|
this.separateVolumes.activateSeparateVolumes();
|
|
@@ -98,19 +96,28 @@ export class VolumesComponent extends ChartBaseElement {
|
|
|
98
96
|
}
|
|
99
97
|
}
|
|
100
98
|
this.canvasBoundsContainer.recalculatePanesHeightRatios();
|
|
99
|
+
this.syncVolumesDynamicObject();
|
|
101
100
|
this.canvasModel.fireDraw();
|
|
102
101
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
102
|
+
syncVolumesDynamicObject() {
|
|
103
|
+
const visible = this.config.components.volumes.visible;
|
|
104
|
+
if (!visible) {
|
|
105
|
+
this.dynamicObjectsComponent.model.removeObject(this.volumesModel.id);
|
|
107
106
|
return;
|
|
108
107
|
}
|
|
109
|
-
this.
|
|
108
|
+
const paneId = this.config.components.volumes.showSeparately ? VOLUMES_UUID : CHART_UUID;
|
|
109
|
+
const volumesDynamicObject = {
|
|
110
110
|
id: this.volumesModel.id,
|
|
111
|
-
paneId
|
|
111
|
+
paneId,
|
|
112
112
|
drawer: this.volumesDrawer,
|
|
113
113
|
model: this.volumesModel,
|
|
114
|
-
}
|
|
114
|
+
};
|
|
115
|
+
// check if the volumes dynamic object is already added
|
|
116
|
+
const position = this.dynamicObjectsComponent.model.getObjectPosition(this.volumesModel.id);
|
|
117
|
+
if (position === -1) {
|
|
118
|
+
this.dynamicObjectsComponent.model.addObject(volumesDynamicObject);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
this.dynamicObjectsComponent.model.updateObject(volumesDynamicObject);
|
|
115
122
|
}
|
|
116
123
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
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
|
*/
|
|
6
6
|
import { Subject } from 'rxjs';
|
|
7
|
-
import { CanvasElement } from '../../canvas/canvas-bounds-container';
|
|
7
|
+
import { CanvasElement, DEFAULT_MIN_PANE_HEIGHT } from '../../canvas/canvas-bounds-container';
|
|
8
8
|
import { ChartBaseElement } from '../../model/chart-base-element';
|
|
9
9
|
import { DragNDropYComponent } from '../dran-n-drop_helper/drag-n-drop-y.component';
|
|
10
10
|
// if you drag full Y height from top to bottom - you will have x3 zoom, and vice-versa
|
|
@@ -35,7 +35,7 @@ export class YAxisScaleHandler extends ChartBaseElement {
|
|
|
35
35
|
this.lastYStart = this.scale.yStart;
|
|
36
36
|
this.lastYEnd = this.scale.yEnd;
|
|
37
37
|
this.lastYHeight = this.scale.yEnd - this.scale.yStart;
|
|
38
|
-
this.lastYPxHeight = this.bounds.getBounds(CanvasElement.Y_AXIS).height;
|
|
38
|
+
this.lastYPxHeight = Math.max(this.bounds.getBounds(CanvasElement.Y_AXIS).height, DEFAULT_MIN_PANE_HEIGHT);
|
|
39
39
|
// Stop redrawing hit test
|
|
40
40
|
this.hitTestCanvasModel.hitTestDrawersPredicateSubject.next(false);
|
|
41
41
|
};
|
|
@@ -73,7 +73,7 @@ export class YAxisScaleHandler extends ChartBaseElement {
|
|
|
73
73
|
onDragStart: this.onYDragStart,
|
|
74
74
|
onDragEnd: this.onYDragEnd,
|
|
75
75
|
}, canvasInputListener, panning, {
|
|
76
|
-
dragPredicate: () => panning.chartAreaPanHandler.chartPanningOptions.vertical && config.type !== 'percent'
|
|
76
|
+
dragPredicate: () => panning.chartAreaPanHandler.chartPanningOptions.vertical && config.type !== 'percent',
|
|
77
77
|
});
|
|
78
78
|
this.addChildEntity(dragNDropYComponent);
|
|
79
79
|
}
|
|
@@ -176,7 +176,7 @@ export class YAxisComponent extends ChartBaseElement {
|
|
|
176
176
|
setVisible(isVisible) {
|
|
177
177
|
this.state.visible = isVisible;
|
|
178
178
|
this.config.components.yAxis.visible = isVisible;
|
|
179
|
-
isVisible ? this.
|
|
179
|
+
isVisible ? this.activate() : this.deactivate();
|
|
180
180
|
this.model.fancyLabelsModel.updateLabels();
|
|
181
181
|
this.model.baseLabelsModel.updateLabels();
|
|
182
182
|
}
|
|
@@ -47,7 +47,7 @@ export const setLineWidth = (ctx, lineWidth, dataSeries, drawerConfig, seriesSel
|
|
|
47
47
|
if (drawerConfig.forceBold) {
|
|
48
48
|
ctx.lineWidth = drawerConfig.forceBold;
|
|
49
49
|
}
|
|
50
|
-
else if (dataSeries.
|
|
50
|
+
else if (dataSeries.highlighted) {
|
|
51
51
|
ctx.lineWidth = lineWidth !== seriesSelectedWidth ? lineWidth + 1 : seriesSelectedWidth;
|
|
52
52
|
}
|
|
53
53
|
else {
|
|
@@ -58,7 +58,7 @@ export declare class HoverProducerComponent extends ChartBaseElement {
|
|
|
58
58
|
private longTouchActivatedSubject;
|
|
59
59
|
private hoverProducerParts;
|
|
60
60
|
xFormatter: DateTimeFormatter;
|
|
61
|
-
constructor(crossEventProducer: CrossEventProducerComponent, scale: ScaleModel, config: FullChartConfig, chartModel: ChartModel, canvasInputListener: CanvasInputListenerComponent, canvasBoundsContainer: CanvasBoundsContainer, paneManager: PaneManager, timeZoneModel: TimeZoneModel, formatterFactory: (format: string) => (timestamp: number
|
|
61
|
+
constructor(crossEventProducer: CrossEventProducerComponent, scale: ScaleModel, config: FullChartConfig, chartModel: ChartModel, canvasInputListener: CanvasInputListenerComponent, canvasBoundsContainer: CanvasBoundsContainer, paneManager: PaneManager, timeZoneModel: TimeZoneModel, formatterFactory: (format: string) => (timestamp: number) => string);
|
|
62
62
|
/**
|
|
63
63
|
* This method is responsible for activating the chart hover functionality. It subscribes to several observables to
|
|
64
64
|
* update the hover when the chart is updated or when the user interacts with it. It also handles special behavior
|