Visual Analytics Course

Site Tools

chicoutimi_2016:doi_tree_de_furnas

Differences

This shows you the differences between two versions of the page.

 chicoutimi_2016:doi_tree_de_furnas [2016/05/23 03:42]melancon [DOI trees de George W. Furnas] chicoutimi_2016:doi_tree_de_furnas [2016/05/23 03:55] (current)melancon [DOI trees de George W. Furnas] Both sides previous revision Previous revision 2016/05/23 03:55 melancon [DOI trees de George W. Furnas] 2016/05/23 03:42 melancon [DOI trees de George W. Furnas] 2016/05/23 03:41 melancon [DOI trees de George W. Furnas] 2016/05/23 03:41 melancon [DOI trees de George W. Furnas] 2016/05/23 03:35 melancon [DOI trees de George W. Furnas] 2016/05/23 03:16 melancon created 2016/05/23 03:55 melancon [DOI trees de George W. Furnas] 2016/05/23 03:42 melancon [DOI trees de George W. Furnas] 2016/05/23 03:41 melancon [DOI trees de George W. Furnas] 2016/05/23 03:41 melancon [DOI trees de George W. Furnas] 2016/05/23 03:35 melancon [DOI trees de George W. Furnas] 2016/05/23 03:16 melancon created Line 31: Line 31: {{ :​furnas_code_doi.png?​link&​300 |}} {{ :​furnas_code_doi.png?​link&​300 |}} + --- + + Furnas had a very clever idea applied to the visualization and edition of code. Because code is organized into a hierarchy of blocks, why not only show the headings of a block while the user is not interested in having a detailed look at the details of that block. For instance, only showing the name and signature of a function might be enough, showing the first line of a loop might be sufficient to indicate what the loop is performing at that location in the code. + + {{::​furnas_code_plain.png?​direct&​300 }} {{ ::​furnas_code_doi.png?​direct&​300}} + + The left figure show a portion of a file. The right figure show the same file where some blocks have been shrunk to a single line. (Click on the images to access an enlarged view.) So the problem we need to solve is to decide what blocks should be shrunk or not. Observe also that blocks residing within a shrunked blocks will not be shown at all. + + Now, we may assume the blocks to form a hierarchy, that is they implicitly defined a tree structure $T = (V, E)$. We may also assume the tree implicitly defines the a priori importance of a node in the tree. That is, a leaf node corresponding to a single instruction is of a lesser importance than an ancestor node corresponding to the function containing this line, for instance. As a consequence,​ the root node $r \in V$ has the greatest //a priori// importance value. + + {{ ::​api.png?​direct&​300|}} This leads to define the //a priori// importance function: + + $$+ API: T \to \mathbb Z \qquad T: v \mapsto T(v) = - d_T(v, r) +$$ + + so the //a priori// importance of a node equals minus its distance to the root in the tree. + + Now, suppose the user is editing a particular line in the file. This translate into the fact that a node of the tree momentarily becomes //a node of interest//. Given a node of interest $f$, we  call the //focus node//, we may compute the distance from any other node $v$ to this focus node $d_T(v, f)$. {{ ::​distance_to_focus.png?​direct&​300|}} ​ + + The combination of these two functions may now be used to define what is called the degree of interest of a node (with respect to a focus node $f$): + + $$+ DOI: V \times V \to \mathbb Z \qquad DOI(v, f) = API(v) - d_T(v, f) = - d_T(v, r) - d_T(v, f) +$$ + + {{::​doi.png?​direct&​300|}} Observe how the values distribute in the tree. Nodes with higher values either are closer to the focus node, or have relatively high a priori importance. + + Next, we need to threshold the DOI values to obtain a partial view of the tree with more details around the focus node. + + ---