feat(analysis): add TradingView-style price scale interaction to the … - #11
Open
Impulssi wants to merge 1 commit into
Open
feat(analysis): add TradingView-style price scale interaction to the …#11Impulssi wants to merge 1 commit into
Impulssi wants to merge 1 commit into
Conversation
…chart exporter The exported HTML chart locked the price (y) scale to auto-fit, which made zoomed-in inspection awkward: axis ticks were sparse, prices used an uneven precision format, and the last price was not visible on the axis. The chart also clipped panning to the data edges, so there was no empty grid space around the series like TradingView shows. ## Price scale interaction - Wheel or drag on the price axis zooms/shrinks the visible price band (manual scale); double-click on the axis restores auto-fit. - Vertical drag inside the chart pans the price scale and activates the manual mode, mirroring the existing horizontal time pan. - Manual range is clamped to sensible bounds derived from the data (floor ~35% below data min, ceil ~1.6x data max, max span ~1.6x the data price range) so the scale cannot collapse to a sliver or run away. - The manual scale resets on chart rebuild, price-scale toggle and pair orientation flip, where the unit changes and the old range is invalid. ## Axis and price marker - Price axis moved to the right side and tick spacing tightened so more price levels appear at every zoom level. - Adaptive decimal formatting on axis values based on the tick step. - TradingView-style last-price marker: colored label pinned to the price axis plus a dashed crosshair line through the chart, log-scale aware. ## Time axis breathing room - Wheel zoom-out now allows up to ~2.5x the data span and clampRange permits up to ~75% of the data span as empty padding on each side, so zooming out reveals the grid around the series instead of hard-clamping to the candles. ## Testing Notes - npm run typecheck clean; full suite run on Windows shows the same pre-existing environment failures with and without this change. - Chart verified manually with 6-month and full-history (2021->2026) BTS/XBTSX.USDT LP datasets.
Impulssi
force-pushed
the
feat/tradingview-chart-interactions
branch
from
August 26, 2026 06:01
8e731d7 to
7c10107
Compare
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.
…chart exporter
The exported HTML chart locked the price (y) scale to auto-fit, which made zoomed-in inspection awkward: axis ticks were sparse, prices used an uneven precision format, and the last price was not visible on the axis. The chart also clipped panning to the data edges, so there was no empty grid space around the series like TradingView shows.
Price scale interaction
Axis and price marker
Time axis breathing room
Testing Notes
Note: I'm new to this codebase and worked through this change with an AI
coding assistant (opencode). The bug was hit on my own live instance and
all measurements / reproduction steps are mine — but please flag anything
in the code that looks off and I'll dig in and follow up.