Highlight edges connected to a node or nodes
Source:R/jamenrich-highlights.R
highlight_edges_by_node.Rd
Highlight edges connected to a node or nodes
Usage
highlight_edges_by_node(
g,
node = NULL,
highlight_color = "royalblue3",
highlight_width = NULL,
highlight_cex = 2,
nonhighlight_alpha = NULL,
...
)
Arguments
- g
igraph
object- node
character
node name, orinteger
node index.- highlight_color
character
color used for highlighting, default 'royalblue'.- highlight_width
numeric
default NULL, set a fixed edge width.- highlight_cex
numeric
default 2, multiplies the edge width by this expansion factor.- nonhighlight_alpha
numeric
default NULL, applies an optional alpha transparency to non-highlighted edges. Values must be between 0 (transparent) and 1 (opaque), where a value 0.5 is recommended when used.- ...
additional arguments are ignored.
Details
This function highlights edges connected to one of more nodes by applying a color, and adjusting the edge width.
Note that when edge attributes 'width' and 'color' are not yet
defined in the igraph
object, they will be defined and stored
into the object by using default_igraph_values()
.
For example: default_igraph_values()$edge$width
and
default_igraph_values()$edge$color
.
See also
Other jam igraph functions:
cnet2df()
,
cnet2im()
,
cnetplotJam()
,
cnetplot_internalJam()
,
color_edges_by_nodegroups()
,
color_edges_by_nodes()
,
color_edges_by_nodes_deprecated()
,
color_nodes_by_nodegroups()
,
communities2nodegroups()
,
drawEllipse()
,
edge_bundle_bipartite()
,
edge_bundle_nodegroups()
,
enrichMapJam()
,
fixSetLabels()
,
flip_edges()
,
get_bipartite_nodeset()
,
igraph2pieGraph()
,
jam_igraph()
,
jam_plot_igraph()
,
label_communities()
,
layout_with_qfr()
,
layout_with_qfrf()
,
mem2emap()
,
memIM2cnet()
,
mem_multienrichplot()
,
nodegroups2communities()
,
rectifyPiegraph()
,
relayout_with_qfr()
,
removeIgraphBlanks()
,
removeIgraphSinglets()
,
reorderIgraphNodes()
,
rotate_igraph_layout()
,
spread_igraph_labels()
,
subgraph_jam()
,
subsetCnetIgraph()
,
subset_igraph_components()
,
sync_igraph_communities()
,
with_qfr()
Examples
cnet1 <- make_cnet_test(seed=1);
# highlight edges by node
cnet1h <- highlight_edges_by_node(cnet1, "CA", nonhighlight_alpha=0.5)
# plot the original
jam_igraph(cnet1, node_factor=2, label_factor=2)
# plot the highlighted variant
jam_igraph(cnet1h, node_factor=2, label_factor=2, label_dist_factor=3)
# highlight edges using nodeset
nodesets <- get_cnet_nodeset(cnet1)
cnet1hns <- highlight_edges_by_node(cnet1,
nodesets[[grep("CA", nodesets)]],
nonhighlight_alpha=0.5)
jam_igraph(cnet1hns, node_factor=2, label_factor=2, label_dist_factor=3,
mark.groups=unname(nodesets[grep("CA", nodesets)]))