以上就是给各位分享如何使用shinyapp中的“提醒”功能?,其中也会对app提醒事项进行解释,同时本文还将给你拓展css–ShinyApp中的可折叠盒子、css–如何使Shinyapp中的图像宽度动
以上就是给各位分享如何使用shinyapp中的“提醒”功能?,其中也会对app提醒事项进行解释,同时本文还将给你拓展css – Shiny App中的可折叠盒子、css – 如何使Shiny app中的图像宽度动态变化?、ggplot中的POSIXct轴无法与Shinyapps一起使用?、ios – 有没有办法监控用户的iphone移动,如“提高说话”功能?等相关知识,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!
本文目录一览:- 如何使用shinyapp中的“提醒”功能?(app提醒事项)
- css – Shiny App中的可折叠盒子
- css – 如何使Shiny app中的图像宽度动态变化?
- ggplot中的POSIXct轴无法与Shinyapps一起使用?
- ios – 有没有办法监控用户的iphone移动,如“提高说话”功能?
如何使用shinyapp中的“提醒”功能?(app提醒事项)
如何解决如何使用shinyapp中的“提醒”功能??
example
我要实现图片中的信息框。我检查了他的 HTML 代码,发现他使用了一个名为 alert alert disallowed alert risk 的类。我不知道如何在 Shinyapp 中使用它。 ps:我是HTML外行!这是HTML代码:
<divhttps://www.jb51.cc/tag/dismissible/" target="_blank">dismissible alert-danger">
<button type="button"data-dismiss="alert">×</button>
<h3>Data privacy statement</h3>
<h4>The data you upload will <strong>NOT</strong> be stored,reused,or shared by us in any form.</h4>
</div>
library(shiny)
library(shinythemes)
shinyUI(fluidPage(theme = bs_theme(bootswatch = "lumen",version = 3),titlePanel("XXX"),navbarPage("Let''s get started",tabPanel(icon("home"),fluidRow(
column(8),column(4,## put notifications
h4("Links"),p("XXX",),h4("Contact")
)
)
)
)
)
)
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)
css – Shiny App中的可折叠盒子
library(shiny) # Define UI for application that draws a histogram ui <- fluidPage( includeCSS(path = "AdminLTE.css"),#added includeCSS(path = "shinydashboard.css"),#added # Application title titlePanel("Old Faithful Geyser Data"),# Sidebar with a slider input for number of bins sidebarLayout( sidebarPanel( sliderInput("bins","Number of bins:",min = 1,max = 50,value = 30) ),# Show a plot of the generated distribution mainPanel( Box(plotOutput("distPlot"),solidHeader = T,collapsible = T,title = "collapsible Box not collapsing",status = "primary") ) ) ) # Define server logic required to draw a histogram server <- function(input,output) { output$distPlot <- renderPlot({ # generate bins based on input$bins from ui.R x <- faithful[,2] bins <- seq(min(x),max(x),length.out = input$bins + 1) # draw the histogram with the specified number of bins hist(x,breaks = bins,col = 'darkgray',border = 'white') }) } # Run the application shinyApp(ui = ui,server = server)
结果是
在上图中,单击mininize按钮时,可碰撞框不会折叠.
我在工作目录中添加了addtional AdminLTE.css和shinydashboard.css文件,但问题仍然存在.
解决方法
includeCSS(path = "AdminLTE.css"),#added #add this file and collapsible nature should work. includeScript(path = "app.js"),#
css – 如何使Shiny app中的图像宽度动态变化?
ui.R
library(shiny) shinyUI(bootstrapPage( # Application title titlePanel("Sidebar Image App"),sidebarPanel( imageOutput("image",height = "auto") ) ))
server.R
library(shiny) shinyServer(function(input,output,session) { output$image <- renderImage({ return(list( src = "one.png",contentType = "image/png",height = 185,alt = "Face" )) }) })
解决方法
shinyUI(bootstrapPage( titlePanel("Sidebar Image App"),tags$head(tags$style( type="text/css","#image img {max-width: 100%; width: 100%; height: auto}" )),sidebarPanel( imageOutput("image") ) )),
其中css id selector(此处为#image)应对应于imageOutput的outputId.
ggplot中的POSIXct轴无法与Shinyapps一起使用?
如何解决ggplot中的POSIXct轴无法与Shinyapps一起使用??
我有一个最终可以完全正常运行的应用程序,但似乎仅在本地计算机上运行。除了带有时间轴(POSIXct
格式)的(gg)曲线以外,其他所有东西都在工作。
在Shinyapp中,我会在任何应该出现这种情节的地方收到ERROR: An error has occurred. Check your logs or contact the app author for clarification.
。
日志显示给我:
2020-09-15T05:07:30.176090+00:00 shinyapps[2456573]: 180: func
2020-09-15T05:07:30.176091+00:00 shinyapps[2456573]: 178: f
2020-09-15T05:07:30.176091+00:00 shinyapps[2456573]: 177: Reduce
2020-09-15T05:07:30.176091+00:00 shinyapps[2456573]: 168: do
2020-09-15T05:07:30.176092+00:00 shinyapps[2456573]: 167: hybrid_chain
2020-09-15T05:07:30.176098+00:00 shinyapps[2456573]: 13: rmarkdown::run
2020-09-15T05:07:30.176098+00:00 shinyapps[2456573]: 12: fn
2020-09-15T05:07:30.176106+00:00 shinyapps[2456573]: 7: connect$retry
2020-09-15T05:07:30.176093+00:00 shinyapps[2456573]: 109: drawReactive
2020-09-15T05:07:30.176092+00:00 shinyapps[2456573]: 139: drawPlot
2020-09-15T05:07:30.176092+00:00 shinyapps[2456573]: 125: <reactive:plotObj>
2020-09-15T05:07:30.176107+00:00 shinyapps[2456573]: 6: eval
2020-09-15T05:07:30.176097+00:00 shinyapps[2456573]: 95: output$plot10_2
2020-09-15T05:07:30.176096+00:00 shinyapps[2456573]: 96: origRenderFunc
2020-09-15T05:07:30.176097+00:00 shinyapps[2456573]: 15: <Anonymous>
2020-09-15T05:07:30.274025+00:00 shinyapps[2456573]: 204: pretty.POSIXt
2020-09-15T05:07:30.274053+00:00 shinyapps[2456573]: 199: view_scale_primary
2020-09-15T05:07:30.274026+00:00 shinyapps[2456573]: 202: self$trans$breaks
2020-09-15T05:07:30.274056+00:00 shinyapps[2456573]: 192: f
2020-09-15T05:07:30.274026+00:00 shinyapps[2456573]: 200: scale$get_breaks
2020-09-15T05:07:30.274026+00:00 shinyapps[2456573]: 201: f
2020-09-15T05:07:30.176107+00:00 shinyapps[2456573]: 5: eval
2020-09-15T05:07:30.274054+00:00 shinyapps[2456573]: 198: view_scales_from_scale
2020-09-15T05:07:30.267680+00:00 shinyapps[2456573]: Warnung: Error in seq.int: ''to'' must be a finite number
2020-09-15T05:07:30.274054+00:00 shinyapps[2456573]: 197: f
2020-09-15T05:07:30.274023+00:00 shinyapps[2456573]: 208: seq.POSIXt
2020-09-15T05:07:30.274055+00:00 shinyapps[2456573]: 196: self$coord$setup_panel_params
2020-09-15T05:07:30.274024+00:00 shinyapps[2456573]: 206: seqDtime
2020-09-15T05:07:30.274056+00:00 shinyapps[2456573]: 195: <Anonymous>
2020-09-15T05:07:30.274025+00:00 shinyapps[2456573]: 205: calcSteps
2020-09-15T05:07:30.274056+00:00 shinyapps[2456573]: 194: mapply
2020-09-15T05:07:30.274057+00:00 shinyapps[2456573]: 191: layout$setup_panel_params
2020-09-15T05:07:30.274056+00:00 shinyapps[2456573]: 193: Map
2020-09-15T05:07:30.274057+00:00 shinyapps[2456573]: 190: ggplot_build.ggplot
2020-09-15T05:07:30.274057+00:00 shinyapps[2456573]: 188: print.ggplot
2020-09-15T05:07:30.274059+00:00 shinyapps[2456573]: 109: drawReactive
2020-09-15T05:07:30.274060+00:00 shinyapps[2456573]: 96: origRenderFunc
2020-09-15T05:07:30.274059+00:00 shinyapps[2456573]: 125: <reactive:plotObj>
2020-09-15T05:07:30.274057+00:00 shinyapps[2456573]: 180: func
2020-09-15T05:07:30.274058+00:00 shinyapps[2456573]: 178: f
2020-09-15T05:07:30.274058+00:00 shinyapps[2456573]: 177: Reduce
2020-09-15T05:07:30.274058+00:00 shinyapps[2456573]: 168: do
2020-09-15T05:07:30.274070+00:00 shinyapps[2456573]: 12: fn
2020-09-15T05:07:30.274067+00:00 shinyapps[2456573]: 15: <Anonymous>
2020-09-15T05:07:30.274069+00:00 shinyapps[2456573]: 13: rmarkdown::run
2020-09-15T05:07:30.274058+00:00 shinyapps[2456573]: 167: hybrid_chain
2020-09-15T05:07:30.274060+00:00 shinyapps[2456573]: 95: output$plot10_3
2020-09-15T05:07:30.274059+00:00 shinyapps[2456573]: 139: drawPlot
2020-09-15T05:07:30.274071+00:00 shinyapps[2456573]: 6: eval
2020-09-15T05:07:30.274070+00:00 shinyapps[2456573]: 7: connect$retry
2020-09-15T05:07:30.274071+00:00 shinyapps[2456573]: 5: eval
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)
ios – 有没有办法监控用户的iphone移动,如“提高说话”功能?
添加更具体的要求:
当用户将手机放在耳边时,我想让屏幕变暗.我知道可以启用接近传感器来实现这一点.但令人讨厌的是,当用户将手指移到传感器上时,屏幕会不时变暗.所以我想知道如何避免这种情况,只有当用户抬起iphone说话时才会使屏幕变暗?
解决方法
>启用它:
UIDevice *device = [UIDevice currentDevice]; device.proximityMonitoringEnabled = YES;
>检查是否成功启用;如果成功,请遵守UIDeviceProximityStateDidChangeNotification
通知;如果没有,您的设备可能无法使用:
if (device.proximityMonitoringEnabled) { [[NSNotificationCenter defaultCenter] addobserver:self selector:@selector(handleProximityChange:) name:UIDeviceProximityStateDidChangeNotification object:nil]; } else { // device not capable }
>并编写你的选择器:
- (void)handleProximityChange:(NSNotification *)notification { NSLog(@"%s proximityState=%d",__FUNCTION__,[[UIDevice currentDevice] proximityState]); }
为了检测用户是否将其握在脸上,我可能会将接近传感器与cmmotionmanager结合并查看重力属性,看看他们是否几乎垂直握住手机.因此,定义一些类属性:
@property (nonatomic,strong) cmmotionmanager *motionManager; @property (nonatomic,strong) NSOperationQueue *deviceQueue;
然后您可以启动cmmotionmanager,查找设备是否处于垂直位置:
self.deviceQueue = [[NSOperationQueue alloc] init]; self.motionManager = [[cmmotionmanager alloc] init]; self.motionManager.deviceMotionUpdateInterval = 5.0 / 60.0; UIDevice *device = [UIDevice currentDevice]; [self.motionManager startDeviceMotionUpdatesUsingReferenceFrame:CMAttitudeReferenceFrameXArbitraryZVertical toQueue:self.deviceQueue withHandler:^(CMDeviceMotion *motion,NSError *error) { BOOL vertical = (motion.gravity.z > -0.4 && motion.gravity.z < 0.4 & motion.gravity.y < -0.7); if ((vertical && !device.proximityMonitoringEnabled) || (!vertical && device.proximityMonitoringEnabled)) { device.proximityMonitoringEnabled = vertical; } }];
这些重力阈值是否有意义是有点主观的.您也可以,而不是仅仅查看手机是否大致垂直握持,查看其他加速度计数据(例如,他们是否提升了对象).似乎有很多方法可以给猫皮肤.
关于如何使用shinyapp中的“提醒”功能?和app提醒事项的介绍现已完结,谢谢您的耐心阅读,如果想了解更多关于css – Shiny App中的可折叠盒子、css – 如何使Shiny app中的图像宽度动态变化?、ggplot中的POSIXct轴无法与Shinyapps一起使用?、ios – 有没有办法监控用户的iphone移动,如“提高说话”功能?的相关知识,请在本站寻找。
本文标签: