Inspection

Inspection functions answer different questions about one model:

FunctionQuestion
parametersWhat may configuration change, and what are the current/default values?
lookWhat does this system or variable declare?
@lookCan I write the same inspection in convenient property syntax?
diveWhat is inside this constructed nested instance?
visualizeHow are variables/systems related, and in what order are they updated?

Use the type when studying structure and an instance when current values matter.

parameters

parameters(SystemType;
    alias = false,
    recursive = false,
    exclude = (),
    scope = nothing,
)

parameters(instance;
    alias = false,
    recursive = false,
    exclude = (),
)
  • alias = true uses a descriptive alias when one exists.
  • recursive = true follows declared child systems and includes their parameters.
  • exclude = (Context,) or another type tuple omits infrastructure or a branch that should not be followed.
  • scope selects the module in which type defaults and constants are evaluated. Its default is the module where the system was declared.

The type form can evaluate only a parameter default with no model-variable dependencies. It reports a dependent or externally required default as missing. The instance form reads current values, so it is the better choice after configuration has been applied.

recursive = true follows types visible in declarations. A dynamically typed vector of systems may not reveal every runtime child type; inspect a constructed instance or use a model-specific hierarchy traversal in that case.

Inspect declarations with look

look(SystemType)
look(instance)
look(SystemType, :variable)
look(instance, :variable)
look(Module, :SystemName)

For a system, look shows the system docstring and public declaration surface. For a variable, it shows the variable docstring and normalized declaration line. Supplying an instance also shows current values.

The display sections can be selected with keywords:

KeywordApplies toDefaultMeaning
headerall formstrueshow section labels such as [doc]
docsystem or variabletrueshow stored documentation
systemsystem summarytrueshow fields and current values when available
codevariable on a typetrueshow the declaration line
valuevariable on an instancetrueshow the current value
excerptvariable documentationfalseshow only its first documentation line

These switches are useful when embedding inspection output in a notebook, but they do not change the model. A declaration printed by look is the composed result, which may differ from the source line in an earlier mixin.

Use property syntax with @look

The macro supplies convenient property-like spelling:

@look Model
@look Model.variable
@look instance.variable
@look Model variable

The dotted forms with no call are equivalent to look(Model, :variable).

A dotted call is intentionally different:

@look instance.response(25u"°C")
@look instance.response(; temperature = 25u"°C")

It calls value(instance, :response, ...) to evaluate a function-like declaration body. It does not print declaration documentation. Use look(instance, :response) when inspection, rather than evaluation, is the goal.

dive

dive(instance)

dive opens a terminal menu for walking through nested systems, state values, and vectors of systems. Use the arrow keys to select an item, Enter to descend, and q to move back. A leaf first displays look; pressing Enter again returns that object to the REPL.

The menu needs a real terminal. In an initialized IJulia session, dive falls back to the noninteractive look(instance) summary. In notebooks and scripts, explicit property paths and look are easier to reproduce.

Model structure

With only a system type, visualize returns a static diagram instead of simulating a trajectory. The default kind = :dependency shows variables and their generated update stages. kind = :hierarchy shows system composition and mixins, omitting nested Context infrastructure. A dependency graph covers the composed declarations of one system, including mixins; child systems are not recursively expanded into their variables. kind = :flow arranges one system's update operations vertically, with a lane for each variable.

QuestionCall
What are the declared dependencies?visualize(S)
Which systems and mixins compose the model?visualize(S; kind = :hierarchy)
What happens during one generated update?visualize(S; kind = :flow)
What directly supplies x?visualize(S, :x; direction = :up)
What directly uses x?visualize(S, :x; direction = :down)
What connects a to c?visualize(S, :a => :c)

For name selectors, the defaults are depth = 1 and direction = :both. depth counts variable boundaries, not the generated phases of one variable. The diagrams display graphically in notebooks. Expand Terminal output (REPL) below an example to see the same result as text. Structural diagrams do not take a plotting backend option.

using Cropbox

@system Supply begin
    rate => 2 ~ preserve(parameter, u"g/hr")
end

@system StructuralGrowth(Controller) begin
    supply(context)            ~ ::Supply
    gain(r = supply.rate) => r ~ track(u"g/hr")
    mass(gain)                 ~ accumulate(u"g")
end

g = visualize(StructuralGrowth)
Terminal output (REPL)

