@devexperts/dxcharts-lite 1.0.2 → 2.0.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/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.d.ts +2 -2
- package/dist/chart/components/pane/pane-hit-test.controller.js +55 -1
- package/dist/chart/components/pane/pane-manager.component.d.ts +12 -6
- package/dist/chart/components/pane/pane-manager.component.js +149 -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.d.ts +4 -3
- package/dist/chart/components/y_axis/price_labels/last-candle-labels.provider.js +96 -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 +10 -17
- package/dist/chart/components/y_axis/y-axis.model.js +34 -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 +3 -2
- package/dist/chart/model/scale.model.js +316 -1
- package/dist/chart/model/scaling/auto-scale.model.d.ts +2 -4
- package/dist/chart/model/scaling/auto-scale.model.js +91 -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,411 @@
|
|
|
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{CHART_UUID
|
|
6
|
+
import { CHART_UUID, CanvasElement } from '../../canvas/canvas-bounds-container';
|
|
7
|
+
import { ChartBaseElement } from '../../model/chart-base-element';
|
|
8
|
+
import { BackgroundDrawer } from '../../drawers/chart-background.drawer';
|
|
9
|
+
import { AreaDrawer } from '../../drawers/chart-type-drawers/area.drawer';
|
|
10
|
+
import { BarDrawer } from '../../drawers/chart-type-drawers/bar.drawer';
|
|
11
|
+
import { BaselineDrawer } from '../../drawers/chart-type-drawers/baseline.drawer';
|
|
12
|
+
import { CandleDrawer } from '../../drawers/chart-type-drawers/candle.drawer';
|
|
13
|
+
import { HistogramDrawer as MainChartHistogramDrawer } from '../../drawers/chart-type-drawers/histogram.drawer';
|
|
14
|
+
import { LineDrawer } from '../../drawers/chart-type-drawers/line.drawer';
|
|
15
|
+
import { ScatterPlotDrawer } from '../../drawers/chart-type-drawers/scatter-plot.drawer';
|
|
16
|
+
import { CandleSeriesWrapper } from '../../drawers/data-series-drawers/candle-series-wrapper';
|
|
17
|
+
import { ColorCandleDrawer } from '../../drawers/data-series-drawers/color-candle.drawer';
|
|
18
|
+
import { DifferenceCloudDrawer } from '../../drawers/data-series-drawers/difference-cloud.drawer';
|
|
19
|
+
import { HistogramDrawer } from '../../drawers/data-series-drawers/histogram.drawer';
|
|
20
|
+
import { LinearDrawer } from '../../drawers/data-series-drawers/linear.drawer';
|
|
21
|
+
import { PointsDrawer } from '../../drawers/data-series-drawers/points.drawer';
|
|
22
|
+
import { TextDrawer } from '../../drawers/data-series-drawers/text.drawer';
|
|
23
|
+
import { TriangleDrawer } from '../../drawers/data-series-drawers/triangle.drawer';
|
|
24
|
+
import { DataSeriesDrawer } from '../../drawers/data-series.drawer';
|
|
25
|
+
import { HIT_TEST_PREFIX } from '../../drawers/drawing-manager';
|
|
26
|
+
import { HTDataSeriesDrawer } from '../../drawers/ht-data-series.drawer';
|
|
27
|
+
import { BaselineModel } from '../../model/baseline.model';
|
|
28
|
+
import { keys } from '../../utils/object.utils';
|
|
29
|
+
import { PriceIncrementsUtils } from '../../utils/price-increments.utils';
|
|
30
|
+
import { defaultCandleTransformer, hollowCandleTransformer, trendCandleTransformer, } from './candle-transformer.functions';
|
|
31
|
+
import { deleteCandlesIndex } from './candle.functions';
|
|
32
|
+
import { TrendHistogramDrawer } from '../../drawers/data-series-drawers/trend-histogram.drawer';
|
|
33
|
+
/**
|
|
34
|
+
* Represents a financial instrument to be displayed on a chart
|
|
35
|
+
* @class
|
|
36
|
+
* @property {string} symbol - The symbol of the instrument
|
|
37
|
+
* @property {string} [description] - The description of the instrument
|
|
38
|
+
* @property {Array<number>} [priceIncrements=[0.01]] - An array of possible price step values on the price axis
|
|
39
|
+
* @property {boolean} [bondFraction] - A flag indicating whether the instrument is a bond fraction or not
|
|
40
|
+
*/
|
|
41
|
+
export class ChartInstrument {
|
|
42
|
+
constructor() {
|
|
43
|
+
this.symbol = 'MOCK';
|
|
44
|
+
/**
|
|
45
|
+
* defines possible price step values on price axis
|
|
46
|
+
*/
|
|
47
|
+
this.priceIncrements = [0.01];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export class ChartComponent extends ChartBaseElement {
|
|
51
|
+
constructor(chartModel, canvasModel, config, scale, canvasBoundsContainer, drawingManager, hitTestCanvasModel, canvasInputListener, backgroundCanvasModel, chartPanComponent, paneManager, cursorHandler, dynamicObjects) {
|
|
52
|
+
super();
|
|
53
|
+
this.chartModel = chartModel;
|
|
54
|
+
this.canvasModel = canvasModel;
|
|
55
|
+
this.config = config;
|
|
56
|
+
this.scale = scale;
|
|
57
|
+
this.canvasBoundsContainer = canvasBoundsContainer;
|
|
58
|
+
this.drawingManager = drawingManager;
|
|
59
|
+
this.hitTestCanvasModel = hitTestCanvasModel;
|
|
60
|
+
this.canvasInputListener = canvasInputListener;
|
|
61
|
+
this.paneManager = paneManager;
|
|
62
|
+
this.dynamicObjects = dynamicObjects;
|
|
63
|
+
this._dataSeriesDrawers = {};
|
|
64
|
+
this.strToBarType = (str) => { var _a; return (_a = this.barTypeValues.find(t => t === str)) !== null && _a !== void 0 ? _a : 'candle'; };
|
|
65
|
+
this.addChildEntity(this.chartModel);
|
|
66
|
+
this.registerDefaultCandlesTransformers();
|
|
67
|
+
this.baselineModel = new BaselineModel(this.chartModel, chartPanComponent, this.canvasModel, this.canvasInputListener, this.config, this.canvasBoundsContainer, cursorHandler);
|
|
68
|
+
this.addChildEntity(this.baselineModel);
|
|
69
|
+
//#region main chart drawers
|
|
70
|
+
const hTChartDrawer = new HTDataSeriesDrawer(this._dataSeriesDrawers, this.hitTestCanvasModel, paneManager);
|
|
71
|
+
this.drawingManager.addDrawerBefore(hTChartDrawer, HIT_TEST_PREFIX + 'DATA_SERIES', 'HIT_TEST_EVENTS');
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region data series drawers
|
|
74
|
+
this.registerDefaultDataSeriesDrawers();
|
|
75
|
+
//#endregion
|
|
76
|
+
this.backgroundDrawer = new BackgroundDrawer(backgroundCanvasModel, this.config);
|
|
77
|
+
drawingManager.addDrawer(this.backgroundDrawer, 'MAIN_BACKGROUND');
|
|
78
|
+
cursorHandler.setCursorForCanvasEl(CanvasElement.PANE_UUID(CHART_UUID), config.components.chart.cursor);
|
|
79
|
+
this.dataSeriesDrawer = new DataSeriesDrawer(paneManager, this.dataSeriesDrawers);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* This method overrides the doActivate method of the parent class and calls it.
|
|
83
|
+
* It does not take any parameters and does not return anything.
|
|
84
|
+
* @protected
|
|
85
|
+
* @returns {void}
|
|
86
|
+
*/
|
|
87
|
+
doActivate() {
|
|
88
|
+
super.doActivate();
|
|
89
|
+
// TODO hack, main data series is created before doActivate, so we need to add it manually
|
|
90
|
+
this.dynamicObjects.model.addObject({ model: this.chartModel.mainCandleSeries, drawer: this.dataSeriesDrawer }, this.chartModel.mainCandleSeries.extentComponent.paneUUID);
|
|
91
|
+
this.addRxSubscription(this.paneManager.dataSeriesAddedSubject.subscribe(series => {
|
|
92
|
+
this.dynamicObjects.model.addObject({ model: series, drawer: this.dataSeriesDrawer }, series.extentComponent.paneUUID);
|
|
93
|
+
}));
|
|
94
|
+
this.addRxSubscription(this.paneManager.dataSeriesRemovedSubject.subscribe(series => {
|
|
95
|
+
this.dynamicObjects.model.removeObject(series, series.extentComponent.paneUUID);
|
|
96
|
+
}));
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Registers default candle transformers.
|
|
100
|
+
* @private
|
|
101
|
+
* @function
|
|
102
|
+
* @returns {void}
|
|
103
|
+
*/
|
|
104
|
+
registerDefaultCandlesTransformers() {
|
|
105
|
+
this.registerCandlesTransformer('candle', defaultCandleTransformer);
|
|
106
|
+
this.registerCandlesTransformer('trend', trendCandleTransformer);
|
|
107
|
+
this.registerCandlesTransformer('hollow', hollowCandleTransformer);
|
|
108
|
+
}
|
|
109
|
+
get barTypeValues() {
|
|
110
|
+
// @ts-ignore
|
|
111
|
+
return keys(this._dataSeriesDrawers);
|
|
112
|
+
}
|
|
113
|
+
get dataSeriesDrawers() {
|
|
114
|
+
return this._dataSeriesDrawers;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* You can use this method to determine logic of visual candle transformation for specified chart type.
|
|
118
|
+
* @param chartType
|
|
119
|
+
* @param transformer
|
|
120
|
+
*/
|
|
121
|
+
registerCandlesTransformer(chartType, transformer) {
|
|
122
|
+
this.chartModel.registerCandlesTransformer(chartType, transformer);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* You can use this method to modify labels for last candle.
|
|
126
|
+
* @param chartType
|
|
127
|
+
* @param handler
|
|
128
|
+
*/
|
|
129
|
+
registerLastCandleLabelHandler(chartType, handler) {
|
|
130
|
+
this.chartModel.registerLastCandleLabelHandler(chartType, handler);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* You can use this method to determine chart width calculation for specified chart type.
|
|
134
|
+
* @param chartType
|
|
135
|
+
* @param calculator
|
|
136
|
+
*/
|
|
137
|
+
registerCandlesWidthCalculator(chartType, calculator) {
|
|
138
|
+
this.chartModel.registerCandlesWidthCalculator(chartType, calculator);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* In future this drawers should have same type as main series
|
|
142
|
+
*/
|
|
143
|
+
registerDefaultDataSeriesDrawers() {
|
|
144
|
+
const candleDrawer = new CandleDrawer(this.config.components.chart);
|
|
145
|
+
this.registerDataSeriesTypeDrawer('candle', candleDrawer);
|
|
146
|
+
this.registerDataSeriesTypeDrawer('trend', candleDrawer);
|
|
147
|
+
this.registerDataSeriesTypeDrawer('hollow', candleDrawer);
|
|
148
|
+
this.registerDataSeriesTypeDrawer('bar', new BarDrawer(this.config.components.chart));
|
|
149
|
+
this.registerDataSeriesTypeDrawer('line', new LineDrawer(this.config.components.chart));
|
|
150
|
+
this.registerDataSeriesTypeDrawer('scatterPlot', new ScatterPlotDrawer(this.config.colors.scatterPlot));
|
|
151
|
+
this.registerDataSeriesTypeDrawer('area', new AreaDrawer(this.config.components.chart));
|
|
152
|
+
this.registerDataSeriesTypeDrawer('baseline', new BaselineDrawer(this.baselineModel, this.canvasBoundsContainer));
|
|
153
|
+
this.registerDataSeriesTypeDrawer('histogram', new MainChartHistogramDrawer(this.config.components.chart.histogram));
|
|
154
|
+
const mainChartBoundsProvider = () => this.canvasBoundsContainer.getBounds(CanvasElement.PANE_UUID(CHART_UUID));
|
|
155
|
+
this.registerDataSeriesTypeDrawer('LINEAR', new LinearDrawer());
|
|
156
|
+
this.registerDataSeriesTypeDrawer('HISTOGRAM', new HistogramDrawer());
|
|
157
|
+
this.registerDataSeriesTypeDrawer('TREND_HISTOGRAM', new TrendHistogramDrawer());
|
|
158
|
+
this.registerDataSeriesTypeDrawer('POINTS', new PointsDrawer());
|
|
159
|
+
this.registerDataSeriesTypeDrawer('COLOR_CANDLE', new CandleSeriesWrapper(new ColorCandleDrawer(this.chartModel), this.config, mainChartBoundsProvider));
|
|
160
|
+
this.registerDataSeriesTypeDrawer('TEXT', new TextDrawer(this.config));
|
|
161
|
+
this.registerDataSeriesTypeDrawer('TRIANGLE', new TriangleDrawer());
|
|
162
|
+
this.registerDataSeriesTypeDrawer('DIFFERENCE', new DifferenceCloudDrawer());
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Sets the chart type of main candle series.
|
|
166
|
+
* @param type - new type
|
|
167
|
+
*/
|
|
168
|
+
setChartType(type) {
|
|
169
|
+
this.config.components.chart.type = type;
|
|
170
|
+
this.chartModel.rememberCurrentTimeframe();
|
|
171
|
+
this.chartModel.mainCandleSeries.setType(type);
|
|
172
|
+
this.chartModel.mainCandleSeries.updateCandleSeriesColors(Object.assign({}, this.config.colors));
|
|
173
|
+
this.chartModel.mainCandleSeries.recalculateVisualPoints();
|
|
174
|
+
this.chartModel.chartTypeChanged.next(type);
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Resets chart scale to default according to config.components.chart.defaultZoomCandleWidth.
|
|
178
|
+
*/
|
|
179
|
+
resetChartScale() {
|
|
180
|
+
this.chartModel.doBasicScale();
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Sets the timestamp range of the chart by setting the x-axis scale.
|
|
184
|
+
* @param {Timestamp} start - The start timestamp of the range.
|
|
185
|
+
* @param {Timestamp} end - The end timestamp of the range.
|
|
186
|
+
* @returns {void}
|
|
187
|
+
*/
|
|
188
|
+
setTimestampRange(start, end) {
|
|
189
|
+
return this.chartModel.setTimestampRange(start, end);
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Moves the viewport to exactly xStart..xEnd place.
|
|
193
|
+
* @param xStart - viewport start in units
|
|
194
|
+
* @param xEnd - viewport end in units
|
|
195
|
+
*/
|
|
196
|
+
setXScale(xStart, xEnd) {
|
|
197
|
+
return this.scale.setXScale(xStart, xEnd);
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Sets the visibility of the wicks in the chart.
|
|
201
|
+
* @param {boolean} isShow - A boolean value indicating whether to show or hide the wicks.
|
|
202
|
+
* @returns {void}
|
|
203
|
+
*/
|
|
204
|
+
setShowWicks(isShow) {
|
|
205
|
+
this.config.components.chart.showWicks = isShow;
|
|
206
|
+
this.canvasModel.fireDraw();
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Used to set the main series to chart.
|
|
210
|
+
* @param series
|
|
211
|
+
*/
|
|
212
|
+
setMainSeries(series) {
|
|
213
|
+
var _a;
|
|
214
|
+
const instrument = (_a = series.instrument) !== null && _a !== void 0 ? _a : this.chartModel.mainCandleSeries.instrument;
|
|
215
|
+
this.chartModel.mainCandleSeries.instrument = instrument;
|
|
216
|
+
this.chartModel.setAllSeries({
|
|
217
|
+
candles: series.candles,
|
|
218
|
+
instrument,
|
|
219
|
+
}, this.chartModel.getSecondarySeries().map(series => {
|
|
220
|
+
var _a;
|
|
221
|
+
const instrument = (_a = series.instrument) !== null && _a !== void 0 ? _a : this.chartModel.mainCandleSeries.instrument;
|
|
222
|
+
const originalCandles = series.dataPoints;
|
|
223
|
+
// reset the idx of candles to calculate them again
|
|
224
|
+
deleteCandlesIndex(originalCandles);
|
|
225
|
+
return {
|
|
226
|
+
candles: originalCandles,
|
|
227
|
+
instrument,
|
|
228
|
+
};
|
|
229
|
+
}));
|
|
230
|
+
this.updatePriceIncrementsIfNeeded(instrument);
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Adds new secondary chart series.
|
|
234
|
+
* @param series
|
|
235
|
+
*/
|
|
236
|
+
setSecondarySeries(series) {
|
|
237
|
+
var _a;
|
|
238
|
+
const instrument = (_a = series.instrument) !== null && _a !== void 0 ? _a : this.chartModel.mainCandleSeries.instrument;
|
|
239
|
+
const candleSeriesModel = this.chartModel.setSecondaryCandleSeries(series.candles, instrument);
|
|
240
|
+
this.updatePriceIncrementsIfNeeded(instrument);
|
|
241
|
+
if (candleSeriesModel) {
|
|
242
|
+
return candleSeriesModel;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Sets the main and secondary series in one bulk operation.
|
|
247
|
+
* Reindexing and visual rerender happens at the same time.
|
|
248
|
+
* @param mainSeries
|
|
249
|
+
* @param secondarySeries
|
|
250
|
+
*/
|
|
251
|
+
setAllSeries(mainSeries, secondarySeries = []) {
|
|
252
|
+
var _a;
|
|
253
|
+
const instrument = (_a = mainSeries.instrument) !== null && _a !== void 0 ? _a : this.chartModel.mainCandleSeries.instrument;
|
|
254
|
+
this.updatePriceIncrementsIfNeeded(instrument);
|
|
255
|
+
secondarySeries.forEach(series => {
|
|
256
|
+
var _a;
|
|
257
|
+
const instrument = (_a = series.instrument) !== null && _a !== void 0 ? _a : this.chartModel.mainCandleSeries.instrument;
|
|
258
|
+
this.updatePriceIncrementsIfNeeded(instrument);
|
|
259
|
+
});
|
|
260
|
+
this.chartModel.setAllSeries(mainSeries, secondarySeries);
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Converts candle index to chart x coordinate
|
|
264
|
+
*/
|
|
265
|
+
toXFromCandleIndex(idx) {
|
|
266
|
+
return this.chartModel.toX(idx);
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Converts timestamp to chart x coordinate
|
|
270
|
+
*/
|
|
271
|
+
toXFromTimestamp(timestamp) {
|
|
272
|
+
const xCandle = this.chartModel.candleFromTimestamp(timestamp);
|
|
273
|
+
return xCandle.xCenter(this.chartModel.scale);
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Converts price to chart y coordinate
|
|
277
|
+
*/
|
|
278
|
+
toY(price) {
|
|
279
|
+
return this.chartModel.toY(price);
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Updates the main and secondary series in one bulk operation.
|
|
283
|
+
* Reindexing and visual rerender happens at the same time.
|
|
284
|
+
* @param mainSeries {CandleSeries}
|
|
285
|
+
* @param secondarySeries {CandleSeries[]}
|
|
286
|
+
*/
|
|
287
|
+
updateAllSeries(mainSeries, secondarySeries = []) {
|
|
288
|
+
this.chartModel.updateAllSeries(mainSeries, secondarySeries);
|
|
289
|
+
this.canvasModel.fireDraw();
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Removes all data points from the main candle series that are newer than the given timestamp.
|
|
293
|
+
* Can be useful for data replay.
|
|
294
|
+
* @param startTimestamp
|
|
295
|
+
*/
|
|
296
|
+
removeDataFrom(timestamp) {
|
|
297
|
+
this.chartModel.removeDataFrom(timestamp);
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Removes chart candles series.
|
|
301
|
+
* @param instrument
|
|
302
|
+
*/
|
|
303
|
+
removeSecondarySeries(series) {
|
|
304
|
+
this.chartModel.removeSecondaryCandleSeries(series);
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Adds new candles array to the existing one at the start, mostly used in lazy loading
|
|
308
|
+
* @param target - initial candles array
|
|
309
|
+
* @param prependUpdate - additional candles array, which will be added to the target array
|
|
310
|
+
*/
|
|
311
|
+
prependCandles(target, prependUpdate) {
|
|
312
|
+
this.chartModel.prependCandles(target, prependUpdate);
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Adds new candle to the chart
|
|
316
|
+
* @param candle - new candle
|
|
317
|
+
* @param instrument - name of the instrument to update
|
|
318
|
+
*/
|
|
319
|
+
addLastCandle(candle, instrumentSymbol) {
|
|
320
|
+
this.chartModel.addLastCandle(candle, instrumentSymbol);
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Updates last candle value
|
|
324
|
+
* @param candle - updated candle
|
|
325
|
+
* @param instrument - name of the instrument to update
|
|
326
|
+
*/
|
|
327
|
+
updateLastCandle(candle, instrumentSymbol) {
|
|
328
|
+
this.chartModel.updateLastCandle(candle, instrumentSymbol);
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Updates candle series for instrument. By default takes main instrument.
|
|
332
|
+
* @param candles
|
|
333
|
+
* @param instrument
|
|
334
|
+
*/
|
|
335
|
+
updateCandles(candles, instrumentSymbol) {
|
|
336
|
+
this.chartModel.updateCandles(candles, instrumentSymbol);
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Sets offsets to viewport.
|
|
340
|
+
* @param offsets - new offsets
|
|
341
|
+
*/
|
|
342
|
+
setOffsets(offsets) {
|
|
343
|
+
this.chartModel.setOffsets(offsets);
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Returns a SeriesDrawer object based on the provided drawerType.
|
|
347
|
+
* @param {BarType} drawerType - The type of the drawer to be returned.
|
|
348
|
+
* @returns {SeriesDrawer | undefined} - The SeriesDrawer object corresponding to the provided drawerType or undefined if not found.
|
|
349
|
+
*/
|
|
350
|
+
getDataSeriesDrawer(drawerType) {
|
|
351
|
+
return this._dataSeriesDrawers[drawerType];
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Registers a new chart type drawer or overrides default drawer if drawerType is {BarType}.
|
|
355
|
+
* @param drawerType {string} - a unique name for the drawer, could be {BarType} - in this case will override default drawer for the type
|
|
356
|
+
* @param drawer {ChartTypeDrawer} - an implementation of the drawer
|
|
357
|
+
*/
|
|
358
|
+
registerDataSeriesTypeDrawer(drawerType, drawer) {
|
|
359
|
+
this._dataSeriesDrawers[drawerType] = drawer;
|
|
360
|
+
}
|
|
361
|
+
//#endregion
|
|
362
|
+
/**
|
|
363
|
+
* Updates the price increments of a given instrument if they are not valid or not defined.
|
|
364
|
+
* If the price increments are not valid or not defined, it will set them to a default value.
|
|
365
|
+
* @param {ChartInstrument} instrument - The instrument to update the price increments for.
|
|
366
|
+
*/
|
|
367
|
+
updatePriceIncrementsIfNeeded(instrument) {
|
|
368
|
+
if (!instrument.priceIncrements ||
|
|
369
|
+
!PriceIncrementsUtils.validatePriceIncrementsOrPrecisions(instrument.priceIncrements)) {
|
|
370
|
+
instrument.priceIncrements = [
|
|
371
|
+
PriceIncrementsUtils.autoDetectIncrementOfValueRange(this.scale.yEnd - this.scale.yStart),
|
|
372
|
+
];
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
//#region public events
|
|
376
|
+
/**
|
|
377
|
+
* Returns an Observable that emits a void value whenever the offsetsChanged event is triggered.
|
|
378
|
+
* @returns {Observable<void>} An Observable that emits a void value whenever the offsetsChanged event is triggered.
|
|
379
|
+
*/
|
|
380
|
+
observeOffsetsChanged() {
|
|
381
|
+
return this.chartModel.offsetsChanged;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Returns an Observable that emits the BarType whenever the chart type is changed.
|
|
385
|
+
* @returns {Observable<BarType>} An Observable that emits the BarType whenever the chart type is changed.
|
|
386
|
+
*/
|
|
387
|
+
observeChartTypeChanged() {
|
|
388
|
+
return this.chartModel.chartTypeChanged;
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Returns an Observable that emits a void value when the candles in the chart model change.
|
|
392
|
+
* The Observable is obtained by calling the observeCandlesChanged method of the chartModel object.
|
|
393
|
+
* @returns {Observable<void>} An Observable that emits a void value when the candles in the chart model change.
|
|
394
|
+
*/
|
|
395
|
+
observeCandlesChanged() {
|
|
396
|
+
return this.chartModel.observeCandlesChanged();
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Returns an Observable that emits a void value when the candles are updated in the chart model.
|
|
400
|
+
* The Observable is obtained from the candlesUpdatedSubject of the chartModel.
|
|
401
|
+
* @returns {Observable<void>} Observable that emits a void value when the candles are updated.
|
|
402
|
+
*/
|
|
403
|
+
observeCandlesUpdated() {
|
|
404
|
+
return this.chartModel.candlesUpdatedSubject;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Returns an Observable that emits a void value whenever the candlesPrependSubject is triggered.
|
|
408
|
+
* @returns {Observable<PrependedCandlesData>} An Observable that emits a PrependedCandlesData whenever the candles are added to the end.
|
|
409
|
+
*/
|
|
410
|
+
observeCandlesPrepended() {
|
|
411
|
+
return this.chartModel.candlesPrependSubject;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
@@ -4,15 +4,14 @@
|
|
|
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 { Observable, Subject } from 'rxjs';
|
|
7
|
-
import { PriceAxisType } from '../labels_generator/numeric-axis-labels.generator';
|
|
8
|
-
import { ChartBaseElement } from '../../model/chart-base-element';
|
|
9
7
|
import { CanvasBoundsContainer } from '../../canvas/canvas-bounds-container';
|
|
10
8
|
import { BarType, ChartConfigComponentsOffsets, FullChartConfig } from '../../chart.config';
|
|
11
|
-
import { CanvasModel } from '../../model/canvas.model';
|
|
12
9
|
import EventBus from '../../events/event-bus';
|
|
13
10
|
import { ChartResizeHandler } from '../../inputhandlers/chart-resize.handler';
|
|
14
11
|
import { CandleSeriesColors, CandleSeriesModel, PartialCandleSeriesColors } from '../../model/candle-series.model';
|
|
15
12
|
import { Candle } from '../../model/candle.model';
|
|
13
|
+
import { CanvasModel } from '../../model/canvas.model';
|
|
14
|
+
import { ChartBaseElement } from '../../model/chart-base-element';
|
|
16
15
|
import { DataSeriesType } from '../../model/data-series.config';
|
|
17
16
|
import { ScaleModel } from '../../model/scale.model';
|
|
18
17
|
import { Index, Pixel, Price, Timestamp, Unit } from '../../model/scaling/viewport.model';
|
|
@@ -37,7 +36,7 @@ export declare class ChartModel extends ChartBaseElement {
|
|
|
37
36
|
bus: EventBus;
|
|
38
37
|
private canvasModel;
|
|
39
38
|
config: FullChartConfig;
|
|
40
|
-
|
|
39
|
+
scale: ScaleModel;
|
|
41
40
|
formatterFactory: (format: string) => (timestamp: number) => string;
|
|
42
41
|
mainCanvasParent: Element;
|
|
43
42
|
private canvasBoundsContainer;
|
|
@@ -48,7 +47,6 @@ export declare class ChartModel extends ChartBaseElement {
|
|
|
48
47
|
get mainCandleSeries(): CandleSeriesModel;
|
|
49
48
|
get secondaryCandleSeries(): Array<CandleSeriesModel>;
|
|
50
49
|
readonly nextCandleTimeStampSubject: Subject<void>;
|
|
51
|
-
readonly axisTypeSetSubject: Subject<PriceAxisType>;
|
|
52
50
|
readonly chartTypeChanged: Subject<BarType>;
|
|
53
51
|
readonly mainInstrumentChangedSubject: Subject<ChartInstrument>;
|
|
54
52
|
readonly scaleInversedSubject: Subject<void>;
|
|
@@ -62,7 +60,7 @@ export declare class ChartModel extends ChartBaseElement {
|
|
|
62
60
|
timeFrameViewportTransformer: (timeframe: [number, number], zoomIn?: boolean | null) => void;
|
|
63
61
|
private FAKE_CANDLES_DEFAULT;
|
|
64
62
|
readonly pane: PaneComponent;
|
|
65
|
-
constructor(chartBaseModel: ChartBaseModel<'candle'>, paneManager: PaneManager, bus: EventBus, canvasModel: CanvasModel, config: FullChartConfig,
|
|
63
|
+
constructor(chartBaseModel: ChartBaseModel<'candle'>, paneManager: PaneManager, bus: EventBus, canvasModel: CanvasModel, config: FullChartConfig, scale: ScaleModel, formatterFactory: (format: string) => (timestamp: number) => string, mainCanvasParent: Element, canvasBoundsContainer: CanvasBoundsContainer, chartResizeHandler: ChartResizeHandler);
|
|
66
64
|
get candlesUpdatedSubject(): Subject<void>;
|
|
67
65
|
get candlesSetSubject(): Subject<void>;
|
|
68
66
|
get candlesRemovedSubject(): Subject<void>;
|
|
@@ -231,11 +229,6 @@ export declare class ChartModel extends ChartBaseElement {
|
|
|
231
229
|
* @param idx - index of candle
|
|
232
230
|
*/
|
|
233
231
|
toX(idx: Index): Pixel;
|
|
234
|
-
/**
|
|
235
|
-
* Returns the baseline of the main candle series.
|
|
236
|
-
* @returns {Unit} The baseline of the main candle series.
|
|
237
|
-
*/
|
|
238
|
-
getBaseLine(): Unit;
|
|
239
232
|
/**
|
|
240
233
|
* Transforms X coordinate (relative to canvas element) to Candle object.
|
|
241
234
|
* If extrapolate = false, then it takes leftmost/rightmost existing candle
|