shinymaterial | Install CRAN version : install | Build Tool library
kandi X-RAY | shinymaterial Summary
kandi X-RAY | shinymaterial Summary
Install CRAN version: install.packages("shinymaterial").
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of shinymaterial
shinymaterial Key Features
shinymaterial Examples and Code Snippets
Community Discussions
Trending Discussions on shinymaterial
QUESTION
I have several applications that I am attempting to port from shinydashboard to shinymaterial, due to the nice aesthetics that my users seem to enjoy. I am facing an issue with searching/filtering factors in the shinymaterial dashboards where the "x" button that normally clears factor filtering is NOT present when using shinymaterial.
shinydashboard screenshot where the "filter clearing" button for the factor column is present: shinydashboard screenshot
shinymaterial screenshot where there is no "filter clearing" button for the factor column: shinymaterial screenshot
Here are my reproducible code examples:
shinydashboard
...ANSWER
Answered 2021-Jan-26 at 08:52That's because this "button" actually is a glyphicon icon. The glyphicon icons are included in bootstrap, which is automatically loaded when you use an ordinary Shiny page, but not when you use 'shinymaterial'. So you have to add a link to bootstrap-glyphicons.css:
QUESTION
I'm using the shinymaterial
R package to make a shiny
app and would like to be able to swap tabs programmatically. From this pull request I made the following reprex but I can't get the functionality to work.
How can I adapt the below example to change tabs programmatically using shinymaterial
?
ANSWER
Answered 2020-Oct-03 at 12:31library(shiny)
library(shinymaterial)
js <- "
$(document).on('shiny:connected', function() {
Shiny.addCustomMessageHandler('selectTab', function(tab) {
var tabs = document.querySelector('ul.tabs');
var instance = M.Tabs.getInstance(tabs);
instance.select(tab);
});
});
"
ui <- material_page(
tags$head(tags$script(HTML(js))),
title = NULL,
# Define tabs
material_tabs(
tabs = c(
"First Tab" = "first_tab",
"Second Tab" = "second_tab",
"Third Tab" = "third_tab"
)
),
# Define tab content
material_tab_content(
tab_id = "first_tab",
tags$h1("First Tab Content"),
material_button("btn1", "Go to tab 2")
),
material_tab_content(
tab_id = "second_tab",
tags$h1("Second Tab Content"),
material_button("btn2", "Go to tab 3")
),
material_tab_content(
tab_id = "third_tab",
tags$h1("Third Tab Content"),
material_button("btn3", "Go to tab 1")
)
)
server <- function(input, output, session) {
observeEvent(input[["btn1"]], {
session$sendCustomMessage("selectTab", "second_tab")
}, ignoreInit = TRUE)
observeEvent(input[["btn2"]], {
session$sendCustomMessage("selectTab", "third_tab")
}, ignoreInit = TRUE)
observeEvent(input[["btn3"]], {
session$sendCustomMessage("selectTab", "first_tab")
}, ignoreInit = TRUE)
}
shinyApp(ui = ui, server = server)
QUESTION
Using the shinymaterial
package, I'm attempting to check if a tab is active in an observer and "do something" i.e. print("Hello")
in below example. The tabs in shinymaterial::material_tabs()
do not have a shiny inputId associated with them, simply an href with class = "active"
if the tab is open.
Below is my feeble attempt of trying this with the shinyjs
package:
Reprex:
...ANSWER
Answered 2020-Oct-02 at 08:10There's probably an event triggered when the active tab changes but I'm not familiar with this package and I don't know.
Below is a solution using a MutationObserver (it does not use shinyjs
).
QUESTION
I wish to implement formatCurrency()
and formatPercentage()
(both from DT package) across multiple columns simultaneously in a shiny dashboard. I am using shinymaterial for the given example.
I am currently doing the following:
...ANSWER
Answered 2018-Nov-09 at 14:30Try:
QUESTION
I'm trying to scaffold together a basic dashboard using the shinymaterial
package (https://ericrayanderson.github.io/shinymaterial/) but having a slight issue where my dropdown menus (usually selectInput
in regular shiny apps) don't show up in a nested UI module.
There should be two dropdown menus above the "Settings" button in this screenshot:
Here's the code snippet for my scaffolding so far:
...ANSWER
Answered 2018-Sep-27 at 21:21There are at least two issues here.
1. material_dropdown does not display (resolved)This appears to be due to the unused width = 100%
option inside material_dropdown()
. Removing this results in some of the drop downs displaying and all of the labels displaying.
Having two consecutive material_dropdown
's results in only the first drop down displaying, even though both labels display. There have been previous bugs with material_dropdown
in the shinymaterial
package so this could be part of a related issue.
Here is the code following my exploration:
QUESTION
The shinymaterial
package includes a function called material_parallax()
which allows for a pretty parallax effect on images while scrolling. The only parameter of the function is image_source
. I'd like to change the height of this parallax box in my app.
Is it possible (using custom css or otherwise) to change the height of material_parallax()
so it takes up less vertical space?
Example:
...ANSWER
Answered 2018-Aug-17 at 12:35You can use this css:
QUESTION
I'm working with a package in R called shinymaterial
, which allows me to build R Shiny apps with material design elements. One element that I need to use is a group of checkboxes based on data uploaded by the user. However, the shinymaterial
package has not yet implemented checkbox groups, only singular checkboxes. Unfortunately, it has masked the use of stock R shiny checkbox groups in the process, so I cannot simply fall back on those.
My best guess at a solution is to write a function that can programmatically generate a series of singular checkboxes based on an input vector of labels. What should I use in order to do that? Or is there a totally different approach that might work instead?
My attempt at a solution is to write a function that builds a string containing the commands for several singular checkboxes (mainly using paste0
and a for
loop). I planned on simply converting that string to an expression and then eval
ing it. However, when I did that (example code below), the Shiny web page just renders the text of the command rather than executing it as a UI element.
ANSWER
Answered 2018-Jun-14 at 21:06The eval(parse(...))
construct works fine. Let the output of materialCheckboxGroupGen
be a vector (like the out
object below), then use eval(parse(...))
. Here's a minimal working example:
QUESTION
I am working on something where I need a floating button in shinydashboard. Below is a code to get a floating button using shinyMaterial package.
...ANSWER
Answered 2018-Mar-07 at 14:08Just use an actionButton
in a fixedPanel
instead.
QUESTION
I would like to open a html link when I click on a button, a "material button" from the shinymaterial package
...ANSWER
Answered 2017-May-19 at 09:07As it seems it cant be passed as an argument for the materialButton()
so instead you could add it yourself via javascript:
Find the element by Id and add an onlick
listener.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install shinymaterial
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page