OpenWaterFoundation / owf-app-gapminder-d3

Open Water Foundation gapminder web application
0 stars 1 forks source link

Streamline coping of example into InfoMapper #1

Open smalers opened 3 years ago

smalers commented 3 years ago

We need to streamline integration of third party tools with the InfoMapper so that code and examples for testing flow from the original Gapminder into InfoMapper.

First, there is an established protocol for separating InfoMapper's development/test configuration from an InfoMapper implementation, as follows:

  1. InfoMapper has its own assets in 'assets/app-default'.  These are the test files that Josh uses.  I assume that he may want to configure a simple GapMinder here but that is for you two to coordinate.  In general, test data should be relatively small so as to not bloat up the InfoMapp repo.  Josh should be the one that integrates and tests anything in InfoMapper.  The 'assets/app' folder contents are actually ignored from the repo because they get copied in from an implementation (see #2 below).  Josh, I expect that if you integrate an example that you include a README that explains to developers and me what was done.

  2. For implementations that use InfoMapper, the assets are in 'assets/app'.  Separate implementations that populate these files have their own repositories and workflows to process data.  I have 3 InfoMapper implementations, with the Poudre Basin Information website being the most complex.  There is a process to create the maps within each repo (dynamic files are git-ignored) and copy into the InfoMapper 'assets/app' folder.  These extra copy steps are accomplished by a script 'web/copy-to-infomapper.sh' that I typically run in Git Bash.  See the README file.  If anything is unclear, please communicate because you should not waste time trying to figure things out.  I may need to clarify the README.

You need to discuss with Josh the best way to do InfoMapper integration work.  You can do work in 'assets/app-default' and coordinate with Josh via pull request or some other handoff.  However, see the next option.

Or, you can somehow do work separately and copy into 'assets/app' for initial work and then Josh can take over and incorporate into InfoMapper test configuration.  This could be accomplished by adding a copy script in the original owf-app-gapminder-d3 repo that would copy the necessary implementation files.  We are trying to keep Angular separate from the core Gapminder JavaScript code so that the Gapminder can be used in different situations.  However, if all you are doing is copying the files into an InfoMapper application I think it would be OK to write a script to do the work.  The alternative that is also an option would be for Josh to write a similar script to copy from the owf-app-gapminder-d3 repo into InfoMapper.

Using a script rather than manual command line or copy forces you to figure out the command line to run. The script should use relative paths, with some reasonable assumption such a the repos will be cloned at the same folder level. You will see in my scripts that there is a line that figures our the folder for the script and then other folders and files are relative to that. This ensure s that the work is as portable as it can be.

smalers commented 3 years ago

Here is the Angular library discussion: https://angular.io/guide/creating-libraries

I had not read this in awhile. This seems like a clean way to integrate Gapminder with InfoMapper. However, I'm not sure if building the Angular-friendly npm package can occur in the JavaScript-focused repo (which is not Angular) or something like the test application (which is Angular).

smalers commented 3 years ago

After thinking about this some more, I have the following suggestion. Creating a script to copy GapMinder files into an Angular application like InfoMapper could perhaps best be done as follows:

  1. Create the script in the GapMinder repository. Keep the script current as GapMinder is enhanced.
  2. Make sure the script has a parameter for the destination folder of the copy, for example --destination-folder=xxxx.
  3. Each application such as InfoMapper can have a second script that calls the first script. The second script would determine the destination folder, such as the main application folder (infomapper) so that the first script can copy into the correct standard Angular folders.

This approach will allow the developers of each side of the software to have control over what they need to control. Sofia would take care of #1 and #2 and Josh would take care of #3.