| girafe_class | R Documentation |
These functions allow programmatic manipulation of CSS classes
on SVG elements within a girafe output in Shiny applications.
Elements are targeted by their data-id, key-id, or theme-id
attributes.
girafe_class_add(
session,
id,
class,
data_id = NULL,
key_id = NULL,
theme_id = NULL
)
girafe_class_remove(
session,
id,
class,
data_id = NULL,
key_id = NULL,
theme_id = NULL
)
girafe_class_toggle(
session,
id,
class,
data_id = NULL,
key_id = NULL,
theme_id = NULL
)
session |
The Shiny session object. |
id |
The output id of the girafe element
(the |
class |
A non-empty character string of CSS class names to add, remove, or toggle. |
data_id |
A character vector of |
key_id |
A character vector of |
theme_id |
A character vector of |
At least one of data_id, key_id, or theme_id must be provided.
These functions send a custom message to the JavaScript side, which applies the CSS class operation to all matching SVG elements within the girafe root node.
## Not run:
# In a Shiny server function:
girafe_class_add(session, "plot", "highlighted", data_id = "some_id")
girafe_class_remove(session, "plot", "highlighted", data_id = "some_id")
girafe_class_toggle(session, "plot", "highlighted", data_id = "some_id")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.