From b7b6562083830b5ef6649c507c1d163a6a370803 Mon Sep 17 00:00:00 2001 From: Yuri Yaryshev Date: Sat, 17 Oct 2026 17:44:38 +0300 Subject: [PATCH] =?UTF-8?q?=D0=93=D0=B0=D0=BD=D1=82:=20=D0=BB=D0=B8=D0=BD?= =?UTF-8?q?=D0=B8=D0=B8=20=D0=BE=D1=82=20=D0=BA=D0=BE=D0=BD=D1=82=D1=83?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D1=85=20=D0=B2=D0=B5=D1=85=20-=20=D1=82?= =?UTF-8?q?=D1=91=D0=BC=D0=BD=D0=BE-=D1=81=D0=B5=D1=80=D1=8B=D0=B5,=20?= =?UTF-8?q?=D0=BF=D0=BE=D1=87=D1=82=D0=B8=20=D1=84=D0=BE=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D1=8B=D0=B9=20=D1=81=D0=BB=D0=BE=D0=B9=20=D0=BF=D0=BE=D0=B4=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=B4=D0=BF=D0=B8=D1=81=D1=8F=D0=BC=D0=B8,=20?= =?UTF-8?q?=D1=81=D1=82=D1=80=D0=B5=D0=BB=D0=BA=D0=B0=20=D0=BD=D0=B0=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=86=D0=B5;=20=D0=BF=D1=80=D0=B8=20=D0=BD?= =?UTF-8?q?=D0=B5=D1=81=D0=BA=D0=BE=D0=BB=D1=8C=D0=BA=D0=B8=D1=85=20=D0=B2?= =?UTF-8?q?=D0=B5=D1=85=D0=B0=D1=85=20=D0=BD=D0=B0=20=D1=81=D1=82=D1=80?= =?UTF-8?q?=D0=BE=D0=BA=D0=B5=20=D0=BF=D0=BE=D0=B4=D0=BF=D0=B8=D1=81=D1=8C?= =?UTF-8?q?=20-=20=D1=82=D0=BE=D0=BB=D1=8C=D0=BA=D0=BE=20id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- packages/khbuild_process_viz/src/gantt.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/khbuild_process_viz/src/gantt.ts b/packages/khbuild_process_viz/src/gantt.ts index e75c5c8..0c38b75 100644 --- a/packages/khbuild_process_viz/src/gantt.ts +++ b/packages/khbuild_process_viz/src/gantt.ts @@ -273,6 +273,8 @@ export function renderGantt(model: ProcessModel, schedule: Schedule, opts: Gantt }; if (opts.deps !== false) { const arrows: string[] = []; + const ghostLines: string[] = []; + const ghostMarks: string[] = []; const redundant = redundantDependencies(model.rows); for (const g of groups) { for (const { row } of g.rows) { @@ -290,10 +292,12 @@ export function renderGantt(model: ProcessModel, schedule: Schedule, opts: Gantt const gc = color(groupOf.get(dep)!.stage).stroke; const gy = to.y; const ghost = ``; - const gl = `${esc(truncate(`${dep} ${depRow.actionName ?? ""}`, 40))}`; - const lp = x2 > x1 + 7 ? `M${x1 + 7} ${gy} H${x2}` : x2 < x1 - 7 ? `M${x1 - 7} ${gy} H${x2}` : ""; // назад - если шаг начинается раньше вехи (противоречие) - const line = lp ? `` : ""; - arrows.push(`${tooltip([label])}${ghost}${gl}${line}`); + const several = row.dependsOn.filter((d) => model.rows.find((r) => r.id === d)?.isMilestone && !redundant.has(`${d}>${row.id}`)).length > 1; + const gl = `${esc(several ? dep : truncate(`${dep} ${depRow.actionName ?? ""}`, 40))}`; // несколько вех на одной строке: только id, чтобы подписи не налезали + const x2e = row.isMilestone ? x2 - 10 : x2; // у вехи-цели стрелка заканчивается перед ромбом, иначе остриё закрыто ромбом + const lp = x2e > x1 + 7 ? `M${x1 + 7} ${gy} H${x2e}` : x2e < x1 - 7 ? `M${x1 - 7} ${gy} H${x2e}` : ""; // назад - если шаг начинается раньше вехи (противоречие) + if (lp) ghostLines.push(`${tooltip([label])}`); + ghostMarks.push(`${tooltip([label])}${ghost}${gl}`); continue; } const d = x2 >= x1 ? `M${x1} ${from.y} V${to.y} H${x2}` : `M${x1} ${from.y} H${x1 + 6} V${to.y} H${x2}`; @@ -301,7 +305,9 @@ export function renderGantt(model: ProcessModel, schedule: Schedule, opts: Gantt } } } - out.push(`${arrows.join("")}`); + // слои снизу вверх: линии от контурных вех (почти фон), обычные зависимости, контурные ромбы с подписями (поверх линий) + out.push(`${ghostLines.join("")}${arrows.join("")}`); + out.push(`${ghostMarks.join("")}`); } // Строки раскрытых групп @@ -439,6 +445,6 @@ export function renderGantt(model: ProcessModel, schedule: Schedule, opts: Gantt `крайний срок`, ); - const defs = ``; + const defs = ``; return svgDoc(width, height, defs, out.join("\n"), `data-left="${GANTT_LEFT}" data-px="${px}"`); }