Nodejs CLI to create SVG charts serverside #74
Replies: 3 comments 14 replies
-
|
hey @harlantwood this is a really good idea! 💡 About the approach, I prefer the 2nd. WDYT? |
Beta Was this translation helpful? Give feedback.
-
|
FYI due to other things heating up, not sure I’ll be able to land this anytime soon, but will try! |
Beta Was this translation helpful? Give feedback.
-
|
Update: not expecting to have time to do further work on this, but for anyone interested, feel free to fork my prototype, which works great: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
No.
Describe the solution you'd like
I have a working prototype of generating an SVG on the server side via a new CLI functionality. It uses
jsdomto fake a DOM, and then extracts the SVG string, outputting it to stdout, where you can (for example) redirect it to a file.The current API accepts a few JSON blobs as command line arguments -- it's not really intended to be used directly by humans, but more by other programs. We could of course later add more granular options which could be more human friendly if desired.
Example of current use:
( note that --settings '{some json}' is not yet in the prototype, but will be soon.
This command generates a standalone SVG that can be opened directly in a browser. Example SVG generated from the command above:
There are multiple options for how this feature could be integrated (or not) here:
tsmto execute typescript directly, which is useful only if you clone the reponpx astrochart --options ...) we would probably move to nodejs using the webpack transpiled outputBeta Was this translation helpful? Give feedback.
All reactions