/
index.qmd
61 lines (52 loc) · 2 KB
/
index.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
title: 'Video: Debugging JavaScript You Wrote in R'
author: Garrick Aden-Buie
date: '2020-07-20'
slug: video-debug-js-from-r
categories:
- R
- RStudio
- JavaScript
- Debugging
- Web Development
- htmlwidgets
- Video
description: A pseudo-live-streamed walkthrough as I debug some buggy JavaScript written in R for a {reactable} htmlwidget.
image: debug-js-from-r.png
keywords: rstats
editor_options:
chunk_output_type: console
---
<!-- Links -->
[htmlwidgets]: https://www.htmlwidgets.org/
[reactable]: https://glin.github.io/reactable
[thomas-mock]: https://twitter.com/thomas_mock
[rsthemes]: https://github.com/gadenbuie/rsthemes/
[js4shiny]: https://pkg.js4shiny.com
::: {.lead}
<span class="pkg">[htmlwidgets]</span> makes it easy to create awesome web things from R and R Markdown, but sometimes you have to write your own JavaScript code... in strings... in R. What do you do if it doesn't work? How can you write JavaScript interactively?
:::
{{< video https://www.youtube.com/embed/aNxT4IOZPtc >}}
I "live streamed" my process
as I worked through debugging
some buggy JavaScript that [Tom Mock][thomas-mock]
[shared on twitter](https://twitter.com/thomas_mock/status/1284932187352072192),
touching on the tools used
to debug JavaScript and
some features from the <span class="pkg">[js4shiny]</span> package
that help R users with web development.
The example uses the awesome <span class="pkg">[reactable]</span> package,
which helps you make some incredible HTML interactive HTML tables.
If you want to try this at home,
I've uploaded the
[code that doesn't work](https://gist.github.com/gadenbuie/9ce3a58a7f6109c23cdd68711a2623ae)
and the
[code that does work](https://gist.github.com/gadenbuie/7d8bb61476dcfa4459fb6e8b7a219022)
as GitHub gists.
Oh and by the way,
I'm using the RStudio theme "Flat White" from <span class="pkg">[rsthemes]</span>.
---
This is the first time I've made a video like this.
If you liked it and want to see more,
let me know on Twitter
[@grrrck](https://twitter.com/grrrck).