The text lists variables and their generated phases in update order.

Dependency update order: [config, ∘context, context, supply, gain, mass, ⋆mass, ⋆context]
g = visualize(StructuralGrowth; kind = :hierarchy)
Terminal output (REPL)

The text lists the systems in the hierarchy. The diagram shows how they are related.

{StructuralGrowth, Controller, Supply}

These graphs describe declared relationships, not observed activity in a run. visualize(S, x, y; kind = :line, stop = ...) still means a simulation plot; visualize(df, x, y) uses saved data. Variable selectors are supported for kind = :dependency and kind = :flow. visualize! remains a plot-layer operation, not a way to modify these static diagrams.

A built-in thermal response

No scenario or input data are needed to inspect the built-in growing-degree response, even though its temperature parameters normally come from configuration:

visualize(GrowingDegree)

The arrows run from a dependency to its consumer. T and the temperature thresholds determine ΔT; ΔT and Δt determine the rate r. This component computes a rate, not a cumulative thermal-time total. The phenology tutorial shows a weather-driven model with an accumulating state.

At depth = 0, only selected variables and their configuration source remain:

visualize(GrowingDegree, [:Tb, :To, :Tx]; depth = 0)

The dotted arrows point from config to the parameters, not the reverse. An alias such as :base_temperature can select Tb; style = (alias = true,) changes the displayed labels to the declared aliases. Labels are taken from declarations, not generated descriptions.

Select neighborhoods or paths

@system PathDemo begin
    a: input => 1     ~ preserve(parameter)
    b(a)     => 2a    ~ track
    c(b)     => b + 1 ~ track
    d(c)     => 2c    ~ track
    e(d)     => d + 1 ~ track
    side(a)  => -a    ~ track
end

visualize(PathDemo, [:a, :e])

A name or list of names selects their neighborhoods. Here depth = 1 includes the side branch and the neighbors of both endpoints, but does not reach c. depth = 0 keeps only the selected variables. direction = :up follows inputs, :down follows affected variables, and :both follows both directions.

Compare the two directions around the same variable:

visualize(PathDemo, :b; direction = :up)
visualize(PathDemo, :b; direction = :down)

The first keeps a → b (and the configuration source for a); the second keeps b → c. Increasing depth adds another variable boundary in the chosen direction. It does not rank variables by importance.

visualize(PathDemo, :a => :e)

A pair selects directed variable paths between its endpoints: this includes c but excludes side. Paths are not limited by depth or direction. For a short chain, a neighborhood selection and a path can happen to look identical.

visualize(PathDemo, [:side, :a => :e]; depth = 0)

A mixed vector combines neighborhoods and paths. An endpoint can itself be a vector, such as [:a, :b] => [:d, :e]; a vector of pairs selects independent paths without adding cross-pair paths. Vector endpoints include all existing source-to-target combinations. Aliases are accepted as selectors. Unknown variables, empty selections, and pairs with no directed path are errors. Included variables retain all their generated phases, and parameters retain their configuration source, even at depth = 0.

Selections show only edges already present between retained nodes. They do not invent a shortcut edge over an omitted intermediate variable. A path selection also does not include every input to its intermediate variables: use an upstream neighborhood or the full graph to inspect those additional inputs. For path selection, the generated phases of one variable are treated as one. For example, :rate => :output follows rate → mass → output even when mass is an accumulating state. Context phases that enforce update order remain distinct, so they do not create paths between unrelated variables. The picture still shows the original update stages and edges. A variable path can span timesteps; it is not necessarily a continuous directed path through one timestep's schedule. The phenology example demonstrates a path through an accumulated thermal state.

Read the symbols

This key is for dependency and hierarchy graphs. For kind = :flow, see the flow diagram legend.

AppearanceMeaning
Plain labelOrdinary derived or fixed variable, remembered value, or system reference
RectangleAccumulating state (accumulate, capture, integrate, advance)
Double rounded rectangleProduced systems
Parallelogram / cylinderDriver / provided storage
Diamond / hexagonCondition / solver
Italic labelLanguage-level declaration (hold, wrap, call, bring)
Bold labelSelected variable or path endpoint; hierarchy labels are also bold
∘name / ⋆namePreparation / post-update phase of one variable
Dashed node outlinePreparation stage of a shaped node
Solid arrowOrdinary dependency
Dotted arrow with open box headConfiguration input to a parameter
Open triangle head / small veePreparation dependency / connection between phases of one variable

