@vninvestcharts/widget 0.0.0-stage → 0.2.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 +201 -0
- package/NOTICE.md +83 -0
- package/README.md +851 -3
- package/dist/AlertsModal-WKEUDTUZ.js +2 -0
- package/dist/ConnectedTradingPanel-KWJMIKTN.css +2 -0
- package/dist/ConnectedTradingPanel-XDKMOQY5.js +2 -0
- package/dist/PineEditorPanel-AUXB4FD3.js +2 -0
- package/dist/PineEditorPanel-V6YN2OTU.css +2 -0
- package/dist/RightSidebarDockHost-6FPZ6EKV.css +2 -0
- package/dist/RightSidebarDockHost-OBFXKSIY.js +2 -0
- package/dist/StrategyTesterPanel-6IUTS2P4.js +2 -0
- package/dist/StrategyTesterPanel-LEWEUMXP.css +2 -0
- package/dist/VolumeProfileWorker-UREKVPUE.js +189 -0
- package/dist/adapters/index.cjs +2532 -0
- package/dist/adapters/index.d.mts +673 -0
- package/dist/adapters/index.d.ts +673 -0
- package/dist/adapters/index.js +2521 -0
- package/dist/adapters/index.umd.js +2535 -0
- package/dist/chunk-5T6DGB3V.js +2 -0
- package/dist/chunk-66JBEGR3.js +4 -0
- package/dist/chunk-6D7DVBIK.js +2 -0
- package/dist/chunk-76E7CKUD.js +2 -0
- package/dist/chunk-AKWVXRQ6.js +2 -0
- package/dist/chunk-FHHSTO6Z.js +2 -0
- package/dist/chunk-HPL723JA.js +2 -0
- package/dist/chunk-NVGTF73S.js +2 -0
- package/dist/chunk-PNIB4OM3.js +2 -0
- package/dist/chunk-UKJ5AKQX.js +595 -0
- package/dist/chunk-UYJTX3SD.js +2 -0
- package/dist/combined.css +3068 -0
- package/dist/css-modules-manifest.json +297 -0
- package/dist/dist-Y6PZ2RN3.js +12 -0
- package/dist/drawing/index.cjs +53 -0
- package/dist/drawing/index.d.mts +2 -0
- package/dist/drawing/index.d.ts +2 -0
- package/dist/drawing/index.js +2 -0
- package/dist/drawing/index.umd.js +54 -0
- package/dist/dts/drawing-shim.d.ts +3 -0
- package/dist/dts/index.d.ts +31 -0
- package/dist/dts/lib/Chart.d.ts +31 -0
- package/dist/dts/lib/ChartContext.d.ts +10 -0
- package/dist/dts/lib/EventCapture.d.ts +3 -0
- package/dist/dts/lib/GenericChartComponent.d.ts +5 -0
- package/dist/dts/lib/GenericComponent.d.ts +124 -0
- package/dist/dts/lib/StockChartContext.d.ts +53 -0
- package/dist/dts/lib/adapters/BaseAdapter.d.ts +25 -0
- package/dist/dts/lib/adapters/BinanceAdapter.d.ts +51 -0
- package/dist/dts/lib/adapters/CSVAdapter.d.ts +17 -0
- package/dist/dts/lib/adapters/ContinuousContractAdapter.d.ts +63 -0
- package/dist/dts/lib/adapters/ContinuousContractTypes.d.ts +154 -0
- package/dist/dts/lib/adapters/DBAdapter.d.ts +16 -0
- package/dist/dts/lib/adapters/DataAdapter.d.ts +136 -0
- package/dist/dts/lib/adapters/DjangoVnstockAdapter.d.ts +15 -0
- package/dist/dts/lib/adapters/LocalCacheAdapter.d.ts +18 -0
- package/dist/dts/lib/adapters/MockAdapter.d.ts +22 -0
- package/dist/dts/lib/adapters/RESTAdapter.d.ts +16 -0
- package/dist/dts/lib/adapters/StockDataAdapter.d.ts +1 -0
- package/dist/dts/lib/adapters/UDFDataAdapter.d.ts +29 -0
- package/dist/dts/lib/adapters/VNStocksAdapter.d.ts +8 -0
- package/dist/dts/lib/adapters/WSAdapter.d.ts +30 -0
- package/dist/dts/lib/adapters/gapFixture.d.ts +71 -0
- package/dist/dts/lib/adapters/index.d.ts +15 -0
- package/dist/dts/lib/adapters/rollAlgorithms.d.ts +68 -0
- package/dist/dts/lib/advisory/AdvisoryPanel.d.ts +5 -0
- package/dist/dts/lib/alerts/AlertEvaluator.d.ts +5 -0
- package/dist/dts/lib/alerts/AlertManager.d.ts +123 -0
- package/dist/dts/lib/alerts/types.d.ts +58 -0
- package/dist/dts/lib/cache/cacheDebug.d.ts +3 -0
- package/dist/dts/lib/calendars/ExchangeCalendar.d.ts +23 -0
- package/dist/dts/lib/calendars/calendarRegistry.d.ts +10 -0
- package/dist/dts/lib/calendars/index.d.ts +3 -0
- package/dist/dts/lib/core/ChartPane.d.ts +8 -0
- package/dist/dts/lib/core/ChartSplitter.d.ts +70 -0
- package/dist/dts/lib/core/ChartTerminal.d.ts +12 -0
- package/dist/dts/lib/core/ErrorBoundary.d.ts +17 -0
- package/dist/dts/lib/core/IndicatorLegend.d.ts +47 -0
- package/dist/dts/lib/core/PaneHeader.d.ts +24 -0
- package/dist/dts/lib/core/PaneLabel.d.ts +8 -0
- package/dist/dts/lib/core/PaneSplitter.d.ts +9 -0
- package/dist/dts/lib/core/SeriesPicker.d.ts +10 -0
- package/dist/dts/lib/core/calculators/alignBarsByDate.d.ts +38 -0
- package/dist/dts/lib/core/calculators/buildIndicatorComputationPlan.d.ts +16 -0
- package/dist/dts/lib/core/calculators/calcCVDApprox.d.ts +6 -0
- package/dist/dts/lib/core/calculators/calcStrengthElder.d.ts +7 -0
- package/dist/dts/lib/core/calculators/calcWhaleApprox.d.ts +6 -0
- package/dist/dts/lib/core/calculators/computationHelpers.d.ts +12 -0
- package/dist/dts/lib/core/calculators/computeIndicatorComputationResult.d.ts +3 -0
- package/dist/dts/lib/core/calculators/computeMarketStructure.d.ts +8 -0
- package/dist/dts/lib/core/calculators/computeMomentum.d.ts +22 -0
- package/dist/dts/lib/core/calculators/computeMovingAverage.d.ts +15 -0
- package/dist/dts/lib/core/calculators/computeProfile.d.ts +9 -0
- package/dist/dts/lib/core/calculators/computeTrend.d.ts +10 -0
- package/dist/dts/lib/core/calculators/computeVolatility.d.ts +14 -0
- package/dist/dts/lib/core/calculators/computeVolumeFlow.d.ts +19 -0
- package/dist/dts/lib/core/calculators/enrichData.d.ts +7 -0
- package/dist/dts/lib/core/calculators/enrichDataWithCanonicalStore.d.ts +33 -0
- package/dist/dts/lib/core/calculators/exoticChartData.d.ts +140 -0
- package/dist/dts/lib/core/calculators/fixtures/mockData.d.ts +2 -0
- package/dist/dts/lib/core/calculators/indicatorComputation.d.ts +27 -0
- package/dist/dts/lib/core/calculators/indicatorComputationTypes.d.ts +249 -0
- package/dist/dts/lib/core/calculators/materializeIndicatorValues.d.ts +3 -0
- package/dist/dts/lib/core/calculators/normalizePrices.d.ts +36 -0
- package/dist/dts/lib/core/calculators/resolveCalculationOrder.d.ts +17 -0
- package/dist/dts/lib/core/calculators/types.d.ts +269 -0
- package/dist/dts/lib/core/canvas/ChartRenderContext.d.ts +14 -0
- package/dist/dts/lib/core/canvas/OverlayCanvas.d.ts +19 -0
- package/dist/dts/lib/core/context/ChartSyncContext.d.ts +21 -0
- package/dist/dts/lib/core/context/DataContext.d.ts +15 -0
- package/dist/dts/lib/core/context/PaneManagerContext.d.ts +10 -0
- package/dist/dts/lib/core/hooks/paneSizingHelpers.d.ts +13 -0
- package/dist/dts/lib/core/hooks/useCanvasResize.d.ts +8 -0
- package/dist/dts/lib/core/hooks/useChartTheme.d.ts +12 -0
- package/dist/dts/lib/core/hooks/useDynamicPanes.d.ts +155 -0
- package/dist/dts/lib/core/hooks/useIndicatorSets.d.ts +20 -0
- package/dist/dts/lib/core/hooks/usePaneManager.d.ts +39 -0
- package/dist/dts/lib/core/hooks/usePaneSizes.d.ts +52 -0
- package/dist/dts/lib/core/index.d.ts +41 -0
- package/dist/dts/lib/core/paneScaleSlotDomains.d.ts +3 -0
- package/dist/dts/lib/core/registry/SeriesRegistry.d.ts +22 -0
- package/dist/dts/lib/core/registry/filterPanesBySeriesTier.d.ts +43 -0
- package/dist/dts/lib/core/registry/marketStructure.d.ts +7 -0
- package/dist/dts/lib/core/registry/momentum.d.ts +20 -0
- package/dist/dts/lib/core/registry/movingAverage.d.ts +14 -0
- package/dist/dts/lib/core/registry/priceChartTypes.d.ts +16 -0
- package/dist/dts/lib/core/registry/profile.d.ts +8 -0
- package/dist/dts/lib/core/registry/registerAll.d.ts +1 -0
- package/dist/dts/lib/core/registry/registerPhaseOne.d.ts +3 -0
- package/dist/dts/lib/core/registry/registryCore.d.ts +77 -0
- package/dist/dts/lib/core/registry/trend.d.ts +11 -0
- package/dist/dts/lib/core/registry/volatility.d.ts +11 -0
- package/dist/dts/lib/core/registry/volumeFlow.d.ts +20 -0
- package/dist/dts/lib/core/replay/BarReplayController.d.ts +62 -0
- package/dist/dts/lib/core/replay/ReplayEventBus.d.ts +68 -0
- package/dist/dts/lib/core/replay/ReplayFillSimulator.d.ts +33 -0
- package/dist/dts/lib/core/replay/ReplayOrderBook.d.ts +24 -0
- package/dist/dts/lib/core/replay/ReplayPositionManager.d.ts +30 -0
- package/dist/dts/lib/core/replay/ReplaySessionAnalytics.d.ts +31 -0
- package/dist/dts/lib/core/replay/createReplayTradeMarkerPrimitives.d.ts +7 -0
- package/dist/dts/lib/core/replay/pnlUtils.d.ts +2 -0
- package/dist/dts/lib/core/replay/replayBrokerAdapters.d.ts +51 -0
- package/dist/dts/lib/core/replay/replayTradingTypes.d.ts +61 -0
- package/dist/dts/lib/core/scales/computeScales.d.ts +8 -0
- package/dist/dts/lib/core/seriesValueResolver.d.ts +27 -0
- package/dist/dts/lib/core/sets/builtins.d.ts +2 -0
- package/dist/dts/lib/core/sets/indicatorSetCodec.d.ts +15 -0
- package/dist/dts/lib/core/trading/AnalyticsEngine.d.ts +56 -0
- package/dist/dts/lib/core/trading/BrokerAPI.d.ts +40 -0
- package/dist/dts/lib/core/trading/ExecutionSimulator.d.ts +53 -0
- package/dist/dts/lib/core/trading/FillSettlement.d.ts +38 -0
- package/dist/dts/lib/core/trading/MarketDataPort.d.ts +41 -0
- package/dist/dts/lib/core/trading/MarketRules.d.ts +58 -0
- package/dist/dts/lib/core/trading/OrderManagementSystem.d.ts +57 -0
- package/dist/dts/lib/core/trading/PositionManager.d.ts +79 -0
- package/dist/dts/lib/core/trading/RiskEngine.d.ts +40 -0
- package/dist/dts/lib/core/trading/SettlementCalendar.d.ts +10 -0
- package/dist/dts/lib/core/trading/VirtualBrokerEngine.d.ts +92 -0
- package/dist/dts/lib/core/trading/orderMargin.d.ts +3 -0
- package/dist/dts/lib/core/trading/storage/InMemoryStorageAdapter.d.ts +10 -0
- package/dist/dts/lib/core/trading/storage/TradingStorage.d.ts +34 -0
- package/dist/dts/lib/core/trading/types.d.ts +99 -0
- package/dist/dts/lib/core/types/chart.d.ts +21 -0
- package/dist/dts/lib/core/types/indicator-catalog.d.ts +38 -0
- package/dist/dts/lib/core/types/indicator-set.d.ts +19 -0
- package/dist/dts/lib/core/types/pane-descriptor.d.ts +46 -0
- package/dist/dts/lib/core/types/seriesComponents.d.ts +15 -0
- package/dist/dts/lib/credentials/credentialStore.d.ts +93 -0
- package/dist/dts/lib/helper/SaveChartAsImage.d.ts +90 -0
- package/dist/dts/lib/indicator/defaultOptionsForAppearance.d.ts +105 -0
- package/dist/dts/lib/indicators/builtin/MTFWrapper.d.ts +3 -0
- package/dist/dts/lib/indicators/builtin/VolumeProfileWorker.d.ts +19 -0
- package/dist/dts/lib/indicators/builtin/ac.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/alligator.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/anchoredVwap.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/ao.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/bbi.d.ts +10 -0
- package/dist/dts/lib/indicators/builtin/bias.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/bollinger.d.ts +9 -0
- package/dist/dts/lib/indicators/builtin/brar.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/cci.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/chaikinOscillator.d.ts +14 -0
- package/dist/dts/lib/indicators/builtin/chaikinVol.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/ci.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/cmf.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/cr.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/cvd.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/deltaProfile.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/dema.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/dma.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/dmi.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/donchian.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/ema.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/emv.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/footprint.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/fractals.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/gator.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/hma.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/hv.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/ichimoku.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/kdj.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/keltner.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/ma.d.ts +10 -0
- package/dist/dts/lib/indicators/builtin/maRibbon.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/macd.d.ts +9 -0
- package/dist/dts/lib/indicators/builtin/marketProfile.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/mfi.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/mtm.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/obv.d.ts +10 -0
- package/dist/dts/lib/indicators/builtin/pivotHighLow.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/pivotStandard.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/psy.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/pvt.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/roc.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/rsi.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/sar.d.ts +10 -0
- package/dist/dts/lib/indicators/builtin/sma.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/smfi.d.ts +8 -0
- package/dist/dts/lib/indicators/builtin/stdDev.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/strengthRelative.d.ts +7 -0
- package/dist/dts/lib/indicators/builtin/supertrend.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/tema.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/trix.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/volOsc.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/volume.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/volumeProfile.d.ts +8 -0
- package/dist/dts/lib/indicators/builtin/vr.d.ts +10 -0
- package/dist/dts/lib/indicators/builtin/vwap.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/vwma.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/wma.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/wr.d.ts +10 -0
- package/dist/dts/lib/indicators/builtin/wyckoffWave.d.ts +15 -0
- package/dist/dts/lib/indicators/index.d.ts +63 -0
- package/dist/dts/lib/indicators/indicatorValueShapes.d.ts +15 -0
- package/dist/dts/lib/indicators/outputKeys.d.ts +50 -0
- package/dist/dts/lib/indicators/overlays/CVDIndicator.d.ts +26 -0
- package/dist/dts/lib/indicators/overlays/DarkFlowBadge.d.ts +19 -0
- package/dist/dts/lib/indicators/overlays/ExternalCVDOverlay.d.ts +15 -0
- package/dist/dts/lib/indicators/overlays/WhaleBubbleOverlay.d.ts +14 -0
- package/dist/dts/lib/indicators/overlays/WhaleMarketBubbleOverlay.d.ts +27 -0
- package/dist/dts/lib/indicators/overlays/whaleDetector.d.ts +66 -0
- package/dist/dts/lib/indicators/registry.d.ts +6 -0
- package/dist/dts/lib/indicators/types.d.ts +5 -0
- package/dist/dts/lib/indicators/utils.d.ts +259 -0
- package/dist/dts/lib/pinescript/PineCompiler.d.ts +34 -0
- package/dist/dts/lib/pinescript/ast.d.ts +73 -0
- package/dist/dts/lib/pinescript/compile.d.ts +40 -0
- package/dist/dts/lib/pinescript/grammar.d.ts +12 -0
- package/dist/dts/lib/pinescript/pine.worker.d.ts +1 -0
- package/dist/dts/lib/pinescript/pineBlocks.d.ts +54 -0
- package/dist/dts/lib/pinescript/pineBuiltins.d.ts +47 -0
- package/dist/dts/lib/pinescript/pineEnv.d.ts +46 -0
- package/dist/dts/lib/pinescript/pineMath.d.ts +13 -0
- package/dist/dts/lib/pinescript/pineParse.d.ts +25 -0
- package/dist/dts/lib/pinescript/pineStrings.d.ts +50 -0
- package/dist/dts/lib/pinescript/runtime.d.ts +5 -0
- package/dist/dts/lib/pinescript/scriptRegistry.d.ts +40 -0
- package/dist/dts/lib/pinescript/series-value.d.ts +64 -0
- package/dist/dts/lib/pinescript/vnscript-completion.d.ts +1 -0
- package/dist/dts/lib/pinescript/vnscript-grammar.d.ts +19 -0
- package/dist/dts/lib/scale/discontinuousTimeScaleProvider.d.ts +3 -0
- package/dist/dts/lib/scale/financeDiscontinuousScale.d.ts +15 -0
- package/dist/dts/lib/scale/index.d.ts +1 -0
- package/dist/dts/lib/scale/levels.d.ts +12 -0
- package/dist/dts/lib/series/AlternatingFillAreaSeries.d.ts +13 -0
- package/dist/dts/lib/series/AreaOnlySeries.d.ts +10 -0
- package/dist/dts/lib/series/AreaSeries.d.ts +30 -0
- package/dist/dts/lib/series/BarSeries.d.ts +40 -0
- package/dist/dts/lib/series/BollingerSeries.d.ts +11 -0
- package/dist/dts/lib/series/CandlestickSeries.d.ts +56 -0
- package/dist/dts/lib/series/CircleMarker.d.ts +28 -0
- package/dist/dts/lib/series/ElderRaySeries.d.ts +14 -0
- package/dist/dts/lib/series/FootprintSeries.d.ts +21 -0
- package/dist/dts/lib/series/GroupedBarSeries.d.ts +9 -0
- package/dist/dts/lib/series/HTFOverlaySeries.d.ts +32 -0
- package/dist/dts/lib/series/HistogramSeries.d.ts +51 -0
- package/dist/dts/lib/series/KagiSeries.d.ts +9 -0
- package/dist/dts/lib/series/LineBreakSeries.d.ts +28 -0
- package/dist/dts/lib/series/LineSeries.d.ts +54 -0
- package/dist/dts/lib/series/MACDSeries.d.ts +28 -0
- package/dist/dts/lib/series/MarketProfileSeries.d.ts +18 -0
- package/dist/dts/lib/series/OHLCSeries.d.ts +9 -0
- package/dist/dts/lib/series/OverlayBarSeries.d.ts +9 -0
- package/dist/dts/lib/series/PointAndFigureSeries.d.ts +45 -0
- package/dist/dts/lib/series/RSISeries.d.ts +38 -0
- package/dist/dts/lib/series/RenkoSeries.d.ts +9 -0
- package/dist/dts/lib/series/SARSeries.d.ts +10 -0
- package/dist/dts/lib/series/SVGComponent.d.ts +5 -0
- package/dist/dts/lib/series/ScatterSeries.d.ts +9 -0
- package/dist/dts/lib/series/SquareMarker.d.ts +28 -0
- package/dist/dts/lib/series/StackedBarSeries.d.ts +19 -0
- package/dist/dts/lib/series/StochasticSeries.d.ts +9 -0
- package/dist/dts/lib/series/StraightLine.d.ts +18 -0
- package/dist/dts/lib/series/TriangleMarker.d.ts +30 -0
- package/dist/dts/lib/series/VolumeProfileSeries.d.ts +9 -0
- package/dist/dts/lib/series/index.d.ts +28 -0
- package/dist/dts/lib/strategy/BrokerSimulator.d.ts +11 -0
- package/dist/dts/lib/strategy/types.d.ts +35 -0
- package/dist/dts/lib/tape/TapePanel.d.ts +5 -0
- package/dist/dts/lib/types/adapter.d.ts +1 -0
- package/dist/dts/lib/types/index.d.ts +5 -0
- package/dist/dts/lib/types/indicator.d.ts +11 -0
- package/dist/dts/lib/types/ohlcv.d.ts +1 -0
- package/dist/dts/lib/types/pane.d.ts +23 -0
- package/dist/dts/lib/types/runtime.d.ts +11 -0
- package/dist/dts/lib/types/vninvest.d.ts +320 -0
- package/dist/dts/lib/types.d.ts +45 -0
- package/dist/dts/lib/utils/ChartDataUtil.d.ts +26 -0
- package/dist/dts/lib/utils/PureComponent.d.ts +5 -0
- package/dist/dts/lib/utils/accumulatingWindow.d.ts +1 -0
- package/dist/dts/lib/utils/axisPriceFormat.d.ts +6 -0
- package/dist/dts/lib/utils/barWidth.d.ts +14 -0
- package/dist/dts/lib/utils/identity.d.ts +1 -0
- package/dist/dts/lib/utils/index.d.ts +70 -0
- package/dist/dts/lib/utils/logger.d.ts +28 -0
- package/dist/dts/lib/utils/mappedSlidingWindow.d.ts +1 -0
- package/dist/dts/lib/utils/merge.d.ts +6 -0
- package/dist/dts/lib/utils/noop.d.ts +1 -0
- package/dist/dts/lib/utils/rebind.d.ts +1 -0
- package/dist/dts/lib/utils/shallowEqual.d.ts +1 -0
- package/dist/dts/lib/utils/slidingWindow.d.ts +1 -0
- package/dist/dts/lib/utils/storage.d.ts +32 -0
- package/dist/dts/lib/utils/strokeDasharray.d.ts +3 -0
- package/dist/dts/lib/utils/timezoneFormatter.d.ts +14 -0
- package/dist/dts/lib/utils/zipper.d.ts +4 -0
- package/dist/dts/public-api.d.ts +31 -0
- package/dist/dts/widget/BackfillWorkerFlags.d.ts +12 -0
- package/dist/dts/widget/CanaryRollbackHelper.d.ts +95 -0
- package/dist/dts/widget/CanaryRolloutConfig.d.ts +100 -0
- package/dist/dts/widget/DrawingPriceLabelsOverlay.d.ts +20 -0
- package/dist/dts/widget/ForkDrawingsOverlay.d.ts +16 -0
- package/dist/dts/widget/MeasurementOverlay.d.ts +24 -0
- package/dist/dts/widget/VNInvestCharts.d.ts +5 -0
- package/dist/dts/widget/VNInvestChartsProps.d.ts +302 -0
- package/dist/dts/widget/VNInvestMultiCharts.d.ts +8 -0
- package/dist/dts/widget/VNInvestMultiCharts.types.d.ts +130 -0
- package/dist/dts/widget/WidgetEmptyState.d.ts +11 -0
- package/dist/dts/widget/WidgetErrorBoundary.d.ts +26 -0
- package/dist/dts/widget/adapters/ContinuousFuturesStockDataAdapter.d.ts +18 -0
- package/dist/dts/widget/adapters/DataProviderAdapterWrapper.d.ts +14 -0
- package/dist/dts/widget/adapters/MultiSourceDataAdapter.d.ts +24 -0
- package/dist/dts/widget/adapters/VNInvestClient.d.ts +161 -0
- package/dist/dts/widget/adapters/VNInvestDataAdapter.d.ts +77 -0
- package/dist/dts/widget/adapters/VNInvestWebSocketClient.d.ts +79 -0
- package/dist/dts/widget/adapters/barsPagingPolicy.d.ts +18 -0
- package/dist/dts/widget/adapters/corporateEvents.d.ts +13 -0
- package/dist/dts/widget/adapters/index.d.ts +20 -0
- package/dist/dts/widget/adapters/nativeShapes.d.ts +32 -0
- package/dist/dts/widget/adapters/watchlistRealtimeSync.d.ts +16 -0
- package/dist/dts/widget/alerts/DrawingAlertsHost.d.ts +18 -0
- package/dist/dts/widget/alerts/useDrawingAlerts.d.ts +37 -0
- package/dist/dts/widget/canaryBarFiltering.d.ts +35 -0
- package/dist/dts/widget/capabilities/CapabilityResolver.d.ts +71 -0
- package/dist/dts/widget/capabilities/capabilityProbe.d.ts +28 -0
- package/dist/dts/widget/capabilities/useTierGatedFeatures.d.ts +48 -0
- package/dist/dts/widget/components/BottomPanelHost.d.ts +80 -0
- package/dist/dts/widget/components/BottomPanelSplitter.d.ts +15 -0
- package/dist/dts/widget/components/CapabilityGate.d.ts +65 -0
- package/dist/dts/widget/components/ChartDiagOverlay.d.ts +31 -0
- package/dist/dts/widget/components/ConfirmDialog.d.ts +12 -0
- package/dist/dts/widget/components/DowngradeBanner.d.ts +9 -0
- package/dist/dts/widget/components/ForkPaneSeparators.d.ts +11 -0
- package/dist/dts/widget/components/ForkPaneTooltips.d.ts +23 -0
- package/dist/dts/widget/components/ForkXAxisOverlay.d.ts +11 -0
- package/dist/dts/widget/components/ForkYAxisCrosshairLabels.d.ts +9 -0
- package/dist/dts/widget/components/LayoutDesigner.d.ts +26 -0
- package/dist/dts/widget/components/PremiumFeatureGate.d.ts +10 -0
- package/dist/dts/widget/components/ShortcutHelpModal.d.ts +44 -0
- package/dist/dts/widget/components/SystemMenu.d.ts +66 -0
- package/dist/dts/widget/components/Toast.d.ts +20 -0
- package/dist/dts/widget/components/canvas/BarCountdownBadge.d.ts +8 -0
- package/dist/dts/widget/components/canvas/ChartA11ySummary.d.ts +40 -0
- package/dist/dts/widget/components/canvas/ChartStatusLine.d.ts +39 -0
- package/dist/dts/widget/components/canvas/PricePaneHeader.d.ts +24 -0
- package/dist/dts/widget/components/canvas/PriceScaleMenu.d.ts +27 -0
- package/dist/dts/widget/components/canvas/TimeAxisScrollbar.d.ts +18 -0
- package/dist/dts/widget/components/common/Icons.d.ts +67 -0
- package/dist/dts/widget/components/dock/DataWindow.d.ts +7 -0
- package/dist/dts/widget/components/dock/DockUpgradeNudge.d.ts +10 -0
- package/dist/dts/widget/components/dock/RightSidebarDockHost.d.ts +57 -0
- package/dist/dts/widget/components/dock/WatchlistPanel.d.ts +7 -0
- package/dist/dts/widget/components/dock/WorkspaceRightDockSlot.d.ts +46 -0
- package/dist/dts/widget/components/dock/dockAccess.d.ts +20 -0
- package/dist/dts/widget/components/dock/drawingDockContentBuilders.d.ts +29 -0
- package/dist/dts/widget/components/drawing/DrawingDock.d.ts +47 -0
- package/dist/dts/widget/components/drawing/DrawingInspector.d.ts +94 -0
- package/dist/dts/widget/components/drawing/DrawingListPanel.d.ts +62 -0
- package/dist/dts/widget/components/drawing/DrawingSemanticPointLegend.d.ts +14 -0
- package/dist/dts/widget/components/drawing/FloatingDrawingInspector.d.ts +18 -0
- package/dist/dts/widget/components/drawing/IconPickerPanel.d.ts +5 -0
- package/dist/dts/widget/components/drawing/InlineTextEditor.d.ts +20 -0
- package/dist/dts/widget/components/drawing/PatternScanPanel.d.ts +27 -0
- package/dist/dts/widget/components/drawing/TemplateManagerPanel.d.ts +18 -0
- package/dist/dts/widget/components/events/CorporateEventsOverlay.d.ts +23 -0
- package/dist/dts/widget/components/events/EventMarkerIcon.d.ts +6 -0
- package/dist/dts/widget/components/footer/ChartFooter.d.ts +26 -0
- package/dist/dts/widget/components/footer/MultiChartsFooter.d.ts +37 -0
- package/dist/dts/widget/components/footer/TimeframeFooter.d.ts +25 -0
- package/dist/dts/widget/components/footer/useBarCountdown.d.ts +5 -0
- package/dist/dts/widget/components/header/OHLCHeader.d.ts +72 -0
- package/dist/dts/widget/components/layout/DrawingConflictNotice.d.ts +4 -0
- package/dist/dts/widget/components/layout/GridContainer.d.ts +70 -0
- package/dist/dts/widget/components/layout/GridSlotErrorBoundary.d.ts +17 -0
- package/dist/dts/widget/components/layout/Splitter.d.ts +23 -0
- package/dist/dts/widget/components/layout/gridSplitterMath.d.ts +40 -0
- package/dist/dts/widget/components/layout/useGridSplitterDrag.d.ts +18 -0
- package/dist/dts/widget/components/mobile/MobileChartCarousel.d.ts +11 -0
- package/dist/dts/widget/components/mobile/MobileToolbar.d.ts +29 -0
- package/dist/dts/widget/components/overlays/AdvisoryPanel.d.ts +25 -0
- package/dist/dts/widget/components/overlays/TapePanel.d.ts +25 -0
- package/dist/dts/widget/components/overlays/WhalePanel.d.ts +5 -0
- package/dist/dts/widget/components/panels/AdvisoryPanel.d.ts +25 -0
- package/dist/dts/widget/components/panels/PineEditorPanel.d.ts +18 -0
- package/dist/dts/widget/components/panels/StrategyTesterPanel.d.ts +7 -0
- package/dist/dts/widget/components/panels/TapePanel.d.ts +17 -0
- package/dist/dts/widget/components/panels/index.d.ts +8 -0
- package/dist/dts/widget/components/replay/FloatingReplayToolbar.d.ts +24 -0
- package/dist/dts/widget/components/replay/ReplayCutOverlay.d.ts +8 -0
- package/dist/dts/widget/components/search/SymbolCompareModal.d.ts +24 -0
- package/dist/dts/widget/components/search/SymbolSearchModal.d.ts +12 -0
- package/dist/dts/widget/components/search/VNSymbolSearch.d.ts +83 -0
- package/dist/dts/widget/components/settings/AlertsModal.d.ts +74 -0
- package/dist/dts/widget/components/settings/SettingsContext.d.ts +58 -0
- package/dist/dts/widget/components/settings/SettingsModal.d.ts +78 -0
- package/dist/dts/widget/components/settings/SettingsRangeSlider.d.ts +17 -0
- package/dist/dts/widget/components/settings/SnapshotPreviewModal.d.ts +16 -0
- package/dist/dts/widget/components/settings/WorkspaceSettingsContext.d.ts +27 -0
- package/dist/dts/widget/components/settings/helpers/seriesFormatters.d.ts +11 -0
- package/dist/dts/widget/components/settings/model/appearancePayload.d.ts +31 -0
- package/dist/dts/widget/components/settings/model/chartSettingsSchema.d.ts +100 -0
- package/dist/dts/widget/components/settings/model/defaultSettings.d.ts +5 -0
- package/dist/dts/widget/components/settings/model/indicatorShare.d.ts +29 -0
- package/dist/dts/widget/components/settings/storageKeys.d.ts +29 -0
- package/dist/dts/widget/components/settings/tabs/AppearanceSettingsTab.d.ts +5 -0
- package/dist/dts/widget/components/settings/tabs/IndicatorParamsForm.d.ts +12 -0
- package/dist/dts/widget/components/settings/tabs/IndicatorsSettingsTab.d.ts +34 -0
- package/dist/dts/widget/components/settings/tabs/LicensingSettingsTab.d.ts +5 -0
- package/dist/dts/widget/components/settings/tabs/PanesLayoutSettingsTab.d.ts +11 -0
- package/dist/dts/widget/components/settings/tabs/ResetSettingsTab.d.ts +8 -0
- package/dist/dts/widget/components/settings/tabs/ScalesSettingsTab.d.ts +5 -0
- package/dist/dts/widget/components/settings/tabs/StatusLineSettingsTab.d.ts +5 -0
- package/dist/dts/widget/components/settings/tabs/SymbolSettingsTab.d.ts +5 -0
- package/dist/dts/widget/components/settings/tabs/ThemePaletteSettingsTab.d.ts +9 -0
- package/dist/dts/widget/components/settings/tabs/TradingEventsSettingsTab.d.ts +8 -0
- package/dist/dts/widget/components/toolbar/DrawingToolIcon.d.ts +10 -0
- package/dist/dts/widget/components/toolbar/DrawingToolbar.d.ts +33 -0
- package/dist/dts/widget/components/toolbar/FloatingChartBar.d.ts +20 -0
- package/dist/dts/widget/components/toolbar/FloatingFavoritesBar.d.ts +18 -0
- package/dist/dts/widget/components/toolbar/MultiChartTopbar.d.ts +47 -0
- package/dist/dts/widget/components/toolbar/UnifiedDrawingToolbar.d.ts +28 -0
- package/dist/dts/widget/components/trading/PaperTradePanel.d.ts +41 -0
- package/dist/dts/widget/components/workspace/WorkspaceToolbar.d.ts +25 -0
- package/dist/dts/widget/config/toolGroups.d.ts +11 -0
- package/dist/dts/widget/config/toolShortcuts.d.ts +27 -0
- package/dist/dts/widget/constants/comparison.d.ts +1 -0
- package/dist/dts/widget/constants/symbolSearch.d.ts +14 -0
- package/dist/dts/widget/constants/vn30.d.ts +7 -0
- package/dist/dts/widget/context/DataProviderContext.d.ts +7 -0
- package/dist/dts/widget/context/HoverEmitter.d.ts +50 -0
- package/dist/dts/widget/context/SyncContextShare.d.ts +11 -0
- package/dist/dts/widget/context/VNInvestChartsConfigContext.d.ts +24 -0
- package/dist/dts/widget/context/VNInvestChartsContext.d.ts +70 -0
- package/dist/dts/widget/context/VNInvestChartsStateContext.d.ts +50 -0
- package/dist/dts/widget/context/WidgetI18nContext.d.ts +25 -0
- package/dist/dts/widget/context/WorkspaceLiveTradingContext.d.ts +30 -0
- package/dist/dts/widget/context/WorkspacePaperVisibilityContext.d.ts +23 -0
- package/dist/dts/widget/context/WorkspaceReplayTradingContext.d.ts +36 -0
- package/dist/dts/widget/contexts/SaaSFeatureContext.d.ts +23 -0
- package/dist/dts/widget/data/DataEnvelope.d.ts +100 -0
- package/dist/dts/widget/drawingPriceLabelInputs.d.ts +3 -0
- package/dist/dts/widget/export/chartCsv.d.ts +59 -0
- package/dist/dts/widget/forkAnchorReconciliation.d.ts +6 -0
- package/dist/dts/widget/forkInteractionHelpers.d.ts +69 -0
- package/dist/dts/widget/grid/DeviceProfiles.d.ts +49 -0
- package/dist/dts/widget/grid/GridChartRegistry.d.ts +9 -0
- package/dist/dts/widget/grid/MemoryBudgetManager.d.ts +63 -0
- package/dist/dts/widget/grid/PerformanceMonitor.d.ts +70 -0
- package/dist/dts/widget/grid/customPresets.d.ts +42 -0
- package/dist/dts/widget/grid/presets.d.ts +18 -0
- package/dist/dts/widget/grid/types.d.ts +39 -0
- package/dist/dts/widget/history/BackfillDedupContext.d.ts +63 -0
- package/dist/dts/widget/history/RequestCoordinator.d.ts +59 -0
- package/dist/dts/widget/history/SharedBarStoreContext.d.ts +22 -0
- package/dist/dts/widget/history/cache/IndexedDBCacheMatrix.d.ts +16 -0
- package/dist/dts/widget/history/cache/LocalCacheMatrix.d.ts +86 -0
- package/dist/dts/widget/history/cache/index.d.ts +3 -0
- package/dist/dts/widget/history/chunkStore.d.ts +77 -0
- package/dist/dts/widget/history/externalBarsNormalization.d.ts +9 -0
- package/dist/dts/widget/history/externalBarsNormalization.worker.d.ts +1 -0
- package/dist/dts/widget/history/externalBarsNormalizationAsync.d.ts +25 -0
- package/dist/dts/widget/history/historyDataUtils.d.ts +82 -0
- package/dist/dts/widget/history/historyWindowPlanner.d.ts +89 -0
- package/dist/dts/widget/history/inflightController.d.ts +15 -0
- package/dist/dts/widget/history/requestCoalescing.d.ts +10 -0
- package/dist/dts/widget/history/sessionGuards.d.ts +3 -0
- package/dist/dts/widget/history/singleWriterLane.d.ts +4 -0
- package/dist/dts/widget/history/useExternalBarsNormalization.d.ts +5 -0
- package/dist/dts/widget/hooks/ShortcutManager.d.ts +65 -0
- package/dist/dts/widget/hooks/overlays/PaneHeaderWrapper.d.ts +11 -0
- package/dist/dts/widget/hooks/overlays/overlayHelpers.d.ts +60 -0
- package/dist/dts/widget/hooks/overlays/useDrawingDockNode.d.ts +15 -0
- package/dist/dts/widget/hooks/overlays/useLegendChrome.d.ts +36 -0
- package/dist/dts/widget/hooks/overlays/useMultiSelectActions.d.ts +22 -0
- package/dist/dts/widget/hooks/overlays/useSidebarResize.d.ts +13 -0
- package/dist/dts/widget/hooks/resolveEntitlement.d.ts +73 -0
- package/dist/dts/widget/hooks/useBottomPanelBehavior.d.ts +38 -0
- package/dist/dts/widget/hooks/useBottomPanelHeight.d.ts +39 -0
- package/dist/dts/widget/hooks/useCanvasTheme.d.ts +24 -0
- package/dist/dts/widget/hooks/useChartImperativeHandle.d.ts +57 -0
- package/dist/dts/widget/hooks/useClockAdapter.d.ts +11 -0
- package/dist/dts/widget/hooks/useComparisonState.d.ts +29 -0
- package/dist/dts/widget/hooks/useDialogFocus.d.ts +25 -0
- package/dist/dts/widget/hooks/useDrawingToolShortcuts.d.ts +16 -0
- package/dist/dts/widget/hooks/useFeatureGate.d.ts +28 -0
- package/dist/dts/widget/hooks/useFloatingChartBar.d.ts +33 -0
- package/dist/dts/widget/hooks/useForkRuntime.d.ts +155 -0
- package/dist/dts/widget/hooks/useIndicatorsShareApplier.d.ts +1 -0
- package/dist/dts/widget/hooks/useIntersectionObserver.d.ts +49 -0
- package/dist/dts/widget/hooks/useKeyboardAdapter.d.ts +9 -0
- package/dist/dts/widget/hooks/useLayoutHistory.d.ts +8 -0
- package/dist/dts/widget/hooks/useLicenseDiagnostics.d.ts +15 -0
- package/dist/dts/widget/hooks/useMultiChartReplaySync.d.ts +31 -0
- package/dist/dts/widget/hooks/useMultiWorkspacePersistence.d.ts +49 -0
- package/dist/dts/widget/hooks/usePaperTradeConfig.d.ts +27 -0
- package/dist/dts/widget/hooks/usePaperTradeInteraction.d.ts +27 -0
- package/dist/dts/widget/hooks/usePatTierAuthentication.d.ts +42 -0
- package/dist/dts/widget/hooks/usePineScriptRestore.d.ts +23 -0
- package/dist/dts/widget/hooks/usePortalAdapter.d.ts +8 -0
- package/dist/dts/widget/hooks/useRecentSymbols.d.ts +3 -0
- package/dist/dts/widget/hooks/useReplayState.d.ts +28 -0
- package/dist/dts/widget/hooks/useReplayTrading.d.ts +26 -0
- package/dist/dts/widget/hooks/useResizeAdapter.d.ts +13 -0
- package/dist/dts/widget/hooks/useScaleOverlays.d.ts +62 -0
- package/dist/dts/widget/hooks/useScriptPersistence.d.ts +72 -0
- package/dist/dts/widget/hooks/useSymbolSearch.d.ts +30 -0
- package/dist/dts/widget/hooks/useViewportBreakpoint.d.ts +15 -0
- package/dist/dts/widget/hooks/useWidgetCoordinateBridge.d.ts +70 -0
- package/dist/dts/widget/hooks/useWidgetData.d.ts +138 -0
- package/dist/dts/widget/hooks/useWidgetDataBackfill.d.ts +67 -0
- package/dist/dts/widget/hooks/useWidgetDataEnrichment.d.ts +32 -0
- package/dist/dts/widget/hooks/useWidgetDrawings.d.ts +38 -0
- package/dist/dts/widget/hooks/useWidgetForkInteraction.d.ts +68 -0
- package/dist/dts/widget/hooks/useWidgetInteractionActions.d.ts +36 -0
- package/dist/dts/widget/hooks/useWidgetOverlays.d.ts +190 -0
- package/dist/dts/widget/hooks/useWidgetRuntime.d.ts +20 -0
- package/dist/dts/widget/hooks/useWidgetSettings.d.ts +244 -0
- package/dist/dts/widget/hooks/useWidgetWorkspaceIO.d.ts +24 -0
- package/dist/dts/widget/hooks/useWorkspaceDockPanels.d.ts +11 -0
- package/dist/dts/widget/hooks/useWorkspaceLiveTrading.d.ts +28 -0
- package/dist/dts/widget/hooks/useWorkspaceReplayTrading.d.ts +22 -0
- package/dist/dts/widget/i18n/a11y.messages.en.d.ts +8 -0
- package/dist/dts/widget/i18n/a11y.messages.vi.d.ts +3 -0
- package/dist/dts/widget/i18n/capability.messages.en.d.ts +7 -0
- package/dist/dts/widget/i18n/capability.messages.vi.d.ts +3 -0
- package/dist/dts/widget/i18n/dock.messages.en.d.ts +2 -0
- package/dist/dts/widget/i18n/dock.messages.vi.d.ts +2 -0
- package/dist/dts/widget/i18n/messages.en.d.ts +2 -0
- package/dist/dts/widget/i18n/messages.licensing.d.ts +48 -0
- package/dist/dts/widget/i18n/messages.vi.d.ts +2 -0
- package/dist/dts/widget/i18n/trading.messages.en.d.ts +2 -0
- package/dist/dts/widget/i18n/trading.messages.vi.d.ts +2 -0
- package/dist/dts/widget/i18n/types.d.ts +3 -0
- package/dist/dts/widget/iframe/builtInAdapters.d.ts +63 -0
- package/dist/dts/widget/iframe/host-entry.d.ts +11 -0
- package/dist/dts/widget/iframe/hostSDK.d.ts +151 -0
- package/dist/dts/widget/iframe/iframeBridge.d.ts +165 -0
- package/dist/dts/widget/iframe/iframeEntry.d.ts +52 -0
- package/dist/dts/widget/iframe/iframeFrame.d.ts +15 -0
- package/dist/dts/widget/iframe/iframeQuotes.d.ts +20 -0
- package/dist/dts/widget/iframe/messageProtocol.d.ts +545 -0
- package/dist/dts/widget/iframe/quoteHub.d.ts +20 -0
- package/dist/dts/widget/iframe/useVNInvestChartsHost.d.ts +8 -0
- package/dist/dts/widget/iife-entry.d.ts +61 -0
- package/dist/dts/widget/iifeWidgetInstance.d.ts +60 -0
- package/dist/dts/widget/index.d.ts +56 -0
- package/dist/dts/widget/multiChartDefaults.d.ts +18 -0
- package/dist/dts/widget/paneInteractionUtils.d.ts +25 -0
- package/dist/dts/widget/patterns/autoPatternScan.d.ts +77 -0
- package/dist/dts/widget/patterns/patternDrawingFactory.d.ts +87 -0
- package/dist/dts/widget/plugin/ProPluginRegistry.d.ts +40 -0
- package/dist/dts/widget/runtime/ChartScaleAdapter.d.ts +73 -0
- package/dist/dts/widget/runtime/ChartSerializer.d.ts +12 -0
- package/dist/dts/widget/runtime/ForkRuntimeAdapter.d.ts +19 -0
- package/dist/dts/widget/runtime/IRuntimeEngine.d.ts +40 -0
- package/dist/dts/widget/runtime/WorkspaceSerializer.d.ts +31 -0
- package/dist/dts/widget/runtimePolicy.d.ts +36 -0
- package/dist/dts/widget/styles/injectStyles.d.ts +9 -0
- package/dist/dts/widget/theme/ThemeConfig.d.ts +21 -0
- package/dist/dts/widget/theme/applyTheme.d.ts +3 -0
- package/dist/dts/widget/trading/chart/DraggableOrderHandles.d.ts +15 -0
- package/dist/dts/widget/trading/chart/InteractivePositionOverlay.d.ts +19 -0
- package/dist/dts/widget/trading/chart/PendingOrderOverlay.d.ts +11 -0
- package/dist/dts/widget/trading/chart/QuickTradingHeader.d.ts +20 -0
- package/dist/dts/widget/trading/chart/TradingChartSurface.d.ts +8 -0
- package/dist/dts/widget/trading/chart/TradingOverlaysHost.d.ts +28 -0
- package/dist/dts/widget/trading/chart/priceTicks.d.ts +1 -0
- package/dist/dts/widget/trading/chart/useFloatingDrag.d.ts +40 -0
- package/dist/dts/widget/trading/chart/useTradingHotkeys.d.ts +21 -0
- package/dist/dts/widget/trading/config/paperRuntimeConfig.d.ts +53 -0
- package/dist/dts/widget/trading/context/PaperPanelRegistry.d.ts +45 -0
- package/dist/dts/widget/trading/context/TradingContext.d.ts +80 -0
- package/dist/dts/widget/trading/context/WorkspaceTradingSync.d.ts +24 -0
- package/dist/dts/widget/trading/hooks/usePaperRuntimeConfig.d.ts +36 -0
- package/dist/dts/widget/trading/index.d.ts +5 -0
- package/dist/dts/widget/trading/panel/AccountSummaryTab.d.ts +7 -0
- package/dist/dts/widget/trading/panel/ActiveChartPaperPanel.d.ts +26 -0
- package/dist/dts/widget/trading/panel/ConnectedTradingPanel.d.ts +3 -0
- package/dist/dts/widget/trading/panel/HistoryTab.d.ts +5 -0
- package/dist/dts/widget/trading/panel/MarketFallbackBanner.d.ts +4 -0
- package/dist/dts/widget/trading/panel/OrdersTab.d.ts +8 -0
- package/dist/dts/widget/trading/panel/PaperCapitalDialog.d.ts +8 -0
- package/dist/dts/widget/trading/panel/PaperSettingsModal.d.ts +17 -0
- package/dist/dts/widget/trading/panel/PositionsTab.d.ts +15 -0
- package/dist/dts/widget/trading/panel/TradeHistoryTab.d.ts +5 -0
- package/dist/dts/widget/trading/panel/TradingBottomPanel.d.ts +36 -0
- package/dist/dts/widget/trading/panel/TradingLogTab.d.ts +8 -0
- package/dist/dts/widget/trading/panel/TradingPanelHeader.d.ts +17 -0
- package/dist/dts/widget/trading/panel/csvExport.d.ts +18 -0
- package/dist/dts/widget/trading/ticket/ConnectedTradingDockPanel.d.ts +5 -0
- package/dist/dts/widget/trading/ticket/OrderTicketForm.d.ts +31 -0
- package/dist/dts/widget/trading/ticket/OrderTicketModal.d.ts +29 -0
- package/dist/dts/widget/trading/ticket/RegistryTradingDockPanel.d.ts +9 -0
- package/dist/dts/widget/trading/ticket/RiskCalculatorView.d.ts +9 -0
- package/dist/dts/widget/trading/ticket/TradingDockPanel.d.ts +36 -0
- package/dist/dts/widget/trading/ticket/orderTicketModel.d.ts +49 -0
- package/dist/dts/widget/trading/visibility/paperVisibility.d.ts +38 -0
- package/dist/dts/widget/types/dataProvider.d.ts +8 -0
- package/dist/dts/widget/types/fullChartHandle.d.ts +25 -0
- package/dist/dts/widget/types/saas.d.ts +83 -0
- package/dist/dts/widget/types/symbolSearch.d.ts +9 -0
- package/dist/dts/widget/types/watchlist.d.ts +26 -0
- package/dist/dts/widget/utils/axisHit.d.ts +16 -0
- package/dist/dts/widget/utils/chartRange.d.ts +12 -0
- package/dist/dts/widget/utils/chartTypeOptions.d.ts +38 -0
- package/dist/dts/widget/utils/clickOutside.d.ts +1 -0
- package/dist/dts/widget/utils/coordinateBridge.d.ts +31 -0
- package/dist/dts/widget/utils/crosshairSync.d.ts +50 -0
- package/dist/dts/widget/utils/drawingSync.d.ts +198 -0
- package/dist/dts/widget/utils/enrichedHash.d.ts +15 -0
- package/dist/dts/widget/utils/headerSync.d.ts +12 -0
- package/dist/dts/widget/utils/numberFormat.d.ts +13 -0
- package/dist/dts/widget/utils/paperTradeAdapters.d.ts +11 -0
- package/dist/dts/widget/utils/pineSeriesData.d.ts +71 -0
- package/dist/dts/widget/utils/rangeSync.d.ts +29 -0
- package/dist/dts/widget/utils/telemetry.d.ts +19 -0
- package/dist/dts/widget/utils/widgetEquality.d.ts +57 -0
- package/dist/dts/widget/utils/widgetErrors.d.ts +29 -0
- package/dist/dts/widget/utils/widgetHelpers.d.ts +395 -0
- package/dist/dts/widget/utils/xAxisTickFormatter.d.ts +33 -0
- package/dist/dts/widget/visibleRangeBridge.d.ts +28 -0
- package/dist/dts/widget/visibleRangeDiagnostics.d.ts +10 -0
- package/dist/dts/widget/visibleRangePolicies.d.ts +6 -0
- package/dist/dts/widget/workspace/WorkspaceManager.d.ts +23 -0
- package/dist/dts/widget/workspace/WorkspaceStore.d.ts +85 -0
- package/dist/dts/widget/workspace/types.d.ts +21 -0
- package/dist/externalBarsNormalization.worker.js +108 -0
- package/dist/iframe/index.html +63 -0
- package/dist/iframe/injected.css +6456 -0
- package/dist/iframe/vninvestchart.iframe.css +2 -0
- package/dist/iframe/vninvestchart.iframe.js +945 -0
- package/dist/iframe-host/host-entry.cjs +687 -0
- package/dist/iframe-host/host-entry.d.mts +818 -0
- package/dist/iframe-host/host-entry.d.ts +818 -0
- package/dist/iframe-host/host-entry.js +680 -0
- package/dist/index.cjs +7253 -0
- package/dist/index.css +3390 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +6461 -0
- package/dist/injected.css +6456 -0
- package/dist/rollAlgorithms-2P2ZKKHO.js +2 -0
- package/dist/types/runtime.cjs +8 -0
- package/dist/types/runtime.d.mts +92 -0
- package/dist/types/runtime.d.ts +92 -0
- package/dist/types/runtime.js +5 -0
- package/dist/types/runtime.umd.js +14 -0
- package/dist/vninvestchart.iife.css +2 -0
- package/dist/vninvestchart.iife.js +945 -0
- package/package.json +225 -5
package/README.md
CHANGED
|
@@ -1,3 +1,851 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# VNInvestCharts Widget
|
|
2
|
+
|
|
3
|
+
> **Enterprise-grade financial charting engine & commercial-grade multi-chart workspace for web applications.**
|
|
4
|
+
> Built for precision, zero backend lock-in, 76 precision drawing tools, 59 technical indicators, in-memory simulated paper trading, and seamless 3-mode embedding.
|
|
5
|
+
>
|
|
6
|
+
> **Bộ công cụ biểu đồ kỹ thuật tài chính & không gian làm việc đa biểu đồ đẳng cấp phần mềm thương mại quốc tế.**
|
|
7
|
+
> Dựng hình tốc độ cao, hoàn toàn độc lập backend, 76 công cụ vẽ chuẩn xác, hơn 60 chỉ báo kỹ thuật, mô phỏng khớp lệnh Paper Trading thời gian thực và 3 chế độ nhúng linh hoạt.
|
|
8
|
+
|
|
9
|
+
<div align="center">
|
|
10
|
+
|
|
11
|
+
[](https://www.npmjs.com/package/@vninvestcharts/widget)
|
|
12
|
+
[](./LICENSE)
|
|
13
|
+
[](https://react.dev)
|
|
14
|
+
[](https://www.typescriptlang.org)
|
|
15
|
+
[](https://vitest.dev)
|
|
16
|
+
[](#core-architecture)
|
|
17
|
+
|
|
18
|
+
[🌐 **Live Demo (Trải nghiệm trực tiếp)**](https://stockchart.edusuccess.vn) •
|
|
19
|
+
[🏛️ **Product Portal (Cổng sản phẩm)**](https://vninvest.edusuccess.vn) •
|
|
20
|
+
[📖 **Integration Guide (Hướng dẫn nhúng)**](./docs/WIDGET_EMBED_GUIDE.md) •
|
|
21
|
+
[👥 **Community (Facebook)**](https://www.facebook.com/vninvestframework)
|
|
22
|
+
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 🌐 Language Navigation / Chuyển đổi ngôn ngữ
|
|
28
|
+
|
|
29
|
+
- 🇬🇧 **[English Documentation](#english)** — Technical Overview, Multi-Chart Sync, Architecture & API
|
|
30
|
+
- 🇻🇳 **[Tài liệu Tiếng Việt](#tieng-viet)** — Tổng quan kỹ thuật, Không gian đa biểu đồ, Kiến trúc & API
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 📸 Production Previews / Ảnh chụp thực tế
|
|
35
|
+
|
|
36
|
+
<div align="center">
|
|
37
|
+
<table>
|
|
38
|
+
<tr>
|
|
39
|
+
<td align="center" width="33%">
|
|
40
|
+
<img src="images/Screenshot%202026-07-15%20213405.png" width="100%" alt="Chart & 76 Drawing Tools"/>
|
|
41
|
+
<br/><b>Precision Charting & 76 Drawing Tools</b>
|
|
42
|
+
</td>
|
|
43
|
+
<td align="center" width="33%">
|
|
44
|
+
<img src="images/Screenshot%202026-07-12%20162137.png" width="100%" alt="Bar Replay & Paper Trading"/>
|
|
45
|
+
<br/><b>Bar Replay & Real-time Paper Trading</b>
|
|
46
|
+
</td>
|
|
47
|
+
<td align="center" width="33%">
|
|
48
|
+
<img src="images/Screenshot%202026-07-06%20163620.png" width="100%" alt="Vietnamese Symbol Search"/>
|
|
49
|
+
<b>Vietnamese Ticker Search</b>
|
|
50
|
+
</td>
|
|
51
|
+
</tr>
|
|
52
|
+
<tr>
|
|
53
|
+
<td align="center" width="33%">
|
|
54
|
+
<img src="images/Screenshot%202026-07-12%20162231.png" width="100%" alt="Multi-Chart Workspace"/>
|
|
55
|
+
<br/><b>Multi-Chart Workspace (Commercial-grade 6-way sync)</b>
|
|
56
|
+
</td>
|
|
57
|
+
<td align="center" width="33%">
|
|
58
|
+
<img src="images/Screenshot%202026-07-12%20162503.png" width="100%" alt="Dynamic Theme & Status Bar"/>
|
|
59
|
+
<br/><b>Responsive Dark/Light Themes & Status Bar</b>
|
|
60
|
+
</td>
|
|
61
|
+
<td align="center" width="33%">
|
|
62
|
+
<img src="images/Screenshot%202026-07-12%20160523.png" width="100%" alt="Drawing Inspector & Dock"/>
|
|
63
|
+
<br/><b>Drawing Inspector, Style Dock & Layer Tree</b>
|
|
64
|
+
</td>
|
|
65
|
+
</tr>
|
|
66
|
+
<tr>
|
|
67
|
+
<td align="center" width="33%">
|
|
68
|
+
<img src="images/Screenshot%202026-07-15%20213356.png" width="100%" alt="Technical Indicators & Overlays"/>
|
|
69
|
+
<br/><b>59 SSOT Indicators & Custom Overlays</b>
|
|
70
|
+
</td>
|
|
71
|
+
<td align="center" width="67%" colspan="2">
|
|
72
|
+
<b>Enterprise Capabilities:</b> large historical datasets (unbenchmarked — measure against your own volume), CRDT cross-tab drawing synchronization (implemented in the engine, **not verified** by this repo's tests), Shadow DOM CSS encapsulation, and typed <code>StockDataAdapter</code> integration.
|
|
73
|
+
</td>
|
|
74
|
+
</tr>
|
|
75
|
+
</table>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
# English
|
|
81
|
+
|
|
82
|
+
<a id="english"></a>
|
|
83
|
+
|
|
84
|
+
## Why VNInvestCharts Widget?
|
|
85
|
+
|
|
86
|
+
**VNInvestCharts Widget** is an enterprise-grade financial charting library and multi-chart workspace engineered specifically for modern capital markets and fintech applications. It combines a **WebGL/Canvas hybrid engine** with a modular, **zero-backend-coupling** architecture.
|
|
87
|
+
|
|
88
|
+
> **Not yet benchmarked.** No frame-rate or throughput benchmark ships with this package. `npm run benchmark:backfill` points at a test file that does not exist, and the only performance test (`tests/soak/render_heavy.test.ts`) times `computeScales` in isolation — no render loop, no FPS assertion. If you need a number for procurement, measure it against your own data volume; treat any FPS figure you find elsewhere about this package as unverified.
|
|
89
|
+
|
|
90
|
+
Whether you are building a React-based institutional trading terminal, embedding a single market chart into a WordPress/Shopify portal, or deploying sandboxed charting inside an enterprise banking app, VNInvestCharts provides 3 native delivery modes (ESM, IIFE, Iframe) with zero style pollution.
|
|
91
|
+
|
|
92
|
+
| Key Capability | Technical Distinction & Value Proposition |
|
|
93
|
+
|---|---|
|
|
94
|
+
| **Zero Backend Coupling** | Fully client-side execution. All data flows through a typed `StockDataAdapter` interface — connect to any REST, WebSocket, GraphQL, or gRPC backend without altering charting code. |
|
|
95
|
+
| **Commercial-Grade Multi-Chart Workspace** | First-class `VNInvestMultiCharts` component supporting flexible grid layouts (1×1, 1×2, 2×1, 2×2, 1×3, 3×1, 6-chart) with 6-way synchronized states (Visible Range, Crosshair, Time-anchor, Symbol, Timeframe, Drawings, Replay). |
|
|
96
|
+
| **76 Precision Drawing Tools** | 14 mathematical and geometric categories (Fibonacci, Gann, Pitchfork, Harmonic, Elliott Wave, Prediction/Measurement, Annotation) with multi-point transform and CRDT conflict-free cross-tab sync. |
|
|
97
|
+
| **59 High-Performance Indicators** | Single Source of Truth (SSOT) mathematical kernel computing indicators in single-pass O(N) complexity — zero redundant calculations, instant timeframe switches. |
|
|
98
|
+
| **Real-time Paper Trading & Replay** | In-memory simulated order execution (Market, Limit, Stop, Take-Profit) with realistic fee/slippage modeling, paired with a historical tick-by-tick bar replay engine. |
|
|
99
|
+
| **Encapsulated 3-Mode Delivery** | Native React 18/19 ESM package, zero-dependency IIFE bundle with automated Shadow DOM CSS isolation, and a postMessage-secured sandboxed Iframe with typed Host SDK. |
|
|
100
|
+
| **Vietnamese Market Native** | Built-in ergonomics for HOSE/HNX/UPCoM exchanges, VN30 derivatives, reference/ceiling/floor price bands, T+2 settlement cycles, VND currency formatting, and full VI/EN localization. |
|
|
101
|
+
|
|
102
|
+

|
|
103
|
+
|
|
104
|
+
## Quick Start
|
|
105
|
+
|
|
106
|
+
### 1. React Application (ESM) — Single Chart
|
|
107
|
+
|
|
108
|
+
Install the package via npm or yarn:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
npm install @vninvestcharts/widget
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
> **Upgrading from `vninvestcharts-widget` 1.x?** The package moved to the
|
|
115
|
+
> `@vninvestcharts/` scope and changed licence from MPL-2.0 to Apache-2.0.
|
|
116
|
+
> Read **[the 0.2.0 migration guide](./docs/MIGRATION_0_2_0.md)** before upgrading —
|
|
117
|
+
> the import specifier changes, and `debugFeatures` is now ignored outside
|
|
118
|
+
> `NODE_ENV=development`.
|
|
119
|
+
|
|
120
|
+
Render an isolated, interactive chart in seconds:
|
|
121
|
+
|
|
122
|
+
```tsx
|
|
123
|
+
import React from 'react';
|
|
124
|
+
import { VNInvestCharts } from '@vninvestcharts/widget';
|
|
125
|
+
import '@vninvestcharts/widget/dist/index.css';
|
|
126
|
+
|
|
127
|
+
export function StockView() {
|
|
128
|
+
return (
|
|
129
|
+
<div style={{ width: '100%', height: '650px' }}>
|
|
130
|
+
<VNInvestCharts
|
|
131
|
+
symbol="VCB"
|
|
132
|
+
timeframe="1D"
|
|
133
|
+
theme="dark"
|
|
134
|
+
locale="en"
|
|
135
|
+
drawingUiEnabled={true}
|
|
136
|
+
showHeader={true}
|
|
137
|
+
showToolbar={true}
|
|
138
|
+
showFooter={true}
|
|
139
|
+
onSymbolChange={(s) => console.log('Selected symbol:', s)}
|
|
140
|
+
onTimeframeChange={(tf) => console.log('Active timeframe:', tf)}
|
|
141
|
+
/>
|
|
142
|
+
</div>
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
### 2. React Application (ESM) — Multi-Chart Synchronized Workspace
|
|
150
|
+
|
|
151
|
+
Instantiate a multi-chart workspace with commercial-grade cross-chart synchronization:
|
|
152
|
+
|
|
153
|
+
```tsx
|
|
154
|
+
import React from 'react';
|
|
155
|
+
import { VNInvestMultiCharts } from '@vninvestcharts/widget';
|
|
156
|
+
import '@vninvestcharts/widget/dist/index.css';
|
|
157
|
+
|
|
158
|
+
export function ProTradingWorkspace() {
|
|
159
|
+
return (
|
|
160
|
+
<div style={{ width: '100vw', height: '100vh' }}>
|
|
161
|
+
<VNInvestMultiCharts
|
|
162
|
+
layout={{ rows: 2, cols: 2 }}
|
|
163
|
+
charts={[{ id: "chart-1", symbol: "FPT", timeframe: "1D" }]}
|
|
164
|
+
syncVisibleRange={true}
|
|
165
|
+
syncCrosshair={true}
|
|
166
|
+
syncSymbolLinks={false}
|
|
167
|
+
syncTimeframe={false}
|
|
168
|
+
syncDrawings={true}
|
|
169
|
+
defaultChartProps={{
|
|
170
|
+
theme: "dark",
|
|
171
|
+
locale: "en",
|
|
172
|
+
}}
|
|
173
|
+
/>
|
|
174
|
+
</div>
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
### 3. Script Tag (IIFE) — Any Website or CMS
|
|
182
|
+
|
|
183
|
+
Embed directly into vanilla HTML, WordPress, Webflow, or PHP apps without any build step or React dependencies:
|
|
184
|
+
|
|
185
|
+
```html
|
|
186
|
+
<!-- Load CSS & Bundle -->
|
|
187
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@vninvestcharts/widget/dist/index.css" />
|
|
188
|
+
<script src="https://cdn.jsdelivr.net/npm/@vninvestcharts/widget/dist/vninvestchart.iife.js"></script>
|
|
189
|
+
|
|
190
|
+
<div id="chart-root" style="width: 100%; height: 600px;"></div>
|
|
191
|
+
|
|
192
|
+
<script>
|
|
193
|
+
const { unmount, widgetRef } = window.VNInvestCharts.mount({
|
|
194
|
+
container: document.getElementById('chart-root'),
|
|
195
|
+
props: {
|
|
196
|
+
layout: { rows: 1, cols: 1 },
|
|
197
|
+
defaultChartProps: {
|
|
198
|
+
symbol: 'HPG',
|
|
199
|
+
timeframe: '1D',
|
|
200
|
+
theme: 'dark',
|
|
201
|
+
locale: 'en',
|
|
202
|
+
drawingUiEnabled: true,
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
useShadowDOM: true, // Complete CSS encapsulation — zero style bleeding
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
// Imperative runtime controls. The IIFE mounts a MULTI-chart workspace, so
|
|
209
|
+
// every single-chart method targets the ACTIVE chart. Symbol/timeframe changes
|
|
210
|
+
// reach linked charts only when the matching sync flag is enabled
|
|
211
|
+
// (syncSymbolLinks / syncTimeframe).
|
|
212
|
+
// widgetRef.current?.setActiveSymbol('SSI');
|
|
213
|
+
// widgetRef.current?.setActiveTimeframe('1H');
|
|
214
|
+
// widgetRef.current?.exportActiveDrawings();
|
|
215
|
+
// widgetRef.current?.setActiveChart('chart-1');
|
|
216
|
+
</script>
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
### 4. Sandboxed Iframe with Host SDK — Isolated Embedding
|
|
222
|
+
|
|
223
|
+
Embed inside third-party portals, banking applications, or strict CSP environments:
|
|
224
|
+
|
|
225
|
+
```html
|
|
226
|
+
<iframe
|
|
227
|
+
id="chart-frame"
|
|
228
|
+
src="https://your-cdn.com/iframe/vninvestchart.iframe.html"
|
|
229
|
+
style="width: 100%; height: 650px; border: none;"
|
|
230
|
+
></iframe>
|
|
231
|
+
|
|
232
|
+
<script type="module">
|
|
233
|
+
import { createVNInvestChartsHost } from '@vninvestcharts/widget/iframe-host';
|
|
234
|
+
|
|
235
|
+
const host = await createVNInvestChartsHost({
|
|
236
|
+
iframe: document.getElementById('chart-frame'),
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
const controller = host.getController();
|
|
240
|
+
await controller.initialize({ symbol: 'VNM', timeframe: '1D', theme: 'dark' });
|
|
241
|
+
|
|
242
|
+
// Bi-directional RPC communication
|
|
243
|
+
controller.on('event:symbolChanged', (payload) => console.log('Iframe switched to:', payload.symbol));
|
|
244
|
+
</script>
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## Core Architecture
|
|
250
|
+
|
|
251
|
+
### Pluggable Data Pipeline (`StockDataAdapter`)
|
|
252
|
+
|
|
253
|
+
The chart engine is strictly decoupled from your backend. All historical candles, real-time WebSocket ticks, and symbol metadata pass through the `StockDataAdapter` interface:
|
|
254
|
+
|
|
255
|
+
```
|
|
256
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
257
|
+
│ Host Web Application │
|
|
258
|
+
│ ┌───────────────────────────────────────────────────────┐ │
|
|
259
|
+
│ │ VNInvestCharts Presentation Layer │ │
|
|
260
|
+
│ │ ┌──────────────┐ ┌───────────────┐ ┌────────────┐ │ │
|
|
261
|
+
│ │ │ React (ESM) │ │ IIFE Wrapper │ │ Iframe SDK │ │ │
|
|
262
|
+
│ │ └──────┬───────┘ └───────┬───────┘ └─────┬──────┘ │ │
|
|
263
|
+
│ │ │ │ │ │ │
|
|
264
|
+
│ │ └──────────┬───────┴────────────────┘ │ │
|
|
265
|
+
│ │ │ │ │
|
|
266
|
+
│ │ ┌──────────────▼─────────────┐ │ │
|
|
267
|
+
│ │ │ Typed StockDataAdapter │ ← Pluggable Bridge │ │
|
|
268
|
+
│ │ └──────────────┬─────────────┘ │ │
|
|
269
|
+
│ └────────────────────┼──────────────────────────────────┘ │
|
|
270
|
+
└───────────────────────┼─────────────────────────────────────┘
|
|
271
|
+
│ HTTP / WebSocket / gRPC
|
|
272
|
+
┌───────────────────────▼─────────────────────────────────────┐
|
|
273
|
+
│ Your Backend API (Node / Python / Go / Java) │
|
|
274
|
+
└─────────────────────────────────────────────────────────────┘
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
#### Custom Adapter Example
|
|
278
|
+
|
|
279
|
+
`StockDataAdapter` has **6 required members** (the engine's own interface, `packages/vn-kline-engine-core/src/types.ts`). An earlier version of this example listed three and used a `subscribeRealtime` method that exists nowhere in the repository, so it could not compile. Here is the full required surface:
|
|
280
|
+
|
|
281
|
+
```typescript
|
|
282
|
+
import type {
|
|
283
|
+
StockDataAdapter, OHLCVBar, Unsubscribe, SymbolInfo,
|
|
284
|
+
} from '@vninvestcharts/widget';
|
|
285
|
+
|
|
286
|
+
export const customFintechAdapter: StockDataAdapter = {
|
|
287
|
+
// 1. required - the initial/backfill window
|
|
288
|
+
fetchBarsInRange: async (symbol, timeframe, from, to): Promise<OHLCVBar[]> => {
|
|
289
|
+
const res = await fetch(
|
|
290
|
+
`/api/range?symbol=${symbol}&tf=${timeframe}&from=${from.getTime()}&to=${to.getTime()}`,
|
|
291
|
+
);
|
|
292
|
+
return res.json();
|
|
293
|
+
},
|
|
294
|
+
|
|
295
|
+
// 2. required - paginating backwards past the initial window
|
|
296
|
+
fetchBarsBefore: async (symbol, timeframe, before, limit): Promise<OHLCVBar[]> => {
|
|
297
|
+
const res = await fetch(
|
|
298
|
+
`/api/history?symbol=${symbol}&tf=${timeframe}&to=${before.getTime()}&limit=${limit}`,
|
|
299
|
+
);
|
|
300
|
+
return res.json();
|
|
301
|
+
},
|
|
302
|
+
|
|
303
|
+
// 3. required - live bar updates
|
|
304
|
+
subscribeToBar: (symbol, timeframe, onBar): Unsubscribe => {
|
|
305
|
+
const ws = new WebSocket(`wss://api.yourbroker.com/bar?symbol=${symbol}&tf=${timeframe}`);
|
|
306
|
+
ws.onmessage = (e) => onBar(JSON.parse(e.data));
|
|
307
|
+
return () => ws.close();
|
|
308
|
+
},
|
|
309
|
+
|
|
310
|
+
// 4. required
|
|
311
|
+
subscribeToTrades: (symbol, onTrade): Unsubscribe => {
|
|
312
|
+
const ws = new WebSocket(`wss://api.yourbroker.com/trades?symbol=${symbol}`);
|
|
313
|
+
ws.onmessage = (e) => onTrade(JSON.parse(e.data));
|
|
314
|
+
return () => ws.close();
|
|
315
|
+
},
|
|
316
|
+
|
|
317
|
+
// 5. required
|
|
318
|
+
subscribeToOrderbook: (symbol, onUpdate): Unsubscribe => {
|
|
319
|
+
const ws = new WebSocket(`wss://api.yourbroker.com/depth?symbol=${symbol}`);
|
|
320
|
+
ws.onmessage = (e) => onUpdate(JSON.parse(e.data));
|
|
321
|
+
return () => ws.close();
|
|
322
|
+
},
|
|
323
|
+
|
|
324
|
+
// 6. required
|
|
325
|
+
searchSymbols: async (query): Promise<SymbolInfo[]> => {
|
|
326
|
+
const res = await fetch(`/api/search?q=${encodeURIComponent(query)}`);
|
|
327
|
+
return res.json();
|
|
328
|
+
},
|
|
329
|
+
};
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
Five further members are **optional** and can be omitted entirely: `getSourceSemantics`, `fetchCorporateEvents`, `getLastBackfillCoverage`, `getLastRangeCoverage`, `fetchCoverageBulk`. Declaring them is how you tell the engine what your data actually is (adjusted prices, snapshot vs. tick, gaps) — omitting them is legal, not a bug.
|
|
333
|
+
|
|
334
|
+
The contract is type-checked by the consumer smoke test: `npm run verify:consumer`.
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
### Commercial-Grade Multi-Chart Synchronization
|
|
339
|
+
|
|
340
|
+
The `VNInvestMultiCharts` engine orchestrates multiple dynamic chart instances using a centralized sync coordinator:
|
|
341
|
+
|
|
342
|
+
1. **Visible Range Synchronization**: Smooth panning and zooming across multiple charts with sub-millisecond throttle windows, zero echo loops, and content-based suppression.
|
|
343
|
+
2. **Crosshair & Tooltip Sync**: Cursor position and time-price projections mirror seamlessly across active and passive viewports.
|
|
344
|
+
3. **Symbol & Timeframe Linking**: Group charts by symbol or timeframe for multi-timeframe analysis (e.g. 1M / 1W / 1D / 1H on a single screen).
|
|
345
|
+
4. **Conflict-Free Drawing Synchronization (CRDT)**: Vector drawings replicate across multi-chart panes and browser tabs with tombstone-based deletion and symbol-scoped persistence.
|
|
346
|
+
5. **Replay State Sync**: Step through market history synchronously across all linked timeframes.
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
### Mathematical SSOT Indicator Engine
|
|
351
|
+
|
|
352
|
+
- **Single Calculation Pass**: Technical indicators (RSI, MACD, Bollinger Bands, Ichimoku, Volume Profile) are calculated once by the `@vninvestcharts/engine-core` kernel in $O(N)$ complexity.
|
|
353
|
+
- **Reactive Presentation Projections**: Overlays, secondary panes, and measurement tools consume computed buffers without re-triggering calculations.
|
|
354
|
+
- **Twin-Repo Decoupling**: High-performance Canvas/WebGL computation is encapsulated in `vn-kline-engine-core`, keeping the widget bundle lean and portable.
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
### Delivery Matrix Comparison
|
|
359
|
+
|
|
360
|
+
| Distribution Mode | Target File | CSS Encapsulation | React Required | Ideal Use Case |
|
|
361
|
+
|---|---|---|---|---|
|
|
362
|
+
| **ESM Module** | `dist/index.js` | Direct bundle import / CSS Modules | Yes (v18 / v19) | Modern React SPAs, Next.js, Vite |
|
|
363
|
+
| **IIFE Bundle** | `dist/vninvestchart.iife.js` | Built-in Shadow DOM (automatic) | **No** (Zero deps) | WordPress, Shopify, Laravel, HTML |
|
|
364
|
+
| **Sandboxed Iframe** | `dist/iframe/index.html` | Iframe sandbox + postMessage Host SDK | **No** | Enterprise portals, Banking, strict CSP |
|
|
365
|
+
|
|
366
|
+
> For complete embedding documentation and prop references, consult [`docs/WIDGET_EMBED_GUIDE.md`](./docs/WIDGET_EMBED_GUIDE.md).
|
|
367
|
+
|
|
368
|
+
---
|
|
369
|
+
|
|
370
|
+
## Technical Features Matrix
|
|
371
|
+
|
|
372
|
+
| Category | Features & Technical Specifications |
|
|
373
|
+
|---|---|
|
|
374
|
+
| **Chart Types** | Standard Japanese Candlesticks, Hollow Candlesticks, OHLC Bars, Heikin-Ashi, Area / Baseline, Renko, Kagi, Point & Figure. |
|
|
375
|
+
| **Drawing Tools (76 Tools)** | **14 Dedicated Categories**: Trend Lines, Fibonacci (Retracement, Extension, Spiral, Wedge), Geometric Shapes, Channels, Pitchforks, Gann, Harmonic Patterns (Gartley, Bat, Butterfly, Crab), Elliott Waves, Cyclic Lines, Measurement & Prediction tools. |
|
|
376
|
+
| **Technical Indicators (59)** | Moving Averages (SMA, EMA, WMA, DEMA, TEMA), Oscillators (RSI, Stochastic, CCI, Williams %R), Trend (MACD, SuperTrend, Parabolic SAR, ADX), Volatility (Bollinger Bands, ATR, Keltner), Volume (VWAP, Anchored VWAP, Volume Profile, CVD, OBV), Ichimoku Kinko Hyo. |
|
|
377
|
+
| **Multi-Chart Grids** | Dynamic grid container (1×1, 1×2, 2×1, 2×2, 1×3, 3×1, 6-chart) with responsive draggable splitters and per-pane toolbar/legend. |
|
|
378
|
+
| **Drawing Lifecycle** | Interactive canvas transform, floating context toolbar, Inspector property sheet, JSON import/export, local storage persistence, CRDT multi-tab sync. |
|
|
379
|
+
| **Simulation & Testing** | Interactive Bar Replay (step forward/backward, seek, jump-to-bar), integrated Paper Trading order ticket (Market, Limit, Stop orders, position tracking, PnL calculation). |
|
|
380
|
+
| **Theming & Localization** | Native Dark / Light themes with CSS variables, full Vietnamese & English localization (`vi` / `en`). |
|
|
381
|
+
| **Market Customization** | VN30 derivative tick size rules, reference/ceiling/floor limit lines, T+2 settlement markers, automatic trading session boundary rendering. |
|
|
382
|
+
|
|
383
|
+

|
|
384
|
+
|
|
385
|
+
---
|
|
386
|
+
|
|
387
|
+
## Widget API & Standalone Components
|
|
388
|
+
|
|
389
|
+
### Standalone Component Exports
|
|
390
|
+
|
|
391
|
+
For modular integration, `@vninvestcharts/widget` exports focused components that can be used standalone or within custom workspace layouts:
|
|
392
|
+
|
|
393
|
+
```typescript
|
|
394
|
+
import {
|
|
395
|
+
VNInvestCharts, // Core single-chart widget
|
|
396
|
+
VNInvestMultiCharts, // Full commercial-grade multi-chart workspace
|
|
397
|
+
DrawingDock, // Standalone 76-tool drawing sidebar
|
|
398
|
+
DrawingInspector, // Selected drawing property inspector
|
|
399
|
+
DrawingListPanel, // Drawing tree & layer management panel
|
|
400
|
+
PaperTradePanel, // Real-time order entry and position ledger
|
|
401
|
+
SettingsModal, // Chart configuration & styling modal
|
|
402
|
+
MeasurementOverlay, // Interactive price/bars measurement tool
|
|
403
|
+
WidgetErrorBoundary, // Enterprise error boundary container
|
|
404
|
+
WidgetEmptyState, // Graceful data-loading fallback state
|
|
405
|
+
} from "@vninvestcharts/widget";
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
### Subpath Utilities
|
|
409
|
+
|
|
410
|
+
```typescript
|
|
411
|
+
// Specialized data adapters
|
|
412
|
+
import { VNInvestDataAdapter, MultiSourceDataAdapter } from "@vninvestcharts/widget/adapters";
|
|
413
|
+
|
|
414
|
+
// Drawing storage controllers
|
|
415
|
+
import { createLocalStorageAdapter, type DrawingWorkspaceController } from "@vninvestcharts/widget/drawing";
|
|
416
|
+
|
|
417
|
+
// Shared TypeScript contracts
|
|
418
|
+
import type { StockDataAdapter, Timeframe, OHLCVBar } from "@vninvestcharts/widget/types";
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
---
|
|
422
|
+
|
|
423
|
+
## Local Development & Testing
|
|
424
|
+
|
|
425
|
+
```bash
|
|
426
|
+
# Clone and install dependencies
|
|
427
|
+
git clone https://github.com/vietdungiitb/vninvestcharts-widget.git
|
|
428
|
+
cd vninvestcharts-widget
|
|
429
|
+
npm install
|
|
430
|
+
|
|
431
|
+
# Start development demo server (runs on port 3000)
|
|
432
|
+
npm run watch # http://localhost:3000
|
|
433
|
+
|
|
434
|
+
# Strict type verification
|
|
435
|
+
npm run type-check
|
|
436
|
+
|
|
437
|
+
# Run test suite (2350+ unit and integration tests)
|
|
438
|
+
npm test
|
|
439
|
+
|
|
440
|
+
# Build production bundles (ESM, CJS, IIFE, Iframe)
|
|
441
|
+
npm run build
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
---
|
|
445
|
+
|
|
446
|
+
## Ecosystem Packages
|
|
447
|
+
|
|
448
|
+
| Package | Role & Responsibility |
|
|
449
|
+
|---|---|
|
|
450
|
+
| `@vninvestcharts/widget` | High-level embeddable widget, multi-chart workspace, drawing UI, and delivery wrappers. |
|
|
451
|
+
| `@vninvestcharts/engine-core` | Low-level WebGL/Canvas rendering pipeline, mathematical SSOT indicator calculators, camera engine. |
|
|
452
|
+
| `@vninvestcharts/engine-react` | React component hooks and render bindings for the engine kernel. |
|
|
453
|
+
|
|
454
|
+
---
|
|
455
|
+
|
|
456
|
+
## License & Intellectual Property
|
|
457
|
+
|
|
458
|
+
Licensed under the **Apache License 2.0**.
|
|
459
|
+
Copyright © 2026 Pham Viet Dung.
|
|
460
|
+
See [LICENSE](./LICENSE) for full terms and conditions, and [NOTICE.md](./NOTICE.md) for the
|
|
461
|
+
bundled third-party works.
|
|
462
|
+
|
|
463
|
+
The widget bundles `@vninvestcharts/engine-core`, `-engine-drawing` and `-engine-react`
|
|
464
|
+
(all Apache-2.0), which incorporate a controlled fork of KLineCharts (Apache-2.0).
|
|
465
|
+
Apache-2.0 permits embedding in a closed-source product and white-labelling, and it
|
|
466
|
+
grants a patent licence with a patent-termination clause — see
|
|
467
|
+
[L1.1 of the plan](./docs/upgrade-standard/plans/PLAN_B2B_WIDGET_2026-10-06.md) for why
|
|
468
|
+
this licence and not MIT/MPL-2.0/AGPL-3.0.
|
|
469
|
+
|
|
470
|
+
# Tiếng Việt
|
|
471
|
+
|
|
472
|
+
<a id="tieng-viet"></a>
|
|
473
|
+
|
|
474
|
+
> ← [Về đầu trang / Back to top](#vninvestcharts-widget) • [English Documentation](#english)
|
|
475
|
+
|
|
476
|
+
## Tại sao chọn VNInvestCharts Widget?
|
|
477
|
+
|
|
478
|
+
**VNInvestCharts Widget** là bộ thư viện biểu đồ kỹ thuật tài chính và không gian làm việc đa biểu đồ (multi-chart workspace), được thiết kế chuyên biệt cho thị trường chứng khoán hiện đại và các ứng dụng Fintech. Sản phẩm kết hợp giữa **động cơ kết xuất đồ họa hybrid WebGL/Canvas** và kiến trúc **hoàn toàn độc lập backend (zero backend coupling)**.
|
|
479
|
+
|
|
480
|
+
> **Chưa có benchmark.** Gói này **không** kèm số đo khung hình hay thông lượng. Lệnh `npm run benchmark:backfill` trỏ tới một file test **không tồn tại**; test hiệu năng duy nhất (`tests/soak/render_heavy.test.ts`) chỉ đo `computeScales` độc lập — không có vòng render, không assert FPS. Nếu cần con số để đánh giá, hãy tự đo trên khối dữ liệu của bạn.
|
|
481
|
+
|
|
482
|
+
Dù bạn đang xây dựng một trạm giao dịch chuyên nghiệp cho khối tổ chức trên nền tảng React, nhúng một biểu đồ thị trường đơn lẻ vào hệ thống CMS/WordPress/Shopify, hay triển khai biểu đồ đóng gói sandbox an toàn trong ứng dụng ngân hàng, VNInvestCharts cung cấp 3 chế độ phân phối linh hoạt (ESM, IIFE, Iframe) mà không gây bất kỳ xung đột kiểu dáng (CSS bleed) nào.
|
|
483
|
+
|
|
484
|
+
| Năng lực cốt lõi | Giá trị kỹ thuật & Lợi thế vượt trội |
|
|
485
|
+
|---|---|
|
|
486
|
+
| **Hoàn toàn độc lập Backend** | Vận hành 100% phía client. Toàn bộ dữ liệu được kết nối qua interface chuẩn kiểu `StockDataAdapter` — tích hợp dễ dàng với bất kỳ backend REST, WebSocket, GraphQL hay gRPC nào mà không cần sửa đổi mã nguồn biểu đồ. |
|
|
487
|
+
| **Không gian đa biểu đồ đẳng cấp quốc tế** | Cung cấp component cao cấp `VNInvestMultiCharts` hỗ trợ đa dạng bố cục lưới (1×1, 1×2, 2×1, 2×2, 1×3, 3×1, 6 biểu đồ) cùng cơ chế đồng bộ hóa 6 chiều (Vùng hiển thị, Con trỏ Crosshair, Trục thời gian, Mã cổ phiếu, Khung thời gian, Bản vẽ hình học, Replay). |
|
|
488
|
+
| **76 Công cụ vẽ kỹ thuật chuẩn xác** | 14 danh mục toán học và hình học chuyên sâu (Fibonacci, Gann, Mô hình Harmonic, Sóng Elliott, Pitchfork, Kênh giá, Đo lường & Dự đoán) kèm khả năng biến đổi đa điểm và đồng bộ CRDT xuyên tab không xung đột. |
|
|
489
|
+
| **Hơn 60 Chỉ báo hiệu năng cao** | Động cơ tính toán toán học Single Source of Truth (SSOT) thực hiện tính toán độ phức tạp $O(N)$ trong đúng một lượt quét dữ liệu — triệt tiêu tính toán dư thừa, chuyển đổi khung thời gian tức thì. |
|
|
490
|
+
| **Mô phỏng Paper Trading & Replay** | Khớp lệnh mô phỏng theo sổ lệnh thời gian thực (Market, Limit, Stop, Take-Profit) với mô hình tính phí và trượt giá (slippage) thực tế, kết hợp bộ máy Replay tua lại lịch sử từng tick giá. |
|
|
491
|
+
| **3 Chế độ nhúng đóng gói hoàn chỉnh** | Module ESM chuẩn cho React 18/19, gói script tag IIFE không phụ thuộc thư viện ngoài với Shadow DOM tự động cô lập CSS, và phiên bản Iframe sandbox bảo mật cao kèm Host SDK có định kiểu. |
|
|
492
|
+
| **Tối ưu bản địa cho thị trường VN** | Tích hợp sẵn cơ chế khớp lệnh của HOSE, HNX, UPCoM, chỉ số phái sinh VN30, dải biên độ giá Trần/Sàn/Tham chiếu, chu kỳ thanh toán T+2, định dạng tiền tệ VNĐ và bản địa hóa song ngữ Việt - Anh. |
|
|
493
|
+
|
|
494
|
+

|
|
495
|
+
|
|
496
|
+
## Bắt đầu nhanh
|
|
497
|
+
|
|
498
|
+
### 1. Ứng dụng React (ESM) — Biểu đồ đơn lẻ
|
|
499
|
+
|
|
500
|
+
Cài đặt gói thư viện qua npm hoặc yarn:
|
|
501
|
+
|
|
502
|
+
```bash
|
|
503
|
+
npm install @vninvestcharts/widget
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
> **Nâng cấp từ `vninvestcharts-widget` 1.x?** Package đã chuyển sang scope
|
|
507
|
+
> `@vninvestcharts/` và đổi giấy phép từ MPL-2.0 sang Apache-2.0. Đọc
|
|
508
|
+
> **[hướng dẫn migration 0.2.0](./docs/MIGRATION_0_2_0.md)** trước khi nâng cấp —
|
|
509
|
+
> import specifier thay đổi, và `debugFeatures` nay bị bỏ qua ngoài
|
|
510
|
+
> `NODE_ENV=development`.
|
|
511
|
+
|
|
512
|
+
Khởi tạo biểu đồ tương tác độc lập trong ứng dụng React:
|
|
513
|
+
|
|
514
|
+
```tsx
|
|
515
|
+
import React from 'react';
|
|
516
|
+
import { VNInvestCharts } from '@vninvestcharts/widget';
|
|
517
|
+
import '@vninvestcharts/widget/dist/index.css';
|
|
518
|
+
|
|
519
|
+
export function StockView() {
|
|
520
|
+
return (
|
|
521
|
+
<div style={{ width: '100%', height: '650px' }}>
|
|
522
|
+
<VNInvestCharts
|
|
523
|
+
symbol="VCB"
|
|
524
|
+
timeframe="1D"
|
|
525
|
+
theme="dark"
|
|
526
|
+
locale="vi"
|
|
527
|
+
drawingUiEnabled={true}
|
|
528
|
+
showHeader={true}
|
|
529
|
+
showToolbar={true}
|
|
530
|
+
showFooter={true}
|
|
531
|
+
onSymbolChange={(s) => console.log('Mã đã chọn:', s)}
|
|
532
|
+
onTimeframeChange={(tf) => console.log('Khung thời gian:', tf)}
|
|
533
|
+
/>
|
|
534
|
+
</div>
|
|
535
|
+
);
|
|
536
|
+
}
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
---
|
|
540
|
+
|
|
541
|
+
### 2. Ứng dụng React (ESM) — Không gian làm việc đa biểu đồ đồng bộ
|
|
542
|
+
|
|
543
|
+
Tạo không gian làm việc đa biểu đồ với cơ chế đồng bộ hóa đẳng cấp phần mềm thương mại:
|
|
544
|
+
|
|
545
|
+
```tsx
|
|
546
|
+
import React from 'react';
|
|
547
|
+
import { VNInvestMultiCharts } from '@vninvestcharts/widget';
|
|
548
|
+
import '@vninvestcharts/widget/dist/index.css';
|
|
549
|
+
|
|
550
|
+
export function ProTradingWorkspace() {
|
|
551
|
+
return (
|
|
552
|
+
<div style={{ width: '100vw', height: '100vh' }}>
|
|
553
|
+
<VNInvestMultiCharts
|
|
554
|
+
layout={{ rows: 2, cols: 2 }}
|
|
555
|
+
charts={[{ id: "chart-1", symbol: "FPT", timeframe: "1D" }]}
|
|
556
|
+
syncVisibleRange={true}
|
|
557
|
+
syncCrosshair={true}
|
|
558
|
+
syncSymbolLinks={false}
|
|
559
|
+
syncTimeframe={false}
|
|
560
|
+
syncDrawings={true}
|
|
561
|
+
defaultChartProps={{
|
|
562
|
+
theme: "dark",
|
|
563
|
+
locale: "vi",
|
|
564
|
+
}}
|
|
565
|
+
/>
|
|
566
|
+
</div>
|
|
567
|
+
);
|
|
568
|
+
}
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
---
|
|
572
|
+
|
|
573
|
+
### 3. Thẻ Script (IIFE) — Mọi Website, CMS hoặc Trang tĩnh
|
|
574
|
+
|
|
575
|
+
Nhúng trực tiếp vào website HTML thuần, WordPress, Webflow, Laravel hoặc PHP mà không cần bước build phức tạp hay cài đặt React:
|
|
576
|
+
|
|
577
|
+
```html
|
|
578
|
+
<!-- Nhúng tệp kiểu dáng và mã nguồn đóng gói -->
|
|
579
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@vninvestcharts/widget/dist/index.css" />
|
|
580
|
+
<script src="https://cdn.jsdelivr.net/npm/@vninvestcharts/widget/dist/vninvestchart.iife.js"></script>
|
|
581
|
+
|
|
582
|
+
<div id="chart-root" style="width: 100%; height: 600px;"></div>
|
|
583
|
+
|
|
584
|
+
<script>
|
|
585
|
+
const { unmount, widgetRef } = window.VNInvestCharts.mount({
|
|
586
|
+
container: document.getElementById('chart-root'),
|
|
587
|
+
props: {
|
|
588
|
+
layout: { rows: 1, cols: 1 },
|
|
589
|
+
defaultChartProps: {
|
|
590
|
+
symbol: 'HPG',
|
|
591
|
+
timeframe: '1D',
|
|
592
|
+
theme: 'dark',
|
|
593
|
+
locale: 'vi',
|
|
594
|
+
drawingUiEnabled: true,
|
|
595
|
+
},
|
|
596
|
+
},
|
|
597
|
+
useShadowDOM: true, // Kích hoạt Shadow DOM cô lập hoàn toàn CSS với trang mẹ
|
|
598
|
+
});
|
|
599
|
+
|
|
600
|
+
// Điều khiển lập trình sau khi khởi tạo. IIFE mount workspace MULTI chart nên
|
|
601
|
+
// các method single-chart nhắm vào chart ACTIVE. Đổi symbol/timeframe chỉ lan
|
|
602
|
+
// sang chart liên kết khi bật syncSymbolLinks / syncTimeframe.
|
|
603
|
+
// widgetRef.current?.setActiveSymbol('SSI');
|
|
604
|
+
// widgetRef.current?.setActiveTimeframe('1H');
|
|
605
|
+
// widgetRef.current?.exportActiveDrawings();
|
|
606
|
+
</script>
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
---
|
|
610
|
+
|
|
611
|
+
### 4. Iframe Cách ly Sandbox với Host SDK — Môi trường bảo mật cao
|
|
612
|
+
|
|
613
|
+
Nhúng vào các cổng thông tin đối tác, ứng dụng ngân hàng hoặc môi trường tuân thủ chính sách CSP nghiêm ngặt:
|
|
614
|
+
|
|
615
|
+
```html
|
|
616
|
+
<iframe
|
|
617
|
+
id="chart-frame"
|
|
618
|
+
src="https://your-cdn.com/iframe/vninvestchart.iframe.html"
|
|
619
|
+
style="width: 100%; height: 650px; border: none;"
|
|
620
|
+
></iframe>
|
|
621
|
+
|
|
622
|
+
<script type="module">
|
|
623
|
+
import { createVNInvestChartsHost } from '@vninvestcharts/widget/iframe-host';
|
|
624
|
+
|
|
625
|
+
const host = await createVNInvestChartsHost({
|
|
626
|
+
iframe: document.getElementById('chart-frame'),
|
|
627
|
+
});
|
|
628
|
+
|
|
629
|
+
const controller = host.getController();
|
|
630
|
+
await controller.initialize({ symbol: 'VNM', timeframe: '1D', theme: 'dark' });
|
|
631
|
+
|
|
632
|
+
// Lắng nghe sự kiện RPC hai chiều
|
|
633
|
+
controller.on('event:symbolChanged', (payload) => console.log('Biểu đồ đã đổi mã sang:', payload.symbol));
|
|
634
|
+
</script>
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
---
|
|
638
|
+
|
|
639
|
+
## Kiến trúc hệ thống chuyên sâu
|
|
640
|
+
|
|
641
|
+
### Luồng tích hợp dữ liệu cắm rút (`StockDataAdapter`)
|
|
642
|
+
|
|
643
|
+
Động cơ biểu đồ được tách rời hoàn toàn khỏi backend. Mọi thanh nến lịch sử, dữ liệu khớp lệnh real-time qua WebSocket và siêu dữ liệu cổ phiếu đều đi qua interface `StockDataAdapter`:
|
|
644
|
+
|
|
645
|
+
```
|
|
646
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
647
|
+
│ Ứng dụng Web / Cổng thông tin │
|
|
648
|
+
│ ┌───────────────────────────────────────────────────────┐ │
|
|
649
|
+
│ │ Tầng hiển thị VNInvestCharts │ │
|
|
650
|
+
│ │ ┌──────────────┐ ┌───────────────┐ ┌────────────┐ │ │
|
|
651
|
+
│ │ │ React (ESM) │ │ IIFE Wrapper │ │ Iframe SDK │ │ │
|
|
652
|
+
│ │ └──────┬───────┘ └───────┬───────┘ └─────┬──────┘ │ │
|
|
653
|
+
│ │ │ │ │ │ │
|
|
654
|
+
│ │ └──────────┬───────┴────────────────┘ │ │
|
|
655
|
+
│ │ │ │ │
|
|
656
|
+
│ │ ┌──────────────▼─────────────┐ │ │
|
|
657
|
+
│ │ │ Typed StockDataAdapter │ ← Cầu nối cắm rút │ │
|
|
658
|
+
│ │ └──────────────┬─────────────┘ │ │
|
|
659
|
+
│ └────────────────────┼──────────────────────────────────┘ │
|
|
660
|
+
└───────────────────────┼─────────────────────────────────────┘
|
|
661
|
+
│ HTTP REST / WebSocket / gRPC
|
|
662
|
+
┌───────────────────────▼─────────────────────────────────────┐
|
|
663
|
+
│ Backend API của bạn (Node / Python / Go / Java) │
|
|
664
|
+
└─────────────────────────────────────────────────────────────┘
|
|
665
|
+
```
|
|
666
|
+
|
|
667
|
+
#### Ví dụ thiết lập Adapter tùy biến
|
|
668
|
+
|
|
669
|
+
```typescript
|
|
670
|
+
import type {
|
|
671
|
+
StockDataAdapter, OHLCVBar, Unsubscribe, SymbolInfo,
|
|
672
|
+
} from '@vninvestcharts/widget';
|
|
673
|
+
|
|
674
|
+
export const customFintechAdapter: StockDataAdapter = {
|
|
675
|
+
// 1. required - the initial/backfill window
|
|
676
|
+
fetchBarsInRange: async (symbol, timeframe, from, to): Promise<OHLCVBar[]> => {
|
|
677
|
+
const res = await fetch(
|
|
678
|
+
`/api/range?symbol=${symbol}&tf=${timeframe}&from=${from.getTime()}&to=${to.getTime()}`,
|
|
679
|
+
);
|
|
680
|
+
return res.json();
|
|
681
|
+
},
|
|
682
|
+
|
|
683
|
+
// 2. required - paginating backwards past the initial window
|
|
684
|
+
fetchBarsBefore: async (symbol, timeframe, before, limit): Promise<OHLCVBar[]> => {
|
|
685
|
+
const res = await fetch(
|
|
686
|
+
`/api/history?symbol=${symbol}&tf=${timeframe}&to=${before.getTime()}&limit=${limit}`,
|
|
687
|
+
);
|
|
688
|
+
return res.json();
|
|
689
|
+
},
|
|
690
|
+
|
|
691
|
+
// 3. required - live bar updates
|
|
692
|
+
subscribeToBar: (symbol, timeframe, onBar): Unsubscribe => {
|
|
693
|
+
const ws = new WebSocket(`wss://api.yourbroker.com/bar?symbol=${symbol}&tf=${timeframe}`);
|
|
694
|
+
ws.onmessage = (e) => onBar(JSON.parse(e.data));
|
|
695
|
+
return () => ws.close();
|
|
696
|
+
},
|
|
697
|
+
|
|
698
|
+
// 4. required
|
|
699
|
+
subscribeToTrades: (symbol, onTrade): Unsubscribe => {
|
|
700
|
+
const ws = new WebSocket(`wss://api.yourbroker.com/trades?symbol=${symbol}`);
|
|
701
|
+
ws.onmessage = (e) => onTrade(JSON.parse(e.data));
|
|
702
|
+
return () => ws.close();
|
|
703
|
+
},
|
|
704
|
+
|
|
705
|
+
// 5. required
|
|
706
|
+
subscribeToOrderbook: (symbol, onUpdate): Unsubscribe => {
|
|
707
|
+
const ws = new WebSocket(`wss://api.yourbroker.com/depth?symbol=${symbol}`);
|
|
708
|
+
ws.onmessage = (e) => onUpdate(JSON.parse(e.data));
|
|
709
|
+
return () => ws.close();
|
|
710
|
+
},
|
|
711
|
+
|
|
712
|
+
// 6. required
|
|
713
|
+
searchSymbols: async (query): Promise<SymbolInfo[]> => {
|
|
714
|
+
const res = await fetch(`/api/search?q=${encodeURIComponent(query)}`);
|
|
715
|
+
return res.json();
|
|
716
|
+
},
|
|
717
|
+
};
|
|
718
|
+
```
|
|
719
|
+
|
|
720
|
+
Interface `StockDataAdapter` có **6 thành phần bắt buộc**. Bản ví dụ trước chỉ liệt kê 3 và dùng một method `subscribeRealtime` **không tồn tại** trong repo, nên không thể biên dịch. Năm thành phần còn lại là **tuỳ chọn**: `getSourceSemantics`, `fetchCorporateEvents`, `getLastBackfillCoverage`, `getLastRangeCoverage`, `fetchCoverageBulk`.
|
|
721
|
+
|
|
722
|
+
---
|
|
723
|
+
|
|
724
|
+
### Cơ chế đồng bộ đa biểu đồ đẳng cấp phần mềm thương mại quốc tế
|
|
725
|
+
|
|
726
|
+
Bộ điều phối `VNInvestMultiCharts` quản lý tập trung trạng thái các biểu đồ con trong cùng không gian làm việc:
|
|
727
|
+
|
|
728
|
+
1. **Đồng bộ vùng hiển thị (Visible Range Sync)**: Cuộn và thu phóng mượt mà giữa các biểu đồ con với cửa sổ điều tiết tính theo mili-giây, ngăn chặn vòng lặp phản hồi (echo loop) và nén nội dung trùng lặp.
|
|
729
|
+
2. **Đồng bộ con trỏ Crosshair**: Tọa độ chuột và nhãn chiếu trục thời gian - mức giá được phản chiếu tức thì trên mọi khung nhìn.
|
|
730
|
+
3. **Liên kết mã cổ phiếu & Khung thời gian**: Gom nhóm biểu đồ linh hoạt để thực hiện phân tích đa khung thời gian (Multi-Timeframe Analysis) trên cùng một mã hoặc so sánh nhiều mã trên cùng một khung giờ.
|
|
731
|
+
4. **Đồng bộ hóa bản vẽ không xung đột (CRDT)**: Các đối tượng vẽ kỹ thuật được đồng bộ hóa xuyên biểu đồ và xuyên tab trình duyệt theo thuật toán CRDT với cơ chế đánh dấu xóa tombstone và phân vùng dữ liệu theo mã cổ phiếu.
|
|
732
|
+
5. **Đồng bộ trạng thái Bar Replay**: Điều khiển tua nến lịch sử đồng thời trên toàn bộ các khung thời gian liên kết.
|
|
733
|
+
|
|
734
|
+
---
|
|
735
|
+
|
|
736
|
+
### Mô hình dữ liệu SSOT tính toán chỉ báo một lượt
|
|
737
|
+
|
|
738
|
+
- **Tính toán tối ưu một lượt**: Mọi chỉ báo kỹ thuật (RSI, MACD, Bollinger Bands, Ichimoku, Volume Profile) đều được nhân xử lý `@vninvestcharts/engine-core` tính toán theo độ phức tạp $O(N)$ trong 1 chu kỳ duy nhất.
|
|
739
|
+
- **Phản chiếu giao diện linh hoạt**: Các đồ thị phụ, dải màu và công cụ đo lường tái sử dụng trực tiếp bộ nhớ đệm kết quả mà không phải tính lại.
|
|
740
|
+
- **Tách tầng twin-repo**: Lõi dựng hình WebGL/Canvas được đóng gói tách bạch trong `vn-kline-engine-core`, đảm bảo tầng widget nhẹ và dễ dàng phân phối.
|
|
741
|
+
|
|
742
|
+
---
|
|
743
|
+
|
|
744
|
+
### Bảng so sánh 3 chế độ nhúng
|
|
745
|
+
|
|
746
|
+
| Chế độ phân phối | Tệp đầu ra | Cơ chế cô lập CSS | Yêu cầu React | Trường hợp ứng dụng tối ưu |
|
|
747
|
+
|---|---|---|---|---|
|
|
748
|
+
| **ESM Module** | `dist/index.js` | Import trực tiếp / CSS Modules | Có (v18 / v19) | Ứng dụng SPA hiện đại, Next.js, Vite |
|
|
749
|
+
| **IIFE Bundle** | `dist/vninvestchart.iife.js` | Tự động qua Shadow DOM | **Không** (Thuần JS) | WordPress, Shopify, Laravel, HTML |
|
|
750
|
+
| **Sandboxed Iframe** | `dist/iframe/index.html` | Iframe sandbox + Host SDK postMessage | **Không** | Cổng tài chính bên thứ 3, Ngân hàng, CSP khắt khe |
|
|
751
|
+
|
|
752
|
+
> Để xem hướng dẫn tích hợp chi tiết và tài liệu thuộc tính props, vui lòng đọc [`docs/WIDGET_EMBED_GUIDE.md`](./docs/WIDGET_EMBED_GUIDE.md).
|
|
753
|
+
|
|
754
|
+
---
|
|
755
|
+
|
|
756
|
+
## Bảng ma trận tính năng kỹ thuật
|
|
757
|
+
|
|
758
|
+
| Danh mục | Tính năng & Thông số kỹ thuật |
|
|
759
|
+
|---|---|
|
|
760
|
+
| **Kiểu biểu đồ** | Nến Nhật tiêu chuẩn, Nến rỗng (Hollow Candles), Nến thanh OHLC, Heikin-Ashi, Biểu đồ vùng (Area / Baseline), Renko, Kagi, Point & Figure. |
|
|
761
|
+
| **Công cụ vẽ (76 công cụ)** | **14 Nhóm chuyên biệt**: Đường xu hướng (Trend Lines), Fibonacci (Thoái lui, Mở rộng, Xoắn ốc, Quạt), Hình học kỹ thuật, Kênh giá, Mô hình Gann, Pitchfork, Mô hình Harmonic (Gartley, Bat, Butterfly, Crab), Sóng Elliott, Chu kỳ thời gian, Đo lường & Dự đoán giá. |
|
|
762
|
+
| **Chỉ báo kỹ thuật (59)** | Đường trung bình (SMA, EMA, WMA, DEMA, TEMA), Chỉ báo dao động (RSI, Stochastic, CCI, Williams %R), Chỉ báo xu hướng (MACD, SuperTrend, Parabolic SAR, ADX), Dải biến động (Bollinger Bands, ATR, Keltner), Chỉ báo khối lượng (VWAP, Anchored VWAP, Volume Profile, CVD, OBV), Mây Ichimoku Kinko Hyo. |
|
|
763
|
+
| **Lưới đa biểu đồ động** | Bố cục lưới linh hoạt (1×1, 1×2, 2×1, 2×2, 1×3, 3×1, 6 biểu đồ) kèm thanh trượt chia khung hình (splitter) kéo thả mượt mà và thanh công cụ độc lập từng ô. |
|
|
764
|
+
| **Vòng đời đối tượng vẽ** | Tương tác trực tiếp trên canvas, thanh công cụ ngữ cảnh nổi, bảng thuộc tính Inspector chi tiết, xuất/nhập tệp JSON, lưu trữ trình duyệt và đồng bộ CRDT xuyên tab. |
|
|
765
|
+
| **Mô phỏng & Kiểm thử** | Bar Replay tua lại dữ liệu lịch sử từng nến (tùy chỉnh tốc độ, bước tới/lùi), giao diện Paper Trading khớp lệnh giả lập (Market, Limit, Stop, theo dõi vị thế và PnL). |
|
|
766
|
+
| **Giao diện & Ngôn ngữ** | Chủ đề Sáng / Tối với các biến CSS linh hoạt, bản địa hóa trọn vẹn tiếng Việt và tiếng Anh (`vi` / `en`). |
|
|
767
|
+
| **Đặc thù thị trường VN** | Tích hợp quy tắc bước giá phái sinh VN30, dải đường giới hạn giá Trần/Sàn/Tham chiếu, mốc chu kỳ thanh toán T+2 và tự động hiển thị phiên giao dịch. |
|
|
768
|
+
|
|
769
|
+

|
|
770
|
+
|
|
771
|
+
---
|
|
772
|
+
|
|
773
|
+
## Tài liệu API & Components độc lập
|
|
774
|
+
|
|
775
|
+
### Danh mục Component độc lập xuất xưởng
|
|
776
|
+
|
|
777
|
+
Để phục vụ tích hợp dạng module hóa, `@vninvestcharts/widget` xuất xưởng sẵn các component độc lập có thể sử dụng riêng biệt hoặc tùy biến layout:
|
|
778
|
+
|
|
779
|
+
```typescript
|
|
780
|
+
import {
|
|
781
|
+
VNInvestCharts, // Widget biểu đồ đơn lẻ hoàn chỉnh
|
|
782
|
+
VNInvestMultiCharts, // Không gian làm việc đa biểu đồ đồng bộ đẳng cấp quốc tế
|
|
783
|
+
DrawingDock, // Thanh dock chứa 76 công cụ vẽ độc lập
|
|
784
|
+
DrawingInspector, // Bảng điều khiển thuộc tính công cụ vẽ đang chọn
|
|
785
|
+
DrawingListPanel, // Cây quản lý các lớp đối tượng vẽ
|
|
786
|
+
PaperTradePanel, // Sổ lệnh và bảng theo dõi danh mục Paper Trading
|
|
787
|
+
SettingsModal, // Hộp thoại tùy chỉnh cấu hình và kiểu dáng biểu đồ
|
|
788
|
+
MeasurementOverlay, // Lớp đo lường khoảng cách thời gian và bước giá
|
|
789
|
+
WidgetErrorBoundary, // Khung bắt lỗi an toàn cấp doanh nghiệp
|
|
790
|
+
WidgetEmptyState, // Trạng thái chờ tải dữ liệu thanh lịch
|
|
791
|
+
} from "@vninvestcharts/widget";
|
|
792
|
+
```
|
|
793
|
+
|
|
794
|
+
### Đường dẫn phụ (Subpaths)
|
|
795
|
+
|
|
796
|
+
```typescript
|
|
797
|
+
// Các bộ chuyển đổi dữ liệu chuyên sâu
|
|
798
|
+
import { VNInvestDataAdapter, MultiSourceDataAdapter } from "@vninvestcharts/widget/adapters";
|
|
799
|
+
|
|
800
|
+
// Bộ điều phối lưu trữ đối tượng vẽ
|
|
801
|
+
import { createLocalStorageAdapter, type DrawingWorkspaceController } from "@vninvestcharts/widget/drawing";
|
|
802
|
+
|
|
803
|
+
// Định nghĩa giao diện TypeScript dùng chung
|
|
804
|
+
import type { StockDataAdapter, Timeframe, OHLCVBar } from "@vninvestcharts/widget/types";
|
|
805
|
+
```
|
|
806
|
+
|
|
807
|
+
---
|
|
808
|
+
|
|
809
|
+
## Phát triển và kiểm thử nội bộ
|
|
810
|
+
|
|
811
|
+
```bash
|
|
812
|
+
# Tải mã nguồn và cài đặt dependencies
|
|
813
|
+
git clone https://github.com/vietdungiitb/vninvestcharts-widget.git
|
|
814
|
+
cd vninvestcharts-widget
|
|
815
|
+
npm install
|
|
816
|
+
|
|
817
|
+
# Khởi chạy máy chủ phát triển demo (chạy tại cổng 3000)
|
|
818
|
+
npm run watch # http://localhost:3000
|
|
819
|
+
|
|
820
|
+
# Kiểm tra kiểu dữ liệu TypeScript nghiêm ngặt
|
|
821
|
+
npm run type-check
|
|
822
|
+
|
|
823
|
+
# Chạy toàn bộ bộ test kiểm thử (2350+ unit và integration tests)
|
|
824
|
+
npm test
|
|
825
|
+
|
|
826
|
+
# Đóng gói xuất xưởng (ESM, CJS, IIFE, Iframe)
|
|
827
|
+
npm run build
|
|
828
|
+
```
|
|
829
|
+
|
|
830
|
+
---
|
|
831
|
+
|
|
832
|
+
## Hệ sinh thái gói phần mềm
|
|
833
|
+
|
|
834
|
+
| Tên gói | Vai trò & Trách nhiệm kiến trúc |
|
|
835
|
+
|---|---|
|
|
836
|
+
| `@vninvestcharts/widget` | Thư viện widget cấp cao có thể nhúng, workspace đa biểu đồ, giao diện công cụ vẽ và các lớp đóng gói phân phối. |
|
|
837
|
+
| `@vninvestcharts/engine-core` | Động cơ kết xuất WebGL/Canvas tầng thấp, bộ vi tính toán chỉ báo kỹ thuật SSOT và quản lý camera. |
|
|
838
|
+
| `@vninvestcharts/engine-react` | Các hook và bindings liên kết tầng React với động cơ kết xuất đồ họa lõi. |
|
|
839
|
+
|
|
840
|
+
---
|
|
841
|
+
|
|
842
|
+
## Giấy phép & Bản quyền sở hữu
|
|
843
|
+
|
|
844
|
+
Phát hành theo **Apache License 2.0**.
|
|
845
|
+
Bản quyền © 2026 Phạm Việt Dũng.
|
|
846
|
+
Xem [LICENSE](./LICENSE) để biết điều khoản đầy đủ và [NOTICE.md](./NOTICE.md) cho các
|
|
847
|
+
tác phẩm bên thứ ba được đóng gói.
|
|
848
|
+
|
|
849
|
+
Widget đóng gói `@vninvestcharts/engine-core`, `-engine-drawing` và `-engine-react`
|
|
850
|
+
(tất cả Apache-2.0), vốn chứa một bản fork được kiểm soát của KLineCharts (Apache-2.0).
|
|
851
|
+
|