@devexperts/dxcharts-lite 1.0.2 → 2.0.0
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/README.md +2 -2
- package/dist/chart/animation/canvas-animation.js +134 -1
- package/dist/chart/animation/types/animation.js +43 -1
- package/dist/chart/animation/types/color-alpha-animation.d.ts +1 -1
- package/dist/chart/animation/types/color-alpha-animation.js +60 -1
- package/dist/chart/animation/types/color-transition-animation.d.ts +1 -1
- package/dist/chart/animation/types/color-transition-animation.js +86 -1
- package/dist/chart/animation/types/viewport-movement-animation.js +63 -1
- package/dist/chart/animation/viewport-model-animation.js +20 -1
- package/dist/chart/bootstrap.d.ts +51 -48
- package/dist/chart/bootstrap.js +449 -1
- package/dist/chart/canvas/canvas-bounds-container.d.ts +0 -5
- package/dist/chart/canvas/canvas-bounds-container.js +815 -1
- package/dist/chart/canvas/canvas-chart-html.js +16 -18
- package/dist/chart/canvas/chart-elements.d.ts +1 -4
- package/dist/chart/canvas/chart-elements.js +22 -1
- package/dist/chart/canvas/cursor.handler.js +122 -1
- package/dist/chart/canvas/layout-creator.js +34 -1
- package/dist/chart/canvas/y-axis-bounds.container.d.ts +2 -2
- package/dist/chart/canvas/y-axis-bounds.container.js +67 -1
- package/dist/chart/chart-container.js +1 -1
- package/dist/chart/chart.config.d.ts +4 -5
- package/dist/chart/chart.config.js +645 -1
- package/dist/chart/chart.d.ts +62 -0
- package/dist/chart/chart.js +106 -0
- package/dist/chart/components/chart/basic-scale.d.ts +2 -2
- package/dist/chart/components/chart/basic-scale.js +31 -1
- package/dist/chart/components/chart/candle-transformer.functions.js +15 -1
- package/dist/chart/components/chart/candle-width-calculator.functions.js +2 -1
- package/dist/chart/components/chart/candle.functions.js +44 -1
- package/dist/chart/components/chart/chart-area-pan.handler.d.ts +3 -3
- package/dist/chart/components/chart/chart-area-pan.handler.js +197 -1
- package/dist/chart/components/chart/chart-base.model.js +66 -1
- package/dist/chart/components/chart/chart.component.d.ts +7 -3
- package/dist/chart/components/chart/chart.component.js +408 -1
- package/dist/chart/components/chart/chart.model.d.ts +4 -11
- package/dist/chart/components/chart/chart.model.js +954 -1
- package/dist/chart/components/chart/data-series.high-low-provider.js +34 -1
- package/dist/chart/components/chart/fake-candles.js +97 -1
- package/dist/chart/components/chart/price.formatter.js +35 -1
- package/dist/chart/components/chart/secondary-chart-colors-pool.js +68 -1
- package/dist/chart/components/cross_tool/cross-tool.component.js +85 -1
- package/dist/chart/components/cross_tool/cross-tool.drawer.js +32 -1
- package/dist/chart/components/cross_tool/cross-tool.model.js +107 -1
- package/dist/chart/components/cross_tool/types/cross-and-labels.drawer.js +137 -1
- package/dist/chart/components/cross_tool/types/none.drawer.js +3 -1
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop-x.component.js +28 -1
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop-y.component.js +24 -1
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop.component.js +53 -1
- package/dist/chart/components/dynamic-objects/dynamic-objects.component.d.ts +13 -0
- package/dist/chart/components/dynamic-objects/dynamic-objects.component.js +20 -0
- package/dist/chart/components/dynamic-objects/dynamic-objects.drawer.d.ts +18 -0
- package/dist/chart/components/dynamic-objects/dynamic-objects.drawer.js +23 -0
- package/dist/chart/components/dynamic-objects/dynamic-objects.model.d.ts +63 -0
- package/dist/chart/components/dynamic-objects/dynamic-objects.model.js +136 -0
- package/dist/chart/components/events/events-hit-test.drawer.js +63 -1
- package/dist/chart/components/events/events.component.js +61 -1
- package/dist/chart/components/events/events.drawer.js +195 -1
- package/dist/chart/components/events/events.model.js +69 -1
- package/dist/chart/components/grid/grid.component.d.ts +2 -2
- package/dist/chart/components/grid/grid.component.js +31 -1
- package/dist/chart/components/grid/grid.drawer.d.ts +4 -3
- package/dist/chart/components/grid/grid.drawer.js +106 -1
- package/dist/chart/components/high_low/high-low.component.js +12 -1
- package/dist/chart/components/high_low/high-low.drawer.js +126 -1
- package/dist/chart/components/highlights/highlights.component.js +46 -1
- package/dist/chart/components/highlights/highlights.drawer.js +154 -1
- package/dist/chart/components/highlights/highlights.model.js +75 -1
- package/dist/chart/components/labels_generator/numeric-axis-labels.generator.d.ts +1 -1
- package/dist/chart/components/labels_generator/numeric-axis-labels.generator.js +199 -1
- package/dist/chart/components/navigation_map/navigation-map-move.handler.d.ts +2 -2
- package/dist/chart/components/navigation_map/navigation-map-move.handler.js +108 -1
- package/dist/chart/components/navigation_map/navigation-map.component.js +112 -1
- package/dist/chart/components/navigation_map/navigation-map.drawer.js +244 -1
- package/dist/chart/components/navigation_map/navigation-map.model.js +33 -2
- package/dist/chart/components/pan/chart-pan.component.d.ts +2 -2
- package/dist/chart/components/pan/chart-pan.component.js +51 -1
- package/dist/chart/components/pane/extent/y-extent-component.d.ts +12 -18
- package/dist/chart/components/pane/extent/y-extent-component.js +120 -1
- package/dist/chart/components/pane/pane-hit-test.controller.js +55 -1
- package/dist/chart/components/pane/pane-manager.component.d.ts +10 -5
- package/dist/chart/components/pane/pane-manager.component.js +148 -1
- package/dist/chart/components/pane/pane.component.d.ts +16 -32
- package/dist/chart/components/pane/pane.component.js +278 -1
- package/dist/chart/components/resizer/bar-resizer.component.js +139 -1
- package/dist/chart/components/resizer/bar-resizer.drawer.js +46 -1
- package/dist/chart/components/snapshot/snapshot.component.js +48 -1
- package/dist/chart/components/volumes/separate-volumes.component.d.ts +6 -10
- package/dist/chart/components/volumes/separate-volumes.component.js +63 -1
- package/dist/chart/components/volumes/volume-color-resolvers.functions.js +18 -1
- package/dist/chart/components/volumes/volumes.component.d.ts +6 -7
- package/dist/chart/components/volumes/volumes.component.js +94 -1
- package/dist/chart/components/volumes/volumes.drawer.d.ts +5 -12
- package/dist/chart/components/volumes/volumes.drawer.js +140 -1
- package/dist/chart/components/volumes/volumes.formatter.js +31 -1
- package/dist/chart/components/volumes/volumes.model.d.ts +2 -2
- package/dist/chart/components/volumes/volumes.model.js +43 -1
- package/dist/chart/components/watermark/water-mark.component.js +103 -1
- package/dist/chart/components/watermark/water-mark.drawer.js +187 -1
- package/dist/chart/components/x_axis/numeric-x-axis-labels.generator.js +27 -1
- package/dist/chart/components/x_axis/time/parser/time-formats-matchers.functions.js +187 -1
- package/dist/chart/components/x_axis/time/parser/time-formats-parser.functions.js +76 -1
- package/dist/chart/components/x_axis/time/parser/time-formats-validators.functions.js +79 -1
- package/dist/chart/components/x_axis/time/parser/time-formats.model.js +14 -1
- package/dist/chart/components/x_axis/time/x-axis-weights.functions.d.ts +1 -1
- package/dist/chart/components/x_axis/time/x-axis-weights.functions.js +143 -1
- package/dist/chart/components/x_axis/time/x-axis-weights.generator.js +73 -1
- package/dist/chart/components/x_axis/x-axis-draw.functions.js +49 -1
- package/dist/chart/components/x_axis/x-axis-labels.drawer.js +70 -1
- package/dist/chart/components/x_axis/x-axis-labels.generator.d.ts +2 -2
- package/dist/chart/components/x_axis/x-axis-labels.generator.js +332 -1
- package/dist/chart/components/x_axis/x-axis-labels.model.js +35 -1
- package/dist/chart/components/x_axis/x-axis-scale.handler.d.ts +2 -2
- package/dist/chart/components/x_axis/x-axis-scale.handler.js +60 -1
- package/dist/chart/components/x_axis/x-axis-time-labels.drawer.js +82 -1
- package/dist/chart/components/x_axis/x-axis.component.d.ts +2 -2
- package/dist/chart/components/x_axis/x-axis.component.js +119 -1
- package/dist/chart/components/y_axis/label-color.functions.js +53 -1
- package/dist/chart/components/y_axis/numeric-y-axis-labels.generator.d.ts +4 -4
- package/dist/chart/components/y_axis/numeric-y-axis-labels.generator.js +33 -1
- package/dist/chart/components/y_axis/price_labels/data-series-y-axis-labels.provider.d.ts +3 -3
- package/dist/chart/components/y_axis/price_labels/data-series-y-axis-labels.provider.js +67 -1
- package/dist/chart/components/y_axis/price_labels/labels-positions-calculator.js +56 -1
- package/dist/chart/components/y_axis/price_labels/last-candle-labels.provider.js +95 -1
- package/dist/chart/components/y_axis/price_labels/price-label.drawer.d.ts +2 -2
- package/dist/chart/components/y_axis/price_labels/price-label.drawer.js +119 -1
- package/dist/chart/components/y_axis/price_labels/y-axis-labels.model.d.ts +9 -8
- package/dist/chart/components/y_axis/price_labels/y-axis-labels.model.js +201 -1
- package/dist/chart/components/y_axis/price_labels/y-axis-price-labels.drawer.d.ts +6 -7
- package/dist/chart/components/y_axis/price_labels/y-axis-price-labels.drawer.js +58 -1
- package/dist/chart/components/y_axis/y-axis-base-labels.model.d.ts +6 -4
- package/dist/chart/components/y_axis/y-axis-base-labels.model.js +47 -1
- package/dist/chart/components/y_axis/y-axis-labels.drawer.d.ts +4 -4
- package/dist/chart/components/y_axis/y-axis-labels.drawer.js +161 -1
- package/dist/chart/components/y_axis/y-axis-scale.handler.d.ts +2 -2
- package/dist/chart/components/y_axis/y-axis-scale.handler.js +72 -1
- package/dist/chart/components/y_axis/y-axis.component.d.ts +32 -41
- package/dist/chart/components/y_axis/y-axis.component.js +220 -1
- package/dist/chart/components/y_axis/y-axis.drawer.d.ts +9 -12
- package/dist/chart/components/y_axis/y-axis.drawer.js +96 -1
- package/dist/chart/components/y_axis/y-axis.model.d.ts +9 -17
- package/dist/chart/components/y_axis/y-axis.model.js +33 -1
- package/dist/chart/drawers/chart-background.drawer.js +69 -1
- package/dist/chart/drawers/chart-type-drawers/area.drawer.js +69 -1
- package/dist/chart/drawers/chart-type-drawers/bar.drawer.js +57 -1
- package/dist/chart/drawers/chart-type-drawers/baseline.drawer.js +84 -1
- package/dist/chart/drawers/chart-type-drawers/candle.drawer.js +162 -1
- package/dist/chart/drawers/chart-type-drawers/histogram.drawer.js +57 -1
- package/dist/chart/drawers/chart-type-drawers/line.drawer.js +38 -1
- package/dist/chart/drawers/chart-type-drawers/scatter-plot.drawer.js +19 -1
- package/dist/chart/drawers/clear-canvas.drawer.js +14 -1
- package/dist/chart/drawers/composite.drawer.js +67 -1
- package/dist/chart/drawers/data-series-drawers/candle-series-wrapper.js +50 -1
- package/dist/chart/drawers/data-series-drawers/color-candle.drawer.js +35 -1
- package/dist/chart/drawers/data-series-drawers/data-series-drawers.utils.js +16 -1
- package/dist/chart/drawers/data-series-drawers/difference-cloud.drawer.js +106 -1
- package/dist/chart/drawers/data-series-drawers/histogram.drawer.js +23 -1
- package/dist/chart/drawers/data-series-drawers/linear.drawer.js +19 -1
- package/dist/chart/drawers/data-series-drawers/points.drawer.js +19 -1
- package/dist/chart/drawers/data-series-drawers/rectangular-tool.drawer.js +7 -1
- package/dist/chart/drawers/data-series-drawers/text.drawer.js +25 -1
- package/dist/chart/drawers/data-series-drawers/trend-histogram.drawer.js +35 -1
- package/dist/chart/drawers/data-series-drawers/triangle.drawer.js +22 -1
- package/dist/chart/drawers/data-series.drawer.d.ts +5 -7
- package/dist/chart/drawers/data-series.drawer.js +56 -1
- package/dist/chart/drawers/drawing-manager.d.ts +1 -1
- package/dist/chart/drawers/drawing-manager.js +177 -1
- package/dist/chart/drawers/ht-data-series.drawer.js +37 -1
- package/dist/chart/events/event-bus.js +73 -1
- package/dist/chart/events/events.js +3 -1
- package/dist/chart/inputhandlers/candle-tap.handler.js +46 -1
- package/dist/chart/inputhandlers/chart-resize.handler.js +98 -1
- package/dist/chart/inputhandlers/cross-event-producer.component.js +67 -1
- package/dist/chart/inputhandlers/hover-producer.component.d.ts +2 -2
- package/dist/chart/inputhandlers/hover-producer.component.js +228 -1
- package/dist/chart/inputhandlers/main-canvas-touch.handler.d.ts +2 -2
- package/dist/chart/inputhandlers/main-canvas-touch.handler.js +80 -1
- package/dist/chart/inputlisteners/canvas-input-listener.component.js +629 -1
- package/dist/chart/model/baseline.model.js +88 -1
- package/dist/chart/model/bounds.model.js +1 -1
- package/dist/chart/model/candle-hover.js +70 -1
- package/dist/chart/model/candle-series-high-low.provider.js +45 -1
- package/dist/chart/model/candle-series.model.d.ts +3 -3
- package/dist/chart/model/candle-series.model.js +245 -1
- package/dist/chart/model/candle.model.js +69 -1
- package/dist/chart/model/canvas.model.js +228 -1
- package/dist/chart/model/chart-base-element.js +129 -1
- package/dist/chart/model/compare-series-hover.js +25 -1
- package/dist/chart/model/data-series-view.d.ts +5 -5
- package/dist/chart/model/data-series-view.js +111 -1
- package/dist/chart/model/data-series.config.js +14 -1
- package/dist/chart/model/data-series.model.d.ts +4 -4
- package/dist/chart/model/data-series.model.js +281 -1
- package/dist/chart/model/date-time.formatter.js +151 -1
- package/dist/chart/model/hit-test-canvas.model.d.ts +1 -1
- package/dist/chart/model/hit-test-canvas.model.js +256 -1
- package/dist/chart/model/main-candle-series.model.d.ts +1 -1
- package/dist/chart/model/main-candle-series.model.js +29 -1
- package/dist/chart/model/scale.model.d.ts +2 -1
- package/dist/chart/model/scale.model.js +316 -1
- package/dist/chart/model/scaling/auto-scale.model.js +97 -1
- package/dist/chart/model/scaling/constrait.functions.js +61 -1
- package/dist/chart/model/scaling/lock-ratio.model.js +17 -1
- package/dist/chart/model/scaling/move-chart.functions.js +22 -1
- package/dist/chart/model/scaling/viewport.model.d.ts +2 -2
- package/dist/chart/model/scaling/viewport.model.js +279 -1
- package/dist/chart/model/scaling/x-zooming.functions.js +35 -1
- package/dist/chart/model/time-zone.model.js +109 -1
- package/dist/chart/model/visual-candle.js +134 -1
- package/dist/chart/utils/__tests__/array.utils.test.js +135 -1
- package/dist/chart/utils/__tests__/math.utils.test.js +14 -1
- package/dist/chart/utils/__tests__/object.utils.test.js +11 -1
- package/dist/chart/utils/__tests__/priceIncrementsUtils.test.js +29 -1
- package/dist/chart/utils/array.utils.d.ts +1 -1
- package/dist/chart/utils/array.utils.js +269 -1
- package/dist/chart/utils/auto-period-detector.utils.js +39 -1
- package/dist/chart/utils/candles-generator-ts.utils.js +20 -1
- package/dist/chart/utils/candles-generator.utils.js +161 -1
- package/dist/chart/utils/candles.utils.js +42 -1
- package/dist/chart/utils/canvas/canvas-drawing-functions.utils.js +144 -1
- package/dist/chart/utils/canvas/canvas-font-measure-tool.utils.js +51 -1
- package/dist/chart/utils/canvas/canvas-text-functions.utils.js +156 -1
- package/dist/chart/utils/color.utils.js +31 -1
- package/dist/chart/utils/device/browser.utils.js +10 -1
- package/dist/chart/utils/device/device-detector.utils.js +24 -1
- package/dist/chart/utils/device/device-pixel-ratio.utils.js +21 -1
- package/dist/chart/utils/device/touchpad.utils.js +91 -1
- package/dist/chart/utils/dom.utils.js +15 -1
- package/dist/chart/utils/function.utils.js +16 -1
- package/dist/chart/utils/linkedList.utils.d.ts +28 -0
- package/dist/chart/utils/linkedList.utils.js +138 -0
- package/dist/chart/utils/math.utils.js +115 -1
- package/dist/chart/utils/merge.utils.js +56 -1
- package/dist/chart/utils/object.utils.js +43 -1
- package/dist/chart/utils/performance/animation-frame-cache.utils.js +77 -0
- package/dist/chart/utils/{perfomance → performance}/debounce.utils.js +7 -1
- package/dist/chart/utils/performance/memoize.utils.js +74 -0
- package/dist/chart/utils/performance/request-animation-frame-throttle.utils.js +43 -0
- package/dist/chart/utils/performance/throttle.utils.js +26 -0
- package/dist/chart/utils/price-increments.utils.d.ts +1 -0
- package/dist/chart/utils/price-increments.utils.js +127 -1
- package/dist/chart/utils/uuid.utils.js +4 -1
- package/dist/dxchart.min.js +9 -12
- package/dist/index.d.ts +3 -3
- package/dist/index.js +20 -1
- package/package.json +4 -4
- package/dist/chart/utils/perfomance/animation-frame-cache.utils.js +0 -6
- package/dist/chart/utils/perfomance/memoize.utils.js +0 -6
- package/dist/chart/utils/perfomance/request-animation-frame-throttle.utils.js +0 -6
- package/dist/chart/utils/perfomance/throttle.utils.js +0 -6
- /package/dist/chart/utils/{perfomance → performance}/animation-frame-cache.utils.d.ts +0 -0
- /package/dist/chart/utils/{perfomance → performance}/debounce.utils.d.ts +0 -0
- /package/dist/chart/utils/{perfomance → performance}/memoize.utils.d.ts +0 -0
- /package/dist/chart/utils/{perfomance → performance}/request-animation-frame-throttle.utils.d.ts +0 -0
- /package/dist/chart/utils/{perfomance → performance}/throttle.utils.d.ts +0 -0
|
@@ -3,4 +3,123 @@
|
|
|
3
3
|
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
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
|
-
import{CanvasElement
|
|
6
|
+
import { CanvasElement } from '../../../canvas/canvas-bounds-container';
|
|
7
|
+
import { ChartBaseElement } from '../../../model/chart-base-element';
|
|
8
|
+
import { DataSeriesModel, VisualSeriesPoint, defaultValueFormatter, } from '../../../model/data-series.model';
|
|
9
|
+
import { mergeHighLow } from '../../../model/scaling/auto-scale.model';
|
|
10
|
+
import { createYExtentFormatters } from '../../chart/price.formatter';
|
|
11
|
+
export class YExtentComponent extends ChartBaseElement {
|
|
12
|
+
constructor(paneUUID, idx, paneComponent, chartBaseModel, canvasBoundsContainer, hitTestController, dynamicObjectsCanvasModel, scale, createYAxisComponent, dragNDrop, dataSeries = new Set(), formatters = {
|
|
13
|
+
regular: defaultValueFormatter,
|
|
14
|
+
}) {
|
|
15
|
+
super();
|
|
16
|
+
this.paneUUID = paneUUID;
|
|
17
|
+
this.idx = idx;
|
|
18
|
+
this.paneComponent = paneComponent;
|
|
19
|
+
this.chartBaseModel = chartBaseModel;
|
|
20
|
+
this.canvasBoundsContainer = canvasBoundsContainer;
|
|
21
|
+
this.hitTestController = hitTestController;
|
|
22
|
+
this.dynamicObjectsCanvasModel = dynamicObjectsCanvasModel;
|
|
23
|
+
this.scale = scale;
|
|
24
|
+
this.dragNDrop = dragNDrop;
|
|
25
|
+
this.dataSeries = dataSeries;
|
|
26
|
+
this.formatters = formatters;
|
|
27
|
+
this.getYAxisBounds = () => {
|
|
28
|
+
return this.canvasBoundsContainer.getBounds(CanvasElement.PANE_UUID_Y_AXIS(this.paneUUID, this.idx));
|
|
29
|
+
};
|
|
30
|
+
this.yAxisHT = this.canvasBoundsContainer.getBoundsHitTest(CanvasElement.PANE_UUID_Y_AXIS(this.paneUUID, this.idx));
|
|
31
|
+
this.toVisualPoints = (points) => points.map(p => new VisualSeriesPoint(this.chartBaseModel.dataFromTimestamp(p.timestamp).centerUnit, p.close));
|
|
32
|
+
this.toY = (value) => {
|
|
33
|
+
var _a, _b;
|
|
34
|
+
return (_b = (_a = this.mainDataSeries) === null || _a === void 0 ? void 0 : _a.view.toY(value)) !== null && _b !== void 0 ? _b : 1;
|
|
35
|
+
};
|
|
36
|
+
this.valueFormatter = (value, dataSeries) => {
|
|
37
|
+
var _a;
|
|
38
|
+
const formatter = (_a = this.formatters[this.yAxis.getAxisType()]) !== null && _a !== void 0 ? _a : this.formatters.regular;
|
|
39
|
+
return formatter(value, dataSeries);
|
|
40
|
+
};
|
|
41
|
+
this.addChildEntity(scale);
|
|
42
|
+
this.setValueFormatters(createYExtentFormatters(this));
|
|
43
|
+
this.yAxis = createYAxisComponent(this.valueFormatter.bind(this), () => this.mainDataSeries);
|
|
44
|
+
this.addChildEntity(this.yAxis);
|
|
45
|
+
}
|
|
46
|
+
doDeactivate() {
|
|
47
|
+
super.doDeactivate();
|
|
48
|
+
this.dataSeries.forEach(ds => {
|
|
49
|
+
this.paneComponent.seriesRemovedSubject.next(ds);
|
|
50
|
+
ds.deactivate();
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Returns the bounds of the scale model.
|
|
55
|
+
* @returns {Bounds} The bounds of the scale model.
|
|
56
|
+
*/
|
|
57
|
+
getBounds() {
|
|
58
|
+
return this.scale.getBounds();
|
|
59
|
+
}
|
|
60
|
+
getBaseline() {
|
|
61
|
+
var _a, _b;
|
|
62
|
+
return (_b = (_a = this.mainDataSeries) === null || _a === void 0 ? void 0 : _a.getBaseline()) !== null && _b !== void 0 ? _b : 1;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Creates a new DataSeriesModel object.
|
|
66
|
+
* @returns {DataSeriesModel} - The newly created DataSeriesModel object.
|
|
67
|
+
*/
|
|
68
|
+
createDataSeries() {
|
|
69
|
+
const series = new DataSeriesModel(this, this.hitTestController.getNewDataSeriesHitTestId());
|
|
70
|
+
series.toVisualPoints = this.toVisualPoints;
|
|
71
|
+
return series;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Adds a new data series to the chart.
|
|
75
|
+
* @param {DataSeriesModel} series - The data series to be added.
|
|
76
|
+
* @returns {void}
|
|
77
|
+
*/
|
|
78
|
+
addDataSeries(series) {
|
|
79
|
+
this.dataSeries.add(series);
|
|
80
|
+
if (this.dataSeries.size === 1) {
|
|
81
|
+
this.mainDataSeries = series;
|
|
82
|
+
}
|
|
83
|
+
this.paneComponent.updateView();
|
|
84
|
+
this.paneComponent.seriesAddedSubject.next(series);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Removes a data series from the chart.
|
|
88
|
+
*
|
|
89
|
+
* @param {DataSeriesModel} series - The data series to be removed.
|
|
90
|
+
* @returns {void}
|
|
91
|
+
*/
|
|
92
|
+
removeDataSeries(series) {
|
|
93
|
+
this.dataSeries.delete(series);
|
|
94
|
+
this.paneComponent.updateView();
|
|
95
|
+
this.paneComponent.seriesRemovedSubject.next(series);
|
|
96
|
+
}
|
|
97
|
+
get regularFormatter() {
|
|
98
|
+
return this.formatters.regular;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Sets the pane value formatters for the current instance.
|
|
102
|
+
* @param {YExtentFormatters} formatters - The pane value formatters to be set.
|
|
103
|
+
*/
|
|
104
|
+
setValueFormatters(formatters) {
|
|
105
|
+
this.formatters = formatters;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Returns the regular value from Y coordinate.
|
|
109
|
+
* @param {number} y - The Y coordinate.
|
|
110
|
+
* @returns {number} - The regular value.
|
|
111
|
+
*/
|
|
112
|
+
regularValueFromY(y) {
|
|
113
|
+
var _a, _b;
|
|
114
|
+
return (_b = (_a = this.mainDataSeries) === null || _a === void 0 ? void 0 : _a.view.priceFromY(y)) !== null && _b !== void 0 ? _b : this.scale.fromY(y);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
export const createDefaultYExtentHighLowProvider = (extent) => ({
|
|
118
|
+
isHighLowActive: () => true,
|
|
119
|
+
calculateHighLow: state => {
|
|
120
|
+
const highLows = Array.from(extent.dataSeries)
|
|
121
|
+
.filter(ds => ds.highLowProvider.isHighLowActive())
|
|
122
|
+
.map(ds => ds.highLowProvider.calculateHighLow(state));
|
|
123
|
+
return mergeHighLow(highLows);
|
|
124
|
+
},
|
|
125
|
+
});
|
|
@@ -3,4 +3,58 @@
|
|
|
3
3
|
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
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
|
-
import{HIT_TEST_ID_RANGE
|
|
6
|
+
import { HIT_TEST_ID_RANGE } from '../../model/hit-test-canvas.model';
|
|
7
|
+
import { flatMap } from '../../utils/array.utils';
|
|
8
|
+
export class PaneHitTestController {
|
|
9
|
+
constructor(paneComponents, canvasModel) {
|
|
10
|
+
this.paneComponents = paneComponents;
|
|
11
|
+
this.canvasModel = canvasModel;
|
|
12
|
+
// used in hit test for creating series
|
|
13
|
+
this.dataSeriesIdCounter = HIT_TEST_ID_RANGE.DATA_SERIES[0];
|
|
14
|
+
this.getNewDataSeriesHitTestId = () => {
|
|
15
|
+
return this.dataSeriesIdCounter++;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Returns an array with two numbers representing the range of IDs for data series.
|
|
20
|
+
* @returns {Array<number>} An array with two numbers representing the range of IDs for data series.
|
|
21
|
+
*/
|
|
22
|
+
getIdRange() {
|
|
23
|
+
return HIT_TEST_ID_RANGE.DATA_SERIES;
|
|
24
|
+
}
|
|
25
|
+
get allDataSeries() {
|
|
26
|
+
return flatMap(flatMap(Object.values(this.paneComponents), c => c.yExtentComponents), p => Array.from(p.dataSeries));
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Looks up a data series by its ID.
|
|
30
|
+
*
|
|
31
|
+
* @param {number} id - The ID of the data series to look up.
|
|
32
|
+
* @returns {DataSeriesModel | undefined} - The data series with the given ID, or undefined if it does not exist.
|
|
33
|
+
*/
|
|
34
|
+
lookup(id) {
|
|
35
|
+
const result = this.allDataSeries.find(d => d.id === id);
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Changes the hovered property of all data series to true if their id matches the id of the provided model.
|
|
40
|
+
* @param {DataSeriesModel | null} model - The model to compare the id with.
|
|
41
|
+
* @returns {void}
|
|
42
|
+
*/
|
|
43
|
+
onHover(model) {
|
|
44
|
+
this.allDataSeries.forEach(d => (d.hovered = d.id === (model === null || model === void 0 ? void 0 : model.id)));
|
|
45
|
+
this.canvasModel.fireDraw();
|
|
46
|
+
}
|
|
47
|
+
onMouseDown(model) {
|
|
48
|
+
model && this.handleYExtentDragStart(model);
|
|
49
|
+
}
|
|
50
|
+
onMouseUp() {
|
|
51
|
+
this.handleYExtentDragEnd();
|
|
52
|
+
}
|
|
53
|
+
handleYExtentDragStart(model) {
|
|
54
|
+
Object.values(this.paneComponents).forEach(p => p.yExtentComponents.forEach(y => y.dragNDrop.deactivate()));
|
|
55
|
+
model.extentComponent.dragNDrop.activate();
|
|
56
|
+
}
|
|
57
|
+
handleYExtentDragEnd() {
|
|
58
|
+
Object.values(this.paneComponents).forEach(p => p.yExtentComponents.forEach(y => y.dragNDrop.activate()));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -18,32 +18,36 @@ import { ScaleModel } from '../../model/scale.model';
|
|
|
18
18
|
import { AtLeastOne } from '../../utils/object.utils';
|
|
19
19
|
import { ChartBaseModel } from '../chart/chart-base.model';
|
|
20
20
|
import { ChartPanComponent } from '../pan/chart-pan.component';
|
|
21
|
-
import { YExtentCreationOptions } from './extent/y-extent-component';
|
|
21
|
+
import { YExtentComponent, YExtentCreationOptions } from './extent/y-extent-component';
|
|
22
22
|
import { PaneHitTestController } from './pane-hit-test.controller';
|
|
23
23
|
import { PaneComponent } from './pane.component';
|
|
24
|
+
import { DataSeriesModel } from '../../model/data-series.model';
|
|
24
25
|
export declare class PaneManager extends ChartBaseElement {
|
|
25
26
|
private chartBaseModel;
|
|
27
|
+
private dynamicObjectsCanvasModel;
|
|
26
28
|
private userInputListenerComponents;
|
|
27
29
|
private eventBus;
|
|
28
|
-
private
|
|
30
|
+
private mainScale;
|
|
29
31
|
private canvasBoundsContainer;
|
|
30
32
|
private config;
|
|
31
33
|
private canvasAnimation;
|
|
32
34
|
private canvasInputListener;
|
|
33
35
|
private drawingManager;
|
|
34
|
-
private dataSeriesCanvasModel;
|
|
35
36
|
private cursorHandler;
|
|
36
37
|
private crossEventProducer;
|
|
37
38
|
chartPanComponent: ChartPanComponent;
|
|
38
39
|
private mainCanvasModel;
|
|
39
|
-
|
|
40
|
+
private yAxisLabelsCanvasModel;
|
|
41
|
+
panes: Record<string, PaneComponent>;
|
|
40
42
|
panesChangedSubject: Subject<Record<string, PaneComponent>>;
|
|
41
43
|
hitTestController: PaneHitTestController;
|
|
44
|
+
dataSeriesAddedSubject: Subject<DataSeriesModel>;
|
|
45
|
+
dataSeriesRemovedSubject: Subject<DataSeriesModel>;
|
|
42
46
|
/**
|
|
43
47
|
* Returns order of panes in the chart from top to bottom.
|
|
44
48
|
*/
|
|
45
49
|
get panesOrder(): string[];
|
|
46
|
-
constructor(chartBaseModel: ChartBaseModel<'candle'>, userInputListenerComponents: ChartEntity[], eventBus: EventBus,
|
|
50
|
+
constructor(chartBaseModel: ChartBaseModel<'candle'>, dynamicObjectsCanvasModel: CanvasModel, userInputListenerComponents: ChartEntity[], eventBus: EventBus, mainScale: ScaleModel, canvasBoundsContainer: CanvasBoundsContainer, config: FullChartConfig, canvasAnimation: CanvasAnimation, canvasInputListener: CanvasInputListenerComponent, drawingManager: DrawingManager, cursorHandler: CursorHandler, crossEventProducer: CrossEventProducerComponent, chartPanComponent: ChartPanComponent, mainCanvasModel: CanvasModel, yAxisLabelsCanvasModel: CanvasModel);
|
|
47
51
|
private addBounds;
|
|
48
52
|
/**
|
|
49
53
|
* Adds a resizer to the canvas bounds container for the given uuid.
|
|
@@ -51,6 +55,7 @@ export declare class PaneManager extends ChartBaseElement {
|
|
|
51
55
|
* @returns {BarResizerComponent} - The BarResizerComponent instance that was added to the userInputListenerComponents array.
|
|
52
56
|
*/
|
|
53
57
|
private addResizer;
|
|
58
|
+
get yExtents(): YExtentComponent[];
|
|
54
59
|
/**
|
|
55
60
|
* Returns the pane component that contains the given point.
|
|
56
61
|
* @param {Point} point - The point to check.
|
|
@@ -3,4 +3,151 @@
|
|
|
3
3
|
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
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
|
-
import
|
|
6
|
+
import { Subject } from 'rxjs';
|
|
7
|
+
import { CHART_UUID, CanvasElement } from '../../canvas/canvas-bounds-container';
|
|
8
|
+
import { ChartBaseElement } from '../../model/chart-base-element';
|
|
9
|
+
import { uuid as generateUuid } from '../../utils/uuid.utils';
|
|
10
|
+
import { createHighLowOffsetCalculator } from '../chart/data-series.high-low-provider';
|
|
11
|
+
import { BarResizerComponent } from '../resizer/bar-resizer.component';
|
|
12
|
+
import { createDefaultYExtentHighLowProvider, } from './extent/y-extent-component';
|
|
13
|
+
import { PaneHitTestController } from './pane-hit-test.controller';
|
|
14
|
+
import { PaneComponent } from './pane.component';
|
|
15
|
+
import { flatMap } from '../../utils/array.utils';
|
|
16
|
+
export class PaneManager extends ChartBaseElement {
|
|
17
|
+
/**
|
|
18
|
+
* Returns order of panes in the chart from top to bottom.
|
|
19
|
+
*/
|
|
20
|
+
get panesOrder() {
|
|
21
|
+
return this.canvasBoundsContainer.panesOrder;
|
|
22
|
+
}
|
|
23
|
+
constructor(chartBaseModel, dynamicObjectsCanvasModel, userInputListenerComponents, eventBus, mainScale, canvasBoundsContainer, config, canvasAnimation, canvasInputListener, drawingManager, cursorHandler, crossEventProducer, chartPanComponent, mainCanvasModel, yAxisLabelsCanvasModel) {
|
|
24
|
+
super();
|
|
25
|
+
this.chartBaseModel = chartBaseModel;
|
|
26
|
+
this.dynamicObjectsCanvasModel = dynamicObjectsCanvasModel;
|
|
27
|
+
this.userInputListenerComponents = userInputListenerComponents;
|
|
28
|
+
this.eventBus = eventBus;
|
|
29
|
+
this.mainScale = mainScale;
|
|
30
|
+
this.canvasBoundsContainer = canvasBoundsContainer;
|
|
31
|
+
this.config = config;
|
|
32
|
+
this.canvasAnimation = canvasAnimation;
|
|
33
|
+
this.canvasInputListener = canvasInputListener;
|
|
34
|
+
this.drawingManager = drawingManager;
|
|
35
|
+
this.cursorHandler = cursorHandler;
|
|
36
|
+
this.crossEventProducer = crossEventProducer;
|
|
37
|
+
this.chartPanComponent = chartPanComponent;
|
|
38
|
+
this.mainCanvasModel = mainCanvasModel;
|
|
39
|
+
this.yAxisLabelsCanvasModel = yAxisLabelsCanvasModel;
|
|
40
|
+
this.panes = {};
|
|
41
|
+
this.panesChangedSubject = new Subject();
|
|
42
|
+
this.dataSeriesAddedSubject = new Subject();
|
|
43
|
+
this.dataSeriesRemovedSubject = new Subject();
|
|
44
|
+
this.hitTestController = new PaneHitTestController(this.panes, this.dynamicObjectsCanvasModel);
|
|
45
|
+
const mainPane = this.createPane(CHART_UUID, {
|
|
46
|
+
useDefaultHighLow: false,
|
|
47
|
+
scale: this.mainScale,
|
|
48
|
+
});
|
|
49
|
+
mainPane.mainExtent.scale.autoScaleModel.setHighLowProvider('series', createDefaultYExtentHighLowProvider(mainPane.mainExtent));
|
|
50
|
+
mainScale.autoScaleModel.setHighLowPostProcessor('offsets', createHighLowOffsetCalculator(() => this.mainScale.getOffsets()));
|
|
51
|
+
}
|
|
52
|
+
addBounds(uuid, order) {
|
|
53
|
+
this.canvasBoundsContainer.addPaneBounds(uuid, order);
|
|
54
|
+
return () => this.canvasBoundsContainer.removedPaneBounds(uuid);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Adds a resizer to the canvas bounds container for the given uuid.
|
|
58
|
+
* @param {string} uuid - The uuid of the pane to which the resizer is to be added.
|
|
59
|
+
* @returns {BarResizerComponent} - The BarResizerComponent instance that was added to the userInputListenerComponents array.
|
|
60
|
+
*/
|
|
61
|
+
addResizer(uuid) {
|
|
62
|
+
const resizerHT = this.canvasBoundsContainer.getBoundsHitTest(CanvasElement.PANE_UUID_RESIZER(uuid), {
|
|
63
|
+
extensionY: this.config.components.paneResizer.dragZone,
|
|
64
|
+
});
|
|
65
|
+
const dragTick = () => {
|
|
66
|
+
this.canvasBoundsContainer.resizePaneVertically(uuid, this.canvasInputListener.getCurrentPoint().y);
|
|
67
|
+
this.eventBus.fireDraw([this.mainCanvasModel.canvasId, 'dynamicObjectsCanvas']);
|
|
68
|
+
};
|
|
69
|
+
const resizerId = CanvasElement.PANE_UUID_RESIZER(uuid);
|
|
70
|
+
const barResizerComponent = new BarResizerComponent(resizerId, () => this.canvasBoundsContainer.getBounds(resizerId), resizerHT, dragTick, this.chartPanComponent, this.mainCanvasModel, this.drawingManager, this.canvasInputListener, this.canvasAnimation, this.config, this.canvasBoundsContainer);
|
|
71
|
+
this.userInputListenerComponents.push(barResizerComponent);
|
|
72
|
+
return barResizerComponent;
|
|
73
|
+
}
|
|
74
|
+
get yExtents() {
|
|
75
|
+
return flatMap(Object.values(this.panes), c => c.yExtentComponents);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Returns the pane component that contains the given point.
|
|
79
|
+
* @param {Point} point - The point to check.
|
|
80
|
+
* @returns {PaneComponent | undefined} - The pane component that contains the point or undefined if no pane contains it.
|
|
81
|
+
*/
|
|
82
|
+
getPaneIfHit(point) {
|
|
83
|
+
const panes = Object.values(this.panes);
|
|
84
|
+
return panes.find(p => this.canvasBoundsContainer.getBoundsHitTest(CanvasElement.PANE_UUID(p.uuid))(point.x, point.y));
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Creates sub-plot on the chart with y-axis
|
|
88
|
+
* @param uuid
|
|
89
|
+
* @returns
|
|
90
|
+
*/
|
|
91
|
+
createPane(uuid = generateUuid(), options) {
|
|
92
|
+
if (this.panes[uuid] !== undefined) {
|
|
93
|
+
return this.panes[uuid];
|
|
94
|
+
}
|
|
95
|
+
const paneComponent = new PaneComponent(this.chartBaseModel, this.mainCanvasModel, this.yAxisLabelsCanvasModel, this.dynamicObjectsCanvasModel, this.hitTestController, this.config, this.mainScale, this.drawingManager, this.chartPanComponent, this.canvasInputListener, this.canvasAnimation, this.cursorHandler, this.eventBus, this.canvasBoundsContainer, uuid, this.dataSeriesAddedSubject, this.dataSeriesRemovedSubject, options);
|
|
96
|
+
// TODO: is resizer should be added always?
|
|
97
|
+
if (this.config.components.paneResizer.visible) {
|
|
98
|
+
paneComponent.addChildEntity(this.addResizer(uuid));
|
|
99
|
+
}
|
|
100
|
+
paneComponent.addSubscription(this.addBounds(uuid, options === null || options === void 0 ? void 0 : options.order));
|
|
101
|
+
paneComponent.addSubscription(this.addCursors(uuid));
|
|
102
|
+
paneComponent.addSubscription(this.crossEventProducer.subscribeMouseOverHT(uuid, paneComponent.ht));
|
|
103
|
+
this.panes[uuid] = paneComponent;
|
|
104
|
+
paneComponent.activate();
|
|
105
|
+
this.recalculateState();
|
|
106
|
+
paneComponent.mainExtent.scale.autoScale(true);
|
|
107
|
+
this.panesChangedSubject.next(this.panes);
|
|
108
|
+
return paneComponent;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Removes pane from the chart and all related components
|
|
112
|
+
* @param uuid
|
|
113
|
+
*/
|
|
114
|
+
removePane(uuid) {
|
|
115
|
+
const pane = this.panes[uuid];
|
|
116
|
+
if (pane !== undefined) {
|
|
117
|
+
pane.disable();
|
|
118
|
+
pane.yExtentComponents.forEach(yExtentComponent => yExtentComponent.disable());
|
|
119
|
+
delete this.panes[uuid];
|
|
120
|
+
this.recalculateState();
|
|
121
|
+
this.panesChangedSubject.next(this.panes);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Adds cursors to the chart elements based on the provided uuid and cursor type.
|
|
126
|
+
* @private
|
|
127
|
+
* @param {string} uuid - The unique identifier for the chart element.
|
|
128
|
+
* @param {string} [cursor=this.config.components.chart.cursor] - The type of cursor to be added to the chart element.
|
|
129
|
+
* @returns {void}
|
|
130
|
+
*/
|
|
131
|
+
addCursors(uuid, cursor = this.config.components.chart.cursor) {
|
|
132
|
+
const pane = CanvasElement.PANE_UUID(uuid);
|
|
133
|
+
const paneResizer = CanvasElement.PANE_UUID_RESIZER(uuid);
|
|
134
|
+
this.cursorHandler.setCursorForCanvasEl(pane, cursor);
|
|
135
|
+
this.config.components.paneResizer.visible &&
|
|
136
|
+
this.cursorHandler.setCursorForCanvasEl(paneResizer, this.config.components.paneResizer.cursor, this.config.components.paneResizer.dragZone);
|
|
137
|
+
return () => {
|
|
138
|
+
this.cursorHandler.removeCursorForCanvasEl(pane);
|
|
139
|
+
this.config.components.paneResizer.visible && this.cursorHandler.removeCursorForCanvasEl(paneResizer);
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Recalculates the zoom Y of all pane components and fires a draw event on the event bus.
|
|
144
|
+
* @function
|
|
145
|
+
* @name recalculateState
|
|
146
|
+
* @memberof PaneManager
|
|
147
|
+
* @returns {void}
|
|
148
|
+
*/
|
|
149
|
+
recalculateState() {
|
|
150
|
+
Object.values(this.panes).forEach(state => state.scale.recalculateZoomY());
|
|
151
|
+
this.eventBus.fireDraw([this.mainCanvasModel.canvasId, 'dynamicObjectsCanvas']);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -3,62 +3,56 @@
|
|
|
3
3
|
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
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
|
+
import { Subject } from 'rxjs';
|
|
6
7
|
import { CanvasAnimation } from '../../animation/canvas-animation';
|
|
7
8
|
import { CanvasBoundsContainer, HitBoundsTest } from '../../canvas/canvas-bounds-container';
|
|
8
9
|
import { CursorHandler } from '../../canvas/cursor.handler';
|
|
9
|
-
import {
|
|
10
|
+
import { FullChartConfig } from '../../chart.config';
|
|
10
11
|
import { DrawingManager } from '../../drawers/drawing-manager';
|
|
11
12
|
import EventBus from '../../events/event-bus';
|
|
12
13
|
import { CanvasInputListenerComponent } from '../../inputlisteners/canvas-input-listener.component';
|
|
13
14
|
import { Bounds } from '../../model/bounds.model';
|
|
14
15
|
import { CanvasModel } from '../../model/canvas.model';
|
|
15
|
-
import { ChartBaseElement
|
|
16
|
+
import { ChartBaseElement } from '../../model/chart-base-element';
|
|
16
17
|
import { DataSeriesModel } from '../../model/data-series.model';
|
|
17
18
|
import { ScaleModel } from '../../model/scale.model';
|
|
18
|
-
import { Unit } from '../../model/scaling/viewport.model';
|
|
19
|
-
import { Unsubscriber } from '../../utils/function.utils';
|
|
19
|
+
import { Pixel, Price, Unit } from '../../model/scaling/viewport.model';
|
|
20
20
|
import { AtLeastOne } from '../../utils/object.utils';
|
|
21
21
|
import { ChartBaseModel } from '../chart/chart-base.model';
|
|
22
22
|
import { PriceAxisType } from '../labels_generator/numeric-axis-labels.generator';
|
|
23
23
|
import { ChartPanComponent } from '../pan/chart-pan.component';
|
|
24
|
-
import {
|
|
25
|
-
import { YAxisScaleHandler } from '../y_axis/y-axis-scale.handler';
|
|
26
|
-
import { YAxisDrawer } from '../y_axis/y-axis.drawer';
|
|
24
|
+
import { YAxisComponent } from '../y_axis/y-axis.component';
|
|
27
25
|
import { YExtentComponent, YExtentCreationOptions } from './extent/y-extent-component';
|
|
28
26
|
import { PaneHitTestController } from './pane-hit-test.controller';
|
|
29
|
-
export interface ExtentYAxis {
|
|
30
|
-
labelsGenerator: NumericYAxisLabelsGenerator;
|
|
31
|
-
drawer: YAxisDrawer;
|
|
32
|
-
yAxisScaleHandler: YAxisScaleHandler;
|
|
33
|
-
state: ChartConfigComponentsYAxis;
|
|
34
|
-
unsub: Unsubscriber;
|
|
35
|
-
}
|
|
36
27
|
export declare class PaneComponent extends ChartBaseElement {
|
|
37
28
|
chartBaseModel: ChartBaseModel<'candle'>;
|
|
29
|
+
private mainCanvasModel;
|
|
30
|
+
private yAxisLabelsCanvasModel;
|
|
31
|
+
readonly dynamicObjectsCanvasModel: CanvasModel;
|
|
38
32
|
private hitTestController;
|
|
39
33
|
private config;
|
|
40
|
-
private
|
|
34
|
+
private mainScale;
|
|
41
35
|
private drawingManager;
|
|
42
36
|
private chartPanComponent;
|
|
43
|
-
private mainCanvasModel;
|
|
44
37
|
private canvasInputListener;
|
|
45
|
-
private userInputListenerComponents;
|
|
46
38
|
private canvasAnimation;
|
|
47
39
|
private cursorHandler;
|
|
48
40
|
eventBus: EventBus;
|
|
49
41
|
private canvasBoundsContainer;
|
|
50
42
|
readonly uuid: string;
|
|
51
|
-
|
|
43
|
+
seriesAddedSubject: Subject<DataSeriesModel>;
|
|
44
|
+
seriesRemovedSubject: Subject<DataSeriesModel>;
|
|
52
45
|
private _paneOrder;
|
|
53
46
|
/**
|
|
54
47
|
* Pane hit test (without Y-Axis and resizer)
|
|
55
48
|
*/
|
|
56
49
|
ht: HitBoundsTest;
|
|
57
50
|
yExtentComponents: YExtentComponent[];
|
|
58
|
-
get
|
|
51
|
+
get scale(): ScaleModel;
|
|
52
|
+
get yAxis(): YAxisComponent;
|
|
59
53
|
get dataSeries(): DataSeriesModel<import("../../model/data-series.model").DataSeriesPoint, import("../../model/data-series.model").VisualSeriesPoint>[];
|
|
60
|
-
|
|
61
|
-
constructor(chartBaseModel: ChartBaseModel<'candle'>, hitTestController: PaneHitTestController, config: FullChartConfig,
|
|
54
|
+
mainExtent: YExtentComponent;
|
|
55
|
+
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>, options?: AtLeastOne<YExtentCreationOptions>);
|
|
62
56
|
/**
|
|
63
57
|
* Method that activates the canvas bounds container and recalculates the zoom Y of the scale model.
|
|
64
58
|
* @protected
|
|
@@ -66,17 +60,7 @@ export declare class PaneComponent extends ChartBaseElement {
|
|
|
66
60
|
* @returns {void}
|
|
67
61
|
*/
|
|
68
62
|
protected doActivate(): void;
|
|
69
|
-
|
|
70
|
-
* Creates a Y-axis component for the chart.
|
|
71
|
-
* @private
|
|
72
|
-
* @param {string} uuid - The unique identifier of the chart pane.
|
|
73
|
-
* @param {ScaleModel} scaleModel - The scale model for the chart.
|
|
74
|
-
* @param {(value: number) => string} formatter - The function to format the Y-axis labels.
|
|
75
|
-
* @param {Unsubscriber[]} subs - The array of unsubscriber functions.
|
|
76
|
-
* @param {number | null} increment - The increment value for the Y-axis labels.
|
|
77
|
-
* @returns {[NumericYAxisLabelsGenerator, YAxisDrawer, YAxisScaleHandler]} - An array containing the Y-axis labels generator, Y-axis drawer, and Y-axis scale handler.
|
|
78
|
-
*/
|
|
79
|
-
private createYAxisComponent;
|
|
63
|
+
toY(price: Price): Pixel;
|
|
80
64
|
/**
|
|
81
65
|
* Creates a new GridComponent instance with the provided parameters.
|
|
82
66
|
* @param {string} uuid - The unique identifier of the pane.
|