From ad8a0648790390590db7659566bf03706c058d05 Mon Sep 17 00:00:00 2001 From: ziajka Date: Mon, 16 Apr 2018 15:26:22 +0200 Subject: [PATCH] Hide statuses when too close --- src/app/cartography/shared/widgets/links.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/app/cartography/shared/widgets/links.ts b/src/app/cartography/shared/widgets/links.ts index 6def1bee..277df048 100644 --- a/src/app/cartography/shared/widgets/links.ts +++ b/src/app/cartography/shared/widgets/links.ts @@ -54,10 +54,15 @@ export class LinksWidget implements Widget { const start_point: SVGPoint = link_path.node().getPointAtLength(40); const end_point: SVGPoint = link_path.node().getPointAtLength(link_path.node().getTotalLength() - 40); - const statuses = [ - new LinkStatus(start_point.x, start_point.y, l.source.status), - new LinkStatus(end_point.x, end_point.y, l.target.status) - ]; + let statuses = []; + + if (link_path.node().getTotalLength() > 2 * 40 + 10) { + statuses = [ + new LinkStatus(start_point.x, start_point.y, l.source.status), + new LinkStatus(end_point.x, end_point.y, l.target.status) + ]; + } + const status_started = link_group .selectAll('circle.status_started')