Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
DivadNojnarg committed Oct 12, 2018
1 parent 70391dc commit eb2eaf5
Show file tree
Hide file tree
Showing 13 changed files with 833 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
@@ -0,0 +1,2 @@
^.*\.Rproj$
^\.Rproj\.user$
4 changes: 4 additions & 0 deletions .gitignore
@@ -0,0 +1,4 @@
.Rproj.user
.Rhistory
.RData
.Ruserdata
16 changes: 16 additions & 0 deletions DESCRIPTION
@@ -0,0 +1,16 @@
Package: argonDash
Type: Package
Title: Aron Shiny Dashboard Template
Version: 0.1.0
Author: David Granjon
Maintainer: David Granjon <dgranjon@ymail.com>
Description: Create awesome bootstrap 4 template powered by argon.
See more here <file:///Users/macdavidgranjon/Desktop/argon-dashboard-v1.0.0/index.html>.
License: GPL-2
Imports: shiny,
htmltools
URL: https://github.com/RinteRface/argonDash
BugReports: https://github.com/RinteRface/argonDash/issues
Encoding: UTF-8
LazyData: true
RoxygenNote: 6.1.0
3 changes: 3 additions & 0 deletions NAMESPACE
@@ -0,0 +1,3 @@
# Generated by roxygen2: do not edit by hand

export(argonDashPage)
61 changes: 61 additions & 0 deletions R/argonDashPage.R
@@ -0,0 +1,61 @@
#' Create a Boostrap 4 dashboard page
#'
#' Build an Argon dashboard page
#'
#' @param navbar Bootstrap 4 dashboard navbar.
#' @param sidebar Bootstrap 4 dashboard main sidebar.
#' @param header Bootstrap 4 dashboard control sidebar (right side).
#' @param body Bootstrap 4 dashboard body wrapper.
#' @param footer Bootstrap 4 dashboard footer.
#' @param title App title.
#' @param author Dashboard author.
#' @param description Dashboard purpose.
#'
#' @examples
#' if(interactive()){
#' library(shiny)
#' library(argonDash)
#'
#' shiny::shinyApp(
#' ui = argonDashPage(),
#' server = function(input, output) {}
#' )
#' }
#'
#' @author David Granjon, \email{dgranjon@@ymail.com}
#'
#' @export
argonDashPage <- function(title = NULL, description = NULL, author = NULL,
navbar = NULL, sidebar = NULL, header = NULL, body = NULL, footer = NULL){

shiny::tags$html(
# Head
shiny::tags$head(
shiny::tags$meta(charset = "utf-8"),
shiny::tags$meta(
name = "viewport",
content = "width=device-width, initial-scale=1, shrink-to-fit=no"
),
shiny::tags$meta(name = "description", content = description),
shiny::tags$meta(name = "author", content = author),
shiny::tags$title(title)
),
# Body
addDeps(
shiny::tags$body(
sidebar,
shiny::tags$div(
class = "main-content",
navbar,
header,
# page content
shiny::tags$div(
class = "container-fluid mt--7",
body,
footer
)
)
)
)
)
}
66 changes: 66 additions & 0 deletions R/deps.R
@@ -0,0 +1,66 @@
# Add an html dependency, without overwriting existing ones
appendDependencies <- function(x, value) {
if (inherits(value, "html_dependency"))
value <- list(value)

old <- attr(x, "html_dependencies", TRUE)

htmltools::htmlDependencies(x) <- c(old, value)
x
}

# Add dashboard dependencies to a tag object
addDeps <- function(x) {

# CSS, icons
#favicon <- "favicon.png"
google_fonts <- "https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700"
nucleo_css <- "nucleo.css"
fontawesome_css <- "all.min.css"
argon_css <- "argon.min.css"

# JS
bootstrap_js <- "bootstrap.bundle.min.js"
argon_js <- "argon.min.js"

dashboardDeps <- list(
# bootstrap deps
htmltools::htmlDependency(
name = "bootstrap",
version = "4.1.3",
src = c(file = system.file("bootstrap-4.1.3", package = "argonDash")),
script = bootstrap_js
),
# google fonts
htmltools::htmlDependency(
name = "googlefonts",
version = as.character(utils::packageVersion("argonDash")),
src = c(href = google_fonts),
stylesheet = ""
),
# nucleo
htmltools::htmlDependency(
name = "nucleo",
version = as.character(utils::packageVersion("argonDash")),
src = c(file = system.file("nucleo-0.1.0", package = "argonDash")),
stylesheet = nucleo_css
),
# fontawesome
htmltools::htmlDependency(
name = "fontawesome",
version = "5.3.1",
src = c(file = system.file("fontawesome-5.3.1", package = "argonDash")),
stylesheet = fontawesome_css
),
# argon
htmltools::htmlDependency(
name = "argon",
version = "1.0.0",
src = c(file = system.file("argon-1.0.0", package = "argonDash")),
stylesheet = argon_css,
script = argon_js
)

)
appendDependencies(x, dashboardDeps)
}
17 changes: 17 additions & 0 deletions argonDash.Rproj
@@ -0,0 +1,17 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
17 changes: 17 additions & 0 deletions inst/argon-1.0.0/argon.min.css

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions inst/argon-1.0.0/argon.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions inst/bootstrap-4.1.3/bootstrap.bundle.min.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions inst/fontawesome-5.3.1/all.min.css

Large diffs are not rendered by default.

0 comments on commit eb2eaf5

Please sign in to comment.