@barchart/chart-lib 2.200.0 → 2.201.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.
- chart-lib/barchart.chart.d.ts +115 -0
- chart-lib/barchart.chart.js +1 -1
- chart-lib/index.js +123 -8
- chart-lib/package.json +1 -1
chart-lib/barchart.chart.d.ts
CHANGED
|
@@ -956,6 +956,101 @@ declare module "@barchart/chart-lib" {
|
|
|
956
956
|
password: string;
|
|
957
957
|
}
|
|
958
958
|
|
|
959
|
+
export type StudyOptions = {
|
|
960
|
+
source: Field | null;
|
|
961
|
+
inputs: {
|
|
962
|
+
[key: string]: FieldValue;
|
|
963
|
+
};
|
|
964
|
+
outFields?: Field[];
|
|
965
|
+
target?: Field;
|
|
966
|
+
aggregation?: Aggregation;
|
|
967
|
+
};
|
|
968
|
+
|
|
969
|
+
export type TimeSeries = {
|
|
970
|
+
canLoadMoreData: boolean;
|
|
971
|
+
isLoading: boolean;
|
|
972
|
+
container: TimeSeriesContainer | null;
|
|
973
|
+
hasData: boolean;
|
|
974
|
+
calculable?: boolean;
|
|
975
|
+
query?: ITimeSeriesQuery;
|
|
976
|
+
loadMoreData(headChunk?: boolean): Promise<void>;
|
|
977
|
+
ready(): Promise<boolean>;
|
|
978
|
+
getCacheableEntities(unique: Set<TimeSeries>): void;
|
|
979
|
+
refresh(): void;
|
|
980
|
+
shutdown(): void;
|
|
981
|
+
isCached?: boolean;
|
|
982
|
+
record?: Record;
|
|
983
|
+
};
|
|
984
|
+
|
|
985
|
+
export type CalcCtx = {
|
|
986
|
+
tag: string;
|
|
987
|
+
src: TimeSeries | null;
|
|
988
|
+
};
|
|
989
|
+
|
|
990
|
+
export type CalculableTimeSeries = TimeSeries & {
|
|
991
|
+
calculate(calcCtx?: CalcCtx): void;
|
|
992
|
+
recalculateAt(calcCtx: CalcCtx, index: number, add: boolean): void;
|
|
993
|
+
calcCtx?: CalcCtx;
|
|
994
|
+
recalcTriggers: Set<TimeSeries>;
|
|
995
|
+
usedAsStyle?: boolean;
|
|
996
|
+
};
|
|
997
|
+
|
|
998
|
+
export type StudyTimeSeries = CalculableTimeSeries & {
|
|
999
|
+
baseVal(fld: Field, pos: number): FieldValue;
|
|
1000
|
+
get base(): TimeSeriesContainer;
|
|
1001
|
+
atLeast(pos: number, len: number): boolean;
|
|
1002
|
+
past(pos: number, len: number, fld: Field, container: TimeSeriesContainer): FieldValueArray;
|
|
1003
|
+
get source(): Field | null;
|
|
1004
|
+
set source(value: Field | null);
|
|
1005
|
+
target?: Field;
|
|
1006
|
+
};
|
|
1007
|
+
|
|
1008
|
+
export type ValueType = "Number" | "String" | "Date";
|
|
1009
|
+
|
|
1010
|
+
export type FieldModel = {
|
|
1011
|
+
id: string;
|
|
1012
|
+
type: ValueType;
|
|
1013
|
+
category: FieldCategory;
|
|
1014
|
+
name?: string;
|
|
1015
|
+
format: FieldFormat;
|
|
1016
|
+
shortName?: string;
|
|
1017
|
+
};
|
|
1018
|
+
|
|
1019
|
+
export type StudyModel = {
|
|
1020
|
+
id: string;
|
|
1021
|
+
defaults: StudyDefaults;
|
|
1022
|
+
meta: StudyMeta;
|
|
1023
|
+
};
|
|
1024
|
+
|
|
1025
|
+
export type CalculationResult = {
|
|
1026
|
+
[key: string]: FieldValue;
|
|
1027
|
+
};
|
|
1028
|
+
|
|
1029
|
+
export type GetValuesFunc = () => FieldValueArray;
|
|
1030
|
+
|
|
1031
|
+
export type FieldToValuesMapping = {
|
|
1032
|
+
f: Field;
|
|
1033
|
+
g: GetValuesFunc;
|
|
1034
|
+
};
|
|
1035
|
+
|
|
1036
|
+
export type StudySeries = StudyTimeSeries &
|
|
1037
|
+
StudyOptions & {
|
|
1038
|
+
new (options: StudyOptions, ...innerSeries: TimeSeries[]): StudySeries;
|
|
1039
|
+
calculateAt?(pos: number): CalculationResult | null;
|
|
1040
|
+
wrapInner(field: Field, index: number): FieldToValuesMapping;
|
|
1041
|
+
getWrappers?(): FieldToValuesMapping[];
|
|
1042
|
+
};
|
|
1043
|
+
|
|
1044
|
+
export type StudyProvider = {
|
|
1045
|
+
getStudies(): StudyModel[];
|
|
1046
|
+
getFields(): FieldModel[];
|
|
1047
|
+
factory(studyId: string, options: StudyOptions, innerSeries: TimeSeries): StudySeries | null;
|
|
1048
|
+
};
|
|
1049
|
+
|
|
1050
|
+
export type Extensions = {
|
|
1051
|
+
studyProvider?: StudyProvider;
|
|
1052
|
+
};
|
|
1053
|
+
|
|
959
1054
|
/** The configuration is extensively documented at our documentation site. */
|
|
960
1055
|
interface Config {
|
|
961
1056
|
environment?: Environment;
|
|
@@ -977,6 +1072,7 @@ declare module "@barchart/chart-lib" {
|
|
|
977
1072
|
logo?: string;
|
|
978
1073
|
baseUrl?: BaseUrl;
|
|
979
1074
|
overrides?: Overrides;
|
|
1075
|
+
extensions?: Extensions;
|
|
980
1076
|
noDataText?: string;
|
|
981
1077
|
useAllFieldsForComparison?: boolean;
|
|
982
1078
|
credentials?: ICredentials;
|
|
@@ -987,6 +1083,25 @@ declare module "@barchart/chart-lib" {
|
|
|
987
1083
|
getCustomEventPopup(view: any): CustomEventPopup | null;
|
|
988
1084
|
}
|
|
989
1085
|
|
|
1086
|
+
export type Trade = {
|
|
1087
|
+
isTrade: true;
|
|
1088
|
+
symbol?: string;
|
|
1089
|
+
time: Date;
|
|
1090
|
+
tradePrice: number | undefined;
|
|
1091
|
+
tradeSize: number;
|
|
1092
|
+
};
|
|
1093
|
+
|
|
1094
|
+
export type ProcessingResult = {
|
|
1095
|
+
isUpdate: boolean;
|
|
1096
|
+
time: number;
|
|
1097
|
+
index: number;
|
|
1098
|
+
};
|
|
1099
|
+
|
|
1100
|
+
export class OHLCDataPointBuilder {
|
|
1101
|
+
constructor(container: TimeSeriesContainer, agg: Aggregation);
|
|
1102
|
+
process(trade: Trade): ProcessingResult;
|
|
1103
|
+
}
|
|
1104
|
+
|
|
990
1105
|
/** How should the chart be initialized on startup (if at all). Please note that this is suited for cases where the `template` is already made such that it matches the type of the main plot. This is not an issue: if the template doesn't match (main plot is set to a different kind of plot) the main plot will be replaced by the desired plot with all the values set to their defaults. */
|
|
991
1106
|
export type ChartConfig = {
|
|
992
1107
|
/** Make the main a plot a symbol. */
|