| Title: | Sunburst 'HTML' Widget Based on 'd3.js' |
|---|---|
| Description: | Provides a sunburst plot based on the 'd3.js' library as an HTML 'Shiny' widget. |
| Authors: | Kamil Foltyński [aut, cre] |
| Maintainer: | Kamil Foltyński <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.5.0 |
| Built: | 2026-05-25 08:10:25 UTC |
| Source: | https://github.com/tazovsky/sunburstshinywidget |
Add Remain and Diff Columns to a Data Frame
add_remain_and_diff_cols(btns_df, totalPathways)add_remain_and_diff_cols(btns_df, totalPathways)
btns_df |
A data frame with a |
totalPathways |
A numeric value for the total number of pathways. |
A data frame with formatted Remain and Diff columns.
See: https://deanattali.com/blog/htmlwidgets-tips/
callJS()callJS()
id
Create a Colored Action Button
customActionButton(inputId, label, color, font_size = "10px")customActionButton(inputId, label, color, font_size = "10px")
inputId |
The input slot for the button. |
label |
The button label. |
color |
A CSS color string for the button background. |
font_size |
A CSS font size string. |
A shiny::actionButton with custom styling.
Sends a custom message to the sunburst widget to retrieve pathway group data.
getPathwayGroupDatatable(id, pathwayAnalysisDTO, pathLength)getPathwayGroupDatatable(id, pathwayAnalysisDTO, pathLength)
id |
The namespaced widget output ID. |
pathwayAnalysisDTO |
A list containing the pathway analysis data. |
pathLength |
An integer specifying the pathway length. |
The widget element ID (invisibly).
Match Event Names to Colors
match_color(x, eventCodes)match_color(x, eventCodes)
x |
A character string of comma-separated event names. |
eventCodes |
A data frame with |
A character string of HTML action buttons.
Launches an example Shiny application that demonstrates the sunburst widget.
run_app(...)run_app(...)
... |
Additional arguments passed to |
This function does not return; it runs the Shiny app.
Creates an interactive sunburst plot as an HTML widget.
sunburstShinyWidget( data, design, width = NULL, height = NULL, elementId = NULL )sunburstShinyWidget( data, design, width = NULL, height = NULL, elementId = NULL )
data |
A list containing the chart data. |
design |
A list containing the design configuration. |
width |
Widget width (a valid CSS unit or a number). |
height |
Widget height (a valid CSS unit or a number). |
elementId |
An optional element ID for the widget. |
An htmlwidget object.
Output and render functions for using sunburstShinyWidget within Shiny applications and interactive Rmd documents.
sunburstShinyWidgetOutput(outputId, width = "100%", height = "400px") renderSunburstShinyWidget(expr, env = parent.frame(), quoted = FALSE)sunburstShinyWidgetOutput(outputId, width = "100%", height = "400px") renderSunburstShinyWidget(expr, env = parent.frame(), quoted = FALSE)
outputId |
output variable to read from |
width, height
|
Must be a valid CSS unit (like |
expr |
An expression that generates a sunburstShinyWidget |
env |
The environment in which to evaluate |
quoted |
Is |
Sunburst Shiny Module UI
Sunburst Shiny Module Server
sunburstUI(id) sunburstServer( id, chartData, design, btn_font_size = "14px", show_colors_in_table = FALSE, steps_table_export_name = reactive(NULL), n_steps = reactive(5L) )sunburstUI(id) sunburstServer( id, chartData, design, btn_font_size = "14px", show_colors_in_table = FALSE, steps_table_export_name = reactive(NULL), n_steps = reactive(5L) )
id |
A character string for the module namespace. |
chartData |
A list containing chart data including event codes and cohort pathways. |
design |
A list containing design configuration for the sunburst plot. |
btn_font_size |
A character string for action button font size. |
show_colors_in_table |
Logical; if |
steps_table_export_name |
A reactive returning a custom export filename,
or |
n_steps |
A reactive returning the number of pathway steps to display. |
A tagList containing the sunburst UI elements.
A Shiny module server function.