Skip to content

Commit 93c84d3

Browse files
committed
Tweak VertexLabels and DirectedEdges
1 parent 2fa63a3 commit 93c84d3

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

pymathics/graph/__main__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@
2323
from inspect import isgenerator
2424

2525
DEFAULT_GRAPH_OPTIONS = {
26-
"VertexSize": "{}",
27-
"VertexStyle": "{}",
26+
"DirectedEdges": "False",
2827
"EdgeStyle": "{}",
2928
"EdgeWeight": "{}",
3029
"GraphLayout": "{}",
31-
"VertexLabels": "False",
3230
"PlotLabel": "Null",
31+
"VertexLabels": "False",
32+
"VertexSize": "{}",
33+
"VertexStyle": "{}",
3334
}
3435

3536
import networkx as nx
@@ -656,8 +657,8 @@ def full_new_edge_properties(new_edge_style):
656657
n_undirected=len(undirected_edges),
657658
)
658659

659-
G.vertex_labels = options["System`VertexLabels"]
660660
g = Graph(G)
661+
g.vertex_labels = G.vertex_labels = options["System`VertexLabels"]
661662
G.title = g.title = options["System`PlotLabel"]
662663
return g
663664

pymathics/graph/graph_generators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ def graph_helper(
3434
G.graph_layout = options["System`GraphLayout"].get_string_value() or String(
3535
graph_layout
3636
)
37-
G.vertex_labels = options["System`VertexLabels"]
3837
g = Graph(G)
38+
G.vertex_labels = g.vertex_labels = options["System`VertexLabels"]
3939

4040
if root is not None:
4141
G.root = g.root = root

pymathics/graph/tree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
DEFAULT_TREE_OPTIONS = {
66
**DEFAULT_GRAPH_OPTIONS,
7-
**{"DirectedEdges": "False", "GraphLayout": '"tree"'},
7+
**{"GraphLayout": '"tree"'},
88
}
99

1010
from mathics.builtin.base import Builtin, AtomBuiltin

0 commit comments

Comments
 (0)