Giter VIP home page Giter VIP logo

base-gior's Introduction

gior-base

This is the base of gior for you to easily follow along the how to build htmlwidgets blogpost and build the htmlwidget for gio.js yourself!

  1. Get Started
  2. Historic
  3. Changes
  4. Data
  5. Package

Get Started

Clone this repository with git clone https://github.com/JohnCoene/base-gior.git, or, from RStudio:

  1. go to File
  2. Click on New Project
  3. Select Version Control
  4. Then select Git
  5. And paste the URL (https://github.com/JohnCoene/base-gior.git) under Repository URL
  6. Finally, click Create Project.

Historic

Here are the only functions that were ran:

  1. devtools::create("gior")
  2. htmlwiidgets::scaffoldWidget("gior")

Essentially creating a package with devtools and scaffolding the htmlwidget from the root of the package. You should be familiar with the first function. The second function essentially builds the following:

R/
| gior.R

inst/
|-- htmlwidgets/
|   |-- gior.js
|   |-- gior.yaml

Changes

Simply for convenience and for one to quickly get on with building the widget, some files were already edited or added.

DESCRIPTION

Edited some meta information that you should change and added necessary Imports:

  1. htmlwidgets
  2. shiny
  3. jsonlite

YML

The gior.yml file located in the inst folder was edited from:

# (uncomment to add a dependency)
# dependencies:
#  - name:
#    version:
#    src:
#    script:
#    stylesheet:

to

dependencies:
 - name: three
   version: 97
   src: htmlwidgets/lib/three
   script: three.min.js
 - name: gio
   version: 2.0
   src: htmlwidgets/lib/gio-2.0
   script: gio.min.js

The blogpost explains what this file does.

lib

The lib directory (and its sub directories); we essentially added the dependencies (that are referred to in the YML section above)

R/
| gior.R

inst/
|-- htmlwidgets/
|   |-- gior.js
|   |-- gior.yaml
|   |-- lib/
|   |   |-- gio-2.0/
|   |   |   |-- gio.min.js
|   |   |-- three/
|   |   |   |-- three.min.js

Data

The package also includes random data for you to test your package which can be loaded with data("country_data").

Package

This is a package, remember that to see changes reflected you will have to run:

  1. devtools::document()
  2. Thendevtools::install() or CTRL/CMD + SHIFT + B from RStudio.

Note that, as is, the package works but does not pass R CMD Check.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.