Гант: контурный ромб зависимости от вехи и для свёрнутых групп
All checks were successful
ci / test (push) Successful in 24s
ci / deploy (push) Successful in 1m34s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-17 17:37:44 +03:00
parent 3428cac809
commit 01bbe9ee66
2 changed files with 9 additions and 7 deletions

View File

@@ -285,13 +285,14 @@ export function renderGantt(model: ProcessModel, schedule: Schedule, opts: Gantt
const x2 = to.xs;
const depRow = model.rows.find((r) => r.id === dep);
const label = `${dep} -> ${row.id} ${depRow?.actionName ?? ""} -> ${row.actionName ?? ""}`;
if (depRow?.isMilestone && !g.collapsed && !groupOf.get(dep)?.collapsed) {
if (depRow?.isMilestone) {
// зависимость от вехи: вместо вертикали через весь план - контурный ромб вехи на строке зависимого шага, стрелка идёт от него
const gc = color(groupOf.get(dep)!.stage).stroke;
const gy = to.y;
const ghost = `<path d="M${x1} ${gy - 7} L${x1 + 7} ${gy} L${x1} ${gy + 7} L${x1 - 7} ${gy} Z" fill="#fff" stroke="${gc}" stroke-width="1.6"/>`;
const gl = `<text x="${x1 - 11}" y="${gy + 3}" text-anchor="end" font-size="9" fill="${gc}">${esc(truncate(`${dep} ${depRow.actionName ?? ""}`, 40))}</text>`;
const line = x2 > x1 + 7 ? `<path d="M${x1 + 7} ${gy} H${x2}" fill="none" stroke="#444" stroke-width="1.1" marker-end="url(#arr)"/><path d="M${x1 + 7} ${gy} H${x2}" fill="none" stroke="transparent" stroke-width="8" pointer-events="stroke"/>` : "";
const lp = x2 > x1 + 7 ? `M${x1 + 7} ${gy} H${x2}` : x2 < x1 - 7 ? `M${x1 - 7} ${gy} H${x2}` : ""; // назад - если шаг начинается раньше вехи (противоречие)
const line = lp ? `<path d="${lp}" fill="none" stroke="#444" stroke-width="1.1" marker-end="url(#arr)"/><path d="${lp}" fill="none" stroke="transparent" stroke-width="8" pointer-events="stroke"/>` : "";
arrows.push(`<g>${tooltip([label])}${ghost}${gl}${line}</g>`);
continue;
}