subroutinedraw_graphprivate
subroutine draw_graph(p, s, relation, job, keep, w, drawing, description, failed)
Lay out and draw one graph.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| p | type(project_t) | in | the project | |
| s | type(settings_t) | in | the settings | |
| relation | type(adjacency_t) | in | the relation | |
| job | type(graph_job_t) | in | the graph | |
| keep | logical | in | whether to give the description too | |
| w | type(walk_t) | inout | the working space | |
| drawing | type(string_t) | inout | the drawing | |
| description | type(string_t) | inout | the description, with | |
| failed | logical | out | whether the layout failed |
Calls
Source
Show the code
subroutine draw_graph(p, s, relation, job, keep, w, drawing, description, failed)
type(project_t), intent(in) :: p !! the project
type(settings_t), intent(in) :: s !! the settings
type(adjacency_t), intent(in) :: relation !! the relation
type(graph_job_t), intent(in) :: job !! the graph
logical, intent(in) :: keep !! whether to give the description too
type(walk_t), intent(inout) :: w !! the working space
type(string_t), intent(inout) :: drawing !! the drawing
type(string_t), intent(inout) :: description !! the description, with `keep`
logical, intent(out) :: failed !! whether the layout failed
type(layout_t) :: g
logical :: found
integer :: status
failed = .false.
call describe_graph(p, s, relation, job, w, g, found)
if (.not. found) return
if (keep) call g%write_dot(description%s)
call g%layout(status)
failed = status /= FDOT_OK
if (.not. failed) call g%write_svg(drawing%s)
end subroutine draw_graph