This repository has been archived by the owner on Feb 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement first ui binding: manipulating using a slider
- Loading branch information
markuskonk
committed
Mar 16, 2018
1 parent
bf651f1
commit 4083922
Showing
22 changed files
with
2,156 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,34 @@ | ||
FROM node:8-alpine | ||
FROM rocker/geospatial:latest | ||
|
||
SHELL ["/bin/bash", "-c"] | ||
|
||
RUN R -e 'install.packages(c("diveMove", "trip", "adehabitatLT", "plm", "cshapes", "plumber"))' | ||
# based on https://gist.github.com/remarkablemark/aacf14c29b3f01d6900d13137b21db3a | ||
RUN apt-get update \ | ||
&& apt-get install -y curl \ | ||
&& apt-get -y autoclean | ||
|
||
ENV NVM_DIR /usr/local/nvm | ||
ENV NODE_VERSION 8.10.0 | ||
RUN curl --silent -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash | ||
RUN source $NVM_DIR/nvm.sh \ | ||
&& nvm install $NODE_VERSION \ | ||
&& nvm alias default $NODE_VERSION \ | ||
&& nvm use default | ||
|
||
# add node and npm to path so the commands are available | ||
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules | ||
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH | ||
|
||
#WORKDIR /bindings | ||
|
||
COPY package.json package.json | ||
|
||
RUN apk add --no-cache | ||
RUN npm install --production | ||
|
||
COPY config config | ||
COPY index.js index.js | ||
COPY controllers controllers | ||
COPY controllers/bindings.js controllers/bindings.js | ||
COPY index.js index.js | ||
|
||
CMD ["node", "index.js"] | ||
|
||
CMD ["node", "index.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
file.exists("plumber.R") | ||
file.exists("plumber.R") | ||
print(file.exists("plumber.R")) | ||
library(here) | ||
print(file.exists(here("plumber.R")) | ||
print(file.exists(here("plumber.R"))) | ||
print(file.exists(here("plumber.R"))) | ||
print(file.exists(here("plumber/plumber.R"))) | ||
print(file.exists(here("plumber","plumber.R"))) | ||
print(file.exists(here("plumber","plumber.R"))) | ||
print(file.exists(here("plumber/plumber.R"))) | ||
print(file.exists(here("plumber.R"))) | ||
here() | ||
print(file.exists(here("plumber.R"))) | ||
setwd("~/o2r-platform/bindings/o2r-bindings/controllers/plumber") | ||
print(file.exists(here("plumber.R"))) | ||
here() | ||
print(file.exists(here("plumber","plumber.R"))) | ||
print(file.exists(here("controllers", "plumber","plumber.R"))) | ||
needs(magrittr) | ||
set.seed(512) | ||
do.call(rep, input) %>% | ||
strsplit(NULL) %>% | ||
sapply(sample) %>% | ||
apply(2, paste, collapse = "") | ||
install.packages("magrittr") | ||
needs(magrittr) | ||
library(magrittr) | ||
set.seed(512) | ||
do.call(rep, input) %>% | ||
strsplit(NULL) %>% | ||
sapply(sample) %>% | ||
apply(2, paste, collapse = "") | ||
do.call(rep) %>% | ||
strsplit(NULL) %>% | ||
sapply(sample) %>% | ||
apply(2, paste, collapse = "") | ||
do.call(rep) %>% | ||
print(set.seed(512)) | ||
r <- plumb(here("controllers", "plumber","plumber.R")) # Where 'myfile.R' is the location of the file shown above | ||
r$run(port=8000) | ||
library(plumber) | ||
library(here) | ||
here() | ||
r <- plumb(here("controllers", "plumber","plumber.R")) # Where 'myfile.R' is the location of the file shown above | ||
r$run(port=8000) | ||
install.package("plumber", repos = "http://cran.us.r-project.org") | ||
install.packages("plumber", repos = "http://cran.us.r-project.org") | ||
install.packages("plumber", repos = "http://cran.us.r-project.org") | ||
install.packages("here", repos = "http://cran.us.r-project.org") | ||
install.packages("here", repos = "http://cran.us.r-project.org") | ||
install.packages('plumber', repos='http://cran.us.r-project.org') | ||
2+2 | ||
install.packages('here',dependencies=TRUE, repos='http://cran.rstudio.com/') | ||
install.packages("here", dependencies = TRUE, repos = "http://cran.rstudio.com/") | ||
file.exists("plumber.R") | ||
here() | ||
#r <- plumb("indings/o2r-bindings/controllers/plumber/plumber.R") # Where 'myfile.R' is the location of the file shown above | ||
r <- plumb("/home/markus/o2r-platform/bindings/o2r-bindings/controllers/plumber/plumber.R") # Where 'myfile.R' is the location of the file shown above | ||
r$run(port=8000) | ||
install.packages("plumber") | ||
r$run(port=8000) | ||
#install.packages('plumber', dependencies=TRUE, repos='http://cran.rstudio.com/') | ||
library(plumber) | ||
#r <- plumb("indings/o2r-bindings/controllers/plumber/plumber.R") # Where 'myfile.R' is the location of the file shown above | ||
r <- plumb("/home/markus/o2r-platform/bindings/o2r-bindings/controllers/plumber/plumber.R") # Where 'myfile.R' is the location of the file shown above | ||
r$run(port=8000) | ||
#r <- plumb(here("bindings", "controllers", "plumber", "plumber.R")) # Where 'myfile.R' is the location of the file shown above | ||
#r <- plumb("home", "markus", "o2r-platform", "bindings", "o2r-bindings", "controllers", "plumber", "plumber.R") | ||
here() | ||
library(here) | ||
library(here) | ||
#r <- plumb(here("bindings", "controllers", "plumber", "plumber.R")) # Where 'myfile.R' is the location of the file shown above | ||
#r <- plumb("home", "markus", "o2r-platform", "bindings", "o2r-bindings", "controllers", "plumber", "plumber.R") | ||
here() | ||
#r <- plumb(here("bindings", "controllers", "plumber", "plumber.R")) # Where 'myfile.R' is the location of the file shown above | ||
r <- plumb("home", "markus", "o2r-platform", "bindings", "o2r-bindings", "controllers", "plumber", "plumber.R") | ||
#install.packages('plumber', dependencies=TRUE, repos='http://cran.rstudio.com/') | ||
library(plumber) | ||
#r <- plumb(here("bindings", "controllers", "plumber", "plumber.R")) # Where 'myfile.R' is the location of the file shown above | ||
r <- plumb("home", "markus", "o2r-platform", "bindings", "o2r-bindings", "controllers", "plumber", "plumber.R") | ||
#r <- plumb(here("bindings", "controllers", "plumber", "plumber.R")) # Where 'myfile.R' is the location of the file shown above | ||
r <- plumb(here("home", "markus", "o2r-platform", "bindings", "o2r-bindings", "controllers", "plumber", "plumber.R")) | ||
#r <- plumb(here("bindings", "controllers", "plumber", "plumber.R")) # Where 'myfile.R' is the location of the file shown above | ||
r <- plumb(here("plumber.R")) | ||
#r <- plumb("/home/markus/o2r-platform/bindings/o2r-bindings/controllers/plumber/plumber.R") # Where 'myfile.R' is the location of the file shown above | ||
r$run(port=8000) | ||
#r <- plumb(here("bindings", "controllers", "plumber", "plumber.R")) # Where 'myfile.R' is the location of the file shown above | ||
here() | ||
install.packages("magrittr") | ||
# ex-async.R | ||
needs(dplyr) | ||
attach(input[[1]]) | ||
# output of final expression is returned to node | ||
df %>% | ||
mutate(group = cut(rating, nGroups, ordered = T)) %>% | ||
group_by(group) %>% | ||
summarize_each(funs_(fxn)) %>% | ||
select(group, rating, advance) %>% | ||
mutate(group = as.character(group)) | ||
getwd() | ||
getwd() + "/test" | ||
getwd()."/test" | ||
paste(getwd(),"/test") | ||
paste(getwd(),"/test", sep="") | ||
file.exists(paste(getwd(),"/plumer.R", sep="")) | ||
file.exists(paste(getwd(),"/plumber.R", sep="")) | ||
#install.packages('plumber', dependencies=TRUE, repos='http://cran.rstudio.com/') | ||
library(plumber) | ||
r <- plumb("/bindings/controllers/plumber/plumber.R") # Where 'myfile.R' is the location of the file shown above | ||
#install.packages('plumber', dependencies=TRUE, repos='http://cran.rstudio.com/') | ||
library(plumber) | ||
r <- plumb("bindings/controllers/plumber/plumber.R") # Where 'myfile.R' is the location of the file shown above | ||
#r <- plumb("/home/markus/o2r-platform/bindings/o2r-bindings/controllers/plumber/plumber.R") # Where 'myfile.R' is the location of the file shown above | ||
r$run(port=8000) | ||
#r <- plumb("bindings/controllers/plumber/plumber.R") # Where 'myfile.R' is the location of the file shown above | ||
r <- plumb("/home/markus/o2r-platform/bindings/o2r-bindings/controllers/plumber/plumber.R") # Where 'myfile.R' is the location of the file shown above | ||
r$run(port=8000) | ||
#install.packages('plumber', dependencies=TRUE, repos='http://cran.rstudio.com/') | ||
library(plumber) | ||
#r <- plumb("bindings/controllers/plumber/plumber.R") # Where 'myfile.R' is the location of the file shown above | ||
r <- plumb("/home/markus/o2r-platform/bindings/o2r-bindings/controllers/plumber/plumber.R") # Where 'myfile.R' is the location of the file shown above | ||
r$run(port=8000) | ||
knitr::opts_chunk$set(echo = TRUE) | ||
plot(pressure) | ||
plot(pressure*2) | ||
plot(pressure) | ||
pressure | ||
install.packages("rgdal") | ||
installed.packages(c("dplyr")) | ||
library("dplyr") | ||
installed.packages(c("dplyr")) | ||
installed.packages(c("dplyr"), repos='http://cran.rstudio.com/') | ||
install.packages(c("dplyr"), repos='http://cran.rstudio.com/') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#' Plot out data from the iris dataset | ||
#' @get /plot | ||
#' @png | ||
|
||
function (spec){ | ||
myData <- iris | ||
title <- "All Species" | ||
|
||
# Filter if the species was specified | ||
if (!missing(spec)){ | ||
title <- paste0("Only the '", spec, "' Species") | ||
myData <- subset(iris, Species == spec) | ||
} | ||
|
||
|
||
plot(myData$Sepal.Length, myData$Petal.Length, | ||
main=title, xlab="Sepal Length", ylab="Petal Length") | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#install.packages('plumber', repos='http://cran.rstudio.com/') | ||
library("plumber") | ||
#r <- plumb("/bindings/controllers/plumber/plumber.R") # Where 'myfile.R' is the location of the file shown above | ||
r <- plumb("/home/markus/o2r-platform/bindings/o2r-bindings/controllers/plumber/plumber.R") # Where 'myfile.R' is the location of the file shown above | ||
r$run(host = '0.0.0.0', port=8000) |
Binary file not shown.
Oops, something went wrong.