Skip to content

Commit 620f74f

Browse files
committed
chore: remove subject selection tooltip
1 parent 0613aea commit 620f74f

File tree

1 file changed

+1
-35
lines changed

1 file changed

+1
-35
lines changed

R/tm_p_swimlane.R

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,7 @@ ui_p_swimlane <- function(id, height) {
137137
selectInput(ns("group_var"), label = "Group by:", choices = NULL, selected = NULL, multiple = FALSE),
138138
selectInput(ns("sort_var"), label = "Sort by:", choices = NULL, selected = NULL, multiple = FALSE),
139139
colour_picker_ui(ns("colors")),
140-
sliderInput(ns("plot_height"), "Plot Height (px)", height[2], height[3], height[1]),
141-
selectInput(ns("subjects"), "Subjects", choices = NULL, selected = NULL, multiple = TRUE),
142-
actionButton(ns("subject_tooltips"), "Show Subject Tooltips")
140+
sliderInput(ns("plot_height"), "Plot Height (px)", height[2], height[3], height[1])
143141
),
144142
tags$div(
145143
bslib::card(
@@ -341,25 +339,6 @@ srv_p_swimlane <- function(id,
341339
plotly::event_data("plotly_selected", source = "swimlane")
342340
})
343341

344-
observeEvent(input$subject_tooltips, {
345-
hovervalues <- data()[[plot_dataname]] |>
346-
dplyr::mutate(customdata = dplyr::row_number()) |>
347-
dplyr::filter(!!rlang::sym(input$subject_var) %in% input$subjects) |>
348-
dplyr::pull(customdata)
349-
350-
351-
hovertips <- plotly_data() |>
352-
dplyr::filter(customdata %in% hovervalues)
353-
354-
session$sendCustomMessage(
355-
"triggerTooltips",
356-
list(
357-
plotID = session$ns("plot"),
358-
tooltipPoints = jsonlite::toJSON(hovertips)
359-
)
360-
)
361-
})
362-
363342
tables_selected_q <- .plotly_selected_filter_children(
364343
data = plotly_q,
365344
plot_dataname = plot_dataname,
@@ -369,19 +348,6 @@ srv_p_swimlane <- function(id,
369348
children_datanames = table_datanames
370349
)
371350

372-
373-
observeEvent(data(), {
374-
if (class(subject_var) == "choices_selected") {
375-
subject_col <- subject_var$selected
376-
} else {
377-
subject_col <- subject_var
378-
}
379-
updateSelectInput(
380-
inputId = "subjects",
381-
choices = data()[[plot_dataname]][[subject_col]]
382-
)
383-
})
384-
385351
srv_t_reactables(
386352
"subtables",
387353
data = tables_selected_q,

0 commit comments

Comments
 (0)