Skip to content

Commit ddd1dd8

Browse files
committed
update docs
1 parent 2e2797d commit ddd1dd8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ext/GraphPPLGraphVizExt.jl

+7-3
Original file line numberDiff line numberDiff line change
@@ -469,9 +469,11 @@ by limiting the available display formats to SVG and plain text.
469469
470470
# Fields
471471
- `graph::GraphViz.Graph`: The wrapped GraphViz graph object
472+
- `dot_string::String`: The DOT string representation of the graph
472473
"""
473474
struct GraphVizGraphWrapper
474475
graph::GraphViz.Graph
476+
dot_string::String
475477
end
476478

477479
# 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)
488490
end
489491

490492
function Base.show(io::IO, mime::MIME"text/plain", x::GraphVizGraphWrapper)
491-
show(io, mime, x.graph)
493+
show(io, mime, x.dot_string)
492494
end
493495

494496
"""
@@ -506,7 +508,9 @@ Converts a GraphPPL.Model to a DOT string for visualization with GraphViz.jl.
506508
- `save_to::String=nothing`: Optional path to save SVG output
507509
508510
# 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.
510514
511515
# Details
512516
Generates a DOT string visualization of a GraphPPL.Model with configurable layout and styling options.
@@ -554,7 +558,7 @@ function GraphViz.load(
554558
end
555559
end
556560

557-
return GraphVizGraphWrapper(final_graph)
561+
return GraphVizGraphWrapper(final_graph, final_string)
558562
end
559563

560564
end

0 commit comments

Comments
 (0)