Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add R Snippet #6

Merged
merged 7 commits into from
Jan 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Comment on lines +58 to +60
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is totally 👌 for the moment, but once the unification PR is merged (plotly/dashR#243), you'll just have to omit the third line, so instead users will load

library(dash)
library(dashVtk)


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)