WA-Department-of-Agriculture / soil-health-report-generator

https://tshapiro.shinyapps.io/soil-health/
MIT License
0 stars 0 forks source link

Decide how Data Dictionary in Report Output should be generated #11

Open tashapiro opened 1 month ago

tashapiro commented 1 month ago

In the Quarto report, the end output includes a Data Dictionary with definitions for each variable. If a user uploads their own data dictionary, some of the default dictionary may not be applicable.

We will need to decide how we want to generate Data Dictionaries for users. Some ideas:

1) Keep Data Dictionary as is and include language noting this is the default 2) Allow users to create their own definitions in the template and generate the text in Quarto, remove default. Issue here will be formatting for long text (not easy for paragraphs) 3) Allow users to set up definitions for each variable in the Shiny application after uploading data template (dynamic inputs, iterates through each record in dictionary, creates long text inputs to pass to Quarto)

jadeynryan commented 2 weeks ago

After thinking about this issue, linking the measurement descriptions to the data dictionary won't be feasible. Some of the measurement descriptions apply to more than one measurement, and some measurements don't have a description by default.

For example, there are 13 rows in the dictionary for plant essential nutrients that are grouped together into one description. image

I'm wondering if we can include a long form input for all the measurement descriptions. I found some examples of embedding WYSIWYG rich text editors as an input for a Shiny app. I can turn 05_physical-measurements.qmd, 06_biological-measurements.qmd, and 07_chemical-measurements.qmd into one simple .md file that could be uploaded as the input placeholder so the user can edit as they see fit (edit/add/remove descriptions). The output from these inputs can then be passed as a parameter to the 01_producer-report.qmd.

This would also be the ideal input for the project description section and looking forward section. We can use the includeMarkdown() function to render a preview of what the markdown text renders to.

Some examples/resources I've found: