瀏覽代碼

Add notes about apps avaiable via repl_example()

master
Garrick Aden-Buie 6 年之前
父節點
當前提交
10e583e80d
共有 2 個檔案被更改,包括 19 行新增4 行删除
  1. +12
    -3
      dev/dev.Rmd
  2. +7
    -1
      dev/dev.md

+ 12
- 3
dev/dev.Rmd 查看文件

@@ -573,6 +573,8 @@ tooltipOptions = list(
## Shiny comes for free!

* `r github_sha_link("739d5945010d5e46ab3f9847fd412beb0766805d")`
* Start from: `repl_example("frappe-chart-starter")`
* Basics: `repl_example("frappe-chart-basic")`

Create a basic Shiny app with

@@ -656,7 +658,10 @@ Add a chart method to the widget object so that we can get to the current chart.
`r github_sha_link("5da4b68b5f60d8e6ee17cc8c4a009121539a2653")`

Demo with `app.R`
Demo with `app.R` by just running the
`repl_example("frappe-chart-basic")` app again
and using the dev console to show
that the update method is working.

```js
let el = document.getElementById('chart')
@@ -697,7 +702,8 @@ Demo the app, now updates are fast!

`r github_sha_link("0b4f7ea16f378ec5a53d81260c8f9056fabbcaba")`
Attach the event listener during `renderValue()` and watch for the `data-select` event.
Attach the event listener during `renderValue()`
and watch for the `data-select` event.
Use the `el.id` to create a new id, like `el.id + '_selected'`.
Send back `index` and `values` from the event.

@@ -707,7 +713,8 @@ Add `verbatimTextOutput('selected')` to show `input$chart_selected`.

`r github_sha_link("e7fe0e1d87977823e6a040434b33e6d5cdf8eac1")`

You would probably want to do some work for the user and return more meaningful values.
You would probably want to do some work for the user
and return more meaningful values.
We'll probably just copy and paste this during the workshop,
but here's a potential method.

@@ -749,3 +756,5 @@ give the input event a type: `inputId_selected:frappeCharts-selected`.
)
}
```

Final result: `repl_example("frappe-chart-full")`

+ 7
- 1
dev/dev.md 查看文件

@@ -552,6 +552,8 @@ tooltipOptions = list(
## Shiny comes for free\!

- [changelog: 739d59](https://github.com/gadenbuie/js4shiny-frappeCharts/commit/739d5945010d5e46ab3f9847fd412beb0766805d)
- Start from: `repl_example("frappe-chart-starter")`
- Basics: `repl_example("frappe-chart-basic")`

Create a basic Shiny app with

@@ -637,7 +639,9 @@ current chart.

[changelog: 5da4b6](https://github.com/gadenbuie/js4shiny-frappeCharts/commit/5da4b68b5f60d8e6ee17cc8c4a009121539a2653)

Demo with `app.R`
Demo with `app.R` by just running the
`repl_example("frappe-chart-basic")` app again and using the dev console
to show that the update method is working.

``` js
let el = document.getElementById('chart')
@@ -731,3 +735,5 @@ type: `inputId_selected:frappeCharts-selected`.
)
}
```

Final result: `repl_example("frappe-chart-full")`

Loading…
取消
儲存