@candleview/core 2.9.3 → 2.9.5
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 +756 -0
- package/dist/index.d.ts +245 -15
- package/dist/index.js +165 -163
- package/dist/index.mjs +2565 -1808
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -599,6 +599,8 @@ declare class BubbleBoxMark implements IGraph, IMarkStyle {
|
|
|
599
599
|
private _onMouseUp;
|
|
600
600
|
private _isPointNearControlPoint;
|
|
601
601
|
private _updateHoverState;
|
|
602
|
+
private _showHandles;
|
|
603
|
+
setShowHandles(show: boolean): void;
|
|
602
604
|
private _onDoubleClick;
|
|
603
605
|
private _showEditorModal;
|
|
604
606
|
private _onContextMenu;
|
|
@@ -624,6 +626,10 @@ declare class BubbleBoxMark implements IGraph, IMarkStyle {
|
|
|
624
626
|
controlPointPrice(): number;
|
|
625
627
|
bubbleTime(): number;
|
|
626
628
|
bubblePrice(): number;
|
|
629
|
+
getTextColor(): string;
|
|
630
|
+
getFontSize(): number;
|
|
631
|
+
isBold(): boolean;
|
|
632
|
+
isItalic(): boolean;
|
|
627
633
|
getText(): string;
|
|
628
634
|
updateText(text: string): void;
|
|
629
635
|
updateStyles(styles: {
|
|
@@ -673,12 +679,7 @@ declare class BubbleBoxMarkManager implements IMarkManager<BubbleBoxMark> {
|
|
|
673
679
|
private bubbleBoxMarks;
|
|
674
680
|
private dragStartData;
|
|
675
681
|
private isOperating;
|
|
676
|
-
private isCreatingNewBubble;
|
|
677
|
-
private creationStep;
|
|
678
682
|
constructor(props: BubbleBoxMarkManagerProps);
|
|
679
|
-
private _addEventListeners;
|
|
680
|
-
private _removeEventListeners;
|
|
681
|
-
private _handleBubbleBoxMarkDragStart;
|
|
682
683
|
clearState(): void;
|
|
683
684
|
getMarkAtPoint(point: Point): BubbleBoxMark | null;
|
|
684
685
|
getMarkAtPointWithType(point: Point): {
|
|
@@ -719,11 +720,11 @@ declare interface BubbleBoxMarkManagerProps {
|
|
|
719
720
|
|
|
720
721
|
declare interface BubbleBoxMarkState {
|
|
721
722
|
isBubbleBoxMarkMode: boolean;
|
|
722
|
-
|
|
723
|
+
bubbleBoxMarkStartPoint: Point | null;
|
|
723
724
|
currentBubbleBoxMark: BubbleBoxMark | null;
|
|
724
725
|
isDragging: boolean;
|
|
725
726
|
dragTarget: BubbleBoxMark | null;
|
|
726
|
-
|
|
727
|
+
dragPoint: 'controlPoint' | 'bubble' | 'connection' | null;
|
|
727
728
|
}
|
|
728
729
|
|
|
729
730
|
export declare class CandleView {
|
|
@@ -822,6 +823,7 @@ export declare class CandleView {
|
|
|
822
823
|
clearCurrentTool(): void;
|
|
823
824
|
getCurrentTool(): string | null;
|
|
824
825
|
setData(data: ICandleViewDataPoint[]): void;
|
|
826
|
+
updateData(newData: ICandleViewDataPoint[]): void;
|
|
825
827
|
getCurrentTheme(): ThemeConfig;
|
|
826
828
|
setTheme(themeType: 'light' | 'dark'): void;
|
|
827
829
|
setLocale(locale: 'en' | 'zh-cn'): void;
|
|
@@ -832,6 +834,66 @@ export declare class CandleView {
|
|
|
832
834
|
getPriceEvents(): PriceEvent[];
|
|
833
835
|
getChart(): Chart | null;
|
|
834
836
|
destroy(): void;
|
|
837
|
+
/**
|
|
838
|
+
* Add a single static mark
|
|
839
|
+
* @param time Timestamp
|
|
840
|
+
* @param text Mark text
|
|
841
|
+
* @param direction Mark direction (StaticMarkDirection.Top or StaticMarkDirection.Bottom)
|
|
842
|
+
* @param type Mark type (StaticMarkType.Text or StaticMarkType.Arrow)
|
|
843
|
+
* @param options Optional configuration
|
|
844
|
+
*/
|
|
845
|
+
addStaticMark(time: number, text: string, direction: StaticMarkDirection, type: StaticMarkType, options?: IStaticMarkOptions): void;
|
|
846
|
+
/**
|
|
847
|
+
* Add multiple static marks in batch
|
|
848
|
+
* @param marks Array of marks
|
|
849
|
+
*/
|
|
850
|
+
addStaticMarks(marks: IStaticMarkItem[]): void;
|
|
851
|
+
/**
|
|
852
|
+
* Add a text mark (convenience method)
|
|
853
|
+
* @param time Timestamp
|
|
854
|
+
* @param text Mark text
|
|
855
|
+
* @param direction Mark direction
|
|
856
|
+
* @param options Optional configuration
|
|
857
|
+
*/
|
|
858
|
+
addTextMark(time: number, text: string, direction: StaticMarkDirection, options?: IStaticMarkOptions): void;
|
|
859
|
+
/**
|
|
860
|
+
* Add an arrow mark (convenience method)
|
|
861
|
+
* @param time Timestamp
|
|
862
|
+
* @param direction Mark direction
|
|
863
|
+
* @param options Optional configuration
|
|
864
|
+
*/
|
|
865
|
+
addArrowMark(time: number, direction: StaticMarkDirection, options?: IStaticMarkOptions & {
|
|
866
|
+
label?: string;
|
|
867
|
+
}): void;
|
|
868
|
+
/**
|
|
869
|
+
* Add multiple text marks in batch
|
|
870
|
+
* @param marks Array of text marks
|
|
871
|
+
*/
|
|
872
|
+
addTextMarks(marks: Array<{
|
|
873
|
+
time: number;
|
|
874
|
+
text: string;
|
|
875
|
+
direction: StaticMarkDirection;
|
|
876
|
+
options?: IStaticMarkOptions;
|
|
877
|
+
}>): void;
|
|
878
|
+
/**
|
|
879
|
+
* Add multiple arrow marks in batch
|
|
880
|
+
* @param marks Array of arrow marks
|
|
881
|
+
*/
|
|
882
|
+
addArrowMarks(marks: Array<{
|
|
883
|
+
time: number;
|
|
884
|
+
direction: StaticMarkDirection;
|
|
885
|
+
options?: IStaticMarkOptions & {
|
|
886
|
+
label?: string;
|
|
887
|
+
};
|
|
888
|
+
}>): void;
|
|
889
|
+
/**
|
|
890
|
+
* Clear all static marks
|
|
891
|
+
*/
|
|
892
|
+
clearAllStaticMarks(): void;
|
|
893
|
+
/**
|
|
894
|
+
* Get the count of static marks
|
|
895
|
+
*/
|
|
896
|
+
getStaticMarkCount(): number;
|
|
835
897
|
}
|
|
836
898
|
|
|
837
899
|
export declare interface CandleViewConfig {
|
|
@@ -862,8 +924,8 @@ export declare interface CandleViewConfig {
|
|
|
862
924
|
|
|
863
925
|
declare class Chart {
|
|
864
926
|
private container;
|
|
865
|
-
|
|
866
|
-
|
|
927
|
+
originalData: ICandleViewDataPoint[];
|
|
928
|
+
preprocessedData: DataPreprocessResult | null;
|
|
867
929
|
private theme;
|
|
868
930
|
currentTheme: ThemeConfig;
|
|
869
931
|
private chartType;
|
|
@@ -932,6 +994,7 @@ declare class Chart {
|
|
|
932
994
|
private textMarkEditorPosition;
|
|
933
995
|
private textMarkEditorData;
|
|
934
996
|
onExitBrushMode?: () => void;
|
|
997
|
+
leftPanel: LeftPanel | null;
|
|
935
998
|
constructor(options: {
|
|
936
999
|
container: HTMLElement;
|
|
937
1000
|
data: ICandleViewDataPoint[];
|
|
@@ -1034,11 +1097,14 @@ declare class Chart {
|
|
|
1034
1097
|
getVisibleIndicatorTypes(): MainChartIndicatorType[];
|
|
1035
1098
|
updateIndicatorParams(indicatorId: string, newParams: MainChartIndicatorParam[]): void;
|
|
1036
1099
|
toggleIndicatorVisibility(type: MainChartIndicatorType): void;
|
|
1037
|
-
private convertDataByType;
|
|
1038
|
-
private fitContent;
|
|
1039
1100
|
private setupResizeObserver;
|
|
1040
1101
|
handleResize(): void;
|
|
1041
|
-
|
|
1102
|
+
getChart(): IChartApi | null;
|
|
1103
|
+
private indicatorUpdateTimer;
|
|
1104
|
+
private panesUpdateTimer;
|
|
1105
|
+
private marketProfileUpdateTimer;
|
|
1106
|
+
private heatMapUpdateTimer;
|
|
1107
|
+
setData(preprocessedData?: DataPreprocessResult): void;
|
|
1042
1108
|
updateChartType(type: MainChartType): void;
|
|
1043
1109
|
getCurrentTheme(): ThemeConfig;
|
|
1044
1110
|
setTheme(themeType: 'light' | 'dark'): void;
|
|
@@ -1585,7 +1651,6 @@ export declare class DataPreprocessor {
|
|
|
1585
1651
|
|
|
1586
1652
|
export declare interface DataPreprocessResult {
|
|
1587
1653
|
displayData: ICandleViewDataPoint[];
|
|
1588
|
-
hiddenBaseData: ICandleViewDataPoint[];
|
|
1589
1654
|
realDataRange: {
|
|
1590
1655
|
firstIndex: number;
|
|
1591
1656
|
lastIndex: number;
|
|
@@ -2188,11 +2253,9 @@ export declare interface DrawingManagerState {
|
|
|
2188
2253
|
isPinDragging: boolean;
|
|
2189
2254
|
pinDragTarget: any;
|
|
2190
2255
|
isBubbleBoxMarkMode: boolean;
|
|
2191
|
-
bubbleBoxMarkPoints: Point[] | null;
|
|
2192
2256
|
currentBubbleBoxMark: any;
|
|
2193
2257
|
isBubbleBoxDragging: boolean;
|
|
2194
2258
|
bubbleBoxDragTarget: any;
|
|
2195
|
-
bubbleBoxDragType: 'controlPoint' | 'bubble' | 'connection' | null;
|
|
2196
2259
|
isTextEditMarkMode: boolean;
|
|
2197
2260
|
isTextEditDragging: boolean;
|
|
2198
2261
|
textEditDragTarget: any;
|
|
@@ -6027,6 +6090,9 @@ export declare interface I18n {
|
|
|
6027
6090
|
flagMarkDesc: string;
|
|
6028
6091
|
image: string;
|
|
6029
6092
|
imageDesc: string;
|
|
6093
|
+
imageUrl: string;
|
|
6094
|
+
inputImageUrl: string;
|
|
6095
|
+
orInputImageUrl: string;
|
|
6030
6096
|
video: string;
|
|
6031
6097
|
videoDesc: string;
|
|
6032
6098
|
audio: string;
|
|
@@ -6420,6 +6486,147 @@ declare interface IMarkStyle {
|
|
|
6420
6486
|
getCurrentStyles(): Record<string, any>;
|
|
6421
6487
|
}
|
|
6422
6488
|
|
|
6489
|
+
declare interface IStaticMarkItem {
|
|
6490
|
+
time: number;
|
|
6491
|
+
text: string;
|
|
6492
|
+
direction: StaticMarkDirection;
|
|
6493
|
+
type: StaticMarkType;
|
|
6494
|
+
options?: IStaticMarkOptions;
|
|
6495
|
+
}
|
|
6496
|
+
|
|
6497
|
+
declare interface IStaticMarkOptions {
|
|
6498
|
+
textColor?: string;
|
|
6499
|
+
backgroundColor?: string;
|
|
6500
|
+
isCircular?: boolean;
|
|
6501
|
+
fontSize?: number;
|
|
6502
|
+
padding?: number;
|
|
6503
|
+
label?: string;
|
|
6504
|
+
}
|
|
6505
|
+
|
|
6506
|
+
declare class LeftPanel {
|
|
6507
|
+
options: LeftPanelOptions;
|
|
6508
|
+
private theme;
|
|
6509
|
+
private i18n;
|
|
6510
|
+
private element;
|
|
6511
|
+
private container;
|
|
6512
|
+
private toolManager;
|
|
6513
|
+
private state;
|
|
6514
|
+
private drawingModalRef;
|
|
6515
|
+
private emojiPickerRef;
|
|
6516
|
+
private cursorModalRef;
|
|
6517
|
+
private brushModalRef;
|
|
6518
|
+
private fibonacciModalRef;
|
|
6519
|
+
private projectInfoModalRef;
|
|
6520
|
+
private irregularShapeModalRef;
|
|
6521
|
+
private textToolModalRef;
|
|
6522
|
+
private aiModalRef;
|
|
6523
|
+
private scriptModalRef;
|
|
6524
|
+
private scrollContainerRef;
|
|
6525
|
+
private scrollTopBtn;
|
|
6526
|
+
private scrollBottomBtn;
|
|
6527
|
+
constructor(options: LeftPanelOptions);
|
|
6528
|
+
private injectScrollbarStyles;
|
|
6529
|
+
private init;
|
|
6530
|
+
private createDOM;
|
|
6531
|
+
private scrollToTop;
|
|
6532
|
+
private scrollToBottom;
|
|
6533
|
+
private addDivider;
|
|
6534
|
+
private renderCursorTools;
|
|
6535
|
+
private renderLineTools;
|
|
6536
|
+
private renderTecGraphTools;
|
|
6537
|
+
private renderMarkTools;
|
|
6538
|
+
private renderOtherTools;
|
|
6539
|
+
private renderTrash;
|
|
6540
|
+
private createToolButton;
|
|
6541
|
+
private handleToolAction;
|
|
6542
|
+
private updateCursorButtonIcon;
|
|
6543
|
+
private updateToolButtonIcon;
|
|
6544
|
+
private getMaxModalHeight;
|
|
6545
|
+
private showDrawingModal;
|
|
6546
|
+
private showBrushModal;
|
|
6547
|
+
private showCursorModal;
|
|
6548
|
+
private showFibonacciModal;
|
|
6549
|
+
private showProjectInfoModal;
|
|
6550
|
+
private showIrregularShapeModal;
|
|
6551
|
+
private showTextToolModal;
|
|
6552
|
+
private showEmojiModal;
|
|
6553
|
+
private closeModal;
|
|
6554
|
+
closeAllModals(): void;
|
|
6555
|
+
private bindOutsideClick;
|
|
6556
|
+
setActiveTool(toolId: string | null): void;
|
|
6557
|
+
private toggleLock;
|
|
6558
|
+
private toggleVisibility;
|
|
6559
|
+
private updateOtherTools;
|
|
6560
|
+
private getToolConfig;
|
|
6561
|
+
private findToolInGroups;
|
|
6562
|
+
private getIconSvg;
|
|
6563
|
+
private getModalTop;
|
|
6564
|
+
private updateContainerHeight;
|
|
6565
|
+
private updateScrollButtons;
|
|
6566
|
+
private updateScrollButtonsUI;
|
|
6567
|
+
private bindEvents;
|
|
6568
|
+
private handleClickOutside;
|
|
6569
|
+
private setState;
|
|
6570
|
+
updateTheme(theme: Theme): void;
|
|
6571
|
+
updateI18n(i18n: I18n): void;
|
|
6572
|
+
destroy(): void;
|
|
6573
|
+
updateState(updates: Partial<LeftPanelState>): void;
|
|
6574
|
+
isMarkLocked(): boolean;
|
|
6575
|
+
getState(): LeftPanelState;
|
|
6576
|
+
}
|
|
6577
|
+
|
|
6578
|
+
declare interface LeftPanelOptions {
|
|
6579
|
+
container: HTMLElement;
|
|
6580
|
+
theme: Theme;
|
|
6581
|
+
i18n: I18n;
|
|
6582
|
+
onToolSelect?: (tool: string) => void;
|
|
6583
|
+
selectedEmoji?: string;
|
|
6584
|
+
onEmojiSelect?: (emoji: string) => void;
|
|
6585
|
+
state: LeftPanelState;
|
|
6586
|
+
onStateChange: (updates: Partial<LeftPanelState>) => void;
|
|
6587
|
+
chart?: any;
|
|
6588
|
+
}
|
|
6589
|
+
|
|
6590
|
+
declare interface LeftPanelState {
|
|
6591
|
+
isDrawingModalOpen: boolean;
|
|
6592
|
+
isEmojiSelectPopUpOpen: boolean;
|
|
6593
|
+
isBrushModalOpen: boolean;
|
|
6594
|
+
isCursorModalOpen: boolean;
|
|
6595
|
+
isFibonacciModalOpen: boolean;
|
|
6596
|
+
isProjectInfoModalOpen: boolean;
|
|
6597
|
+
isIrregularShapeModalOpen: boolean;
|
|
6598
|
+
isTextToolModalOpen: boolean;
|
|
6599
|
+
isAIToolsModalOpen: boolean;
|
|
6600
|
+
isScriptModalOpen: boolean;
|
|
6601
|
+
selectedEmoji: string;
|
|
6602
|
+
selectedEmojiCategory: string;
|
|
6603
|
+
selectedCursor: string;
|
|
6604
|
+
selectedAITool: string | null;
|
|
6605
|
+
selectedScriptTool: string | null;
|
|
6606
|
+
lastSelectedTools: {
|
|
6607
|
+
drawing: string;
|
|
6608
|
+
brush: string;
|
|
6609
|
+
cursor: string;
|
|
6610
|
+
fibonacci: string;
|
|
6611
|
+
projectInfo: string;
|
|
6612
|
+
irregularShape: string;
|
|
6613
|
+
textTool: string;
|
|
6614
|
+
aiTools: string;
|
|
6615
|
+
script: string;
|
|
6616
|
+
};
|
|
6617
|
+
arrowButtonStates: Record<string, boolean>;
|
|
6618
|
+
toolHoverStates: Record<string, boolean>;
|
|
6619
|
+
isMarkLocked: boolean;
|
|
6620
|
+
isMarkVisibility: boolean;
|
|
6621
|
+
toolSearch: string;
|
|
6622
|
+
containerHeight: number;
|
|
6623
|
+
scrollButtonVisibility: {
|
|
6624
|
+
showTop: boolean;
|
|
6625
|
+
showBottom: boolean;
|
|
6626
|
+
};
|
|
6627
|
+
isBrushActive: boolean;
|
|
6628
|
+
}
|
|
6629
|
+
|
|
6423
6630
|
export declare const Light: ThemeConfig;
|
|
6424
6631
|
|
|
6425
6632
|
declare class LinearRegressionChannelMark implements IGraph, IMarkStyle {
|
|
@@ -7616,6 +7823,11 @@ declare class PinMark implements IGraph, IMarkStyle {
|
|
|
7616
7823
|
};
|
|
7617
7824
|
destroy(): void;
|
|
7618
7825
|
updateText(text: string): void;
|
|
7826
|
+
getText(): string;
|
|
7827
|
+
getTextColor(): string;
|
|
7828
|
+
getFontSize(): number;
|
|
7829
|
+
isBold(): boolean;
|
|
7830
|
+
isItalic(): boolean;
|
|
7619
7831
|
}
|
|
7620
7832
|
|
|
7621
7833
|
declare class PinMarkManager implements IMarkManager<PinMark> {
|
|
@@ -7924,6 +8136,10 @@ declare class PriceLabelMark implements IGraph, IMarkStyle {
|
|
|
7924
8136
|
minY: number;
|
|
7925
8137
|
maxY: any;
|
|
7926
8138
|
} | null;
|
|
8139
|
+
getTextColor(): string;
|
|
8140
|
+
getFontSize(): number;
|
|
8141
|
+
isBold(): boolean;
|
|
8142
|
+
isItalic(): boolean;
|
|
7927
8143
|
}
|
|
7928
8144
|
|
|
7929
8145
|
declare class PriceLabelMarkManager implements IMarkManager<PriceLabelMark> {
|
|
@@ -8958,6 +9174,16 @@ declare interface SignPostMarkState {
|
|
|
8958
9174
|
dragTarget: SignPostMark | null;
|
|
8959
9175
|
}
|
|
8960
9176
|
|
|
9177
|
+
export declare enum StaticMarkDirection {
|
|
9178
|
+
Top = "Top",
|
|
9179
|
+
Bottom = "Bottom"
|
|
9180
|
+
}
|
|
9181
|
+
|
|
9182
|
+
export declare enum StaticMarkType {
|
|
9183
|
+
Text = "Text",
|
|
9184
|
+
Arrow = "Arrow"
|
|
9185
|
+
}
|
|
9186
|
+
|
|
8961
9187
|
export declare enum SubChartIndicatorType {
|
|
8962
9188
|
RSI = "RSI",
|
|
8963
9189
|
MACD = "MACD",
|
|
@@ -9040,6 +9266,10 @@ declare class TextEditMark implements IGraph, IMarkStyle {
|
|
|
9040
9266
|
private requestUpdate;
|
|
9041
9267
|
bubbleTime(): number;
|
|
9042
9268
|
bubblePrice(): number;
|
|
9269
|
+
getTextColor(): string;
|
|
9270
|
+
getFontSize(): number;
|
|
9271
|
+
isBold(): boolean;
|
|
9272
|
+
isItalic(): boolean;
|
|
9043
9273
|
getText(): string;
|
|
9044
9274
|
updateText(text: string): void;
|
|
9045
9275
|
updateStyles(styles: {
|