canviz, jake and npm

I wanted to play with canviz (http://www.ryandesign.com/canviz/) to play around with graphviz and javascript.

It’s still not clear what I’ll be able to do quickly with it but first I needed to install it.

I first tried from the source tar ball provided on the web site (http://canviz.googlecode.com/). This led to many issues that I’m provided here below. The outcome is that after an hour, I could not install it. So, I decided to start from the SVN,

svn checkout http://canviz.googlecode.com/svn/canviz/trunk/ canviz-read-only

and again no success: the javascript somehow was not working. The old version from the examples worked but not the new ones (see below). Finally, I found a link to the GIT repo and with that version, it worked out of the box:

git clone https://github.com/koops/canviz

 

Installing canviz from the source using npm and jake

!! This did not work at the end but some information here below could be useful.

In order to install canviz from the source, you need to install jake. But before, you need another tool called npm, an executable installed with Node.js (http://nodejs.org/download/).

tar xvfz node-v0.10.17.tar.gz
cd node-v0.10.17
./configure
make
sudo make install

Then, you can either install jake from the source file or using npm, which I realised later on. So, here is what I did to install jake from the source. First, get the source file from https://github.com/mde/jake

# installing jake 
git clone git://github.com/mde/jake.git
cd ./jake
make
sudo make install

Then, you can come back to the canviz installation from source.

Just type the following command in the canviz directory:

jake

I got this error:

[prompt] jake
jake aborted.
Error: Cannot find module 'browserify'
    at Function.Module._resolveFilename (module.js:338:15)
(See full trace by running task with --trace)

Here, a module is missing. You can install missing modules with npm:

npm install browserify

There are a couple of other modules to install. There was not problem except canvas:

make: Entering directory `/home/cokelaer/Downloads/canviz-read-only/node_modules/canvas/build'
  CXX(target) Release/obj.target/canvas/src/Canvas.o
In file included from ../src/Canvas.cc:8:0:
../src/PNG.h: In function ‘cairo_status_t canvas_write_png(cairo_surface_t*, png_rw_ptr, void*)’:
../src/PNG.h:139:10: error: ‘CAIRO_FORMAT_RGB30’ was not declared in this scope
make: *** [Release/obj.target/canvas/src/Canvas.o] Error 1
make: Leaving directory `/home/cokelaer/Downloads/canviz-read-only/node_modules/canvas/build'
continue....

Here the solution was to install a specific version of canvas as specified in the file package.json.

npm install canvas@1.0.4

Some references:

  • http://www.cappuccino-project.org/blog/2010/04/introducing-jake-a-build-tool-for-javascript.html
  • http://nodejs.org/download/
  • http://code.google.com/p/canviz/wiki/HowToUse
  • http://stackoverflow.com/questions/14472522/cannot-find-module-browserify
Please follow and like us:
This entry was posted in Computer Science and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *