Skip to content

Commit

Permalink
Add R Snippet (#6)
Browse files Browse the repository at this point in the history
* Add R Snippet

* Fix some stuff

* Update README.md

* Update README.md

* Apply suggestions from code review

Co-authored-by: Ryan Patrick Kyle <[email protected]>

* Fix links

* refactor R example on readme

Co-authored-by: Ryan Patrick Kyle <[email protected]>
  • Loading branch information
Xing Han Lu and rpkyle authored Jan 29, 2021
1 parent 04b51de commit 4d434bf
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,34 @@ For a more detailed example, see `usage.py`.

### Quickstart (R)

This section will be added soon.
First, install the package from GitHub (the package is not yet available via CRAN):
```
remotes::install_github("plotly/dash-vtk")
```

then, create your component and add it to your layout:

```r
library(dash)
library(dashVtk)
library(dashHtmlComponents)

app <- Dash$new()

app$layout(htmlDiv(
style = list("width" = "100%", "height" = "calc(100vh - 16px)"),
children = vtkView(list(
vtkGeometryRepresentation(
vtkAlgorithm(
vtkClass = "vtkConeSource",
state = list("resolution" = 64, "capping" = FALSE),
)
)
))
))

app$run_server()
```
## Contributing

See [docs/CONTRIBUTING.md](./docs/CONTRIBUTING.md) to learn about:
Expand Down Expand Up @@ -111,4 +137,4 @@ You can find the complete API reference in [`docs/REFERENCES.md`](./docs/REFEREN
* [Code](./demos/usage-algorithm)
* Online Demo (coming soon)

![A demo of the usage-algorithm app](demos/usage-algorithm/demo.jpg)
![A demo of the usage-algorithm app](demos/usage-algorithm/demo.jpg)

0 comments on commit 4d434bf

Please sign in to comment.