shiny.emptystate icon indicating copy to clipboard operation
shiny.emptystate copied to clipboard

[Feature]: support for javascript condition check

Open erikrenz88 opened this issue 2 years ago • 0 comments

Guidelines

  • [X] I agree to follow this project's Contributing Guidelines.

Description

Add a "condition" argument to empty_state_manager (potentially) to allow for adding a javascript condition that will show or hide the empty state.

Problem

There is not a standard way I've seen to currently have a spinner or loading screen connected to a loading screen unless a conditionalPanel is used with javascript in the condition. While other spinner packages exist, it is difficult to customize this without using a conditionalPanel or being forced to use limited spinner options. In particular, I'd like to use the shiny.fluent Spinner() while my dataset loads but I can't attach this to the "shiny-busy" class within the javascript.

Proposed Solution

Add a condition argument to allow for users to show/hide the empty state based on javascript elements (in particular, shiny-busy). Similar to "condition" of conditionalPanel.

Alternatives Considered

I've tried using a conditionalPanel in a fluidPage in a module and then add this to my main fluentPage similar to the dashboard tutorial on the shiny.fluent side, but there seems to be a disconnect when trying to mix these UI states. I also thought about using a counter value in a reactiveValues and watching for the counter to increase (change) which would occur once the dataset is pulled into the reactiveValues variable but it feels like this is a more crude work around to actually monitoring whether shiny is busy.

erikrenz88 avatar Sep 08 '23 17:09 erikrenz88