Hierarchy arrows point from a child system or mixin to the containing or derived system. Dashed hierarchy edges denote mixins. Shape and line style carry the distinctions without requiring colors, unit labels, or state names.

The prefixes ∘ and ⋆ distinguish generated preparation and post-update stages of the same variable. They do not mean two independent variables or the next simulation timestep. A phase connection is solid with a small vee head; a dashed node outline marks preparation, while a dotted edge marks a configuration input. See Model Execution for the update lifecycle and Behaviors and Tags for each state's semantics.

For example, a bisection solver has preparation and main stages:

@system RootStages begin
    target => 2 ~ preserve(parameter)
    lower  => 0 ~ preserve(parameter)
    upper  => 2 ~ preserve(parameter)

    root(root, target) => root^2 - target ~ bisect(lower = lower, upper = upper)
end

visualize(RootStages)

Bounds feed the preparation stage ∘root; target feeds the equation at root. The graph does not expand the solver's internal iterations.

Produced systems use the same phase notation with double rounded rectangles:

@system LeafUnit begin
    area => 1 ~ preserve(u"cm^2")
end

@system CanopyStages(Controller) begin
    leaves => produce(LeafUnit) ~ produce::LeafUnit[]
end

visualize(CanopyStages, :leaves; depth = 0)

This is a declaration graph, not a count of leaves created during a run. visualize(CanopyStages; kind = :hierarchy) follows the declared child type; visualize(LeafUnit) inspects that child's variables. Use the dynamic hierarchy APIs to inspect runtime children.

Computation flow diagram

A flow diagram follows one update in compiler order, showing expressions, conditions, and retained state. It describes potential reads, not an observed run or a stock-and-flow model. For a large model, start with one variable or a source => target path; inputs outside the selection remain visible.

g = visualize(GrowingDegree; kind = :flow)
Example block output
Terminal output (REPL)
        T    Δt    ΔT    r    Tb    To    Tx
7  ΔT   ●─────────→○←─────────●─────●─────●
9  r         ●─────●────→○

Read downward through the numbered rows. Each number is a position in the full update, so a selection can leave gaps. Variables occupy lanes; a fixed input can have a lane without an operation. Horizontal arrows on the same row lead to one target, not from one input to the next.

Flow diagram legend

Operation symbols. In the figure, the shape at the arrow tip tells you what Cropbox does on that row. In a wide terminal, the target usually shows the phase instead: ◓ pre, ○ main, ◒ post. Two operations have their own terminal targets: △ saves a rate and ▽ marks a binding.

Target in the figureOperation
● Filled circle / ○ open circleCompute a value (track) / keep the first eligible value (remember).
□ SquareUpdate an accumulated value, captured increment, or counter (accumulate, capture, advance).
Rounded square / double rounded squareUpdate a field or child system / update or queue children with produce.
▱ ParallelogramRead a stored driver input (drive).
◇ DiamondEvaluate a flag (flag).
△ Upward triangle / ▽ downward triangleSave a rate for the next update / show a local callable's bound inputs, without calling it.
⬡ HexagonA solve, bisect, integrate, or wrap operation; its internal steps are not expanded.

Connections and colors. The table gives the full key; each figure's legend shows only the marks used there. Follow horizontal arrows toward the target. A small open circle on a source lane marks a selected input; a small open square marks an input outside the selection (for example, supply.rate). In a wide terminal, ● marks either kind of input, not the result. An unmarked crossing is not an input.

FigureTerminalHow to read it
Solid blue arrow●──→○; x ← a, b in a listRead the marked inputs for this target. Several inputs on one row are not a chain.
Dashed blue arrow●╌╌→▽; f ⇠ k in a listf binds k. Its current value is read when f is invoked, not at the numbered binding row.
Dotted ochre arrow[when ready] or [reset restart]Read a control. The terminal shows the tag instead of a separate control arrow. [once] is a latch, not another input.
Arrow looping back to its own lane↺ in wide outputA row reads its own variable. This is distinct from carrying a value across updates.
Gray rail, right of the lane← mass [prev update]Carry a value, counter, or memory. A name means the same row retained it.
Teal rail, left of the lane← #9 [prev update] / → #8 [next update]Carry a cached rate between two rows. # refers to the other row's number, not a variable or timestep.
Pale gray center lineLane heading onlyFollow the same variable to its last use; the dotted background guide and horizontal row dividers carry no value.
—┬─, ├─, └─ in a listMore inputs to the same row on a narrow terminal.

