如何修复我闪亮的应用程序中的hoverinfo错误?

时间:2019-05-29 01:59:05

标签: r shiny ggplotly

我已经使用ggplot2开发了一个闪亮的应用程序,并进行了绘图,但是,对于我添加为上下限的两条水平线,没有正确显示悬停文本。我想隐藏这两行的悬停文字。有人知道如何实现吗?

我找到了一种解决方案,但不适用于闪亮的
Disable hover information for a specific layer (geom) of plotly

  library(shiny)
    shinyServer(

     function(input,output,session){
       reactivelab <- reactive({
           gg <-labn %>% filter(PARCAT2  == input$Group & LBTEST == 
                 input$Par & SUBJID == input$ID) })    

 output$labpot <- renderPlotly({
     req(nrow(reactivelab()) > 0)
     q <- ggplot(data=reactivelab(),aes(x=ADY, y=AVAL))+
        geom_point()+geom_line()+
        geom_hline(aes(yintercept=ANRLO),linetype="longdash")+
        geom_hline(aes(yintercept=ANRHI),linetype="longdash")+
        ylab("Lab Standard Value") + xlab("Lab Test Day") 
        mm <- style(q,  text =  paste("Lab Parameter:", reactivelab()$PARAM,
                                "<br>Lab Test Day:", reactivelab()$ADY,
                                "<br>Lab Standard Value:", reactivelab()$AVAL,
                                "<br>Normal Range Upper Limit:", reactivelab()$ANRHI,
                                "<br>Normal Range Lower Limit:", reactivelab()$ANRLO

  ), hoverinfo = "text")})

 })

Shiny App 1

Shiny App 2

1 个答案:

答案 0 :(得分:0)

您可以将from sympy import * from sympy.printing.mathml import mathml print(mathml(S=abs(a)*(β-α)^3/6,printer='presentation')) 美学传递给style函数的text,而不使用aes

ggplot