From b8b76b42655bf192d42d042153d10d4d99cde1a1 Mon Sep 17 00:00:00 2001 From: Vijay Sarvepalli Date: Tue, 28 Oct 2025 16:34:37 -0400 Subject: [PATCH 01/11] updates also to truncate long fields --- docs/ssvc-explorer/simple.js | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/docs/ssvc-explorer/simple.js b/docs/ssvc-explorer/simple.js index 82a337f5..394f42d9 100644 --- a/docs/ssvc-explorer/simple.js +++ b/docs/ssvc-explorer/simple.js @@ -144,7 +144,12 @@ const graphModule = (function() { d3.select(self.frameElement).style("height", "700px"); } - + function truncateEllipsis(d) { + let dstr = d.name.split(":")[0]; + if(dstr.length > 25) + dstr = dstr.substr(0, 22) + "..."; + return dstr; + } function update(source) { var i = 0 var nodes = tree.nodes(root).reverse() @@ -198,10 +203,13 @@ const graphModule = (function() { .attr("dy", ".35em") .attr("class",function(d) { var fclass = d.name.split(":").shift().toLowerCase(); + fclass = fclass.replace(/^[a-zA-Z_]/,'C'); + fclass = fclass.replace(/[^a-zA-Z0-9_-]/g,'_'); if(!('children' in d)) - return "gvisible prechk-"+fclass+" finale"; + return "gvisible prechk-" + fclass + " finale"; return "gvisible prechk-"+fclass;}) - .text(function(d) { return d.name.split(":")[0]; }) + .attr("data-fullname", function(d) { return d.name.split(":").shift(); }) + .text(truncateEllipsis) .style("font-size",font) .style("fill", function(d) { var t = d.name.split(":").shift(); @@ -368,13 +376,17 @@ const graphModule = (function() { var yoffset = -10 if(showFullTree) yoffset = -6 - d3.select("g#x"+id).append("text").attr("dx",-6).attr("dy",yoffset).attr("class","gtext") + d3.select("g#x"+id) + .append("text").attr("dx",-6) + .attr("dy",yoffset).attr("class","gtext") .append("textPath").attr("href","#f"+id).attr("class",xclass) .attr("text-anchor","middle") .attr("id","t"+id) .attr("csid",csid) .attr("parentname",pname) - .text(text).attr("startOffset",doffset+"%") + .attr("data-fullname", text) + .text(truncateEllipsis({name:text})) + .attr("startOffset",doffset+"%") .on("click",pathclick) .on("mouseover",showdiv) .on("mouseout",hidediv); From 69d0b8c312e2dfedbccc6981ec8d4def41e701a9 Mon Sep 17 00:00:00 2001 From: Vijay Sarvepalli Date: Tue, 28 Oct 2025 16:45:36 -0400 Subject: [PATCH 02/11] Update docs/ssvc-explorer/simple.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docs/ssvc-explorer/simple.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ssvc-explorer/simple.js b/docs/ssvc-explorer/simple.js index 394f42d9..3ead1acb 100644 --- a/docs/ssvc-explorer/simple.js +++ b/docs/ssvc-explorer/simple.js @@ -147,7 +147,7 @@ const graphModule = (function() { function truncateEllipsis(d) { let dstr = d.name.split(":")[0]; if(dstr.length > 25) - dstr = dstr.substr(0, 22) + "..."; + dstr = dstr.substring(0, 22) + "..."; return dstr; } function update(source) { From df4ad63f7862495b013b475f46b688459f3a4934 Mon Sep 17 00:00:00 2001 From: Vijay Sarvepalli Date: Tue, 28 Oct 2025 16:45:52 -0400 Subject: [PATCH 03/11] Update docs/ssvc-explorer/simple.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docs/ssvc-explorer/simple.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ssvc-explorer/simple.js b/docs/ssvc-explorer/simple.js index 3ead1acb..21e3a883 100644 --- a/docs/ssvc-explorer/simple.js +++ b/docs/ssvc-explorer/simple.js @@ -203,7 +203,7 @@ const graphModule = (function() { .attr("dy", ".35em") .attr("class",function(d) { var fclass = d.name.split(":").shift().toLowerCase(); - fclass = fclass.replace(/^[a-zA-Z_]/,'C'); + fclass = fclass.replace(/^[^a-zA-Z_-]/,'C'); fclass = fclass.replace(/[^a-zA-Z0-9_-]/g,'_'); if(!('children' in d)) return "gvisible prechk-" + fclass + " finale"; From 58153d0efc1e5b25e2955735769900bebc00b9a8 Mon Sep 17 00:00:00 2001 From: Vijay Sarvepalli Date: Tue, 28 Oct 2025 16:46:06 -0400 Subject: [PATCH 04/11] Update docs/ssvc-explorer/simple.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docs/ssvc-explorer/simple.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ssvc-explorer/simple.js b/docs/ssvc-explorer/simple.js index 21e3a883..9d23fa97 100644 --- a/docs/ssvc-explorer/simple.js +++ b/docs/ssvc-explorer/simple.js @@ -384,7 +384,7 @@ const graphModule = (function() { .attr("id","t"+id) .attr("csid",csid) .attr("parentname",pname) - .attr("data-fullname", text) + .attr("data-fullname", text) .text(truncateEllipsis({name:text})) .attr("startOffset",doffset+"%") .on("click",pathclick) From 221822f5863ae5a0dfcc00106b9551ac430737c0 Mon Sep 17 00:00:00 2001 From: Vijay Sarvepalli Date: Wed, 29 Oct 2025 12:44:41 -0400 Subject: [PATCH 05/11] Updates to handle words that may end with spaces and ellipsis is invisible --- docs/ssvc-explorer/simple.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/ssvc-explorer/simple.js b/docs/ssvc-explorer/simple.js index 9d23fa97..55a0536d 100644 --- a/docs/ssvc-explorer/simple.js +++ b/docs/ssvc-explorer/simple.js @@ -146,8 +146,16 @@ const graphModule = (function() { } function truncateEllipsis(d) { let dstr = d.name.split(":")[0]; - if(dstr.length > 25) - dstr = dstr.substring(0, 22) + "..."; + if (dstr.length > 25) { + let truncated = dstr.substring(0, 22); + if(/\s+$/.test(truncated)) { + /* If it ends with spaces remove all spaces and the last + non-space character to show the word has been truncated */ + truncated = truncated.replace(/\s+$/, ""); + truncated = truncated.slice(0, -1); + } + dstr = truncated + "..."; + } return dstr; } function update(source) { From f225d89128237594c896d0ee115661692e4cc28a Mon Sep 17 00:00:00 2001 From: Vijay Sarvepalli Date: Wed, 29 Oct 2025 13:46:35 -0400 Subject: [PATCH 06/11] Suggestion to color distinguish values from names of Decision Points --- docs/ssvc-explorer/simple.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/ssvc-explorer/simple.js b/docs/ssvc-explorer/simple.js index 55a0536d..94be635c 100644 --- a/docs/ssvc-explorer/simple.js +++ b/docs/ssvc-explorer/simple.js @@ -216,12 +216,14 @@ const graphModule = (function() { if(!('children' in d)) return "gvisible prechk-" + fclass + " finale"; return "gvisible prechk-"+fclass;}) - .attr("data-fullname", function(d) { return d.name.split(":").shift(); }) + .attr("data-fullname", function(d) { + return d.name.split(":").shift(); + }) .text(truncateEllipsis) .style("font-size",font) .style("fill", function(d) { - var t = d.name.split(":").shift(); - var x; + const t = d.name.split(":").shift(); + let x; if(t in lcolors) x = lcolors[t]; return x; @@ -394,6 +396,7 @@ const graphModule = (function() { .attr("parentname",pname) .attr("data-fullname", text) .text(truncateEllipsis({name:text})) + .attr("fill", "#777") .attr("startOffset",doffset+"%") .on("click",pathclick) .on("mouseover",showdiv) From 62fad9f9a38b43a1321965dd087481e9143fb3bb Mon Sep 17 00:00:00 2001 From: Vijay Sarvepalli Date: Wed, 29 Oct 2025 13:52:08 -0400 Subject: [PATCH 07/11] Added more conditions to regex match --- docs/ssvc-explorer/simple.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ssvc-explorer/simple.js b/docs/ssvc-explorer/simple.js index 94be635c..b8b15565 100644 --- a/docs/ssvc-explorer/simple.js +++ b/docs/ssvc-explorer/simple.js @@ -148,7 +148,7 @@ const graphModule = (function() { let dstr = d.name.split(":")[0]; if (dstr.length > 25) { let truncated = dstr.substring(0, 22); - if(/\s+$/.test(truncated)) { + if(/\s+$/.test(truncated) || /^\s/.test(dstr[22]) ) { /* If it ends with spaces remove all spaces and the last non-space character to show the word has been truncated */ truncated = truncated.replace(/\s+$/, ""); From 86c18b51d4d4ddb86599e9b45a28f37287ee611b Mon Sep 17 00:00:00 2001 From: Renae Metcalf Date: Wed, 29 Oct 2025 14:38:01 -0400 Subject: [PATCH 08/11] Reduce string length to truncate --- docs/ssvc-explorer/simple.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/ssvc-explorer/simple.js b/docs/ssvc-explorer/simple.js index b8b15565..1ecf490a 100644 --- a/docs/ssvc-explorer/simple.js +++ b/docs/ssvc-explorer/simple.js @@ -146,13 +146,13 @@ const graphModule = (function() { } function truncateEllipsis(d) { let dstr = d.name.split(":")[0]; - if (dstr.length > 25) { - let truncated = dstr.substring(0, 22); - if(/\s+$/.test(truncated) || /^\s/.test(dstr[22]) ) { + if (dstr.length > 20) { + let truncated = dstr.substring(0, 18); + if(/\s+$/.test(truncated)) { /* If it ends with spaces remove all spaces and the last non-space character to show the word has been truncated */ truncated = truncated.replace(/\s+$/, ""); - truncated = truncated.slice(0, -1); + //truncated = truncated.slice(0, -1); } dstr = truncated + "..."; } From b13acfaebe03c00e9e6d46414aa7712b4975ff4a Mon Sep 17 00:00:00 2001 From: Renae Metcalf Date: Wed, 29 Oct 2025 14:44:08 -0400 Subject: [PATCH 09/11] Uncomment a slicer --- docs/ssvc-explorer/simple.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ssvc-explorer/simple.js b/docs/ssvc-explorer/simple.js index 1ecf490a..9cb4ffb2 100644 --- a/docs/ssvc-explorer/simple.js +++ b/docs/ssvc-explorer/simple.js @@ -152,7 +152,7 @@ const graphModule = (function() { /* If it ends with spaces remove all spaces and the last non-space character to show the word has been truncated */ truncated = truncated.replace(/\s+$/, ""); - //truncated = truncated.slice(0, -1); + truncated = truncated.slice(0, -1); } dstr = truncated + "..."; } From 2be8f340cdd5f25fc7e5a619702487cb08a0cc4c Mon Sep 17 00:00:00 2001 From: Vijay Sarvepalli Date: Wed, 29 Oct 2025 14:51:11 -0400 Subject: [PATCH 10/11] Add test for first character not to be space --- docs/ssvc-explorer/simple.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ssvc-explorer/simple.js b/docs/ssvc-explorer/simple.js index 9cb4ffb2..f9fcf44c 100644 --- a/docs/ssvc-explorer/simple.js +++ b/docs/ssvc-explorer/simple.js @@ -148,7 +148,7 @@ const graphModule = (function() { let dstr = d.name.split(":")[0]; if (dstr.length > 20) { let truncated = dstr.substring(0, 18); - if(/\s+$/.test(truncated)) { + if(/\s+$/.test(truncated) || /^\s/.test(dstr[18])) { /* If it ends with spaces remove all spaces and the last non-space character to show the word has been truncated */ truncated = truncated.replace(/\s+$/, ""); From 4805f9f5d1bda44bc78f4eb51a66c5f8d1a106c7 Mon Sep 17 00:00:00 2001 From: Renae Metcalf Date: Wed, 29 Oct 2025 14:53:31 -0400 Subject: [PATCH 11/11] Fix syntax --- docs/ssvc-explorer/simple.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/ssvc-explorer/simple.js b/docs/ssvc-explorer/simple.js index f9fcf44c..4c815092 100644 --- a/docs/ssvc-explorer/simple.js +++ b/docs/ssvc-explorer/simple.js @@ -151,8 +151,8 @@ const graphModule = (function() { if(/\s+$/.test(truncated) || /^\s/.test(dstr[18])) { /* If it ends with spaces remove all spaces and the last non-space character to show the word has been truncated */ - truncated = truncated.replace(/\s+$/, ""); - truncated = truncated.slice(0, -1); + truncated = truncated.replace(/\s+$/, ""); + truncated = truncated.slice(0, -1); } dstr = truncated + "..."; }