AGA8 icon indicating copy to clipboard operation
AGA8 copied to clipboard

Implementation in Vanilla JS

Open TorrensJoaquin opened this issue 3 years ago • 5 comments

Implementation of AGA8 algorithm in Vanilla JS. Example implementation in p5js.

TorrensJoaquin avatar May 26 '21 18:05 TorrensJoaquin

Also, I tried to run your JS code on my side, and I have no idea how to interface with the copy-paste target. Can you please show an example in the HTML file? Perhaps pre-populate the dialog with a valid input?

ianhbell avatar May 26 '21 18:05 ianhbell

  • I still have no idea how to use the HTML file; some documentation is needed. Maybe a tiny txt file that I could copy-paste into the text box could be provided in the HTML, or as a separate file.
  • I would not have separate copies of the JS files in the top level folder and in the example. Recommend to write a tiny python script that copies and renames the files into your example. This is to ensure you have one copy only, following DRY (don't repeat yourself)

ianhbell avatar Jun 16 '21 14:06 ianhbell

Dear Ian: Thanks for the fast response. I've uploaded a copy of the example html page on https://torrensjoaquin.github.io/GERG2008/ for testing in mobile devices and different computers/browsers. I'will delete it if we merge. I see it ok in there. Is hard to me to find the problem. Regarding DRY. Ok. Do you prefer to only show the example of implementation? The code will be available anyway. I've refused to use python because this could be useful non ITs professionals (without administration access in their day to day computer). But i will implement it if you will. Best regards.

TorrensJoaquin avatar Jun 16 '21 14:06 TorrensJoaquin

Actually I would maybe consider to put just the core javascript in this repository, and recommend that you put the other code somewhere else. That would mirror how things are handled in the other implementations. Then we would just need a small HTML file script that prints to the console the output values, something like: https://github.com/usnistgov/AGA8/blob/master/AGA8CODE/C/GERG2008_test_01.cpp

ianhbell avatar Jun 16 '21 21:06 ianhbell

That's easy then. Already uploaded. Please, let me know if it is okay. Best regards.

TorrensJoaquin avatar Jun 17 '21 01:06 TorrensJoaquin