refactor: add ignored images and update chart.js for drawing
This commit is contained in:
@ -283,7 +283,11 @@ export class TradingDashboard {
|
||||
const data = this.candleSeries.data();
|
||||
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() {
|
||||
@ -786,7 +790,13 @@ async loadNewData() {
|
||||
//console.log(`[NewData Load] Added ${chartData.length} new candles, total in dataset: ${this.allData.get(this.currentInterval).length}`);
|
||||
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user