Shiny

Browser-friendly way of drawing rectangles on top of image R Shiny

扶醉桌前 提交于 2020-01-30 05:44:46
问题 I have written a shiny app that allows the user to draw rectangles on top of an image (minimal reproducible example below). The problem with my current approach is that every time a rectangle is added, a new image is created, written to disk, and rendered (sent to the user's browser). This takes quite some time, and becomes really annoying when the Internet connection is slow. Is there any way to display the rectangles on top of the image directly in the browser , without modifying the image

How to make label and box align next to each other in shiny::numericInput?

一世执手 提交于 2020-01-30 04:55:21
问题 Is it possible to create a numericInput() for shiny where box is next to the label (instead of below it which is the default). Here is a simple example: library(shiny) ui <- shinyUI(fluidPage( titlePanel("Shiny with lots of numericInput()"), sidebarLayout( sidebarPanel( fluidRow( column(6, numericInput("a1", label = "A1", value = 1)), column(6, numericInput("b1", label = "B1", value = 1)) ), fluidRow( column(6, numericInput("a2", label = "A2", value = 2)), column(6, numericInput("b2", label =

used on a smartphone, shiny interactive plot doesn't understand finger movements

五迷三道 提交于 2020-01-29 03:23:12
问题 I have a R-Shiny application with a plot that implements interactive actions: click, hovering (hovering is passing the mouse over the plot, which can be detected by shiny). To give an idea, I post below a simplified shinyapp with the functionnality that is problematic to me, the interactive drawing plot. (it's taken from an old answer of mine here) It's actually working fine, however I need people to use it from their smartphones . The problem: the finger movements we do in the smartphone are

Shiny Slider Input step by month

我的梦境 提交于 2020-01-28 09:20:27
问题 I am writing a shiny and and wanted a slider for the date. The date in my data are monthly and I would like to step forward one month at a time. The docs for the slider input say that the step value is either in second or days depending on the min/max parameter types. Currently I have: sliderInput("slider", "Time", min=as.Date("2005-01-01"), max=as.Date("2014-12-01"), value=as.Date("2005-01-01"), step = 30,...) I want to be able to step by month instead of by day but it doesn't seem possible

Shiny Slider Input step by month

核能气质少年 提交于 2020-01-28 09:20:23
问题 I am writing a shiny and and wanted a slider for the date. The date in my data are monthly and I would like to step forward one month at a time. The docs for the slider input say that the step value is either in second or days depending on the min/max parameter types. Currently I have: sliderInput("slider", "Time", min=as.Date("2005-01-01"), max=as.Date("2014-12-01"), value=as.Date("2005-01-01"), step = 30,...) I want to be able to step by month instead of by day but it doesn't seem possible

Reduce Font Size of datatable in a Flexdashboard

最后都变了- 提交于 2020-01-25 23:39:09
问题 I'm working on a shiny flexdashboard, and one of the elements is a datatable with a lot of columns. Currently the columns are so many that they exceed the width of the app. Instead of adding a scroll bar I would prefer to simply reduce the font used in datatable so that each column will be smaller. Is this possible? 回答1: Found the answer. Needed to wrap renderDataTable in a div. div(renderDataTable(table()),style = "font-size:80%) 来源: https://stackoverflow.com/questions/46534677/reduce-font

get ID of element under cursor in shiny

邮差的信 提交于 2020-01-25 11:59:07
问题 In my Shiny app, the user mouses over some HTML output which consists of several spans, like this: <div id="mydiv"> <span id="span1">foo</span> <span id="span2">bar</span> </div> I want to get the ID of the span which the user is currently mousing over as a shiny input$... I know there are lots of js ways to do it, jquery get element where the cursor is, but I don't know how to integrate with Shiny, e.g. by using shinyjs https://deanattali.com/shinyjs/extend. 回答1: Like this, if I correctly

auto-resize textAreaInput in shiny R

牧云@^-^@ 提交于 2020-01-25 10:19:06
问题 I am trying to adapt this SO answer regarding how to auto-resize a textarea input via javascript for shiny R. Ideally, I want to avoid helper packages such as shinyJS. First I tried a pure javascript implementation in which I load the javascript as is into the app (approach 1). Then I tried triggering the javascript function from an observeEvent within shiny (approach 2). Both approaches are not working. It seems like I am missing something. Approach 1: library(shiny) jsCode1 <- " var observe

how to acheive conditional output based on tab selection in shiny app

[亡魂溺海] 提交于 2020-01-25 09:41:05
问题 I would like to have 2 tabs in the sidebar "otu selection" and "anova". Based on the tab that is selected in the sidebar I would like to output different plots or tables in the main panel. At the moment I am getting an error: ERROR: object 'input.tabs' not found Here is my script. ui <- fluidPage( # Make a title to display in the app titlePanel(" Exploring the Effect of Metarhizium on the Soil and Root Microbiome "), # Make the Sidebar layout sidebarLayout( # Put in the sidebar all the input

Resize absolute panel and text inside it on different screens (Desktop, Laptop, Mobile)

狂风中的少年 提交于 2020-01-25 06:52:33
问题 My shiny application has different absolute panels , but their appearance is different on different screens. In particular, I noticed that the size of the panel and the text inside it, usually present inside h() tags) are always the same, while some widget (as actionButtons) are automatically resized. Here is a minimal reproducible example with an absolutePanel that is supposed to appear in the middle of the screen: library(shiny) ui <- fluidPage( absolutePanel(id = "initial_panel", fixed =