feat: add custom React trade markers for KLine chart#17
Open
tonichiga wants to merge 9 commits intohellohublot:mainfrom
Open
feat: add custom React trade markers for KLine chart#17tonichiga wants to merge 9 commits intohellohublot:mainfrom
tonichiga wants to merge 9 commits intohellohublot:mainfrom
Conversation
…nfiguration - Updated iOS and Android implementations to support open/close trade prices and counts. - Added scrollEnabled property to HTKLineConfigManager for better user control. - Introduced visual markers for open/close trades in the chart view. - Adjusted dependencies for lottie-ios to ensure compatibility.
- Introduced fitBarsCount property in HTKLineConfigManager for limiting visible bars. - Updated reloadOptionList method to handle fitBarsCount and adjust modelArray accordingly. - Enhanced HTKLineContainerView to manage chart scaling based on fitBarsCount. - Added resetChartScale method in ScrollAndScaleView to reset the chart scale. - Modified HTKLineView to adjust content size and scrolling behavior based on fitBarsCount. - Updated TypeScript definitions to include fitBarsCount and related properties.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: add custom React trade markers for KLine chart
Summary
This PR adds support for rendering trade markers with a custom React component in
react-native-kline-view.Instead of only drawing native marker dots, consumers can now provide
tradeComponent(trade, count)and fully control the marker UI.What changed
index.jsto:tradeComponentpropuseCustomTradeMarkeronTradeMarkersLayoutpointerEvents="none"index.d.ts:TTradetradeComponent?: (trade: TTrade, count: number) => ReactNodeuseCustomTradeMarkerandonTradeMarkersLayoutto config/bridgeHTKLineView(debounced)RNKLineView.mmavenCentral().New feature
Custom trade marker rendering
You can now render trade markers using your own React UI.
tradepayload shape:id: stringtimestamp: numberprice: numbertype: "buy" | "sell"countis provided as the second argument.Screenshot
Notes
pointerEvents="none") to preserve chart gestures.Testing checklist
tradeComponentfalls back to native markerstradeComponentprop andTTradetype are available