Skip to content

Commit

Permalink
feat: generate mermaid with node id
Browse files Browse the repository at this point in the history
need for node hightlight

work on #9
  • Loading branch information
bsorrentino committed Jul 16, 2024
1 parent cd93489 commit 7967a93
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protected void appendHeader(StringBuilder sb, String title) {

@Override
protected void appendFooter(StringBuilder sb) {

// do nothing
}

@Override
Expand Down Expand Up @@ -58,11 +58,11 @@ protected void finish(StringBuilder sb, String finishPoint, String description)

@Override
protected void call(StringBuilder sb, String from, String to) {
sb.append( format("\t%s --> %s\n", from, to) );
sb.append( format("\t%1$s:::%1$s --> %2$s:::%2$s\n", from, to) );
}

@Override
protected void call(StringBuilder sb, String from, String to, String description) {
sb.append(format("\t%s -->|%s| %s\n", from, description, to));
sb.append(format("\t%1$s:::%1$s -->|%2$s| %3$s:::%3$s\n", from, description, to));
}
}
14 changes: 7 additions & 7 deletions core-jdk8/src/test/java/org/bsc/langgraph4j/GraphTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,12 @@ public void GenerateImageToDiagramGraph() throws Exception {
"\tagent_generic_plantuml(\"agent_generic_plantuml\")\n" +
"\tevaluate_result(\"evaluate_result\")\n" +
"\tcondition1{\"check state\"}\n" +
"\tstart --> agent_describer\n" +
"\tagent_describer --> condition1\n" +
"\tcondition1 -->|sequence| agent_sequence_plantuml\n" +
"\tcondition1 -->|generic| agent_generic_plantuml\n" +
"\tagent_sequence_plantuml --> evaluate_result\n" +
"\tagent_generic_plantuml --> evaluate_result\n" +
"\tevaluate_result --> stop\n", result.getContent() );
"\tstart:::start --> agent_describer:::agent_describer\n" +
"\tagent_describer:::agent_describer --> condition1:::condition1\n" +
"\tcondition1:::condition1 -->|sequence| agent_sequence_plantuml:::agent_sequence_plantuml\n" +
"\tcondition1:::condition1 -->|generic| agent_generic_plantuml:::agent_generic_plantuml\n" +
"\tagent_sequence_plantuml:::agent_sequence_plantuml --> evaluate_result:::evaluate_result\n" +
"\tagent_generic_plantuml:::agent_generic_plantuml --> evaluate_result:::evaluate_result\n" +
"\tevaluate_result:::evaluate_result --> stop:::stop\n", result.getContent() );
}
}

0 comments on commit 7967a93

Please sign in to comment.