|
|
|
@@ -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")` |