A hoverbox is a box of text that shows up when the cursor hovers over something. These can be useful when making interactive network plots of the HPO phenotypes because we can include a hoverbox that gives information and data associated with each phenotype.
add_hoverboxes(
g,
columns = get_graph_colnames(g),
hoverbox_column = c("hover", "title", "label"),
width = 60,
digits = 3,
decorators = c("<b>", "</b>"),
as_html = TRUE,
force_new = FALSE
)
tbl_graph object.
Character vector of column names to include in the hoverbox.
Name of the new hoverbox column to add.
Positive integer giving target line width (in number of characters). A width less than or equal to 1 will put each word on its own line.
integer indicating the number of decimal places
(round
) or significant digits (signif
) to be used.
For round
, negative values are allowed (see ‘Details’).
Left and right decorators to add to the hoverbox titles.
Provide the hoverbox in HTML format.
Add the data again even if the associated column already exists.
tidygraph with additional metadata column named "hover".
ont <- get_ontology("hp")
#> Loading cached ontology: /github/home/.cache/R/KGExplorer/hp.rds
g <- ontology_to(ont, to="tbl_graph")
#> Translating ontology terms to ids.
#> Converted ontology to: tbl_graph
g2 <- add_hoverboxes(g)
#> Making hoverboxes from: 'name', 'short_id', 'label', 'namespace', 'definition', 'IC', 'depth', 'n_children', 'n_ancestors', 'n_parents', 'n_offspring', 'n_connected_leaves', 'ancestor', 'ancestor_name', 'n_edges', 'ontLvl'
#> Adding hoverboxes to data.table.