The tapered rail above a target brings a value or rate in from the previous update; the one below saves it for the next. If terminal colors are enabled, input lines are light blue, controls yellow, row numbers and cross-references gray, and rate targets and update labels cyan. The symbols also work without color.

Computation column. Read the target name first. Monospace is a declared expression or setting (share(0.3), lower = 0); italics are a Cropbox action (drive · read input); an outlined tag such as when = ready applies to that row. The terminal keeps the names and tags, but omits expressions and action text.

Worked examples

An accumulating state needs two operations, but not two repeated timesteps:

@system ThermalFlow(Controller) begin
    Tb: base_temperature => 5            ~ preserve(parameter, u"°C")
    T: temperature       => [8, 12, 16]  ~ drive(u"°C")
    rate(T, Tb) => max(T - Tb, 0u"K")    ~ track(u"K")
    total(rate): thermal_time            ~ accumulate(u"K*d")
    mature(total) => total >= 50u"K*d"   ~ flag(once)
end

tf = visualize(ThermalFlow; kind = :flow)
Example block output
Terminal output (REPL)

Wide terminal (100 columns). Here rate is a model variable, while △ marks the operation that saves the rate for total.

            Tb    T    rate    total    mature
5  T              ○
6  rate     ●─────●────→○
7  total                         ○  ← (total, #9) [prev update]
8  mature                        ●───────→○  ← mature [prev update]  [once]
9  total                ●───────→△  → #7 [next update]

Narrow terminal (40 columns). When lanes do not fit, the inputs are listed by name. The rate-saving row lists its input, then points to the next update.

5   T
6   rate    ← T, Tb
7   total   ← (total, #9) [prev update]
8   mature  ← total  ← mature
            [prev update]  [once]
9   total   rate  → #7 [next update]

Follow the paired # numbers between the two total rows. In contrast, mature retains its own flag value, so its previous-update link names mature.

Read the two rows named total together. The first says accumulate: add the previously cached rate multiplied by elapsed time. The later row shows rate followed by accumulate · save rate: the input from total(rate) is saved for the next update. A capture replaces its value with that same increment rather than adding it. A declared time = elapsed identifies the clock used to measure the interval. The legend gives these meanings once per diagram, for the operations shown.

An if in a body stays model code, not a control tag. For when = mask[1] only mask is a condition input; when = mask[idx[]] also reads idx. In a declaration argument or tag, the diagram shows possible reads: both sides of && or ||, each operand of lo[] < T[] <= hi[], and the condition and both alternatives of on[] ? lo[] : hi[]. Only the chosen alternative runs. In f(x[]).field, the field belongs to the result: the row reads x, not x.field. It also reads f if f is a model variable. The broadcast f.(xs[]) has the same model inputs and call bindings as map(f, xs[]).

A variable used both in the calculation and as a control has both arrows. A tag describes behavior, not a runtime observation or a universal on/off switch. For accumulate and capture, a false when saves a zero rate; it does not skip the main row. An accumulator samples reset alongside that rate even if when is false. If set, the next main row starts from init before adding the increment. An ordinary track uses init or zero when its condition is false; a flag clears unless already latched by once. For produce, the existing child is updated independently of when. Only the later row queues new children for construction next update; a single child can be queued only while empty. A driver reads the input stored at construction, not the source table anew. With a bisection, only an explicit min or max adds a clipping row; lower and upper are search bounds. An outer begin … end is reduced to its statements; multiple statements are parenthesized and separated by semicolons. Private names use Owner._name, keeping identically named fields from different mixins distinct without exposing internal mangled names. Use look for complete declarations, aliases, units, and documentation.

Name, vector, and path selectors use the compiler's dependency graph. A flow arrow can show a read that is not an edge in that graph: for example, with dotted(v = sum(f.(xs[]))), the diagram shows xs as an input, but :xs => :dotted can raise an ArgumentError because there is no compiler path. Select the target with depth = 0 to see its declared reads instead: visualize(S, :dotted; kind = :flow, depth = 0). For the accumulator above:

visualize(ThermalFlow, :total; kind = :flow, depth = 0)
Example block output

This retains total's operations in their original order. Its omitted input rate remains visible as a gray boundary lane, not as a shortcut through a hidden computation. This differs from a dependency graph, whose unselected nodes are simply absent. Selecting more variables does not reorder the full system's schedule.

This model both updates a child system and calls a local function:

@system GrowthAllocation(StructuralGrowth) begin
    share(gain; f)   => f * gain   ~ call(u"g/hr")
    root_rate(share) => share(0.3) ~ track(u"g/hr")
end

diagram = visualize(GrowthAllocation; kind = :flow)
Example block output
Terminal output (REPL)
               supply    gain    mass    share    root_rate    supply.rate
4  supply        ○
5  gain                   ○←────────────────────────────────────────●
6  share                  ●╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌→▽
7  root_rate                               ●─────────→○
8  mass                           ○  ← (mass, #9) [prev update]
9  mass                   ●──────→△  → #8 [next update]

supply.rate is a boundary read; inspect visualize(Supply; kind = :flow) for the child's update. The dashed arrow into share identifies gain as a bound input. Here root_rate invokes share with the argument 0.3; another consumer could pass the callable without invoking it. Each local binding is shown once, including nested calls. Initialization, child steps and solver internals are not expanded.

Graphical export

The Makie/CairoMakie figure is created only for notebook display or export. Its only style option is style = (fontsize = 10,), which scales text and spacing together. The monospace and italic fonts are bundled with Makie; no system font installation is needed. The canvas grows with variables and rows instead of clipping or shrinking them.

Cropbox.writeimage("flow.svg", diagram)
Cropbox.writeimage("flow.pdf", diagram)
Cropbox.writeimage("flow.png", diagram; px_per_unit = 2)

Download the Flow SVG, PDF, or PNG. Graphviz-specific style, engine, and writedot options do not apply to flow diagrams. visualize! does not add layers to this diagram.

Display, grouping, and export

Dependency and hierarchy graphs use bundled Graphviz, not the Makie/UnicodePlots plotting backends. Notebooks display SVG; terminals show a compact text summary without running Graphviz. A failed automatic SVG render shows a fallback notice and logs the underlying exception as a warning; explicit image export reports the rendering error.

g = visualize(StructuralGrowth; style = (group = :system,))

The grouped graph displays directly in a notebook. Its stored rendering options also apply to exports:

Cropbox.writeimage("structure.svg", g)
Cropbox.writeimage("structure.pdf", g)
Cropbox.writedot("structure.dot", g)

Download the grouped SVG, PDF, or Graphviz source. group = :system clusters variables by their declaring system or mixin; it does not expand child-system instances.

Pass rendering options in style to visualize, leaving the underlying graph unchanged. writeimage and writedot inherit them and can override individual options with their own style. Supported keys are alias, group, rankdir, ratio, ranksep, nodesep, splines, fontname, fontsize, margin, arrowsize, and penwidth; alias and group apply only to dependency graphs. For example, style = (rankdir = :LR, group = :system) gives a left-to-right grouped graph. writeimage also accepts engine = :neato or another Graphviz layout engine; the default is :dot. writedot does not require a working renderer.

To explicitly use the terminal fallback, call show(stdout, MIME("text/plain"), g). Dependency text lists a valid generated update order, not a measured execution trace. If image rendering fails, save DOT with Cropbox.writedot("structure.dot", g); an explicit writeimage call reports the Graphviz error rather than silently succeeding. Bold and italic labels retain the chosen font family. Fonts are resolved by the rendering environment, so a custom fontname is not bundled with an export.

Scope and larger models

  • These are static declaration graphs. They do not show runtime values, configuration-specific active branches, elapsed time, or sensitivity.
  • Dependencies include declared arguments and tags, not only equation bodies. A scientific feedback may span state-update phases rather than form a cycle in the generated scheduling graph.
  • A nested reference such as supply.rate is represented through supply in the parent graph. Inspect Supply separately for its internal variables; dotted cross-system paths are not selectors in this interface.
  • Hierarchies follow declared system types, not every runtime instance of that type. A dynamically chosen child type may not be discoverable statically.
  • Grouping changes presentation, not selection. There is no automatic importance filter or recursive variable flattening in this interface.

For larger models, start with the hierarchy, then select an output's upstream neighborhood and increase depth as needed. The SimpleCrop example demonstrates this workflow; the phenology example groups a weather-to-state path by its declaring systems.

The underlying Cropbox.dependency and Cropbox.hierarchy helpers remain unexported implementation utilities. Their graph fields are not a stable serialization format; use visualize as the model-facing entry point.

Structural graph API

Cropbox.visualize — Method
visualize(S::Type{<:System}; kind = :dependency, style = ())
visualize(S::Type{<:System}, selector;
    kind = :dependency, depth = 1, direction = :both, style = ())

Show a system's declared structure without running a simulation. kind is :dependency for variables and their generated update stages, :hierarchy for system composition and mixins, or :flow for the static order of operations in one update. The hierarchy omits nested Context infrastructure. Simulation plots still use visualize(S, x, y; ...).

Dependency and flow selectors both follow the compiler's dependency graph. Use a variable name, a source => target pair, or a vector combining them. Names select neighborhoods: depth = 0 keeps only the named variables, and each additional level crosses one variable boundary. direction is :up for inputs, :down for affected variables, or :both. Pairs select directed variable paths between their endpoints, independent of depth and direction; each endpoint may also be a vector of names. Several selectors combine their results. Unknown names and pairs with no path raise an ArgumentError. Path selection treats the phases of a variable as one, so a path can pass through an accumulating state. Context scheduling phases remain distinct to avoid connecting otherwise unrelated variables. The displayed graph retains the original update stages and edges; a selected path is not necessarily a same-timestep execution chain.

[:a, :c] selects the union of two neighborhoods, which may be disconnected or include side branches. :a => :c selects the connecting paths regardless of their length, without off-path neighbors. Dependency graphs retain all generated phases of included variables and configuration sources for included parameters. They emphasize selected names and path endpoints in bold.

Dependency/hierarchy graphs have a text representation in a terminal and an SVG display in notebooks. Pass options such as style = (group = :system,) to display a grouped graph directly. Use Cropbox.writeimage to save an image, or Cropbox.writedot for renderer-independent Graphviz source. Exports inherit these options and can override them with their own style.

Flow rows keep their positions in the full update; inputs outside the selection remain visible. Terminals show variable lanes when they fit, otherwise an input list. Notebooks and SVG/PDF/PNG exports also show expressions and state actions. Use style = (fontsize = 10,) to scale the figure. See the flow diagram guide and its legend.

Examples

visualize(GrowingDegree)
visualize(GrowingDegree; kind = :hierarchy)
visualize(GrowingDegree, :r; depth = 2, direction = :up)
visualize(GrowingDegree, [:T, :r])
visualize(GrowingDegree, :T => :r)
visualize(GrowingDegree, [:Tb, :T => :r])
visualize(GrowingDegree; style = (group = :system,))
visualize(GrowingDegree; kind = :flow)
visualize(GrowingDegree, :r; kind = :flow, direction = :up)
source
Cropbox.writedot — Function
writedot(name::AbstractString, graph::Graph; style = ()) -> String
writedot(graph::Graph; style = ()) -> String

Write graph as Graphviz DOT source and return the output path. The .dot extension is appended when name has no such extension. Omitting name writes to a temporary file.

The style named tuple customizes Graphviz generation without changing the underlying graph, overriding matching options saved by visualize. Supported keys are ratio, rankdir, ranksep, nodesep, splines, margin, fontname, fontsize, arrowsize, and penwidth. Dependency graphs additionally support alias = true for declared aliases and group = :system for system clusters. For example:

g = visualize(GrowingDegree)
Cropbox.writedot("gdd.dot", g; style = (rankdir = :LR, group = :system))
source
Cropbox.writeimage — Method
writeimage(name::AbstractString, graph::Graph;
    format = nothing, engine = :dot, style = ()) -> String

Render graph with Graphviz and return the output path. The output format is inferred from the extension of name, or may be supplied explicitly with format. engine selects a Graphviz layout engine such as :dot, :neato, or :sfdp. The style named tuple is forwarded to DOT generation, overriding matching options saved by visualize.

g = visualize(GrowingDegree)
Cropbox.writeimage("gdd.pdf", g)
Cropbox.writeimage("gdd.svg", g; style = (group = :system,))

If Graphviz cannot render the requested output, this function reports the renderer error. writedot remains available as a renderer-independent fallback.

source