According to the results, nothing seems wrong for the function arguments. I also additionally set two Watch Expressions (for message and duration) whose type are string and number, respectively, as depicted in Figure 10.8. Put a break point at line two by clicking on the left side of the center panel and click again on the action button to trigger the break point. Watched expressions are saved when you close the browser. We could create a new “watcher” by entering typeof message and clicking the add icon to check the message type within the sendNotif function. Watch allows you to track specific elements, and Event Listener Breakpoints allow you to stop at a given listener type. The scope shows all variables/object values at a break point. The right side displays debugging tools you can trigger them by clicking on the corresponding accordion. See more here.) The central part contains any opened script like a classic IDE. If the app is deployed on shinyapps.io, all scripts are located in a folder starting by _w_, which corresponds to the shinyapps.io workerId (This is a detail and not important to understand. On the left side, you can navigate through all files accessible by the web server, that is Shiny internal resources, Shiny external dependencies (like Bootstrap 3), as well as your own scripts. For instance shiny.js has more than 6500 lines of code (240kb), while is only 91.4kb. Overall, the minification process reduces the loading time of a web page by removing comments and extra spaces, thereby decreasing the file size. Sounds good, doesn’t it?įIGURE 10.7: Inspect the source causing the error. Notice the presence of minified files like and non-minified elements such as shiny.css. As expected and shown in Figure 10.6, the console displays anĮrror message: Uncaught TypeError: Cannot read property 'show' of undefined.Click on the action button (I am pretty sure you clicked before step 2 )). We deliberately made some typos, the goal being to find and fix them. In the following, we consider a very simple Shiny app deployed on shinyapps.io, where a notification is displayed with JavaScript as soon as a user clicks the action button. For instance, the Framework7 HTML template, which shinyMobile is built on ( Granjon, Perrier, and Rudolf 2021), has source maps but the size would exceed 5MB, which is obviously too big to include in the R package. In practice, most R packages bundling HTML templates do not ship these files since they could be quite large (> 1.5MB), and CRAN restricts the package size to 5MB. If you have minified files, there should be source maps, which will allow reconstructing the original scripts, that is as they were before the minification process. To debug Shiny apps from the inspector, all your scripts have to be in a folder accessible by the app like the www/ folder or by using addResourcePath(). In JavaScript, there are already predefined objects to interact with arrays, dates, …ġ0.6.2 Debug Shiny/JS code with the inspector We use this to refer to the object itself.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |