subroutineadd_nodeprivate
subroutine add_node(p, id, root, g, place)
Add node id to a description. The key to the graphs in fdoc.js lists these colours.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| p | type(project_t) | in | the project | |
| id | integer | in | the entity | |
| root | logical | in | true for the entity the graph is about | |
| g | type(layout_t) | inout | the description | |
| place | integer | out | its number in |
Calls
Called by
Source
Show the code
subroutine add_node(p, id, root, g, place)
type(project_t), intent(in) :: p !! the project
integer, intent(in) :: id !! the entity
logical, intent(in) :: root !! true for the entity the graph is about
type(layout_t), intent(inout) :: g !! the description
integer, intent(out) :: place !! its number in `g`
character(len=:), allocatable :: url, colour, name, outline, owner_url, owner_colour
integer :: at, owner
associate (e => p%list%box(id)%e)
select case (e%kind)
case (E_MODULE); colour = '#3657c9'
case (E_SUBMODULE); colour = '#5a78de'
case (E_PROGRAM); colour = '#a61e69'
case (E_SUBROUTINE); colour = '#1d7a55'
case (E_FUNCTION); colour = '#0b7285'
case (E_INTERFACE, E_MODPROC); colour = '#6a4fb3'
case (E_TYPE); colour = '#a15c00'
case (E_BOUNDPROC); colour = '#7a6a2d'
case (E_FILE); colour = '#5c6f2d'
case default; colour = '#646d7e'
end select
name = e%name
if (e%kind == E_FILE) then
at = last_separator(name)
name = name(at + 1:)
end if
! what belongs to a type is drawn joined to it, with a link to each
owner = 0
if (e%kind == E_BOUNDPROC) owner = e%parent
if (e%bound_to > 0) owner = e%bound_to
url = ''
! something shown inside something hidden, such as a binding of a private type, has no page either
if (is_shown(p%list, id) .or. allocated(e%external_url)) call entity_url(p%list, id, url)
if (.not. is_shown(p%list, id) .and. .not. allocated(e%external_url)) colour = '#8a93a5'
if (allocated(e%external_url)) colour = '#646d7e'
if (len(url) > 0 .and. .not. allocated(e%external_url)) url = '../'//url
outline = ''
if (root) outline = '#f0a868'
if (owner > 0) then
call node_link(p, owner, owner_url)
owner_colour = merge('#a15c00', '#8a93a5', len(owner_url) > 0)
call g%add_node(name, place, fill=colour, link=url, outline=outline, owner=p%list%box(owner)%e%name, &
owner_fill=owner_colour, owner_link=owner_url)
else
call g%add_node(name, place, fill=colour, link=url, outline=outline)
end if
end associate
end subroutine add_node