You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ext/GraphPPLGraphVizExt.jl
+7-3
Original file line number
Diff line number
Diff line change
@@ -469,9 +469,11 @@ by limiting the available display formats to SVG and plain text.
469
469
470
470
# Fields
471
471
- `graph::GraphViz.Graph`: The wrapped GraphViz graph object
472
+
- `dot_string::String`: The DOT string representation of the graph
472
473
"""
473
474
struct GraphVizGraphWrapper
474
475
graph::GraphViz.Graph
476
+
dot_string::String
475
477
end
476
478
477
479
# Override showable to only allow SVG and text display
@@ -488,7 +490,7 @@ function Base.show(io::IO, mime::MIME"image/svg+xml", x::GraphVizGraphWrapper)
488
490
end
489
491
490
492
function Base.show(io::IO, mime::MIME"text/plain", x::GraphVizGraphWrapper)
491
-
show(io, mime, x.graph)
493
+
show(io, mime, x.dot_string)
492
494
end
493
495
494
496
"""
@@ -506,7 +508,9 @@ Converts a GraphPPL.Model to a DOT string for visualization with GraphViz.jl.
506
508
- `save_to::String=nothing`: Optional path to save SVG output
507
509
508
510
# Returns
509
-
- `GraphVizGraphWrapper`: A wrapper around the GraphViz.Graph object that restricts display capabilities to SVG and text formats only. Use `.graph` property to access the GraphViz.Graph object directly.
511
+
- `GraphVizGraphWrapper`: A wrapper around the GraphViz.Graph object that restricts display capabilities to SVG and text formats only.
512
+
Use `.graph` property to access the GraphViz.Graph object directly.
513
+
Use `.dot_string` property to access the DOT string representation of the graph.
510
514
511
515
# Details
512
516
Generates a DOT string visualization of a GraphPPL.Model with configurable layout and styling options.
0 commit comments