-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow usage outside of the browser - in NodeJS with node-canvas #29
Comments
The node-canvas module has a native dependency, which needs installing some pre-requisites depending on the operating system before the actual module can be installed. I was not sure if you wanted to add it to the development dependencies; I did it and included a testing script in the nodejs-test branch and I can create a pull request if you like. |
I found the closed issue #27 by chance when googling. Your opinion makes sense, not to make everyone, who integrates nomnoml on a web page, depend on PhantomJS or other heavy dependency. I created nomnoml-cli for the command-line and/or NodeJS integrations. About the dagre integration: I'd prefer depending on dagre loaded from node_modules to doing the current workaround (#31). I cannot simply load the newest dagre version, because its interface was changed when the version 0.5.0 was released. The last working dagre version is 0.4.6. Was there a reason to upgrade nomnoml to the new interface? |
The pull requests are marked with a build failure:
Apparently the registration of this project for the Travis CI builds has not been finished yet, but I assure you that the code works :-) I tested using the test pages and the Jasmine test specs. The pages open OK. 1 spec from the 16 failed but the failure was not caused by my changes. |
It is not supposed to use Travis (yet). Fixing that. We saw some layout differences in later versions of Dagre, and earlier versions don't have RequireJS support. That is the reason for embedding the Dagre source inside the project. The goal is to have NodeJS support, but it is a work in progress. I will probably refactor the renderer so that it receives the dagre as a parameter instead of depending on it being available globally. |
I tried to handle the dependency on dagre in the same way as on lodash in a8239cd. In the nodejs-separate-dagre branch I load lodash and dagre installed by NPM on the command line; dagre version must be < 0.5.0. In the browser I still load the files from the lib directory, which could be changed too. |
I just merged the SVG branch that allows (rudimentary) support for SVG rendering, which by it nature is node-compatible since no canvas is involved. |
Thanks a lot for publishing this project! I believe that it has more potential than powering the web page editor.
I'd like to use nomnoml for generating diagrams in developer documentation. Instead of checking in binary images together with nomnoml sources, just the nomnoml sources would be maintained and the images would be generated when the documentation output is generated. It would mean calling nomnoml from a command-line tool.
When not running in the browser, the tool would have to either start the browser in the background and communicate with it, or integrate a headless browser like PhantomJS, or use an alternative canvas implementation like node-canvas. The former two possibilities would be tricky to make for a quickly executable tool. The latter would need a reliable canvas implementation. Let's have a look at the latter:
Luckily, nomnoml does not use other browser features than the canvas. What prevents nomnoml from being used like this?
I tried to make the necessary changes in my fork. Would you be interested in making nomnoml usable from NodeJS?
The text was updated successfully, but these errors were encountered: