Warning, /sdk/codevis/doc/loading.md is written in an unsupported language. File is not indexed.

0001 ## Graph Loading Policy
0002 Vertices and edges are considered separately (vertices in physicalloader and
0003 edges in graphloader).
0004 
0005 ### Vertices
0006 A graph is loaded by visiting each node one by one, starting with the main node
0007 (e.g. if we are drawing a graph of `bal`, `bal` is the main node).
0008 
0009 Visiting a node causes it to be added to the graph. We then make policy decisions
0010 about which nodes to visit next after the current node. These fall into three
0011 categories
0012 
0013 1. Should we load forward or reverse dependencies of this vertex? This is done
0014    when the "Load External Dependencies" toggle is enabled, if the vertex is in
0015    the same package group as the main node or if the vertex is not too distant
0016    (1) from the main node.
0017 2. Should we load the parent of this vertex? This is done for anything in a
0018    different package group to the main node (so these package groups can be
0019    easily collapsed) or if the node is of a smaller type than the main node
0020    (e.g. the main node is a package and this node is a component).
0021 3. Should we load the children of this vertex? If the node is in a different
0022    package group to the main node, don't load children to any greater detail
0023    than components (if we load types as well, graph load times explode). If the
0024    node is in the same package group as the main node, load children if the node
0025    is the same type (group, package, etc) as the main node or if the main
0026    node is a component and this this node is a type (so we don't miss nested
0027    types in component graphs).
0028 
0029 Care is taken so that each node is visited only once, even in the presence of
0030 circular dependencies.
0031 
0032 (1) Distance is measured by the number of graph edges between this node and the
0033     main node. The thresholds are 2 edges for package group and component graphs
0034     and only 1 edge on package graphs (because these tend to be more congested.
0035 
0036 These policy rules can seem convoluted, they walk a very fine line between
0037 omitting necessary detail and creating graphs that are unreadably large and
0038 complex.
0039 
0040 #### Manual Intervention
0041 All three kinds of vertex loading policy can be overridden on a per-vertex basis
0042 by right clicking on that vertex in the graph. The right click menu also tells
0043 you what policy decision was made for that node when loading the graph: for
0044 example if it says "Don't load edges" then all of the dependencies were loaded,
0045 if it says "Load edges" then there (possibly) are more dependencies to load for
0046 that vertex.
0047 
0048 Sometimes setting a "never load" manual option appears not to do anything. For
0049 example, we might tell a node not to load its children but find some of those
0050 children are still loaded for another reason (e.g. due to edges loaded from
0051 something else's children).
0052 
0053 ### Edges
0054 Once `lvtldr::PhysicalLoader` has picked out which vertices to include in the
0055 graph, `lvtldr::GraphLoader` will load *all* edges existing between those
0056 vertices from the database.
0057 
0058 By default, displayed graphs only render the transitive reduction of dependency
0059 edges. For example, if we have a graph like
0060 ```
0061 A -- B -- C
0062  \_______/
0063 ```
0064 
0065 The edge between A and C will not be drawn because this edge is redundant
0066 (being already implied by transitivity from A - B - C).
0067 
0068 These redundant edges can be displayed by right clicking on empty space and
0069 selecting "show redundant edges".