@devexperts/dxcharts-lite 2.7.10 → 2.7.12
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__/env.js +2 -2
- package/dist/chart/canvas/canvas-bounds-container.js +1 -2
- package/dist/chart/canvas/chart-elements.d.ts +1 -1
- package/dist/chart/chart.config.js +2 -2
- package/dist/chart/chart.js +2 -1
- package/dist/chart/components/chart/chart.component.js +2 -0
- package/dist/chart/components/chart/chart.model.d.ts +1 -1
- package/dist/chart/components/chart/price-formatters/treasury-price.formatter.d.ts +1 -0
- package/dist/chart/components/chart/price-formatters/treasury-price.formatter.js +1 -0
- package/dist/chart/components/labels_generator/numeric-axis-labels.generator.d.ts +3 -3
- package/dist/chart/components/labels_generator/numeric-axis-labels.generator.js +2 -4
- package/dist/chart/components/pane/extent/y-extent-component.d.ts +1 -1
- package/dist/chart/components/pane/extent/y-extent-component.js +11 -1
- package/dist/chart/components/pane/pane.component.d.ts +2 -2
- package/dist/chart/components/volumes/separate-volumes.component.js +1 -2
- package/dist/chart/components/x_axis/time/parser/time-formats.model.d.ts +3 -3
- package/dist/chart/components/x_axis/x-axis-labels.generator.d.ts +8 -13
- package/dist/chart/components/x_axis/x-axis-labels.generator.js +87 -23
- package/dist/chart/components/x_axis/x-axis.component.js +12 -5
- package/dist/chart/components/y_axis/numeric-y-axis-labels.generator.d.ts +2 -1
- package/dist/chart/components/y_axis/numeric-y-axis-labels.generator.js +7 -2
- package/dist/chart/drawers/data-series-drawers/difference-cloud.drawer.d.ts +1 -1
- package/dist/chart/drawers/data-series-drawers/linear-trend.drawer.d.ts +12 -0
- package/dist/chart/drawers/data-series-drawers/linear-trend.drawer.js +42 -0
- package/dist/chart/inputhandlers/hover-producer.component.d.ts +1 -1
- package/dist/chart/inputlisteners/canvas-input-listener.component.js +1 -2
- package/dist/chart/model/data-series-view.d.ts +1 -1
- package/dist/chart/model/data-series.config.d.ts +1 -1
- package/dist/chart/model/data-series.model.d.ts +5 -5
- package/dist/chart/model/data-series.model.js +3 -2
- package/dist/chart/model/scaling/constrait.functions.d.ts +6 -6
- package/dist/chart/utils/array.utils.d.ts +5 -5
- package/dist/chart/utils/candles.utils.d.ts +2 -2
- package/dist/chart/utils/performance/memoize.utils.d.ts +1 -1
- package/dist/chart/utils/price-increments.utils.js +1 -2
- package/dist/dxchart.min.js +6 -6
- package/package.json +31 -33
|
@@ -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 { BarTypes, YAxisLabelAppearanceType, YAxisLabelMode } from '../chart.config';
|
|
7
|
-
export type DataSeriesType = 'POINTS' | 'LINEAR' | 'HISTOGRAM' | 'TREND_HISTOGRAM' | 'DIFFERENCE' | 'TEXT' | 'ABOVE_CANDLE_TEXT' | 'BELOW_CANDLE_TEXT' | 'ABOVE_CANDLE_TRIANGLE' | 'TRIANGLE' | 'COLOR_CANDLE' | 'RECTANGULAR' | 'EMA_CLOUD_LINE' | keyof BarTypes | string;
|
|
7
|
+
export type DataSeriesType = 'POINTS' | 'LINEAR' | 'HISTOGRAM' | 'TREND_HISTOGRAM' | 'DIFFERENCE' | 'TEXT' | 'ABOVE_CANDLE_TEXT' | 'BELOW_CANDLE_TEXT' | 'ABOVE_CANDLE_TRIANGLE' | 'TRIANGLE' | 'COLOR_CANDLE' | 'RECTANGULAR' | 'EMA_CLOUD_LINE' | 'LINEAR_TREND' | keyof BarTypes | string;
|
|
8
8
|
export interface DataSeriesConfig {
|
|
9
9
|
paintConfig: Array<DataSeriesPaintConfig>;
|
|
10
10
|
visible: boolean;
|
|
@@ -43,15 +43,15 @@ export interface DataSeriesViewportIndexes {
|
|
|
43
43
|
* If the data is presented as two-dim array when every data array will be drawn as a separate time-series
|
|
44
44
|
* For example, linear chart type will be drawn with gaps on the chart
|
|
45
45
|
*/
|
|
46
|
-
export declare class DataSeriesModel<D extends DataSeriesPoint = DataSeriesPoint, V extends VisualSeriesPoint = VisualSeriesPoint> extends ChartBaseElement {
|
|
46
|
+
export declare class DataSeriesModel<D extends DataSeriesPoint = DataSeriesPoint, V extends VisualSeriesPoint = VisualSeriesPoint, C extends DataSeriesConfig = DataSeriesConfig> extends ChartBaseElement {
|
|
47
47
|
extentComponent: YExtentComponent;
|
|
48
48
|
id: string;
|
|
49
49
|
htId: number;
|
|
50
|
-
parentId?:
|
|
50
|
+
parentId?: number | string | undefined;
|
|
51
51
|
name: string;
|
|
52
52
|
highlighted: boolean;
|
|
53
53
|
yAxisLabelProvider: DataSeriesYAxisLabelsProvider;
|
|
54
|
-
readonly config:
|
|
54
|
+
readonly config: C;
|
|
55
55
|
scale: ScaleModel;
|
|
56
56
|
view: DataSeriesView;
|
|
57
57
|
protected _dataPoints: D[][];
|
|
@@ -59,7 +59,7 @@ export declare class DataSeriesModel<D extends DataSeriesPoint = DataSeriesPoint
|
|
|
59
59
|
/**
|
|
60
60
|
* Should be used for paint tools like rectangular drawing or diff cloud
|
|
61
61
|
*/
|
|
62
|
-
linkedDataSeriesModels: DataSeriesModel<D, V>[];
|
|
62
|
+
linkedDataSeriesModels: DataSeriesModel<D, V, C>[];
|
|
63
63
|
highLowProvider: HighLowProvider;
|
|
64
64
|
get dataPoints2D(): D[][];
|
|
65
65
|
get dataPoints(): D[];
|
|
@@ -72,7 +72,7 @@ export declare class DataSeriesModel<D extends DataSeriesPoint = DataSeriesPoint
|
|
|
72
72
|
get visualPoints(): V[];
|
|
73
73
|
get visualPoints2D(): V[][];
|
|
74
74
|
set visualPoints(points: V[][] | V[]);
|
|
75
|
-
constructor(extentComponent: YExtentComponent, id: string, htId: number, parentId?:
|
|
75
|
+
constructor(extentComponent: YExtentComponent, id: string, htId: number, parentId?: number | string | undefined, _config?: AtLeastOne<C>);
|
|
76
76
|
protected doActivate(): void;
|
|
77
77
|
/**
|
|
78
78
|
* Sets the data points and recalculates internal state
|
|
@@ -66,7 +66,7 @@ export class DataSeriesModel extends ChartBaseElement {
|
|
|
66
66
|
this._visualPoints = create2DArray(points);
|
|
67
67
|
this._visualPointsFlat = this._visualPoints.flat();
|
|
68
68
|
}
|
|
69
|
-
constructor(extentComponent, id, htId, parentId, _config
|
|
69
|
+
constructor(extentComponent, id, htId, parentId, _config) {
|
|
70
70
|
var _a;
|
|
71
71
|
super();
|
|
72
72
|
this.extentComponent = extentComponent;
|
|
@@ -130,7 +130,8 @@ export class DataSeriesModel extends ChartBaseElement {
|
|
|
130
130
|
const points = this.visualPoints;
|
|
131
131
|
return lastOf(points);
|
|
132
132
|
};
|
|
133
|
-
|
|
133
|
+
const config = _config !== null && _config !== void 0 ? _config : cloneUnsafe(DEFAULT_DATA_SERIES_CONFIG);
|
|
134
|
+
this.config = merge(config, DEFAULT_DATA_SERIES_CONFIG);
|
|
134
135
|
this.scale = extentComponent.scale;
|
|
135
136
|
this.view = new DataSeriesView(this, this.scale, () => this.extentComponent.yAxis.getAxisType(), this.getBaseline);
|
|
136
137
|
this.yAxisLabelProvider = new DataSeriesYAxisLabelsProvider(this, this.config, extentComponent.getYAxisBounds, (_a = extentComponent.yAxis) === null || _a === void 0 ? void 0 : _a.state);
|
|
@@ -18,11 +18,11 @@ import { ViewportModelState } from './viewport.model';
|
|
|
18
18
|
* @doc-tags viewport,zoom,scaling
|
|
19
19
|
*/
|
|
20
20
|
export declare const candleEdgesConstrait: (state: ViewportModelState, visualCandlesCoordinates: VisualCandle[], candleLimit: number, bounds: Bounds) => {
|
|
21
|
-
xStart:
|
|
22
|
-
xEnd:
|
|
23
|
-
yStart:
|
|
24
|
-
yEnd:
|
|
25
|
-
zoomX:
|
|
26
|
-
zoomY:
|
|
21
|
+
xStart: import("./viewport.model").Unit;
|
|
22
|
+
xEnd: import("./viewport.model").Unit;
|
|
23
|
+
yStart: import("./viewport.model").Unit;
|
|
24
|
+
yEnd: import("./viewport.model").Unit;
|
|
25
|
+
zoomX: import("./viewport.model").Zoom;
|
|
26
|
+
zoomY: import("./viewport.model").Zoom;
|
|
27
27
|
inverseY: boolean;
|
|
28
28
|
};
|
|
@@ -50,17 +50,17 @@ type ItemFinder<T> = (item: T) => boolean;
|
|
|
50
50
|
*/
|
|
51
51
|
export declare function replaceInArray<T>(arr: Array<T>, itemFinder: ItemFinder<T>, replace: T): T[];
|
|
52
52
|
export declare const uniqueArray: <T extends string | number>(arr: T[]) => T[];
|
|
53
|
-
export declare const groupBy: <T, K extends keyof T, KV extends T[K] extends string | number ? T[K] : never>(array: T
|
|
53
|
+
export declare const groupBy: <T, K extends keyof T, KV extends T[K] extends string | number ? T[K] : never>(array: Array<T>, key: K) => Record<KV, Array<T>>;
|
|
54
54
|
/**
|
|
55
55
|
* Inserts *something* between every two elements in the source array
|
|
56
56
|
* Example: interleave(['first', 'second', 'third'], 'bar') => ['first', 'bar', 'second', 'bar', 'third']
|
|
57
57
|
* @param arr
|
|
58
58
|
* @param something
|
|
59
59
|
*/
|
|
60
|
-
export declare const interleave: <T>(arr: T
|
|
61
|
-
export declare const isTwoDimArray: <T>(arr: T
|
|
62
|
-
export declare const create2DArray: <T>(arr: T
|
|
63
|
-
export declare const slice2DArray: <T>(arr: T[]
|
|
60
|
+
export declare const interleave: <T>(arr: Array<T>, something: T) => T[];
|
|
61
|
+
export declare const isTwoDimArray: <T>(arr: Array<T> | Array<T[]>) => boolean;
|
|
62
|
+
export declare const create2DArray: <T>(arr: Array<T> | Array<T[]>) => Array<T[]>;
|
|
63
|
+
export declare const slice2DArray: <T>(arr: Array<T[]>, startIdx: number, endIdx: number) => T[][];
|
|
64
64
|
export declare const at: <T>(idx: number, arr: T[]) => T;
|
|
65
65
|
export declare const flat: <T>(arr: T[][]) => T[];
|
|
66
66
|
export declare const flatMap: <T, U>(arr: T[], callback: (value: T, index: number, array: T[]) => U[]) => U[];
|
|
@@ -7,6 +7,6 @@ import { DataSeriesPoint } from '../model/data-series.model';
|
|
|
7
7
|
import { BinarySearchResult } from './array.utils';
|
|
8
8
|
export declare const getDaysOnlyTimestampFn: (isDaysPeriod: boolean) => (timestamp: number) => number;
|
|
9
9
|
export declare const searchCandleIndex: (rawTimestamp: number, options: {
|
|
10
|
-
extrapolate?: boolean
|
|
11
|
-
isDaysPeriod?: boolean
|
|
10
|
+
extrapolate?: boolean;
|
|
11
|
+
isDaysPeriod?: boolean;
|
|
12
12
|
} | undefined, candles: DataSeriesPoint[], periodMs?: number) => BinarySearchResult;
|
|
@@ -12,7 +12,7 @@ export declare const MEMOIZE_CLEAR_FUNCTION: symbol;
|
|
|
12
12
|
* @doc-tags utility
|
|
13
13
|
*/
|
|
14
14
|
export declare function memoize<F extends Function>(this: any, fn: F): F;
|
|
15
|
-
export declare const memoOnce: <A>(E: Eq<A>) => <Args extends A[], R>(f: (...args: Args) => R) => (...args: Args) => R;
|
|
15
|
+
export declare const memoOnce: <A>(E: Eq<A>) => <Args extends A[], R>(f: (...args: Args) => R) => ((...args: Args) => R);
|
|
16
16
|
/**
|
|
17
17
|
* @param {Array.<*>} args
|
|
18
18
|
* @returns {String}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { lastOf } from './array.utils';
|
|
7
7
|
import { floor, MathUtils } from './math.utils';
|
|
8
|
-
class PriceIncrementsUtils {
|
|
8
|
+
export class PriceIncrementsUtils {
|
|
9
9
|
/**
|
|
10
10
|
* Automatically detects increment of provided value range.
|
|
11
11
|
* Naive algorithm takes 1st mantissa number's :
|
|
@@ -123,7 +123,6 @@ PriceIncrementsUtils.DEFAULT_INCREMENT = 0.01;
|
|
|
123
123
|
PriceIncrementsUtils.DEFAULT_PRECISION = 2;
|
|
124
124
|
PriceIncrementsUtils.RELATIVE_EPS = 1e-8;
|
|
125
125
|
PriceIncrementsUtils.MAXIMUM_PRECISION = 10;
|
|
126
|
-
export { PriceIncrementsUtils };
|
|
127
126
|
// TODO review dxFeed precision format
|
|
128
127
|
export const precisionsToIncrement = (price, precisions) => {
|
|
129
128
|
var _a;
|