ATFutures / geoplumber

Serve geographic data from R and consume with scalable front end.
https://atfutures.github.io/geoplumber/
59 stars 7 forks source link

gp_map option to separate data file #73

Closed layik closed 4 years ago

layik commented 5 years ago

Update, this is not "straightforward" and requires removing the jsx pattern of writing the JS code which is preferred in my coding style. It may need a rewrite of the current "standalone" template file.

layik commented 5 years ago

at least

Screenshot 2019-03-28 at 14 21 55 Screenshot 2019-03-28 at 14 22 02

https://reactjs.org

layik commented 5 years ago

So I have found the way to do this.

The only way to do this, is to have a precompiled version of the code in ES as stated by the React docs, and import into the browser with a standard <script src='react_no_jsx.js'>. I would like to keep my code in JSX and there is a good reason for it (human readability and conciseness). In our case a 251 line is transpired into 325.

But providing docs for this would mean a considerable amount of work. Example section below.

Screenshot 2019-03-28 at 16 57 26
layik commented 5 years ago

To clarify:

  1. keep html code & scripts in a file say geoplumber.html
  2. keep React code in a file say react.js (as in the example above)
  3. data in data.json (or data.js)

But I see little value in the whole exercise I must say.

layik commented 4 years ago

This is not useful even if done. Revisit if need be.