wdesr_ggplot_graph: Plot an ESR graph.

View source: R/wikidataESR.R

wdesr_ggplot_graphR Documentation

Plot an ESR graph.

Description

A wrapper for ggplot2 to plot graph as returned by wdesr_get_graph.

Usage

wdesr_ggplot_graph(
  df.g,
  layout = igraph::with_kk,
  size = 1,
  node_sizes = c(10, 30),
  label_sizes = c(4, 6),
  node_label = "alias",
  node_type = "text",
  edge_label = TRUE,
  edge_arrow = FALSE,
  arrow_gap = 0.05,
  size_guide = "none",
  legend_position = "right",
  margin_x = 0.2,
  margin_y = 0.03,
  label_wrap = 20
)

Arguments

df.g

A data representing a graph, as returned by wdesr_get_graph.

layout

The layout to use in the graph computing

size

A multiplier of all of the other sizes (default to 1.0)

node_sizes

The size of the nodes, either a single value or a range c(min,max).

label_sizes

The size of the nodes, either a single value or a range c(min,max).

node_label

Define the label for the nodess. Either "alias", "alias_date", "long", or "long_date" (default to "alias").

node_type

Define the type of drawing for the nodes. Either "text", "text_repel", "label", "label_repel", "node" or "none" (default to "text").

edge_label

TRUE to plot dates on edges (default to "TRUE").

edge_arrow

TRUE or arrow object to plot arrow on edges, FALSE otherwise (default to "FALSE").

arrow_gap

A parameter that will shorten the network edges in order to avoid overplotting edge arrows and nodes see fortify.network.

size_guide

TRUE to plot the guide for sizes (default to "FALSE").

legend_position

The position of the legend, "none" to remove (default to "right").

margin_x

The horizontal margins, useful for big nodes (defautl to 0.2).

margin_y

The vertical margins, useful for long node texts (default to 0.03).

label_wrap

The number of charaters to wrap labels (default to 20).

Value

A ggplot2.

Author(s)

Julien Gossa, gossa@unistra.fr

References

See Also

wdesr_clear_cache

Examples

df.aslace <- wdesr_get_graph("Q61716176",c('composante','associƩ'), 1)

wdesr_ggplot_graph(df.alsace,
  node_size = c(10,30), label_sizes = c(3,5), arrow_gap = 0.0,
  node_label = "alias", node_type = "text",
  edge_label = FALSE)

cpesr/wikidataESR documentation built on Sept. 14, 2024, 5:51 a.m.