Using custom icon - not part in Font-Awesome/Glyphicons?

2,046 views
Skip to first unread message

Lalas

unread,
May 7, 2015, 6:28:08 PM5/7/15
to shiny-...@googlegroups.com
In shiny dashboard, Is it possible to use one's own icon with the value/info box? I have tried:

valueBox(10 * 2, "New Orders", icon = list(iconUrl="test_green.png"))

as suggested in the "Shiny-Leaflet custom marker icons" discussion, but i got the following error:

Error in tagAssert(icon, type = "i") : 
  Expected an object with class 'shiny.tag'.

 
the icon parameters uses/call the icon function in shiny package, so I guess another way of asking the same question: Is it possible to use custom (one own) icons with the icons function in shiny, and if so, how?

Thanks

Winston Chang

unread,
May 7, 2015, 9:26:45 PM5/7/15
to Lalas, shiny-discuss
Sorry, using a PNG image won't work for a valueBox. The icons used in shinydashboard are characters from special fonts; this is different from the PNG icons used in Leaflet.

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/8ecef264-4e07-4eae-82a9-6ad56ef3816f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lalas

unread,
May 8, 2015, 12:09:28 AM5/8/15
to shiny-...@googlegroups.com, ahmed...@gmail.com
Excuse my poor understanding of this topic. My question is not specific to png, but any other source of icons not part of Font-Awesome/Glyphicons. 

For example, can i use an icon (font) from available at http://fontastic.me/ ? Sorry for giving you the impression that it had to be png.

Thanks

Max Moro

unread,
May 8, 2015, 11:52:06 AM5/8/15
to shiny-...@googlegroups.com
I think you cannot use any image, because the icon command is calling a special set of fonts ( Font-Awesome/Glyphicons).It is  kind of the Wingdings font in windows environment..

Another option you may have is using the html command with the img tag
example:
HTML('<img src="smiley.gif" alt="Smiley face" height="42" width="42">')

Max

Lalas

unread,
May 8, 2015, 3:31:08 PM5/8/15
to shiny-...@googlegroups.com
Thanks for the clarification :)
Reply all
Reply to author
Forward
0 new messages