noaa-onms / cinms

Channel Islands National Marine Sanctuary
https://noaa-onms.github.io/cinms
MIT License
3 stars 1 forks source link

Expand nms4r vignettes #69

Open bbest opened 3 years ago

bbest commented 3 years ago

See #61

bbest commented 3 years ago

Audience:

Existing Vignettes:

Perhaps expand on vignettes similar to breakdown here:

And then highlight how we populate static and dynamic content with captions, so possibly pulling from:

Diagrams of what?

bbest commented 3 years ago

We need a bigger picture Vignette to orient the technical audience around the necessary files (html, svg, csv) to construct an interactive infographic website, and where these files should be located and reference each other.

See README.md in https://github.com/marinebon/info-demo.

> # brew install tree
> cd ~/github/info-demo
> tree -L 2
.
├── README.md
├── _site.yml
├── about.Rmd
├── docs
│   ├── README.html
│   ├── about.html
│   ├── index.html
│   ├── libs
│   ├── modals
│   ├── site_libs
│   └── svg
├── index.Rmd
├── info-demo.Rproj
├── libs
│   ├── bootstrap-toggle.min.css
│   ├── bootstrap-toggle.min.js
│   ├── d3.v5.min.js
│   ├── infographiq.js
│   └── styles.css
├── modals
│   ├── test-video.Rmd
│   └── test-video.html
└── svg
    ├── cinms_pelagic.svg
    └── svg_links.csv
superjai commented 3 years ago

Hey @bbest & @mspector13 - I took a first pass at a bunch of the vignettes, which you can find in the nms4r package here. I created vignettes for each of the function groups listed on the Reference page. It is a pretty crude first pass, so there is a lot of room for improvement. But I figured that something was better than nothing - editing is easier than writing from scratch, I find. I think the vignette for "Sanctuary Utilities" (which currently is just a placeholder) should be dumped, as there is only one function in this function group (meaning I don't what there is to say further than what is in the individual function description).

I also created an overview vignette, which is currently a placeholder. I'll get a bad first pass down on the overview later on today.

superjai commented 3 years ago

Hey @bbest - I had a thought. Given the complexity of creating a new site from scratch, I thought it might be good if nms4r could itself create a new template site. I created a new function to do that - initial_build() - which creates a template site in a path selected by the user. The function just copies over the contents of the template directory that is sitting in the R package (in the inst folder).

I created this template as a very simple version of a new site. I think it would work well to walk through this template site in a vignette.

The only trouble is that this template site doesn't quite work. The issue is that, in the rendered html (like this file), the clickable infographic images don't display in a browser (though they do show up fine if the html is viewed within R studio). The html files in the modal directory seem to be fine.

Anyway, what do you think?

bbest commented 3 years ago

Looks good @superjai. Reminds me of devtools::create("dir/here"):

> devtools::create("testpkg")
New project 'testpkg' is nested inside an existing project './', which is rarely a good idea.
If this is unexpected, the here package has a function, `here::dr_here()` that reveals why './' is regarded as a project.
Do you want to create anyway?

1: Yes
2: Absolutely not
3: No

Selection: 1
✓ Creating 'testpkg/'
✓ Setting active project to '/Users/bbest/github/nms4r/testpkg'
✓ Creating 'R/'
✓ Writing 'DESCRIPTION'
Package: nms4r
Title: What the Package Does (One Line, Title Case)
Version: 0.0.0.9000
Authors@R (parsed):
    * First Last <first.last@example.com> [aut, cre] (YOUR-ORCID-ID)
Description: What the package does (one paragraph).
License: `use_mit_license()`, `use_gpl3_license()` or friends to
    pick a license
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.1
✓ Writing 'NAMESPACE'
✓ Writing 'nms4r.Rproj'
✓ Adding '.Rproj.user' to '.gitignore'
✓ Adding '^nms4r\\.Rproj$', '^\\.Rproj\\.user$' to '.Rbuildignore'
✓ Opening '/Users/bbest/github/nms4r/testpkg/' in new RStudio session
✓ Setting active project to '<no active project>'
bbest commented 3 years ago

TODO:

Expand for reuse in different environments:

superjai commented 3 years ago

Hey @bbest & @mspector13 - I have gone ahead and greatly updated the vignette for documenting how to create a new nms4r site. What do you think? Feel free to edit as you wish. It is in the nms4r package so you should do a pull on that. Here is the direct link to the specific vignette. The file to edit is Overview.Rmd in the vignettes folder.

bbest commented 3 years ago

Looking good Jai! Thanks so much. Next, we’ll want to move this to https://github.com/marinebon/infographiq

On Fri, Feb 5, 2021 at 4:13 PM Jai Ranganathan notifications@github.com wrote:

Hey @bbest https://github.com/bbest & @mspector13 https://github.com/mspector13 - I have gone ahead and greatly updated the vignette for documenting how to create a new nms4r site. What do you think? Feel free to edit as you wish. It is in the nms4r package so you should do a pull on that. Here is the direct link to the specific vignette https://marinebon.org/nms4r/articles/Overview.html. The file to edit is Overview.Rmd in the vignettes folder.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/marinebon/cinms/issues/69#issuecomment-774355170, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVUWCLXQSPCIUWQKZYJFA3S5SCQZANCNFSM4UN2HCHQ .

-- Ben Best, PhD Environmental Data Scientist EcoQuants.com http://ecoquants.com/ calendar: LA (PDT) https://calendar.google.com/calendar/embed?src=ben@ecoquants.com&ctz=America/Los_Angeles , NY (EDT) https://calendar.google.com/calendar/embed?src=ben@ecoquants.com&ctz=America/New_York +1.805.705.9770 <(805)%20705-9770>

superjai commented 3 years ago

Hey @bbest. Sounds good. Let's chat about it though during our next meetup - I am not exactly sure where infographiq ends and nms4r begins.