Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a rough POC for generating maps from the CLI, related to #71. Ideally we'd be able to load a file into the JS, return HTML or an SVG, then pass that to a renderer and save an image. But right now the browser is the render engine.
I tried OWM -> React -> html2canvas directly, but the browser was required.
Tried running everything in JSDOM (which could potentially work), but html2canvas doesn't support SVG, relies directly on the browser for that.
This version loads the app in a headless chromium instance and then uses chrome's screenshot tool. Didn't need to screenshot cause the html2canvas save function works this way as well, but managing the file was more involved.
This is actually a workable solution but the full chromium instance is a little overkill. The only caveat to this PR is that it needs the dev server running. The need for the local server can be eliminated with a small build step and rendering the built files (or committing some built files), but I didn't go through the webpack config for that.
to test:
in a new tab, run the cli command
Try it out and let me know what you think