human | R Documentation |
This widget visualizes an SVG-based human body, highlights specific body parts, and displays associated participant data.
human(
gender = c("male", "female"),
organ_df,
select_color = "yellow",
width = NULL,
height = NULL,
elementId = NULL
)
gender |
One of "male" or "female" |
organ_df |
A data.frame with at least an
|
select_color |
The color that should be applied to organs with the "selected" state (activated by clicking the organ and deactivated by clicking again). |
width |
Widget width |
height |
Widget height |
elementId |
ID of the widget |
An object of class human
and class htmlwidget
.
example_organs <- c("brain", "eye", "heart", "stomach", "bladder")
my_organ_df <- subset(shinybody_organs, organ %in% example_organs)
my_organ_df$show <- TRUE
my_organ_df$color <- grDevices::rainbow(nrow(my_organ_df))
my_organ_df$selected[1] <- TRUE
my_organ_df$hovertext <- mapply(
function(o, clr) htmltools::strong(
tools::toTitleCase(o),
style = paste("color:", clr)
),
my_organ_df$organ,
my_organ_df$color,
SIMPLIFY = FALSE
)
human(gender = "female", organ_df = my_organ_df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.