hubverse-org / hubVis

Plotting methods for hub model outputs
https://hubverse-org.github.io/hubVis/
Other
3 stars 0 forks source link

interactive vis does not respect the `group` argument #32

Closed elray1 closed 4 months ago

elray1 commented 4 months ago

Working with data from hubExamples, the following code produces a static plot that looks as expected:

library(dplyr)
library(hubExamples)
library(hubVis)

plot_step_ahead_model_output(
    model_output_data = forecast_outputs |> filter(output_type %in% c("quantile", "median")),
    target_data = forecast_target_ts |>
        filter(location %in% c("25", "48"),
               date >= "2022-10-01", date <= "2023-04-01"),
    use_median_as_point = TRUE,
    x_col_name = "target_end_date",
    intervals = c(0.5, 0.8, 0.9),
    facet = "location",
    group = "reference_date",
   interactive = FALSE
)

image

However, if we set interactive = TRUE, forecasts from different reference dates are connected:

plot_step_ahead_model_output(
    model_output_data = forecast_outputs |> filter(output_type %in% c("quantile", "median")),
    target_data = forecast_target_ts |>
        filter(location %in% c("25", "48"),
               date >= "2022-10-01", date <= "2023-04-01"),
    use_median_as_point = TRUE,
    x_col_name = "target_end_date",
    intervals = c(0.5, 0.8, 0.9),
    facet = "location",
    group = "reference_date",
   interactive = TRUE
)
Screenshot 2024-04-25 at 4 43 12 PM
LucieContamin commented 4 months ago

It's an ongoing issue (see #16). The group parameter documentation should say that it is only currently available for "static" plot. I can make it more visible, but as it's a temporary issue I was not sure it was necessary.

elray1 commented 4 months ago

Thanks, i didn't realize that this was already covered in that other issue. I'll close this issue as a duplicate of that one.