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)?

2 replies Last reply

  1. 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

    Copy link
  2. 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 classpath for 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.ndbx
    

    Example:

    java -cp /Users/USERNAME/.m2/repository/org/clojure/clojure/1.6.0/clojure-1.6.0.jar:... nodebox.NodeBox ~/Desktop/colors.ndbx
    

    This will generate a file in the same folder with the PNG extension.

    There are two options:

    • -o FILE Allows you to override the output file
    • -l FILE Allows you to specify the location of the libraries folder, which contains the NodeBox system libraries. (By default we look in the current directory for a libraries folder)

    Hope this helps,

    F

    Copy link
  3. 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.ndbx 
    

    You still need to refer to the system libraries folder.

    Copy link

Know something that helps?

Sign in with your email address to reply. No password needed.

Sign in to reply