How to generate this plot in R and shiny?

I am new to R and Shiny, I want to know how to generate the plot in the following pictures? Which library should be used? Thanks!