Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jverzani/gwidgetswww2
gWidgets API for web programming
https://github.com/jverzani/gwidgetswww2
Last synced: 2 months ago
JSON representation
gWidgets API for web programming
- Host: GitHub
- URL: https://github.com/jverzani/gwidgetswww2
- Owner: jverzani
- Created: 2011-12-20T19:32:24.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2020-02-06T16:47:19.000Z (almost 5 years ago)
- Last Synced: 2024-05-09T13:07:22.392Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 10.3 MB
- Stars: 6
- Watchers: 6
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog
Awesome Lists containing this project
README
Port of gWidgets to the web
---------------------------This package implements the `gWidgets` API for web
programming. Deployment is through `Rook`, best suited for local use
or limited internet usage. For wider deployment, there is
`gWidgetsWWW2.rapache` which runs under Jeffrey Horner's rapache
module for the apache webserver.Primarily, the package turns the gWidgets commands into
`JavaScript` commands. The `ExtJS` javascript libraries (www.sencha.com)
are used for this, as they provide an excellent programming
environment for `JavaScript`. Of course, the `R` user need not know any
`JavaScript`, or even any web technologies -- not even HTML. Basically,
most simple gWidgets scripts will just work.If installed from github or r-forge, the extjs files will be included. If
in the future the package will be available on CRAN, likely the commmand
`download_extjs` will have to be issued to download the extjs files (67Mb) and
install them within the package directory.Example
-------To use `gWidgetsWWW2` locally, one writes scripts to be executed by Rook.
The basic "Hello World" app with a window, container, button and
callback is created in a script `hello.R` and contains:```{r}
w <- gwindow("Hello world example")
g <- ggroup(cont=w, width=300, height=300)
b <- gbutton("click me", cont=g, handler=function(h,...) {
galert("Hello World", parent=w)
})
```
This script is turned into a web page through the `load_app` function:
```{r}
require(gWidgetsWWW2)
load_app("hello.R", app_name="hello")
```The app is then mapped to the url
`http://127.0.0.1:PORT/custom/hello/indexgw.rhtml`
The "PORT" will be that for R's internal help server. The `port`
argument can pass in a value if that has not yet been started, with a
default of 9000.The "hello" in the url matches that given by the `app_name` argument.
Read on for notes on deployment beyond the local computer.
Installation
------------You can install the package from RForge:
```{r}
install.packages("gWidgetsWWW2",
repos = c("http://r-forge.r-project.org", getOption("repos")))
```Alternatively you can install from github, if the `devtools` package of H. Wickham is installed:
```{r}
library(devtools)
install_github("jverzani/gWidgetsWWW2")
```Otherwise, a) install git, b) clone the project c) use +R CMD
INSTALL+, or some such to install from a local set of files.Graphics
--------There is no interactive graphic device, though one can use several
non-interactive graphics devices, in particular: `png`, through the `gimage` widget; and `RSVGTipsDevice`,
through the `gsvg` widget. The basic use for each is similar.