Skip to content

vue-r/vueR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3f2a128 · Oct 11, 2017

History

43 Commits
Oct 11, 2017
Dec 5, 2016
Oct 11, 2017
Oct 11, 2017
Apr 20, 2017
Jul 13, 2017
Nov 29, 2016
Jul 13, 2017
Nov 29, 2016
Nov 28, 2016
Apr 18, 2017
Oct 11, 2017
Nov 29, 2016
Nov 29, 2016
Oct 11, 2017
Apr 18, 2017
Apr 18, 2017
Nov 28, 2016

Repository files navigation

Travis-CI Build StatusCRAN_Status_Badge

Vue.js is a quiet, very popular JavaScript framework with an impressive set of features, a solid community, and MIT license. Don't tell anybody, but I think I might even like it better than React. With all this, Vue deserves its own set of helpers for R, just like d3r and reactR.

vueR provides these helpers with its dependency function html_dependency_vue and ?htmlwidget?.

Installation

vueR aims to achieve CRAN status, but for now, it only exists on Github.

devtools::install_github("timelyportfolio/vueR")

Example

We'll start with a recreation of the simple "Hello World" example from the Vue.js documentation. This is the hard way.

library(htmltools)
library(vueR)

browsable(
  attachDependencies(
    tagList(
      tags$div(id="app","{{message}}"),
      tags$script(
      "
      var app = new Vue({
        el: '#app',
        data: {
          message: 'Hello Vue!'
        }
      });
      "
      )
    ),
    html_dependency_vue()
  )
)

vueR gives us an htmlwidget that can ease the code burden from above.

library(vueR)
library(htmltools)

# recreate Hello Vue! example
browsable(
  tagList(
    tags$div(id="app", "{{message}}"),
    vue(
      list(
        el = "#app",
        data = list(
          message = "Hello Vue!"
        )
      )
    )
  )
)

Code of Conduct

I would love for you to participate and help with vueR, but please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.