Hello,
I made a nodebox 3 file (.ndbx) that generates a dashboard of a production status.
It is based on csv files that change every day.
For the moment, I have to open each day the nodebox file manually and generate the png.
I would like to generate automatically the dashboard with a script that I could execute with our Continuous Integration System.
Is there a way to call nodebox3 in a command line with a .nbdx file and tell it to generate a png image?
Thank you!
Gilbert
The new NodeBox forum is live! Everything from support.nodebox.net moved here: sign in with the same email to pick up your old posts. Something not working? Write to forum-support@nodebox.net.
NodeBox 3From the old forum
How to automatically generate a png export from a .ndbx file in a command line (with a script)?
-
-
NodeBox team Hi,
I've added a GitHub Issue that tracks this.
I've also solved it :-)
The nodebox.jar now has a new class, nodebox.NodeBox, that serves as a command-line tool renderer.
Since you don't only need the nodebox.jar but also all of its dependencies, you first need to find the full classpath. Use
ant classpathfor this:ant classpath ... classpath: [echo] /Users/USERNAME/.m2/repository/org/clojure/clojure/1.6.0/clojure-1.6.0.jar:...Copy the full classpath, and invoke it like this:
java -cp CLASSPATH nodebox.NodeBox YOURFILE.ndbxExample:
java -cp /Users/USERNAME/.m2/repository/org/clojure/clojure/1.6.0/clojure-1.6.0.jar:... nodebox.NodeBox ~/Desktop/colors.ndbxThis will generate a file in the same folder with the PNG extension.
There are two options:
-o FILEAllows you to override the output file-l FILEAllows you to specify the location of thelibrariesfolder, which contains the NodeBox system libraries. (By default we look in the current directory for alibrariesfolder)
Hope this helps,
F
-
NodeBox team The NodeBox JAR now contains all dependencies, so assuming you're in the root of the NodeBox Git repo, you can just do:
java -jar dist/lib/nodebox.jar YOURFILE.ndbxYou still need to refer to the system libraries folder.