Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve jac_dataspatial #1321

Closed
wants to merge 8 commits into from
3 changes: 2 additions & 1 deletion jac/jaclang/plugin/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,9 +915,10 @@ def dfs(node: NodeArchitype, cur_depth: int) -> None:
'fillcolor="invis", fontcolor="black"];\n'
)
for source, target, edge in connections:
edge_label = html.escape(str(edge.__jac__.architype))
dot_content += (
f"{visited_nodes.index(source)} -> {visited_nodes.index(target)} "
f' [label="{html.escape(str(edge.__jac__.architype))} "];\n'
f' [label="{edge_label if "GenericEdge" not in edge_label else ""} "];\n'
)
for node_ in visited_nodes:
color = (
Expand Down
12 changes: 6 additions & 6 deletions jac/jaclang/tests/fixtures/builtin_dotgen.jac
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ with entry{
d3=dotgen(b[2],edge_limit=5,depth=5);l3=d3|>len; #generate dot for all connected with b[1] node
d4=dotgen(b[1],bfs=True,edge_type= ["Edge1"],node_limit=100,edge_limit=900,depth=300);l4=d4|>len; #generate dot from nodes with depth 3 connected with b[1] node
d5=dotgen(b[1],node_limit=10,edge_limit=90);l5:=d5|>len; #generate dot from nodes with depth 3 connected with b[1] node
print(d1.count('a(val')==12,d1.count('#FFFFE0')==3,'Root' in d1,d1.count('GenericEdge')==30);
print(d2.count('a(val')==19,d2.count('#F5E5FF')==2 ,'Edge1' not in d2,d2.count('GenericEdge')==42);
print(d3.count('a(val')==6,d3.count("GenericEdge")==5,d3.count('#F5E5FF')==1);
print(d4.count("a(val")==25,d4.count("GenericEdge")==66,d4.count('#FFF0F')==3);
print(d5.count("Edge1(val=6)")==2, d5.count("GenericEdge()")==24);
print(d1.count('a(val')==12,d1.count('#FFFFE0')==3,'Root' in d1,d1.count('label=" "')==30);
print(d2.count('a(val')==19,d2.count('#F5E5FF')==2 ,'Edge1' not in d2,d2.count('label=" "')==42);
print(d3.count('a(val')==6,d3.count('label=" "')==5,d3.count('#F5E5FF')==1);
print(d4.count("a(val")==25,d4.count('label=" "')==66,d4.count('#FFF0F')==3);
print(d5.count("Edge1(val=6)")==2, d5.count('label=" "')==24);
# print(l3<l2);
# print(d1);
# print(d2);
# print(d3);
# print(d4);
# print(dotgen(node=b[2],bfs=True,depth=3.96,edge_limit=12,node_limit=12.96));

}
}
2 changes: 1 addition & 1 deletion jac/support/jac-lang.org/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ nav:

- Why: "why.md"
# - ~/roadmap$: 'roadmap.md'
- Github: https://github.com/Jaseci-Labs/jaclang
- Github: https://github.com/Jaseci-Labs/jaseci

- EECS449:
- "learn/tutorial/readme.md"
Expand Down
Loading