Book Image

Learning Shiny

By : Hernan Resnizky
Book Image

Learning Shiny

By: Hernan Resnizky

Overview of this book

Table of Contents (19 chapters)
Learning Shiny
Credits
About the Author
Acknowledgements
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
1
Introducing R, RStudio, and Shiny
Index

Chapter 8. Shiny and HTML/JavaScript

As it was already explained in the introduction, Shiny has practically no boundaries. Apart from the built-in capabilities that the package provides, the developer can also code their own HTML document instead of the UI.R file.

This HTML document is as any other document of its kind and can include the same things (for example, CSS, jQuery, JavaScript, and so on). In fact, UI.R files are, as it was previously mentioned, a mere wrapper that generates an HTML document with JavaScript, CSS, and so on.

This chapter is focused on the inclusion of custom JavaScript or CSS code in a Shiny application. In this sense, it is important to consider that it is not a JavaScript or CSS tutorial, and not even an introduction; it simply illustrates the different ways of including a few pieces of code from the previously mentioned languages in Shiny. This chapter is divided into the following four sections:

  • The www directory

  • Creating UIs from plain HTML

  • Using tags

  • Relating HTML...