Closed superjai closed 3 years ago
I appreciate these points Jai, but let's distinguish between these repositories for different aspects of interactive infographic creation and maintenance:
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.
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.
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)?
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:
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 onlycalcofi_plot
: modal window generation onlycalculate_SST_anomaly
: modal window generation onlycalculate_statistics
: modal window generation onlygenerate_html_4_rmd
: modal window generation onlyget_dates
: modal window generation onlyget_figure_info
: modal window generation onlyget_nms_polygons
: modal window generation onlymap_nms_sites
: modal window generation onlymd_caption
: modal window generation onlyplot_SST_anomaly
: modal window generation onlyplot_intertidal_nms
: modal window generation onlyplot_metric_timeseries
: modal window generation onlyply2erddap
: modal window generation onlyrender_all_rmd
: modal window generation onlyrender_figure
: modal window generation onlycreate_website
: infographic generation onlyget_modal_info
: modal window AND infographic generationYou can see that only the last two functions
create_website
andget_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.