Гант: зависимость от вехи рисуется контурным ромбом вехи на строке зависимого шага (цвет группы вехи) вместо вертикали через весь план
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -283,9 +283,19 @@ export function renderGantt(model: ProcessModel, schedule: Schedule, opts: Gantt
|
||||
if (!from || !to) continue;
|
||||
const x1 = from.xe;
|
||||
const x2 = to.xs;
|
||||
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}`;
|
||||
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) {
|
||||
// зависимость от вехи: вместо вертикали через весь план - контурный ромб вехи на строке зависимого шага, стрелка идёт от него
|
||||
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"/>` : "";
|
||||
arrows.push(`<g>${tooltip([label])}${ghost}${gl}${line}</g>`);
|
||||
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}`;
|
||||
arrows.push(`<g>${tooltip([label])}<path d="${d}" fill="none" stroke="#444" stroke-width="1.1" marker-end="url(#arr)"/><path d="${d}" fill="none" stroke="transparent" stroke-width="8" pointer-events="stroke"/></g>`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user