File: layout_tbl_graph_treemap.Rd

package info (click to toggle)
r-cran-ggraph 2.2.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,832 kB
  • sloc: cpp: 1,630; makefile: 2
file content (111 lines) | stat: -rw-r--r-- 4,353 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/layout_treemap.R
\name{layout_tbl_graph_treemap}
\alias{layout_tbl_graph_treemap}
\title{Calculate nodes as rectangles subdividing that of their parent}
\usage{
layout_tbl_graph_treemap(
  graph,
  algorithm = "split",
  weight = NULL,
  circular = FALSE,
  sort.by = NULL,
  direction = "out",
  height = 1,
  width = 1
)
}
\arguments{
\item{graph}{A \code{tbl_graph} object}

\item{algorithm}{The name of the tiling algorithm to use. Defaults to 'split'}

\item{weight}{An optional node variable to use as weight. Will only affect
the weight of leaf nodes as the weight of non-leaf nodes are derived from
their children.}

\item{circular}{Logical. Should the layout be transformed to a circular
representation. Ignored.}

\item{sort.by}{The name of a node variables to sort the nodes by.}

\item{direction}{The direction of the tree in the graph. \code{'out'} (default)
means that parents point towards their children, while \code{'in'} means that
children point towards their parent.}

\item{height}{The height of the bounding rectangle}

\item{width}{The width of the bounding rectangle}
}
\value{
A data.frame with the columns \code{x}, \code{y}, \code{width},
\code{height}, \code{leaf}, \code{depth}, \code{circular} as well as any
information stored as node variables in the tbl_graph object.
}
\description{
A treemap is a space filling hierarchical layout that maps nodes to
rectangles. The rectangles of the children of a node is packed into the
rectangle of the node so that the size of a rectangle is a function of the
size of the children. The size of the leaf nodes can be mapped arbitrarily
(defaults to 1). Many different algorithms exists for dividing a rectangle
into smaller bits, some optimizing the aspect ratio and some focusing on the
ordering of the rectangles. See details for more discussions on this. The
treemap layout was first developed by Ben Shneiderman for visualizing disk
usage in the early '90 and has seen many improvements since.
}
\details{
Different approaches to dividing the rectangles in a treemap exists; all with
their strengths and weaknesses. Currently only the split algorithm is
implemented which strikes a good balance between aspect ratio and order
preservation, but other, more well-known, algorithms such as squarify and
slice-and-dice will eventually be implemented.

\strong{Algorithms}

\emph{Split} (default)

The Split algorithm was developed by Bjorn Engdahl in order to address the
downsides of both the original slice-and-dice algorithm (poor aspect ratio)
and the popular squarify algorithm (no ordering of nodes). It works by
finding the best cut in the ordered list of children in terms of making sure
that the two rectangles associated with the split will have optimal aspect
ratio.
}
\note{
Treemap is a layout intended for trees, that is, graphs where nodes
only have one parent and zero or more children. If the provided graph does
not fit this format an attempt to convert it to such a format will be made.
}
\references{
Engdahl, B. (2005). \emph{Ordered and unordered treemap algorithms and their
applications on handheld devices}. Master's Degree Project.

Johnson, B., & Ben Shneiderman. (1991). \emph{Tree maps: A Space-Filling
Approach to the Visualization of Hierarchical Information Structures}. IEEE
Visualization, 284-291. \doi{10.1109/VISUAL.1991.175815}
}
\seealso{
Other layout_tbl_graph_*: 
\code{\link{layout_tbl_graph_auto}()},
\code{\link{layout_tbl_graph_backbone}()},
\code{\link{layout_tbl_graph_cactustree}()},
\code{\link{layout_tbl_graph_centrality}()},
\code{\link{layout_tbl_graph_circlepack}()},
\code{\link{layout_tbl_graph_dendrogram}()},
\code{\link{layout_tbl_graph_eigen}()},
\code{\link{layout_tbl_graph_fabric}()},
\code{\link{layout_tbl_graph_focus}()},
\code{\link{layout_tbl_graph_hive}()},
\code{\link{layout_tbl_graph_htree}()},
\code{\link{layout_tbl_graph_igraph}()},
\code{\link{layout_tbl_graph_linear}()},
\code{\link{layout_tbl_graph_manual}()},
\code{\link{layout_tbl_graph_matrix}()},
\code{\link{layout_tbl_graph_metro}()},
\code{\link{layout_tbl_graph_partition}()},
\code{\link{layout_tbl_graph_pmds}()},
\code{\link{layout_tbl_graph_sf}()},
\code{\link{layout_tbl_graph_stress}()},
\code{\link{layout_tbl_graph_unrooted}()}
}
\concept{layout_tbl_graph_*}