@@ -506,8 +506,8 @@ public String renderClassGraphDotImage() {
506
506
stringBuilder .append ("const " + classGraphName + "_dot = " + dot + "\n " );
507
507
stringBuilder .append ("</script>\n " );
508
508
stringBuilder .append (generateForce3DPopup (classGraphName ));
509
-
510
509
stringBuilder .append (generate2DPopup (classGraphName ));
510
+ stringBuilder .append (generateHidePopup (classGraphName ));
511
511
512
512
stringBuilder .append ("<div align=\" center\" >\n Red lines represent back edges to remove.<br>\n " );
513
513
stringBuilder .append ("Zoom in / out with your mouse wheel and click/move to drag the image.\n " );
@@ -525,6 +525,9 @@ public String renderClassGraphDotImage() {
525
525
stringBuilder .append (".fit(true)\n " );
526
526
stringBuilder .append (".renderDot(" + classGraphName + "_dot);\n " );
527
527
stringBuilder .append ("</script>\n " );
528
+ } else {
529
+ // revisit and add D3 SVG popup button
530
+ stringBuilder .append ("<div align=\" center\" >\n Map is too big to render SVG quickly</div>\n " );
528
531
}
529
532
530
533
return stringBuilder .toString ();
@@ -591,6 +594,7 @@ public String renderCycleDotImage(RankedCycle cycle) {
591
594
stringBuilder .append ("</script>\n " );
592
595
stringBuilder .append (generateForce3DPopup (cycleName ));
593
596
stringBuilder .append (generate2DPopup (cycleName ));
597
+ stringBuilder .append (generateHidePopup (cycleName ));
594
598
595
599
stringBuilder .append ("<div align=\" center\" >\n " );
596
600
stringBuilder .append ("Red lines represent back edges to remove.<br>\n " );
@@ -609,8 +613,8 @@ public String renderCycleDotImage(RankedCycle cycle) {
609
613
stringBuilder .append (".renderDot(" + cycleName + "_dot);\n " );
610
614
stringBuilder .append ("</script>\n " );
611
615
} else {
612
- // revisit and add D3 popup button as well
613
-
616
+ // revisit and add D3 SVG popup button
617
+ stringBuilder . append ( "<div align= \" center \" > \n Cycle is too big to render SVG quickly</div> \n " );
614
618
}
615
619
616
620
stringBuilder .append ("<br/>\n " );
@@ -672,22 +676,21 @@ String buildCycleDot(Graph<String, DefaultWeightedEdge> classGraph, RankedCycle
672
676
String generate2DPopup (String cycleName ) {
673
677
// Created by generative AI and modified
674
678
return "<button style=\" display: block; margin: 0 auto;\" onclick=\" showPopup('popup-" + cycleName
675
- + "', 'graph-container-" + cycleName + "'," + cycleName + "_dot )\" >Show " + cycleName
676
- + " 2D Popup</button>\n " + "\n "
677
- + "<div class=\" popup\" id=\" popup-"
678
- + cycleName + "\" >\n " + " <span class=\" close-btn\" onclick=\" hidePopup()\" >×</span>\n "
679
- + " <div id=\" graph-container-"
680
- + cycleName + "\" style=\" width: 100%; height: 100%;\" ></div>\n " + "</div>" ;
679
+ + "', 'graph-container-" + cycleName + "', " + cycleName + "_dot )\" >Show " + cycleName
680
+ + " 2D Popup</button>\n " ;
681
681
}
682
682
683
683
String generateForce3DPopup (String cycleName ) {
684
684
// Created by generative AI and modified
685
685
return "<button style=\" display: block; margin: 0 auto;\" onclick=\" createForceGraph('popup-" + cycleName
686
- + "', 'graph-container-" + cycleName + "'," + cycleName + "_dot )\" >Show " + cycleName
687
- + " 3D Popup</button>\n " + "\n "
688
- + "<div class=\" popup\" id=\" popup-"
689
- + cycleName + "\" >\n " + " <span class=\" close-btn\" onclick=\" hidePopup()\" >×</span>\n "
690
- + " <div id=\" graph-container-"
691
- + cycleName + "\" style=\" width: 100%; height: 100%;\" ></div>\n " + "</div>" ;
686
+ + "', 'graph-container-" + cycleName + "', " + cycleName + "_dot )\" >Show " + cycleName
687
+ + " 3D Popup</button>\n " ;
688
+ }
689
+
690
+ String generateHidePopup (String cycleName ) {
691
+ return "<div class=\" popup\" id=\" popup-" + cycleName + "\" >\n "
692
+ + "<span class=\" close-btn\" onclick=\" hidePopup()\" >×</span>\n "
693
+ + " <div id=\" graph-container-" + cycleName + "\" style=\" width: 100%; height: 100%;\" ></div>"
694
+ + "\n </div>\n " ;
692
695
}
693
696
}
0 commit comments