RinteRface / argonDash

argon dashboard template
https://rinterface.github.io/argonDash/
138 stars 37 forks source link

Icon not getting displayed inside argonInfoCard #21

Closed tusharmajhi9 closed 4 years ago

tusharmajhi9 commented 5 years ago

Hi,

I am using argonR and argonDash packages version 0.2.0.9000. I am using some argonInfoCards in my Shiny Dashboard.

While stat_icons are getting displayed, the issue is that icons (icon = argonIcon("chart-bar-32"),) are not getting displayedin argonInfoCard.

Here's my code:

library(argonR)
library(argonDash)
library(shiny)

shiny::shinyApp(
  ui = argonDashPage(
    body = argonDashBody(
      argonRow(
        argonInfoCard(
          value = textOutput("ctr_increase"),
          title = "CTR",
          stat = 3.48,
          stat_icon = argonIcon("bold-up"),
          description = "compared to 7 day avg",
          icon = argonIcon("chart-bar-32"),
          hover_lift = TRUE,
          width = 4,
        ),
        argonInfoCard(
          value = "2,356",
          title = "Card Views",
          stat = -3.48,
          stat_icon = argonIcon("bold-down"),
          description = "compared to 7 day avg",
          icon = argonIcon("chart-bar-32"),
          shadow = TRUE,
          width = 4
        ),
        argonInfoCard(
          value = "924",
          title = "Unique Users",
          stat = -1.10,
          stat_icon = argonIcon("bold-down"),
          description = "compared to 7 day avg",
          icon = argonIcon("chart-bar-32"),
          gradient = TRUE,
          background_color = '#DBAE58',
          shadow = TRUE,
          width = 4
        )
      )
    )
  ),
  server = function(input, output) {}
)

And here's the output: image

DivadNojnarg commented 4 years ago

According to the last development version of argonDash, you are missing the icon_background parameter (but that's my fault ;) ):

argonInfoCard(
      value = "350,897", 
      title = "TRAFFIC", 
      stat = 3.48, 
      stat_icon = icon("arrow-up"),
      description = "Since last month", 
      icon = argonIcon("planet"), 
      icon_background = "danger",
      hover_lift = TRUE
    )

I changed the function so that this parameter has a default value. Thanks again!