appsilon / shiny.emptystate Goto Github PK
View Code? Open in Web Editor NEWEmpty state components for Shiny
Home Page: https://appsilon.github.io/shiny.emptystate/
Empty state components for Shiny
Home Page: https://appsilon.github.io/shiny.emptystate/
Description: We want to provide use cases of the package, examples that come to mind:
Task Description:
shiny.emptystate
package.Acceptance Criteria:
Description: Create a package skeleton using devtools::create
for example.
When showing empty state content, the user might be resizing the window. Whenever the window resizes we need to update the empty state container so that it overlays the widget it is supposed to replace.
0.0.0.9002
Windows
No response
Placeholder doesn't follow the component it's supposed to cover when programatically changing it's location.
Toggle panel
buttonWhen #container1
is hidden #container2
slides into its place with a placeholder instead of sliding from underneath the placeholder.
library(shiny)
library(shiny.emptystate)
library(bslib)
ui <- page(
theme = bs_theme(version = 5),
use_empty_state(),
tags$button(
"Toggle panel",
class = "btn btn-primary",
onClick = "$('#container1').toggle(anim = 'slide');"
),
div(
style = "width: 300px",
class = "d-flex flex-column gap-5",
div(
id = "container1",
div(
h1("Card 1"),
"Card content"
)
),
div(
id = "container2",
div(
h1("Card 2"),
"Card content"
)
)
)
)
server <- function(input, output, session) {
empty_state_content <- div(
"This is example empty state content"
)
empty_state_manager <- EmptyStateManager$new(
id = "container2",
html_content = empty_state_content
)
empty_state_manager$show()
}
shinyApp(ui, server)
No response
0.0.0.9000
macOS M2 13.0.1
No response
While running the example in the main readme and clicking the Show empty state!
multiple times the Hide empty state!
does not work until the number of clicks exceeds the # of clicks made on the Show empty state!
Show empty state!
2 or more timesHide empty state!
to try to hide it.Hide empty state!
multiple timesEvery call of the show()
method should show the empty state UI and every call of the hide()
method should hide the empty state UI
No response
No response
No response
Write a draft of a blogpost about the release of the package. It should include a general overview and some examples of usage. It does not need to be long but needs to be in a state where marketing can use it.
Users of the package gave feedback that the mechanism works but they are missing a set of defaults components.
Having a set of default components would make it easier to start using the package.
One idea is to provide a helper function that will create an empty state component composed of an icon and text.
The icons can be provided by bsicons or fontawesome.
A good analogy is how value boxes work in bslib
1.0
Tested in Windows and Google Chrome
No response
I wanted to use a modal when the empty state content is shown
library(shiny)
library(shiny.emptystate)
ui <- fluidPage(
use_empty_state(),
actionButton("show", "Show empty state!"),
actionButton("hide", "Hide empty state!"),
actionButton("modal", "Show modal"),
tableOutput("my_table")
)
server <- function(input, output, session) {
empty_state_content <- div(
"This is example empty state content"
)
empty_state_manager <- EmptyStateManager$new(
id = "my_table",
html_content = empty_state_content
)
observeEvent(input$show, empty_state_manager$show())
observeEvent(input$hide, empty_state_manager$hide())
observeEvent(input$modal, {
showModal(modalDialog(title = "Hello from modal"))
})
output$my_table <- renderTable(mtcars)
}
shinyApp(ui, server)
The modal shoul be over the empty state content
No response
No response
It seems to be that the problem is here:
shiny.emptystate/inst/emptystate.css
Lines 8 to 10 in 9963c95
But I don't know what would be the best solution for it ๐ค
As part of an effort to provide users with default components, we want to provide a tutorial on how to use a custom illustration in empty state components.
Examples of services that offer illustrations are https://www.drawkit.com/ and https://undraw.co/illustrations.
Important: Check license details of those services e.g. undraw does not permit redistributing their illustrations, so we can only describe how to use them, not include copies of them within the package.
0.0.0.9000
Windows 10
No response
When using the example app from the Readme with the EmptyStateManager
, it seems that the state is not a binary state but an integer state. That means, that if I click three times on "Show empty state!", I need to click four times on "Hide empty state!".
Use the app:
library(shiny)
library(shiny.emptystate)
library(reactable)
ui <- fluidPage(
use_empty_state(),
actionButton("show", "Show empty state!"),
actionButton("hide", "Hide empty state!"),
reactableOutput("my_table")
)
server <- function(input, output, session) {
empty_state_content <- div(
"This is example empty state content"
)
empty_state_manager <- EmptyStateManager$new(
id = "my_table",
html_content = empty_state_content
)
observeEvent(input$show, {
empty_state_manager$show()
})
observeEvent(input$hide, {
empty_state_manager$hide()
})
output$my_table <- reactable::renderReactable({
reactable(iris)
})
}
shinyApp(ui, server)
Click a couple of times on "Show empty state!" and now try to hide the empty state again.
When clicking Hide Empty State I expect to hide the empty state regardless of how many times I have clicked on "Show Empty State"
No response
No response
No response
Fill in missing parts of the functions/classes/methods documentation
Build the documentation with roxygen2
.
Add a "condition" argument to empty_state_manager (potentially) to allow for adding a javascript condition that will show or hide the empty state.
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.
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.