node_aes | R Documentation |
This helper function should be invoked to provide values for the namesake
node_aes
argument, which is present in any function where nodes are
created.
node_aes(
shape = NULL,
style = NULL,
penwidth = NULL,
color = NULL,
fillcolor = NULL,
image = NULL,
fontname = NULL,
fontsize = NULL,
fontcolor = NULL,
peripheries = NULL,
height = NULL,
width = NULL,
x = NULL,
y = NULL,
group = NULL,
tooltip = NULL,
xlabel = NULL,
URL = NULL,
sides = NULL,
orientation = NULL,
skew = NULL,
distortion = NULL,
gradientangle = NULL,
fixedsize = NULL,
labelloc = NULL,
margin = NULL
)
shape |
The shape to use for the node. Some possible |
style |
The node line style. The |
penwidth |
The thickness of the stroke line (in pt units) for the node
shape. The default value is |
color |
The color of the node's outline. Can be any of the named colors
that R knows about (obtained using the |
fillcolor |
The color with which to fill the shape of the node. Can be
any of the named colors that R knows about (obtained using the |
image |
A reference to an image location. |
fontname |
The name of the system font that will be used for any node text. |
fontsize |
The point size of the font used for any node text. |
fontcolor |
The color used for any node text. Can be any of the named
colors that R knows about (obtained using the |
peripheries |
The repeated number of node shapes (of increasing size) to draw at the node periphery. |
height |
The height of the node shape, in inches. The default value is
|
width |
The width of the node shape, in inches. The default value is
|
x |
The fixed position of the node in the x direction. Any integer-based or floating point value will be accepted. |
y |
The fixed position of the node in the y direction. Any integer-based or floating point value will be accepted. |
group |
The node group. |
tooltip |
Text for a node tooltip. |
xlabel |
External label for a node. The label will be placed outside of the node but near it. These labels are added after all nodes and edges have been placed. The labels will be placed so that they do not overlap any node or label. This means it may not be possible to place all of them. |
URL |
A URL to associate with a node. Upon rendering the plot, clicking nodes with any associated URLs will open the URL in the default browser. |
sides |
When using the shape |
orientation |
This is the angle, in degrees, that is used to rotate
nodes that have a |
skew |
A |
distortion |
A distortion factor that is used only when a |
gradientangle |
The path angle for the node color fill gradient. |
fixedsize |
If set to |
labelloc |
Sets the vertical placement of labels for nodes and clusters.
This attribute is used only when the height of the node is larger than the
height of its label. The |
margin |
Sets the amount of space around the node's label. By default,
the value is |
Other aesthetics:
edge_aes()
,
node_edge_aes_data
# Create a new graph and add
# a path with several node
# aesthetic attributes
graph <-
create_graph() %>%
add_path(
n = 3,
type = "path",
node_aes = node_aes(
shape = "circle",
x = c(1, 3, 2),
y = c(4, -1, 3)
)
)
# View the graph's internal
# node data frame; the node
# aesthetic attributes have
# been inserted
graph %>% get_node_df()
# Create a new graph which is
# fully connected
graph <-
create_graph() %>%
add_full_graph(
n = 4,
node_data = node_data(value = 1:4),
node_aes = node_aes(
x = c(2, 1, 3, 2),
y = c(3, 2, 2, 1)
),
edge_aes = edge_aes(color = "blue")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.