refactor: add ignored images and update chart.js for drawing

This commit is contained in:
DiTus
2026-03-21 17:38:47 +01:00
parent 78363fa269
commit 901a25d727
3 changed files with 12 additions and 2 deletions

BIN
ignore/measurment_down.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
ignore/measurment_up.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@ -283,7 +283,11 @@ export class TradingDashboard {
const data = this.candleSeries.data(); const data = this.candleSeries.data();
if (!data || data.length === 0) return true; if (!data || data.length === 0) return true;
return visibleRange.to >= data.length - 5; // Only snap to edge if we are actually at the edge or slightly panned into the past,
// but NOT if we are panned into the future (whitespace).
// visibleRange.to > data.length means we are in the future whitespace.
const isNearEdge = visibleRange.to >= data.length - 2 && visibleRange.to <= data.length + 5;
return isNearEdge;
} }
createTimeframeButtons() { createTimeframeButtons() {
@ -786,7 +790,13 @@ async loadNewData() {
//console.log(`[NewData Load] Added ${chartData.length} new candles, total in dataset: ${this.allData.get(this.currentInterval).length}`); //console.log(`[NewData Load] Added ${chartData.length} new candles, total in dataset: ${this.allData.get(this.currentInterval).length}`);
if (atEdge) { if (atEdge) {
this.chart.timeScale().scrollToRealTime(); // Only auto-scroll if NOT drawing or editing
const dm = this.drawingManager;
const isInteracting = dm && (dm.activeTool !== null || dm.currentDrawing !== null || (dm.selectedDrawing !== null && dm.isMouseDown));
if (!isInteracting) {
this.chart.timeScale().scrollToRealTime();
}
} }
this.updateStats(latest); this.updateStats(latest);