Closed paul-shannon closed 2 years ago
Hey @paul-shannon , I have worked on your 1st plan..please look at this directory on inst/unitTests/Hello_world.R
@Dharna5599 - a good start. Here are some suggestions.
Remove most of the white space. For instance, the blank line between the two widget constructors in the ui. Use names which are descriptive, and camel case rather than underscores. rather than, "Print_Hello", I suggest "printHelloButton" rather than "Server_Hello", "textDisplay"
# Run the application
tells us nothing we do not already know.
In order for me tor run the app in plain R (I never use RStudio) I had to change your code:
runApp(shinyApp(ui = ui, server = server))
Please find a way to invoke the app which does not depend upon RStudio (but that still works conveniently for you within RStudio)
@paul-shannon, thank you for the suggestion..I will surely look upon that.
Hey @paul-shannon, I made the necessary adjustments and embedded code in the R6 structure. Kindly have a look at the same directory inst/unitTests/Hello_world.R.
@Dharna5599 I just pushed inst/demos/simple_R6_shiny.R for you to study.
@Dharna5599 - good zoom meeting just now. Thank you. Two coding strategies (maybe "meta-strategies"):
Your tasks - to be implemented using these two strategies:
Important:
After I approve your changes, we will move in this same incremental, pessimistic and humble way to add event handlers.
Then we will add tests.
Remember that the best way to get somewhere fast is to go slowly!
@paul-shannon thankyou soo much Sure I will do it.
Hey @paul-shannon, I have pushed the required code for the given task. Please have a look at it.
No changes in simple_R6_shiny.R!
On Jul 30, 2021, at 7:39 AM, Dharna Chandrakar @.***> wrote:
Hey @paul-shannon, I have pushed the required code for the given task. Please have a look at it.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
Can you please recheck, I missed the commit. Sorry for inconvenience!
Looks good, @Dharna5599! Now we want the textOutputDisplay
to always display private$currentValue.
At the start of the program, it will display a zero. With every click of the incrementValueButton
, textOutputDisplay will update to display the newly incremented value.
Some questions and suggestions (and thinking out loud):
read and experiment! Let me know what you figure out, and what is confusing.
Sure @paul-shannon, I will. Thankyou
Hey @paul-shannon, As you suggested, I tried and experimented with the code and discovered that shiny observes the private$currentValue, thus we don't need to create reactive values in this instance. Thus I have pushed the updated version of code in github and on starting the program, it just displays zero. Perhaps on clicking the incrementValueBtton, the textOutputDisplay gets updated. Kindly have a look at it and if I misunderstood something please let me know.
Thank you Dharna
@Dharna5599 - let's tentatively close this issue, based on your good work inst/demos/ simple_R6_shiny.R. We can re-open if necessary.
Please move on to the new issue I am about to create - automated testing for the cyjShiny function selectFirstNeighbors .
@Dharna5599,
As we discussed, your goal is to acquire complete familiarity with the R6 unitTest strategy used in
unitTests/test_selection.R
. There is quite a lot to grasp here, and it must be grasped deeply for you to add the large number of feature-by-feature unitTests for cyjShiny we need for package submission.The plan:
test_selection.R
- but DO NOT add tests yet! the sub-goal here is simply to make you completely at home with R6 classes. Read up on their design. Hadley does a good job in his book.later
which is an indispensable tool for testing shiny's asynchronous behavior.