Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should infographiqR repo exist? #63

Closed
superjai opened this issue May 17, 2021 · 1 comment
Closed

Should infographiqR repo exist? #63

superjai opened this issue May 17, 2021 · 1 comment
Assignees

Comments

@superjai
Copy link
Contributor

superjai commented May 17, 2021

Hey @bbest - I have completed the rewrite of the infographiq javascript and the reorganization of cinms. After doing all of this, it doesn't seem like that the infographiqR repo serves much purpose.

Here's the reasoning. You have drawn a clear distinction between 1) the code needed to generate the infographic itself and 2) the code generating the modal windows. To this end, you split nms4r into two repos, with the repos containing the following r files:

  • infographiqR (infographic generation)
    • render_rmd.R
  • onmsR (modal window generation)
    • calcofi.R
    • calculate_data.R
    • spatial.R
    • utils-pipe.R

If you take a look at the functions contained within the original render_rmd.R, you'll see that almost all of them have to do with modal window generation, not infographic generation:

  • calcofi_map: modal window generation only
  • calcofi_plot: modal window generation only
  • calculate_SST_anomaly: modal window generation only
  • calculate_statistics: modal window generation only
  • generate_html_4_rmd: modal window generation only
  • get_dates: modal window generation only
  • get_figure_info: modal window generation only
  • get_nms_polygons: modal window generation only
  • map_nms_sites: modal window generation only
  • md_caption: modal window generation only
  • plot_SST_anomaly: modal window generation only
  • plot_intertidal_nms: modal window generation only
  • plot_metric_timeseries: modal window generation only
  • ply2erddap: modal window generation only
  • render_all_rmd: modal window generation only
  • render_figure: modal window generation only
  • create_website: infographic generation only
  • get_modal_info: modal window AND infographic generation

You can see that only the last two functions create_website and get_modal_info of the 18 total have anything at all to do with infographic generation. Consequently, I moved the 16 other functions into onmsR into a R file called render_modal.R.

So that leaves us with two functions in render_rmd.R in infographiqR. And I would argue that these shouldn't be here either.

  • create_website should be deleted. This is a simple function I wrote to copy a working template version of the infographic from the inst folder to whatever folder the user wants. The thing though is that the same functionality can be achieved by including a hyperlink to a zip file of the working template in the tutorial materials.
  • get_modal_info should really be moved to onmsR. Though used to generate camera and info icons above the infographic, it is primarily used for generating those icons within the modal window.
@bbest
Copy link
Contributor

bbest commented May 18, 2021

I appreciate these points Jai, but let's distinguish between these repositories for different aspects of interactive infographic creation and maintenance:

  1. infographiqJS: core JavaScript functionality open a modal or new window from icons in SVG or link in table of contents; and stops short of how to populate the modal window.

  2. onmsR: dataset-specific wrangling and visualization for populating into the modal windows, but could also be used outside of any interactive infographic generation altogether, ie static or dynamic Condition Reports, etc.

  3. infographiqR: support functions in R (NOT core JS, NOT specific visualizations) to generate interactive infographic websites, such as creating a simple Rmarkdown website of infographics, using a glossary to generate tooltips, populating modal templates from Google Sheets with fontawesome icons and links, etc. When Jai says "infographiqR generates the modal" generates the html template (but not the specific visualization contained within the modal)?

@bbest bbest self-assigned this May 21, 2021
@bbest bbest closed this as completed Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants