An R HTMLWidget that can generate single image graphics, mutli image graphics, or a table of single/multi image graphics.
Installation in R
Simple Example to verify installation:
The repo contains an internal web server that can be started via
gulp serve. Once the server is running, on the index page of the web content there is a link to a tutorial. This is the best way to understand how to use the widget.
Developing and Contributing
Local Installation to Develop/Contribute
- Must have node.js version >= 6.1 installed
- Must have yarn installed globally (can use npm just to run, should use yarn if contributing)
- Must have Google Chrome installed
- tested on OSX only, should work in Windows/Linux
git clone firstname.lastname@example.org:Displayr/rhtmlPictographs.git
You should now see a page listing tutorial sections and several examples. Each of these pages has one or more pictographs defined.
rhtmlPictograph relies heavily on rhtmlBuildUtils. You should read through the docs in the rhtmlBuildUtils repo to understand:
- which gulp tasks are available
- the constraints on file layout in your widget project
- How to perform visual testing.
Here are a few important notes (both detailed in the rhtmlBuildUtils docs) you must keep in mind:
- The last thing you do before committing is run
gulp buildto ensure all the autogenerated files are up to date.
- (With some exceptions) ONLY EDIT THINGS IN these directories:
docs, and sometimes
build!! Many of the other files are auto generated based on the contents of
theSrc. As an example, if you edit
R/rhtmlTemplate.Rand then run
gulp buildyour changes will be DELETED FOREVER!, because
R/rhtmlTemplate.Ris just a copy of
theSrc/R/htmlwidget.R. See htmlwidget_build_system for more details.
Contributing to rhtmlPictograph
- Do not work in master, as the master branch of rhtmlTemplate is used to verify the R server build process.
- Create a branch, make some changes, add test for your changes, update the docs if necessary, push your branch, and create a pull request on github.
How the git prepush hook works (aka: My git push got rejected ?!)
Of particular interest is the
prepush entry which runs a script that checks the project code style using the
gulp lint command. If there are errors, then it will reject your git push command. You have two options:
- Fix the errors and try pushing again. To see which errors are in the code run
gulp lint. To autofix as many as possible run
gulp lint --fix; this will only report the errors it could not auto-fix. Don't forget to commit your code again before pushing.
- If you must (not recommended) add a --no-verify (i.e.,
git push origin head --no-verify) to skip the style checking.
Here is an illustrative sequence:
$ git push origin head > husky - npm run -s prepush ... .../rhtmlPictograph/bdd/steps/loadThePage.steps.js 8:47 error Missing semicolon semi ✖ 1 problem (1 error, 0 warnings) [17:50:09] 'lint' errored after 4.85 s ... $ gulp lint --fix [17:50:16] Starting 'lint'... [17:50:21] Finished 'lint' after 4.94 s $ git commit -a -m 'fix the style' ... $ git push origin head
Detailed list of CSS class names - useful when targeting these DOM via the custom CSS feature
A bit out of date here
The R examples are auto generated from the internal www contents. You are strongly encouraged to view the contents in it's intended glorious format (using a browser), and only use the R examples file for reference.