candleview 1.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/LICENSE +661 -0
- package/README.md +397 -0
- package/dist/components/CandleView/Camera.d.ts +16 -0
- package/dist/components/CandleView/CandleView.d.ts +149 -0
- package/dist/components/CandleView/ChartLayer/ChartEventManager.d.ts +47 -0
- package/dist/components/CandleView/ChartLayer/ChartInfo.d.ts +62 -0
- package/dist/components/CandleView/ChartLayer/ChartLayerMarkState.d.ts +281 -0
- package/dist/components/CandleView/ChartLayer/ChartManager.d.ts +11 -0
- package/dist/components/CandleView/ChartLayer/ChartMarkManager.d.ts +203 -0
- package/dist/components/CandleView/ChartLayer/ChartMarkTextEditManager.d.ts +16 -0
- package/dist/components/CandleView/ChartLayer/ChartTypeManager.d.ts +17 -0
- package/dist/components/CandleView/ChartLayer/MainChart/Area.d.ts +13 -0
- package/dist/components/CandleView/ChartLayer/MainChart/Bar.d.ts +13 -0
- package/dist/components/CandleView/ChartLayer/MainChart/BaseLine.d.ts +12 -0
- package/dist/components/CandleView/ChartLayer/MainChart/BaselineArea.d.ts +12 -0
- package/dist/components/CandleView/ChartLayer/MainChart/Candlestick.d.ts +12 -0
- package/dist/components/CandleView/ChartLayer/MainChart/HLCArea.d.ts +35 -0
- package/dist/components/CandleView/ChartLayer/MainChart/HeikinAshi.d.ts +12 -0
- package/dist/components/CandleView/ChartLayer/MainChart/HighLow.d.ts +12 -0
- package/dist/components/CandleView/ChartLayer/MainChart/Histogram.d.ts +13 -0
- package/dist/components/CandleView/ChartLayer/MainChart/HollowCandle.d.ts +13 -0
- package/dist/components/CandleView/ChartLayer/MainChart/IMainChart.d.ts +7 -0
- package/dist/components/CandleView/ChartLayer/MainChart/Line.d.ts +13 -0
- package/dist/components/CandleView/ChartLayer/MainChart/LineBreak.d.ts +15 -0
- package/dist/components/CandleView/ChartLayer/MainChart/MainChartManager.d.ts +17 -0
- package/dist/components/CandleView/ChartLayer/MainChart/MarketProfile.d.ts +52 -0
- package/dist/components/CandleView/ChartLayer/MainChart/Mountain.d.ts +12 -0
- package/dist/components/CandleView/ChartLayer/MainChart/StepLine.d.ts +12 -0
- package/dist/components/CandleView/ChartLayer/MainChart/Volume.d.ts +6 -0
- package/dist/components/CandleView/ChartLayer/MainChart/VolumeHeatMap.d.ts +41 -0
- package/dist/components/CandleView/ChartLayer/Modal/ImageUploadModal.d.ts +10 -0
- package/dist/components/CandleView/ChartLayer/Modal/MainChartIndicatorsSettingModal.d.ts +17 -0
- package/dist/components/CandleView/ChartLayer/Modal/SubChartIndicatorsSettingModal.d.ts +17 -0
- package/dist/components/CandleView/ChartLayer/Modal/TextMarkEditorModal.d.ts +21 -0
- package/dist/components/CandleView/ChartLayer/Panes/BaseChartPane.d.ts +41 -0
- package/dist/components/CandleView/ChartLayer/Panes/ChartPaneFactory.d.ts +6 -0
- package/dist/components/CandleView/ChartLayer/Panes/ChartPanesManager.d.ts +31 -0
- package/dist/components/CandleView/ChartLayer/Panes/IChartPanes.d.ts +42 -0
- package/dist/components/CandleView/ChartLayer/SubChart/ADX.d.ts +25 -0
- package/dist/components/CandleView/ChartLayer/SubChart/ATR.d.ts +25 -0
- package/dist/components/CandleView/ChartLayer/SubChart/BBWidth.d.ts +26 -0
- package/dist/components/CandleView/ChartLayer/SubChart/CCI.d.ts +25 -0
- package/dist/components/CandleView/ChartLayer/SubChart/KDJ.d.ts +23 -0
- package/dist/components/CandleView/ChartLayer/SubChart/MACD.d.ts +23 -0
- package/dist/components/CandleView/ChartLayer/SubChart/OBV.d.ts +24 -0
- package/dist/components/CandleView/ChartLayer/SubChart/RSI.d.ts +25 -0
- package/dist/components/CandleView/ChartLayer/SubChart/SAR.d.ts +23 -0
- package/dist/components/CandleView/ChartLayer/SubChart/Stochastic.d.ts +23 -0
- package/dist/components/CandleView/ChartLayer/SubChart/Volume.d.ts +24 -0
- package/dist/components/CandleView/ChartLayer/ToolBar/GraphMarkToolBar.d.ts +51 -0
- package/dist/components/CandleView/ChartLayer/ToolBar/TextMarkToolBar.d.ts +65 -0
- package/dist/components/CandleView/ChartLayer/index.d.ts +291 -0
- package/dist/components/CandleView/DataAdapter.d.ts +28 -0
- package/dist/components/CandleView/DataLoader.d.ts +15 -0
- package/dist/components/CandleView/DataManager.d.ts +23 -0
- package/dist/components/CandleView/DataPointManager.d.ts +45 -0
- package/dist/components/CandleView/I18n.d.ts +418 -0
- package/dist/components/CandleView/Icons.d.ts +161 -0
- package/dist/components/CandleView/Indicators/MainChart/BaseIndicator.d.ts +26 -0
- package/dist/components/CandleView/Indicators/MainChart/BollingerBandsIndicator.d.ts +51 -0
- package/dist/components/CandleView/Indicators/MainChart/DonchianChannelIndicator.d.ts +24 -0
- package/dist/components/CandleView/Indicators/MainChart/EMAIndicator.d.ts +24 -0
- package/dist/components/CandleView/Indicators/MainChart/EnvelopeIndicator.d.ts +52 -0
- package/dist/components/CandleView/Indicators/MainChart/IchimokuIndicator.d.ts +58 -0
- package/dist/components/CandleView/Indicators/MainChart/MAIndicator.d.ts +24 -0
- package/dist/components/CandleView/Indicators/MainChart/MainChartIndicatorInfo.d.ts +24 -0
- package/dist/components/CandleView/Indicators/MainChart/MainChartIndicatorManager.d.ts +28 -0
- package/dist/components/CandleView/Indicators/MainChart/VWAPIndicator.d.ts +26 -0
- package/dist/components/CandleView/Indicators/SubChart/ADXIndicator.d.ts +6 -0
- package/dist/components/CandleView/Indicators/SubChart/ATRIndicator.d.ts +6 -0
- package/dist/components/CandleView/Indicators/SubChart/BBWidthIndicator.d.ts +6 -0
- package/dist/components/CandleView/Indicators/SubChart/CCIIndicator.d.ts +6 -0
- package/dist/components/CandleView/Indicators/SubChart/IIndicator.d.ts +15 -0
- package/dist/components/CandleView/Indicators/SubChart/KDJIndicator.d.ts +6 -0
- package/dist/components/CandleView/Indicators/SubChart/MACDIndicator.d.ts +6 -0
- package/dist/components/CandleView/Indicators/SubChart/OBVIndicator.d.ts +6 -0
- package/dist/components/CandleView/Indicators/SubChart/RSIIndicator.d.ts +6 -0
- package/dist/components/CandleView/Indicators/SubChart/SARIndicator.d.ts +6 -0
- package/dist/components/CandleView/Indicators/SubChart/StochasticIndicator.d.ts +25 -0
- package/dist/components/CandleView/Indicators/SubChart/VolumeIndicator.d.ts +11 -0
- package/dist/components/CandleView/LeftPanel/Config.d.ts +65 -0
- package/dist/components/CandleView/LeftPanel/EmojiConfig.d.ts +21 -0
- package/dist/components/CandleView/LeftPanel/ToolManager.d.ts +5 -0
- package/dist/components/CandleView/LeftPanel/index.d.ts +95 -0
- package/dist/components/CandleView/Mark/Arrow/ArrowLineMark.d.ts +67 -0
- package/dist/components/CandleView/Mark/Arrow/ThickArrowLineMark.d.ts +73 -0
- package/dist/components/CandleView/Mark/Channel/DisjointChannelMark.d.ts +74 -0
- package/dist/components/CandleView/Mark/Channel/EquidistantChannelMark.d.ts +67 -0
- package/dist/components/CandleView/Mark/Channel/LinearRegressionChannelMark.d.ts +70 -0
- package/dist/components/CandleView/Mark/Channel/ParallelChannelMark.d.ts +67 -0
- package/dist/components/CandleView/Mark/Content/ImageMark.d.ts +75 -0
- package/dist/components/CandleView/Mark/Fibonacci/FibonacciArcMark.d.ts +88 -0
- package/dist/components/CandleView/Mark/Fibonacci/FibonacciChannelMark.d.ts +80 -0
- package/dist/components/CandleView/Mark/Fibonacci/FibonacciCircleMark.d.ts +81 -0
- package/dist/components/CandleView/Mark/Fibonacci/FibonacciExtensionBasePriceMark.d.ts +89 -0
- package/dist/components/CandleView/Mark/Fibonacci/FibonacciExtensionBaseTimeMark.d.ts +89 -0
- package/dist/components/CandleView/Mark/Fibonacci/FibonacciFanMark.d.ts +91 -0
- package/dist/components/CandleView/Mark/Fibonacci/FibonacciRetracementMark.d.ts +81 -0
- package/dist/components/CandleView/Mark/Fibonacci/FibonacciSpiralMark.d.ts +95 -0
- package/dist/components/CandleView/Mark/Fibonacci/FibonacciTimeZoonMark.d.ts +71 -0
- package/dist/components/CandleView/Mark/Fibonacci/FibonacciWedgeMark.d.ts +97 -0
- package/dist/components/CandleView/Mark/Fork/AndrewPitchforkMark.d.ts +77 -0
- package/dist/components/CandleView/Mark/Fork/EnhancedAndrewPitchforkMark.d.ts +78 -0
- package/dist/components/CandleView/Mark/Fork/SchiffPitchforkMark.d.ts +86 -0
- package/dist/components/CandleView/Mark/Gann/GannBoxMark.d.ts +100 -0
- package/dist/components/CandleView/Mark/Gann/GannFanMark.d.ts +90 -0
- package/dist/components/CandleView/Mark/Gann/GannRectangleMark.d.ts +106 -0
- package/dist/components/CandleView/Mark/IDeletableMark.d.ts +5 -0
- package/dist/components/CandleView/Mark/IGraph.d.ts +7 -0
- package/dist/components/CandleView/Mark/IMarkManager.d.ts +11 -0
- package/dist/components/CandleView/Mark/IMarkStyle.d.ts +6 -0
- package/dist/components/CandleView/Mark/Line/HorizontalLineMark.d.ts +51 -0
- package/dist/components/CandleView/Mark/Line/LineSegmentMark.d.ts +62 -0
- package/dist/components/CandleView/Mark/Line/VerticalLineMark.d.ts +51 -0
- package/dist/components/CandleView/Mark/Map/HeatMapMark.d.ts +75 -0
- package/dist/components/CandleView/Mark/Mock/MockKLineMark.d.ts +70 -0
- package/dist/components/CandleView/Mark/Pattern/ABCDMark.d.ts +57 -0
- package/dist/components/CandleView/Mark/Pattern/ElliottCorrectiveMark.d.ts +59 -0
- package/dist/components/CandleView/Mark/Pattern/ElliottDoubleCombinationMark.d.ts +59 -0
- package/dist/components/CandleView/Mark/Pattern/ElliottImpulseMark.d.ts +59 -0
- package/dist/components/CandleView/Mark/Pattern/ElliottTriangleMark.d.ts +59 -0
- package/dist/components/CandleView/Mark/Pattern/ElliottTripleCombinationMark.d.ts +59 -0
- package/dist/components/CandleView/Mark/Pattern/HeadAndShouldersMark.d.ts +63 -0
- package/dist/components/CandleView/Mark/Pattern/TriangleABCDMark.d.ts +66 -0
- package/dist/components/CandleView/Mark/Pattern/XABCDMark.d.ts +58 -0
- package/dist/components/CandleView/Mark/Pen/BrushMark.d.ts +67 -0
- package/dist/components/CandleView/Mark/Pen/EraserMark.d.ts +51 -0
- package/dist/components/CandleView/Mark/Pen/MarkerPenMark.d.ts +62 -0
- package/dist/components/CandleView/Mark/Pen/PenMark.d.ts +62 -0
- package/dist/components/CandleView/Mark/Pen/PencilMark.d.ts +62 -0
- package/dist/components/CandleView/Mark/Range/LongPositionMark.d.ts +79 -0
- package/dist/components/CandleView/Mark/Range/PriceRangeMark.d.ts +71 -0
- package/dist/components/CandleView/Mark/Range/ShortPositionMark.d.ts +79 -0
- package/dist/components/CandleView/Mark/Range/TimePriceRangeMark.d.ts +74 -0
- package/dist/components/CandleView/Mark/Range/TimeRangeMark.d.ts +71 -0
- package/dist/components/CandleView/Mark/Shape/CircleMark.d.ts +78 -0
- package/dist/components/CandleView/Mark/Shape/CurveMark.d.ts +70 -0
- package/dist/components/CandleView/Mark/Shape/DoubleCurveMark.d.ts +75 -0
- package/dist/components/CandleView/Mark/Shape/EllipseMark.d.ts +85 -0
- package/dist/components/CandleView/Mark/Shape/RectangleMark.ts.d.ts +65 -0
- package/dist/components/CandleView/Mark/Shape/SectorMark.d.ts +83 -0
- package/dist/components/CandleView/Mark/Shape/TriangleMark.d.ts +91 -0
- package/dist/components/CandleView/Mark/Static/BottomArrowMark.d.ts +13 -0
- package/dist/components/CandleView/Mark/Static/BottomTextMark.d.ts +22 -0
- package/dist/components/CandleView/Mark/Static/MultiBottomArrowMark.d.ts +14 -0
- package/dist/components/CandleView/Mark/Static/MultiBottomTextMark.d.ts +36 -0
- package/dist/components/CandleView/Mark/Static/MultiTopArrowMark.d.ts +14 -0
- package/dist/components/CandleView/Mark/Static/MultiTopTextMark.d.ts +36 -0
- package/dist/components/CandleView/Mark/Static/TopArrowMark.d.ts +13 -0
- package/dist/components/CandleView/Mark/Static/TopTextMark.d.ts +22 -0
- package/dist/components/CandleView/Mark/Text/BubbleBoxMark.d.ts +126 -0
- package/dist/components/CandleView/Mark/Text/EmojiMark.d.ts +72 -0
- package/dist/components/CandleView/Mark/Text/FlagMark.d.ts +63 -0
- package/dist/components/CandleView/Mark/Text/PinMark.d.ts +110 -0
- package/dist/components/CandleView/Mark/Text/PriceLabelMark.d.ts +70 -0
- package/dist/components/CandleView/Mark/Text/PriceNoteMark.d.ts +87 -0
- package/dist/components/CandleView/Mark/Text/SignPostMark.d.ts +110 -0
- package/dist/components/CandleView/Mark/Text/TextEditMark.d.ts +105 -0
- package/dist/components/CandleView/MarkManager/Channel/DisjointChannelMarkManager.d.ts +68 -0
- package/dist/components/CandleView/MarkManager/Channel/EquidistantChannelMarkManager.d.ts +67 -0
- package/dist/components/CandleView/MarkManager/Channel/LinearRegressionChannelMarkManager.d.ts +64 -0
- package/dist/components/CandleView/MarkManager/Channel/ParallelChannelMarkManager.d.ts +67 -0
- package/dist/components/CandleView/MarkManager/Content/ImageMarkManager.d.ts +58 -0
- package/dist/components/CandleView/MarkManager/Elliott/ElliottCorrectiveMarkManager.d.ts +54 -0
- package/dist/components/CandleView/MarkManager/Elliott/ElliottDoubleCombinationMarkManager.d.ts +54 -0
- package/dist/components/CandleView/MarkManager/Elliott/ElliottImpulseMarkManager.d.ts +54 -0
- package/dist/components/CandleView/MarkManager/Elliott/ElliottTriangleMarkManager.d.ts +54 -0
- package/dist/components/CandleView/MarkManager/Elliott/ElliottTripleCombinationMarkManager.d.ts +54 -0
- package/dist/components/CandleView/MarkManager/Fibonacci/FibonacciArcMarkManager.d.ts +54 -0
- package/dist/components/CandleView/MarkManager/Fibonacci/FibonacciChannelMarkManager.d.ts +65 -0
- package/dist/components/CandleView/MarkManager/Fibonacci/FibonacciCircleMarkManager.d.ts +54 -0
- package/dist/components/CandleView/MarkManager/Fibonacci/FibonacciExtensionBasePriceMarkManager.d.ts +55 -0
- package/dist/components/CandleView/MarkManager/Fibonacci/FibonacciExtensionBaseTimeMarkManager.d.ts +55 -0
- package/dist/components/CandleView/MarkManager/Fibonacci/FibonacciFanMarkManager.d.ts +54 -0
- package/dist/components/CandleView/MarkManager/Fibonacci/FibonacciRetracementMarkManager.d.ts +55 -0
- package/dist/components/CandleView/MarkManager/Fibonacci/FibonacciSpiralMarkManager.d.ts +54 -0
- package/dist/components/CandleView/MarkManager/Fibonacci/FibonacciTimeZoonMarkManager.d.ts +54 -0
- package/dist/components/CandleView/MarkManager/Fibonacci/FibonacciWedgeMarkManager.d.ts +57 -0
- package/dist/components/CandleView/MarkManager/Fork/AndrewPitchforkMarkManager.d.ts +72 -0
- package/dist/components/CandleView/MarkManager/Fork/EnhancedAndrewPitchforkMarkManager.d.ts +72 -0
- package/dist/components/CandleView/MarkManager/Fork/SchiffPitchforkMarkManager.d.ts +77 -0
- package/dist/components/CandleView/MarkManager/Gann/GannBoxMarkManager.d.ts +54 -0
- package/dist/components/CandleView/MarkManager/Gann/GannFanMarkManager.d.ts +54 -0
- package/dist/components/CandleView/MarkManager/Gann/GannRectangleManager.d.ts +57 -0
- package/dist/components/CandleView/MarkManager/Line/ArrowLineMarkManager.d.ts +53 -0
- package/dist/components/CandleView/MarkManager/Line/AxisLineMarkManager.d.ts +57 -0
- package/dist/components/CandleView/MarkManager/Line/LineSegmentMarkManager.d.ts +53 -0
- package/dist/components/CandleView/MarkManager/Line/ThickArrowLineMarkManager.d.ts +53 -0
- package/dist/components/CandleView/MarkManager/Map/HeatMapMarkManager.d.ts +65 -0
- package/dist/components/CandleView/MarkManager/Mock/MockKLineMarkManager.d.ts +53 -0
- package/dist/components/CandleView/MarkManager/Pattern/ABCDMarkManager.d.ts +54 -0
- package/dist/components/CandleView/MarkManager/Pattern/HeadAndShouldersMarkManager.d.ts +54 -0
- package/dist/components/CandleView/MarkManager/Pattern/TriangleABCDMarkManager.d.ts +55 -0
- package/dist/components/CandleView/MarkManager/Pattern/XABCDMarkManager.d.ts +54 -0
- package/dist/components/CandleView/MarkManager/Pen/BrushMarkManager.d.ts +56 -0
- package/dist/components/CandleView/MarkManager/Pen/EraserMarkManager.d.ts +52 -0
- package/dist/components/CandleView/MarkManager/Pen/MarkerPenMarkManager.d.ts +56 -0
- package/dist/components/CandleView/MarkManager/Pen/PenMarkManager.d.ts +56 -0
- package/dist/components/CandleView/MarkManager/Pen/PencilMarkManager.d.ts +55 -0
- package/dist/components/CandleView/MarkManager/Range/LongPositionMarkManager.d.ts +64 -0
- package/dist/components/CandleView/MarkManager/Range/PriceRangeMarkManager.d.ts +64 -0
- package/dist/components/CandleView/MarkManager/Range/ShortPositionMarkManager.d.ts +64 -0
- package/dist/components/CandleView/MarkManager/Range/TimePriceRangeMarkManager.d.ts +64 -0
- package/dist/components/CandleView/MarkManager/Range/TimeRangeMarkManager.d.ts +64 -0
- package/dist/components/CandleView/MarkManager/Shape/CircleMarkManager.d.ts +54 -0
- package/dist/components/CandleView/MarkManager/Shape/CurveMarkManager.d.ts +54 -0
- package/dist/components/CandleView/MarkManager/Shape/DoubleCurveMarkManager.d.ts +55 -0
- package/dist/components/CandleView/MarkManager/Shape/EllipseMarkManager.d.ts +56 -0
- package/dist/components/CandleView/MarkManager/Shape/RectangleMarkManager.d.ts +52 -0
- package/dist/components/CandleView/MarkManager/Shape/SectorMarkManager.d.ts +54 -0
- package/dist/components/CandleView/MarkManager/Shape/TriangleMarkManager.d.ts +54 -0
- package/dist/components/CandleView/MarkManager/StaticMarkManager.d.ts +46 -0
- package/dist/components/CandleView/MarkManager/Text/BubbleBoxMarkManager.d.ts +62 -0
- package/dist/components/CandleView/MarkManager/Text/EmojiMarkManager.d.ts +53 -0
- package/dist/components/CandleView/MarkManager/Text/FlagMarkManager.d.ts +52 -0
- package/dist/components/CandleView/MarkManager/Text/PinMarkManager.d.ts +57 -0
- package/dist/components/CandleView/MarkManager/Text/PriceLabelMarkManager.d.ts +52 -0
- package/dist/components/CandleView/MarkManager/Text/PriceNoteMarkManager.d.ts +54 -0
- package/dist/components/CandleView/MarkManager/Text/SignPostMarkManager.d.ts +56 -0
- package/dist/components/CandleView/MarkManager/Text/TextEditMarkManager.d.ts +62 -0
- package/dist/components/CandleView/Theme.d.ts +59 -0
- package/dist/components/CandleView/TopPanel/Config.d.ts +22 -0
- package/dist/components/CandleView/TopPanel/IndicatorProcessing.d.ts +4 -0
- package/dist/components/CandleView/TopPanel/index.d.ts +104 -0
- package/dist/components/CandleView/ViewportManager.d.ts +53 -0
- package/dist/components/CandleView/index.d.ts +2 -0
- package/dist/components/CandleView/tools.d.ts +7 -0
- package/dist/components/CandleView/types.d.ts +200 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +87315 -0
- package/dist/index.js.map +1 -0
- package/dist/index.modern.js +87312 -0
- package/dist/index.modern.js.map +1 -0
- package/dist/index.test.d.ts +1 -0
- package/package.json +93 -0
package/README.md
ADDED
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
<h1 align="center">
|
|
2
|
+
📊 CandleView
|
|
3
|
+
</h1>
|
|
4
|
+
<h4 align="center">
|
|
5
|
+
Chart engine in the financial field.
|
|
6
|
+
</h4>
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://https://github.com/0xhappyboy/candleview/LICENSE"><img src="https://img.shields.io/badge/License-AGPL3.0-d1d1f6.svg?style=flat&labelColor=1C2C2E&color=BEC5C9&logo=googledocs&label=license&logoColor=BEC5C9" alt="License"></a>
|
|
9
|
+
</p>
|
|
10
|
+
<p align="center">
|
|
11
|
+
<a href="./README_zh-CN.md">简体中文</a> | <a href="./README.md">English</a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
# 🚀 Quick Start
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import { CandleView } from "./CandleView";
|
|
18
|
+
|
|
19
|
+
const App = () => {
|
|
20
|
+
return (
|
|
21
|
+
<CandleView
|
|
22
|
+
title="BTC/USDT"
|
|
23
|
+
height={600}
|
|
24
|
+
theme="dark"
|
|
25
|
+
i18n="en"
|
|
26
|
+
showToolbar={true}
|
|
27
|
+
showLeftPanel={true}
|
|
28
|
+
showTopPanel={true}
|
|
29
|
+
timeframe="1d"
|
|
30
|
+
timezone="America/New_York"
|
|
31
|
+
data={klineData}
|
|
32
|
+
/>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
# Preview
|
|
38
|
+
|
|
39
|
+
## Theme
|
|
40
|
+
|
|
41
|
+
<table>
|
|
42
|
+
<tr>
|
|
43
|
+
<td align="left">
|
|
44
|
+
<h4>Dark</h4>
|
|
45
|
+
</td>
|
|
46
|
+
<td align="left">
|
|
47
|
+
<h4>Light</h4>
|
|
48
|
+
</td>
|
|
49
|
+
</tr>
|
|
50
|
+
<tr>
|
|
51
|
+
<td align="center"><img src="./assets/preview_theme_dark.png" width="400"></td>
|
|
52
|
+
<td align="center"><img src="./assets/preview_theme_light.png" width="400"></td>
|
|
53
|
+
</tr>
|
|
54
|
+
</table>
|
|
55
|
+
|
|
56
|
+
## I18n
|
|
57
|
+
|
|
58
|
+
<table>
|
|
59
|
+
<tr>
|
|
60
|
+
<td align="left">
|
|
61
|
+
<h4>En</h4>
|
|
62
|
+
</td>
|
|
63
|
+
<td align="left">
|
|
64
|
+
<h4>zh-CN</h4>
|
|
65
|
+
</td>
|
|
66
|
+
</tr>
|
|
67
|
+
<tr>
|
|
68
|
+
<td align="center"><img src="./assets/preview_i18n_en.png" width="400"></td>
|
|
69
|
+
<td align="center"><img src="./assets/preview_i18n_zh-CN.png" width="400"></td>
|
|
70
|
+
</tr>
|
|
71
|
+
</table>
|
|
72
|
+
|
|
73
|
+
# 🔧 Configuration Options
|
|
74
|
+
|
|
75
|
+
## Props
|
|
76
|
+
|
|
77
|
+
| Parameter | Type | Default | Description | Required |
|
|
78
|
+
| ------------------------- | -------------------------------------------------------------------------------------------------------- | ----------------- | ---------------------------------------- | -------- |
|
|
79
|
+
| `theme` | `'dark' \| 'light'` | `'dark'` | Theme mode | No |
|
|
80
|
+
| `i18n` | `'en' \| 'zh-cn'` | `'zh-cn'` | Language setting | No |
|
|
81
|
+
| `height` | `number \| string` | `500` | Chart height (px or percentage) | No |
|
|
82
|
+
| `title` | `string` | `''` | Chart title displayed on the chart | Yes |
|
|
83
|
+
| `showToolbar` | `boolean` | `true` | Show top toolbar | No |
|
|
84
|
+
| `showLeftPanel` | `boolean` | `true` | Show left drawing tools panel | No |
|
|
85
|
+
| `showTopPanel` | `boolean` | `true` | Show top settings panel | No |
|
|
86
|
+
| `showIndicators` | `boolean` | `true` | Show indicators panel | No |
|
|
87
|
+
| `timeframe` | `string` | `'1d'` | Chart timeframe (e.g., '1m', '1h', '1d') | No |
|
|
88
|
+
| `timezone` | `string` | `'Asia/Shanghai'` | Timezone for data display | No |
|
|
89
|
+
| `data` | `ICandleViewDataPoint[]` | `[]` | K-line data array | No |
|
|
90
|
+
| `jsonFilePath` | `string` | `''` | Path to JSON data file | No |
|
|
91
|
+
| `url` | `string` | `''` | URL to fetch data from | No |
|
|
92
|
+
| `markData` | `IStaticMarkData[]` | `[]` | Pre-drawn marks data | No |
|
|
93
|
+
| `handleScreenshotCapture` | `(imageData: { dataUrl: string; blob: Blob; width: number; height: number; timestamp: number }) => void` | `undefined` | Callback for screenshot capture | No |
|
|
94
|
+
|
|
95
|
+
## ⏰ Supported Timeframes
|
|
96
|
+
|
|
97
|
+
### Second-based Timeframes
|
|
98
|
+
|
|
99
|
+
| Value | Display Name | Description |
|
|
100
|
+
| ------- | ------------------ | ----------- |
|
|
101
|
+
| `'1S'` | 1 秒 / 1 Second | 1 second |
|
|
102
|
+
| `'5S'` | 5 秒 / 5 Seconds | 5 seconds |
|
|
103
|
+
| `'15S'` | 15 秒 / 15 Seconds | 15 seconds |
|
|
104
|
+
| `'30S'` | 30 秒 / 30 Seconds | 30 seconds |
|
|
105
|
+
|
|
106
|
+
### Minute-based Timeframes
|
|
107
|
+
|
|
108
|
+
| Value | Display Name | Description |
|
|
109
|
+
| ------- | ------------------ | ----------- |
|
|
110
|
+
| `'1M'` | 1 分 / 1 Minute | 1 minute |
|
|
111
|
+
| `'3M'` | 3 分 / 3 Minutes | 3 minutes |
|
|
112
|
+
| `'5M'` | 5 分 / 5 Minutes | 5 minutes |
|
|
113
|
+
| `'15M'` | 15 分 / 15 Minutes | 15 minutes |
|
|
114
|
+
| `'30M'` | 30 分 / 30 Minutes | 30 minutes |
|
|
115
|
+
| `'45M'` | 45 分 / 45 Minutes | 45 minutes |
|
|
116
|
+
|
|
117
|
+
### Hour-based Timeframes
|
|
118
|
+
|
|
119
|
+
| Value | Display Name | Description |
|
|
120
|
+
| ------- | ------------------ | ----------- |
|
|
121
|
+
| `'1H'` | 1 小时 / 1 Hour | 1 hour |
|
|
122
|
+
| `'2H'` | 2 小时 / 2 Hours | 2 hours |
|
|
123
|
+
| `'3H'` | 3 小时 / 3 Hours | 3 hours |
|
|
124
|
+
| `'4H'` | 4 小时 / 4 Hours | 4 hours |
|
|
125
|
+
| `'6H'` | 6 小时 / 6 Hours | 6 hours |
|
|
126
|
+
| `'8H'` | 8 小时 / 8 Hours | 8 hours |
|
|
127
|
+
| `'12H'` | 12 小时 / 12 Hours | 12 hours |
|
|
128
|
+
|
|
129
|
+
### Day-based Timeframes
|
|
130
|
+
|
|
131
|
+
| Value | Display Name | Description |
|
|
132
|
+
| ------ | ------------- | ----------- |
|
|
133
|
+
| `'1D'` | 1 日 / 1 Day | 1 day |
|
|
134
|
+
| `'3D'` | 3 日 / 3 Days | 3 days |
|
|
135
|
+
|
|
136
|
+
### Week-based Timeframes
|
|
137
|
+
|
|
138
|
+
| Value | Display Name | Description |
|
|
139
|
+
| ------ | -------------- | ----------- |
|
|
140
|
+
| `'1W'` | 1 周 / 1 Week | 1 week |
|
|
141
|
+
| `'2W'` | 2 周 / 2 Weeks | 2 weeks |
|
|
142
|
+
|
|
143
|
+
### Month-based Timeframes
|
|
144
|
+
|
|
145
|
+
| Value | Display Name | Description |
|
|
146
|
+
| -------- | --------------- | ----------- |
|
|
147
|
+
| `'1MON'` | 1 月 / 1 Month | 1 month |
|
|
148
|
+
| `'3MON'` | 3 月 / 3 Months | 3 months |
|
|
149
|
+
| `'6MON'` | 6 月 / 6 Months | 6 months |
|
|
150
|
+
|
|
151
|
+
## 🌍 Supported Timezones
|
|
152
|
+
|
|
153
|
+
### Americas
|
|
154
|
+
|
|
155
|
+
| Timezone ID | Display Name | UTC Offset | Major Cities |
|
|
156
|
+
| ----------------------- | -------------------- | ----------- | -------------------------- |
|
|
157
|
+
| `'America/New_York'` | 纽约 / New York | UTC-5/UTC-4 | New York, Washington DC |
|
|
158
|
+
| `'America/Chicago'` | 芝加哥 / Chicago | UTC-6/UTC-5 | Chicago, Dallas |
|
|
159
|
+
| `'America/Denver'` | 丹佛 / Denver | UTC-7/UTC-6 | Denver, Phoenix |
|
|
160
|
+
| `'America/Los_Angeles'` | 洛杉矶 / Los Angeles | UTC-8/UTC-7 | Los Angeles, San Francisco |
|
|
161
|
+
| `'America/Toronto'` | 多伦多 / Toronto | UTC-5/UTC-4 | Toronto, Montreal |
|
|
162
|
+
|
|
163
|
+
### Europe
|
|
164
|
+
|
|
165
|
+
| Timezone ID | Display Name | UTC Offset | Major Cities |
|
|
166
|
+
| ----------------- | -------------------- | ----------- | -------------------- |
|
|
167
|
+
| `'Europe/London'` | 伦敦 / London | UTC+0/UTC+1 | London, Dublin |
|
|
168
|
+
| `'Europe/Paris'` | 巴黎 / Paris | UTC+1/UTC+2 | Paris, Berlin |
|
|
169
|
+
| `'Europe/Berlin'` | 法兰克福 / Frankfurt | UTC+1/UTC+2 | Frankfurt, Amsterdam |
|
|
170
|
+
| `'Europe/Zurich'` | 苏黎世 / Zurich | UTC+1/UTC+2 | Zurich, Vienna |
|
|
171
|
+
| `'Europe/Moscow'` | 莫斯科 / Moscow | UTC+3 | Moscow, Istanbul |
|
|
172
|
+
|
|
173
|
+
### Asia
|
|
174
|
+
|
|
175
|
+
| Timezone ID | Display Name | UTC Offset | Major Cities |
|
|
176
|
+
| ------------------ | ------------------ | ---------- | ----------------------- |
|
|
177
|
+
| `'Asia/Dubai'` | 迪拜 / Dubai | UTC+4 | Dubai, Abu Dhabi |
|
|
178
|
+
| `'Asia/Karachi'` | 卡拉奇 / Karachi | UTC+5 | Karachi, Lahore |
|
|
179
|
+
| `'Asia/Kolkata'` | 加尔各答 / Kolkata | UTC+5:30 | Kolkata, Mumbai |
|
|
180
|
+
| `'Asia/Shanghai'` | 上海 / Shanghai | UTC+8 | Shanghai, Beijing |
|
|
181
|
+
| `'Asia/Hong_Kong'` | 香港 / Hong Kong | UTC+8 | Hong Kong, Macau |
|
|
182
|
+
| `'Asia/Singapore'` | 新加坡 / Singapore | UTC+8 | Singapore, Kuala Lumpur |
|
|
183
|
+
| `'Asia/Tokyo'` | 东京 / Tokyo | UTC+9 | Tokyo, Seoul |
|
|
184
|
+
| `'Asia/Seoul'` | 首尔 / Seoul | UTC+9 | Seoul, Pyongyang |
|
|
185
|
+
|
|
186
|
+
### Pacific
|
|
187
|
+
|
|
188
|
+
| Timezone ID | Display Name | UTC Offset | Major Cities |
|
|
189
|
+
| -------------------- | ----------------- | ------------- | -------------------- |
|
|
190
|
+
| `'Australia/Sydney'` | 悉尼 / Sydney | UTC+10/UTC+11 | Sydney, Melbourne |
|
|
191
|
+
| `'Pacific/Auckland'` | 奥克兰 / Auckland | UTC+12/UTC+13 | Auckland, Wellington |
|
|
192
|
+
|
|
193
|
+
### Global
|
|
194
|
+
|
|
195
|
+
| Timezone ID | Display Name | UTC Offset | Description |
|
|
196
|
+
| ----------- | ------------ | ---------- | -------------------------- |
|
|
197
|
+
| `'UTC'` | UTC / UTC | UTC+0 | Coordinated Universal Time |
|
|
198
|
+
|
|
199
|
+
## 📄 Data structure
|
|
200
|
+
|
|
201
|
+
```typescript
|
|
202
|
+
interface ICandleViewDataPoint {
|
|
203
|
+
time: number; // timestamp in seconds
|
|
204
|
+
open: number;
|
|
205
|
+
high: number;
|
|
206
|
+
low: number;
|
|
207
|
+
close: number;
|
|
208
|
+
volume?: number;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export interface IStaticMarkData {
|
|
212
|
+
time: number;
|
|
213
|
+
type: string;
|
|
214
|
+
data: {
|
|
215
|
+
direction: string;
|
|
216
|
+
text: string;
|
|
217
|
+
fontSize?: number;
|
|
218
|
+
textColor?: string;
|
|
219
|
+
backgroundColor?: string;
|
|
220
|
+
isCircular?: boolean;
|
|
221
|
+
padding?: number;
|
|
222
|
+
}[];
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
# 🌟 Core Features
|
|
227
|
+
|
|
228
|
+
## 📈 Supported Technical Indicators
|
|
229
|
+
|
|
230
|
+
### Main Chart Indicators
|
|
231
|
+
|
|
232
|
+
- Moving Average (MA)
|
|
233
|
+
- Exponential Moving Average (EMA)
|
|
234
|
+
- Bollinger Bands
|
|
235
|
+
- Ichimoku Cloud
|
|
236
|
+
- Donchian Channel
|
|
237
|
+
- Envelope
|
|
238
|
+
- Volume Weighted Average Price (VWAP)
|
|
239
|
+
- Heat Map
|
|
240
|
+
- Market Profile
|
|
241
|
+
|
|
242
|
+
### Sub Chart Indicators
|
|
243
|
+
|
|
244
|
+
- Relative Strength Index (RSI)
|
|
245
|
+
- Moving Average Convergence Divergence (MACD)
|
|
246
|
+
- Volume
|
|
247
|
+
- Parabolic SAR
|
|
248
|
+
- KDJ Indicator
|
|
249
|
+
- Average True Range (ATR)
|
|
250
|
+
- Stochastic Oscillator
|
|
251
|
+
- Commodity Channel Index (CCI)
|
|
252
|
+
- Bollinger Bands Width
|
|
253
|
+
- Average Directional Index (ADX)
|
|
254
|
+
- On Balance Volume (OBV)
|
|
255
|
+
|
|
256
|
+
## 🎨 Supported Drawing Tools
|
|
257
|
+
|
|
258
|
+
### Basic Tools
|
|
259
|
+
|
|
260
|
+
- Pencil, Pen, Brush, Marker Pen, Eraser
|
|
261
|
+
- Line Segment, Horizontal Line, Vertical Line
|
|
262
|
+
- Arrow Line, Thick Arrow Line
|
|
263
|
+
|
|
264
|
+
### Channel Tools
|
|
265
|
+
|
|
266
|
+
- Parallel Channel
|
|
267
|
+
- Linear Regression Channel
|
|
268
|
+
- Equidistant Channel
|
|
269
|
+
- Disjoint Channel
|
|
270
|
+
|
|
271
|
+
### Fibonacci Tools
|
|
272
|
+
|
|
273
|
+
- Fibonacci Retracement
|
|
274
|
+
- Fibonacci Time Zones
|
|
275
|
+
- Fibonacci Arc
|
|
276
|
+
- Fibonacci Circle
|
|
277
|
+
- Fibonacci Spiral
|
|
278
|
+
- Fibonacci Fan
|
|
279
|
+
- Fibonacci Channel
|
|
280
|
+
- Fibonacci Price Extension
|
|
281
|
+
- Fibonacci Time Extension
|
|
282
|
+
|
|
283
|
+
### Gann Tools
|
|
284
|
+
|
|
285
|
+
- Gann Fan
|
|
286
|
+
- Gann Box
|
|
287
|
+
- Gann Rectangle
|
|
288
|
+
|
|
289
|
+
### Pattern Tools
|
|
290
|
+
|
|
291
|
+
- Andrew Pitchfork
|
|
292
|
+
- Enhanced Andrew Pitchfork
|
|
293
|
+
- Schiff Pitchfork
|
|
294
|
+
- XABCD Pattern
|
|
295
|
+
- Head and Shoulders
|
|
296
|
+
- ABCD Pattern
|
|
297
|
+
- Triangle ABCD Pattern
|
|
298
|
+
|
|
299
|
+
### Elliott Wave
|
|
300
|
+
|
|
301
|
+
- Elliott Impulse Wave
|
|
302
|
+
- Elliott Corrective Wave
|
|
303
|
+
- Elliott Triangle
|
|
304
|
+
- Elliott Double Combination
|
|
305
|
+
- Elliott Triple Combination
|
|
306
|
+
|
|
307
|
+
### Geometric Shapes
|
|
308
|
+
|
|
309
|
+
- Rectangle, Circle, Ellipse, Triangle
|
|
310
|
+
- Sector, Curve, Double Curve
|
|
311
|
+
|
|
312
|
+
### Annotation Tools
|
|
313
|
+
|
|
314
|
+
- Text Annotation, Price Note
|
|
315
|
+
- Bubble Box, Pin, Signpost
|
|
316
|
+
- Price Label, Flag Mark
|
|
317
|
+
- Image Insertion
|
|
318
|
+
|
|
319
|
+
### Range Tools
|
|
320
|
+
|
|
321
|
+
- Time Range, Price Range
|
|
322
|
+
- Time-Price Range
|
|
323
|
+
- Heat Map
|
|
324
|
+
|
|
325
|
+
### Trading Tools
|
|
326
|
+
|
|
327
|
+
- Long Position, Short Position
|
|
328
|
+
- Mock K-line
|
|
329
|
+
|
|
330
|
+
## ⏰ Supported Timeframes
|
|
331
|
+
|
|
332
|
+
### Second-based
|
|
333
|
+
|
|
334
|
+
- 1s, 5s, 15s, 30s
|
|
335
|
+
|
|
336
|
+
### Minute-based
|
|
337
|
+
|
|
338
|
+
- 1m, 3m, 5m, 15m
|
|
339
|
+
- 30m, 45m
|
|
340
|
+
|
|
341
|
+
### Hour-based
|
|
342
|
+
|
|
343
|
+
- 1h, 2h, 3h, 4h
|
|
344
|
+
- 6h, 8h, 12h
|
|
345
|
+
|
|
346
|
+
### Day-based
|
|
347
|
+
|
|
348
|
+
- 1d, 3d
|
|
349
|
+
|
|
350
|
+
### Week-based
|
|
351
|
+
|
|
352
|
+
- 1w, 2w
|
|
353
|
+
|
|
354
|
+
### Month-based
|
|
355
|
+
|
|
356
|
+
- 1M, 3M, 6M
|
|
357
|
+
|
|
358
|
+
## 🌍 Supported Timezones
|
|
359
|
+
|
|
360
|
+
- New York (America/New_York)
|
|
361
|
+
- Chicago (America/Chicago)
|
|
362
|
+
- Denver (America/Denver)
|
|
363
|
+
- Los Angeles (America/Los_Angeles)
|
|
364
|
+
- Toronto (America/Toronto)
|
|
365
|
+
- London (Europe/London)
|
|
366
|
+
- Paris (Europe/Paris)
|
|
367
|
+
- Frankfurt (Europe/Berlin)
|
|
368
|
+
- Zurich (Europe/Zurich)
|
|
369
|
+
- Moscow (Europe/Moscow)
|
|
370
|
+
- Dubai (Asia/Dubai)
|
|
371
|
+
- Karachi (Asia/Karachi)
|
|
372
|
+
- Kolkata (Asia/Kolkata)
|
|
373
|
+
- Shanghai (Asia/Shanghai)
|
|
374
|
+
- Hong Kong (Asia/Hong_Kong)
|
|
375
|
+
- Singapore (Asia/Singapore)
|
|
376
|
+
- Tokyo (Asia/Tokyo)
|
|
377
|
+
- Seoul (Asia/Seoul)
|
|
378
|
+
- Sydney (Australia/Sydney)
|
|
379
|
+
- Auckland (Pacific/Auckland)
|
|
380
|
+
- UTC
|
|
381
|
+
|
|
382
|
+
## 🎯 Supported Chart Types
|
|
383
|
+
|
|
384
|
+
- Candlestick Chart
|
|
385
|
+
- Hollow Candlestick Chart
|
|
386
|
+
- Bar Chart (OHLC)
|
|
387
|
+
- BaseLine Chart
|
|
388
|
+
- Line Chart
|
|
389
|
+
- Area Chart
|
|
390
|
+
- Step Line Chart
|
|
391
|
+
- Heikin Ashi Chart
|
|
392
|
+
- Histogram Chart
|
|
393
|
+
- Line Break Chart
|
|
394
|
+
- Mountain Chart
|
|
395
|
+
- Baseline Area Chart
|
|
396
|
+
- High Low Chart
|
|
397
|
+
- HLCArea Chart
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CandleView } from "./CandleView";
|
|
2
|
+
export interface CaptureResult {
|
|
3
|
+
success: boolean;
|
|
4
|
+
dataUrl?: string;
|
|
5
|
+
blob?: Blob;
|
|
6
|
+
error?: string;
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
timestamp: number;
|
|
10
|
+
}
|
|
11
|
+
export declare type CaptureCallback = (result: CaptureResult) => void;
|
|
12
|
+
export declare function captureWithCanvas(candleView: CandleView, callback?: CaptureCallback): Promise<CaptureResult>;
|
|
13
|
+
export declare function drawHTMLElementsToCanvas(candleView: CandleView, container: HTMLElement, ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
14
|
+
export declare function drawElementToCanvas(candleView: CandleView, element: HTMLElement, ctx: CanvasRenderingContext2D, container: HTMLElement): void;
|
|
15
|
+
export declare function drawElementContent(candleView: CandleView, element: HTMLElement, ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
16
|
+
export declare function wrapText(candleView: CandleView, ctx: CanvasRenderingContext2D, text: string, maxWidth: number): string[];
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MainChartIndicatorInfo } from './Indicators/MainChart/MainChartIndicatorInfo';
|
|
3
|
+
import { I18n } from './I18n';
|
|
4
|
+
import { ICandleViewDataPoint, MainChartType, SubChartIndicatorType, TimeframeEnum, TimezoneEnum } from './types';
|
|
5
|
+
import { IStaticMarkData } from './MarkManager/StaticMarkManager';
|
|
6
|
+
import { ThemeConfig } from './Theme';
|
|
7
|
+
export interface CandleViewProps {
|
|
8
|
+
theme?: 'dark' | 'light';
|
|
9
|
+
i18n?: 'en' | 'zh-cn';
|
|
10
|
+
showToolbar?: boolean;
|
|
11
|
+
showIndicators?: boolean;
|
|
12
|
+
height?: number | string;
|
|
13
|
+
title: string;
|
|
14
|
+
showTopPanel?: boolean;
|
|
15
|
+
showLeftPanel?: boolean;
|
|
16
|
+
markData?: IStaticMarkData[];
|
|
17
|
+
timeframe?: string;
|
|
18
|
+
timezone?: string;
|
|
19
|
+
data?: ICandleViewDataPoint[];
|
|
20
|
+
jsonFilePath?: string;
|
|
21
|
+
url?: string;
|
|
22
|
+
handleScreenshotCapture?: (imageData: {
|
|
23
|
+
dataUrl: string;
|
|
24
|
+
blob: Blob;
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
timestamp: number;
|
|
28
|
+
}) => void;
|
|
29
|
+
}
|
|
30
|
+
interface CandleViewState {
|
|
31
|
+
isIndicatorModalOpen: boolean;
|
|
32
|
+
isTimeframeModalOpen: boolean;
|
|
33
|
+
isTradeModalOpen: boolean;
|
|
34
|
+
isChartTypeModalOpen: boolean;
|
|
35
|
+
isSubChartModalOpen: boolean;
|
|
36
|
+
isMobileMenuOpen: boolean;
|
|
37
|
+
activeTool: string | null;
|
|
38
|
+
currentTheme: ThemeConfig;
|
|
39
|
+
currentI18N: I18n;
|
|
40
|
+
chartInitialized: boolean;
|
|
41
|
+
isDarkTheme: boolean;
|
|
42
|
+
selectedEmoji: string;
|
|
43
|
+
subChartPanelHeight: number;
|
|
44
|
+
isResizing: boolean;
|
|
45
|
+
showInfoLayer: boolean;
|
|
46
|
+
isTimezoneModalOpen: boolean;
|
|
47
|
+
currentTimezone: string;
|
|
48
|
+
isTimeFormatModalOpen: boolean;
|
|
49
|
+
isCloseTimeModalOpen: boolean;
|
|
50
|
+
isTradingDayModalOpen: boolean;
|
|
51
|
+
currentCloseTime: string;
|
|
52
|
+
currentTradingDayType: string;
|
|
53
|
+
activeTimeframe: TimeframeEnum;
|
|
54
|
+
timeframe?: TimeframeEnum;
|
|
55
|
+
timezone?: TimezoneEnum;
|
|
56
|
+
savedVisibleRange: {
|
|
57
|
+
from: number;
|
|
58
|
+
to: number;
|
|
59
|
+
} | null;
|
|
60
|
+
currentMainChartType: MainChartType;
|
|
61
|
+
selectedSubChartIndicators: SubChartIndicatorType[];
|
|
62
|
+
selectedMainChartIndicator: MainChartIndicatorInfo | null;
|
|
63
|
+
virtualDataBeforeCount: number;
|
|
64
|
+
virtualDataAfterCount: number;
|
|
65
|
+
displayData: ICandleViewDataPoint[];
|
|
66
|
+
isDataLoading: boolean;
|
|
67
|
+
dataLoadProgress: number;
|
|
68
|
+
loadError: string | null;
|
|
69
|
+
}
|
|
70
|
+
export declare class CandleView extends React.Component<CandleViewProps, CandleViewState> {
|
|
71
|
+
candleViewContainerRef: React.RefObject<HTMLDivElement>;
|
|
72
|
+
private chartRef;
|
|
73
|
+
private chartContainerRef;
|
|
74
|
+
private drawingLayerRef;
|
|
75
|
+
private chart;
|
|
76
|
+
private resizeObserver;
|
|
77
|
+
private realTimeInterval;
|
|
78
|
+
private currentSeries;
|
|
79
|
+
private chartManager;
|
|
80
|
+
private updateTimeout;
|
|
81
|
+
private viewportManager;
|
|
82
|
+
private chartEventManager;
|
|
83
|
+
private preparedData;
|
|
84
|
+
private originalData;
|
|
85
|
+
constructor(props: CandleViewProps);
|
|
86
|
+
componentDidMount(): void;
|
|
87
|
+
componentDidUpdate(prevProps: CandleViewProps, prevState: CandleViewState): void;
|
|
88
|
+
componentWillUnmount(): void;
|
|
89
|
+
private loadDataAsync;
|
|
90
|
+
private loadExternalData;
|
|
91
|
+
private loadInternalData;
|
|
92
|
+
initializeChart(): void;
|
|
93
|
+
handleTimeFormatClick: () => void;
|
|
94
|
+
handleCloseTimeClick: () => void;
|
|
95
|
+
handleTradingDayClick: () => void;
|
|
96
|
+
handleTimezoneClick: () => void;
|
|
97
|
+
handleCloseModals: () => void;
|
|
98
|
+
handleTimezoneSelect: (timezone: string) => void;
|
|
99
|
+
handleTimeframeSelect: (timeframe: string) => void;
|
|
100
|
+
private loadInternalDataAsync;
|
|
101
|
+
private initChart;
|
|
102
|
+
private refreshChart;
|
|
103
|
+
private refreshExternalData;
|
|
104
|
+
private refreshInternalData;
|
|
105
|
+
handleSelectedSubChartIndicator: (indicators: SubChartIndicatorType[]) => void;
|
|
106
|
+
handleRemoveSubChartIndicator: (indicatorId: string) => void;
|
|
107
|
+
handleCameraClick: () => void;
|
|
108
|
+
private fallbackToDownload;
|
|
109
|
+
serializeDrawings: () => string;
|
|
110
|
+
handleSubChartClick: () => void;
|
|
111
|
+
deserializeDrawings: (data: string) => void;
|
|
112
|
+
clearAllDrawings: () => void;
|
|
113
|
+
private viewportDataBufferSize;
|
|
114
|
+
private handleVisibleTimeRangeChange;
|
|
115
|
+
setupResizeObserver(): void;
|
|
116
|
+
updateChartTheme(): void;
|
|
117
|
+
getThemeConfig(theme: 'dark' | 'light'): ThemeConfig;
|
|
118
|
+
getI18nConfig(i18n: 'en' | 'zh-cn'): I18n;
|
|
119
|
+
handleEmojiSelect: (emoji: string) => void;
|
|
120
|
+
handleThemeToggle: () => void;
|
|
121
|
+
handleMobileMenuToggle: () => void;
|
|
122
|
+
handleClickOutside: (event: MouseEvent) => void;
|
|
123
|
+
handleToolSelect: (tool: string) => void;
|
|
124
|
+
handleChartTypeSelect: (mainChartType: MainChartType) => void;
|
|
125
|
+
handleCloseChartTypeModal: () => void;
|
|
126
|
+
handleCloseDrawing: () => void;
|
|
127
|
+
handleTimeframeClick: () => void;
|
|
128
|
+
handleChartTypeClick: () => void;
|
|
129
|
+
handleIndicatorClick: () => void;
|
|
130
|
+
handleTradeClick: () => void;
|
|
131
|
+
handleSelectedMainChartIndicator: (selectedMainChartIndicator: MainChartIndicatorInfo) => void;
|
|
132
|
+
handleMainChartIndicatorChange: (indicator: MainChartIndicatorInfo | null) => void;
|
|
133
|
+
handleCloseIndicatorModal: () => void;
|
|
134
|
+
handleCloseTimeframeModal: () => void;
|
|
135
|
+
handleCloseTradeModal: () => void;
|
|
136
|
+
handleTradeAction: (action: string) => void;
|
|
137
|
+
handleFullscreen: () => void;
|
|
138
|
+
handleCompareClick: () => void;
|
|
139
|
+
handleReplayClick: () => void;
|
|
140
|
+
stopRealTimeDataSimulation: () => void;
|
|
141
|
+
private handleContextMenu;
|
|
142
|
+
handleLeftArrowClick: () => void;
|
|
143
|
+
handleRightArrowClick: () => void;
|
|
144
|
+
handleRefreshClick: () => void;
|
|
145
|
+
handleZoomIn: () => void;
|
|
146
|
+
handleZoomOut: () => void;
|
|
147
|
+
render(): React.JSX.Element;
|
|
148
|
+
}
|
|
149
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { MouseEventParams } from "lightweight-charts";
|
|
2
|
+
import { ChartLayer } from ".";
|
|
3
|
+
export declare class ChartEventManager {
|
|
4
|
+
constructor();
|
|
5
|
+
registerClickEvent(chart: any, callback: (event: MouseEventParams) => void): void;
|
|
6
|
+
registerDblClickEvent(chart: any, callback: (event: MouseEventParams) => void): void;
|
|
7
|
+
registerCrosshairMoveEvent(chartLayer: ChartLayer): void;
|
|
8
|
+
private updateCurrentOHLCByCrosshair;
|
|
9
|
+
registerVisibleTimeRangeChangeEvent(chart: any, callback: (event: {
|
|
10
|
+
from: number;
|
|
11
|
+
to: number;
|
|
12
|
+
} | null) => void): void;
|
|
13
|
+
registerVisibleLogicalRangeChangeEvent(chart: any, callback: (event: {
|
|
14
|
+
from: number;
|
|
15
|
+
to: number;
|
|
16
|
+
} | null) => void): void;
|
|
17
|
+
handleKeyDown: (chartLayer: ChartLayer, event: KeyboardEvent) => void;
|
|
18
|
+
mouseUp(chartLayer: ChartLayer, event: MouseEvent): void;
|
|
19
|
+
mouseMove(chartLayer: ChartLayer, event: MouseEvent): void;
|
|
20
|
+
mouseDown(chartLayer: ChartLayer, event: MouseEvent): void;
|
|
21
|
+
documentMouseDown(chartLayer: ChartLayer, event: MouseEvent): void;
|
|
22
|
+
documentMouseMove(chartLayer: ChartLayer, event: MouseEvent): void;
|
|
23
|
+
documentMouseUp(chartLayer: ChartLayer, event: MouseEvent): void;
|
|
24
|
+
documentMouseWheel(chartLayer: ChartLayer, event: MouseEvent): void;
|
|
25
|
+
private getMousePosition;
|
|
26
|
+
private setMouseStyle;
|
|
27
|
+
private removeCircleCursor;
|
|
28
|
+
private removeDotCursor;
|
|
29
|
+
private handleLineMarkMouseDown;
|
|
30
|
+
private updateMAValues;
|
|
31
|
+
private updateEMAValues;
|
|
32
|
+
private updateBollingerBandsValues;
|
|
33
|
+
private updateIchimokuValues;
|
|
34
|
+
private updateDonchianChannelValues;
|
|
35
|
+
private updateEnvelopeValues;
|
|
36
|
+
private updateVWAPValues;
|
|
37
|
+
private coordinateToPrice;
|
|
38
|
+
private getChartPriceRange;
|
|
39
|
+
private isChartArea;
|
|
40
|
+
private isPriceArea;
|
|
41
|
+
private isTimeArea;
|
|
42
|
+
private handleDocumentMainChartPriceAreaMouseWheel;
|
|
43
|
+
private handleDocumentMainChartTimeAreaMouseWheel;
|
|
44
|
+
private handleDocumentMainChartAreaMouseWheel;
|
|
45
|
+
private handleDocumentMainChartMouseDownMove;
|
|
46
|
+
private handleGraphStyle;
|
|
47
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MainChartIndicatorType, Point } from '../types';
|
|
3
|
+
import { ThemeConfig } from '../Theme';
|
|
4
|
+
import { MainChartIndicatorInfo, MainChartIndicatorParam } from '../Indicators/MainChart/MainChartIndicatorInfo';
|
|
5
|
+
import { I18n } from '../I18n';
|
|
6
|
+
export interface ChartInfoProps {
|
|
7
|
+
currentTheme: ThemeConfig;
|
|
8
|
+
title?: string;
|
|
9
|
+
currentOHLC: any;
|
|
10
|
+
mousePosition: Point | null;
|
|
11
|
+
showOHLC: boolean;
|
|
12
|
+
onToggleOHLC: () => void;
|
|
13
|
+
onOpenIndicatorsModal?: () => void;
|
|
14
|
+
indicators?: MainChartIndicatorInfo[];
|
|
15
|
+
onRemoveIndicator?: (type: MainChartIndicatorType) => void;
|
|
16
|
+
onToggleIndicator?: (type: MainChartIndicatorType) => void;
|
|
17
|
+
onEditIndicatorParams?: (id: string, newParams: MainChartIndicatorParam[]) => void;
|
|
18
|
+
visibleIndicatorTypes?: MainChartIndicatorType[];
|
|
19
|
+
onOpenIndicatorSettings?: (indicator: MainChartIndicatorInfo) => void;
|
|
20
|
+
maIndicatorValues?: {
|
|
21
|
+
[key: string]: number;
|
|
22
|
+
};
|
|
23
|
+
emaIndicatorValues?: {
|
|
24
|
+
[key: string]: number;
|
|
25
|
+
};
|
|
26
|
+
bollingerBandsValues?: {
|
|
27
|
+
[key: string]: number;
|
|
28
|
+
};
|
|
29
|
+
ichimokuValues?: {
|
|
30
|
+
[key: string]: number;
|
|
31
|
+
};
|
|
32
|
+
donchianChannelValues?: {
|
|
33
|
+
[key: string]: number;
|
|
34
|
+
};
|
|
35
|
+
envelopeValues?: {
|
|
36
|
+
[key: string]: number;
|
|
37
|
+
};
|
|
38
|
+
vwapValue?: number | null;
|
|
39
|
+
i18n: I18n;
|
|
40
|
+
}
|
|
41
|
+
interface ChartInfoState {
|
|
42
|
+
currentOHLC: any;
|
|
43
|
+
mousePosition: Point | null;
|
|
44
|
+
showOHLC: boolean;
|
|
45
|
+
visibleIndicatorsMap: Map<MainChartIndicatorType, boolean>;
|
|
46
|
+
}
|
|
47
|
+
export declare class ChartInfo extends React.Component<ChartInfoProps, ChartInfoState> {
|
|
48
|
+
constructor(props: ChartInfoProps);
|
|
49
|
+
componentDidMount(): void;
|
|
50
|
+
componentWillUnmount(): void;
|
|
51
|
+
componentDidUpdate(prevProps: ChartInfoProps): void;
|
|
52
|
+
private handleRemoveIndicator;
|
|
53
|
+
private handleToggleIndicator;
|
|
54
|
+
private handleEditParams;
|
|
55
|
+
renderEyeIcon: (isVisible: boolean) => React.JSX.Element;
|
|
56
|
+
renderIndicatorWithValues: (item: MainChartIndicatorInfo) => React.JSX.Element | null;
|
|
57
|
+
private getActualIndicatorValue;
|
|
58
|
+
getFilteredIndicators: () => MainChartIndicatorInfo[];
|
|
59
|
+
renderNormalIndicatorParams: (item: MainChartIndicatorInfo) => React.JSX.Element | null;
|
|
60
|
+
render(): React.JSX.Element;
|
|
61
|
+
}
|
|
62
|
+
export {};
|