I’ve written a Reprocessing program using ReScript; it’s mostly gone OK so far.
I’d now like to do several more things, in increasing order of difficulty
-
Put my program into a web page so that others can play with it. I haven’t yet been able to figure out how to do this within React (see below).
-
The program is a kind of drawing tool made for laser-cutting plywood, and there are a few parameters like “How big should the drawing canvas be?” and “How thick is the plywood you’re using” that I currently set as globals at the top of my ReProcessing program because, as with many programs, this was supposed to be just a one-off thing. Is there a way to take a user-provided value from another component and have it become a usable value within my ReProcessing program? I’m imagining something like a dropdown of plywood-thicknesses, for instance. I can probably handle making a dropdown and getting a “prop” from it…but will my ReProcessing program be able to access that somehow?
-
The end result of the current ReProcessing program is a string (the text of an SVG file) that gets written to a file, but I’d really like to have this be downloadable from the web page. I was thinking I could use [download.js] (download.js) with the string as its argument to do this, but I can’t figure out how to call a “script” function like this from within my ReScript/React structure.
I’m incredibly naive about the structure of modern web applications, so I’ve been following along with (and making guesses about the updated names in a few cases) the stuff presented here, and here without really understanding everything that’s going on. So I’ve got a spinning logo, and even an increment-decrement counter from bobzhang’s example, and I’m beginning to get the big picture.
What I’d like is some advice about whether the things I’m hoping to do are even possible, and if so, any pointers/advice about them.
Thanks in advance.