일목균형표 구름 미표시 수정: 구름 호스트 시리즈 visible 보장

LWC는 visible:false 인 시리즈에 붙은 ISeriesPrimitive를 렌더링하지 않음.
서버 DB에 plotVisibility.plot3=false 가 저장된 경우,
SpanA(plot3) 시리즈가 visible:false 로 설정되어 구름 플러그인도 사라지는 버그.

수정:
- applyIndicatorStyle에서 구름 플러그인 호스트 시리즈(plot3 우선)를
  지표 전체 hidden일 때만 실제로 visible:false 처리
- 사용자가 라인을 숨길 경우 visible:true 유지 + color를 'rgba(0,0,0,0)'으로
  투명 처리하여 라인은 보이지 않지만 primitive 렌더링은 유지

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Macbook
2026-06-02 11:11:28 +09:00
parent 5d96417c42
commit 9ee429bebd
+20 -4
View File
@@ -2437,6 +2437,16 @@ export class ChartManager {
const plotById = Object.fromEntries(plotDefs.map((p: PlotDef) => [p.id, p]));
// 일목균형표: 구름 플러그인이 붙은 호스트 시리즈(plot3 우선, 없으면 seriesList[0]) 식별
// LWC는 visible:false 시리즈에 붙은 primitive를 렌더링하지 않으므로
// 호스트 시리즈는 항상 visible:true 로 유지하고, 사용자가 라인을 숨길 경우
// 투명 색상으로 처리한다.
const ichimokuCloudHost: ISeriesApi<SeriesType> | null = (() => {
if (entry.type !== 'IchimokuCloud' || !entry.cloudPlugin) return null;
const plot3Idx = entry.seriesMeta.findIndex(m => m.plotId === 'plot3');
return plot3Idx >= 0 ? entry.seriesList[plot3Idx] : (entry.seriesList[0] ?? null);
})();
entry.seriesList.forEach((series, i) => {
let plot: PlotDef | undefined;
const pid = entry.seriesMeta[i]?.plotId;
@@ -2446,13 +2456,19 @@ export class ChartManager {
const visible = indicatorVisible && config.plotVisibility?.[plot.id] !== false;
const paneIdx = entry.paneIndex ?? 0;
const indicatorPriceFormat = priceFormatForIndicatorPane(paneIdx);
const isCloudHost = series === ichimokuCloudHost;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const opts: Record<string, unknown> = { visible };
const opts: Record<string, unknown> = {
// 구름 호스트 시리즈: 지표 전체가 hidden 일 때만 실제로 visible:false
visible: isCloudHost ? indicatorVisible : visible,
};
if (indicatorPriceFormat) {
opts['priceFormat'] = indicatorPriceFormat;
}
if (!entry.seriesMeta[i]?.isHistogram) {
opts['color'] = plot.color ?? '#aaa';
// 구름 호스트 시리즈가 사용자에 의해 숨겨진 경우 → 라인을 투명 처리
opts['color'] = (isCloudHost && !visible) ? 'rgba(0,0,0,0)' : (plot.color ?? '#aaa');
if (plot.lineWidth != null) opts['lineWidth'] = plot.lineWidth;
opts['lineStyle'] = plotSeriesLineStyle(plot.lineStyle);
let plotAllows = true;
@@ -2460,8 +2476,8 @@ export class ChartManager {
plotAllows = entry.seriesMeta[i]?.plotId !== 'plot2';
}
const showPriceLabel = this.shouldShowSeriesPriceLabel(config, plotAllows, paneIdx);
opts['lastValueVisible'] = showPriceLabel;
opts['title'] = paneIdx < 2 && showPriceLabel
opts['lastValueVisible'] = showPriceLabel && visible;
opts['title'] = paneIdx < 2 && showPriceLabel && visible
? this.seriesTitleForPlot(config, plot, plotAllows, paneIdx)
: '';
} else {