This commit is contained in:
Macbook
2026-06-09 22:46:15 +09:00
parent 47e287c0f6
commit 222c6ecca8
2 changed files with 12 additions and 52 deletions
+10 -6
View File
@@ -753,7 +753,7 @@ export class ChartManager {
config: IndicatorConfig,
def: ReturnType<typeof getIndicatorDef> | undefined,
): string[] {
const plotDefs = config.plots ?? def?.plots ?? [];
const plotDefs = def?.plots ?? config.plots ?? [];
return plotDefs
.filter(p => p.type !== 'histogram' && config.plotVisibility?.[p.id] !== false)
.map(p => p.id);
@@ -783,8 +783,11 @@ export class ChartManager {
indicatorHidden: boolean,
def: ReturnType<typeof getIndicatorDef>,
): void {
const plotDefs = sortDualLinePlotDefs(config.plots ?? def?.plots ?? [])
.filter(p => p.type !== 'histogram' && config.plotVisibility?.[p.id] !== false);
const regPlots = def?.plots ?? [];
const styleById = Object.fromEntries((config.plots ?? regPlots).map(p => [p.id, p]));
const plotDefs = sortDualLinePlotDefs(regPlots)
.filter(p => p.type !== 'histogram' && config.plotVisibility?.[p.id] !== false)
.map(p => ({ ...p, ...styleById[p.id], id: p.id, title: p.title }));
const indicatorPriceFormat = priceFormatForIndicatorPane(pane);
for (const plotDef of plotDefs) {
@@ -1092,7 +1095,7 @@ export class ChartManager {
this._setIndicatorPlotsFullData(entry, result.plots as Record<string, PlotData>, config);
}
}
this.applyIndicatorStyle(config);
this.applyIndicatorStyle(config, { skipDualLineRefresh: true });
if (config.type === 'BollingerBands' && !indicatorHidden) {
attachBbBandFill(entry, config, this._shouldShowBbBandFillForConfig(config));
entry.bbFillPrimitive?.requestRefresh();
@@ -1165,7 +1168,7 @@ export class ChartManager {
this._setIndicatorPlotsFullData(entry, result.plots as Record<string, PlotData>, config);
} catch { /* ok */ }
}
this.applyIndicatorStyle(config);
this.applyIndicatorStyle(config, { skipDualLineRefresh: true });
}
}
@@ -1282,7 +1285,8 @@ export class ChartManager {
async refreshIndicators(configs: IndicatorConfig[]): Promise<void> {
if (configs.length === 0) return;
this.cancelPendingIndicatorUpdates();
const loadGen = ++this._dataGeneration;
/** setData 와 달리 generation 을 올리지 않음 — 배치 add 중 다른 지표 로드를 끊지 않음 */
const loadGen = this._dataGeneration;
let any = false;
for (const c of configs) {