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
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
integer :: at
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
if (e%kind == E_BOUNDPROC) name = p%list%box(e%parent)%e%name//'%'//name
if (e%bound_to > 0) name = p%list%box(e%bound_to)%e%name//'%'//name
url = ''
if (e%visible .or. allocated(e%external_url)) call entity_url(p%list, id, url)
if (.not. e%visible .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'
call g%add_node(name, place, fill=colour, link=url, outline=outline)
end associate
end subroutine add_node