Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

second example gives NullPointerException javax.swing.ImageIcon.loadImage #3

Closed
trevor opened this issue Jul 12, 2013 · 4 comments
Closed

Comments

@trevor
Copy link

trevor commented Jul 12, 2013

user=> (use 'rhizome.viz)
nil
user=> (def g
  #_=>     {:a [:b :c]
  #_=>      :b [:c]
  #_=>      :c [:a]})
#'user/g
user=> (view-graph (keys g) g
  #_=>     :node->descriptor (fn [n] {:label n}))
nil
user=> (view-graph (keys g) g
  #_=>     :cluster->descriptor (fn [n] {:label n})
  #_=>     :node->cluster identity
  #_=>     :cluster->parent {:b :c, :a :c})

NullPointerException   javax.swing.ImageIcon.loadImage (ImageIcon.java:309)
user=> (pst)
NullPointerException
  javax.swing.ImageIcon.loadImage (ImageIcon.java:309)
  javax.swing.ImageIcon.setImage (ImageIcon.java:369)
  rhizome.viz/view-image (viz.clj:53)
  rhizome.viz/view-image (viz.clj:50)
  clojure.core/comp/fn--4156 (core.clj:2341)
  user/eval2474 (NO_SOURCE_FILE:1)
  clojure.lang.Compiler.eval (Compiler.java:6619)
  clojure.lang.Compiler.eval (Compiler.java:6582)
  clojure.core/eval (core.clj:2852)
  clojure.main/repl/read-eval-print--6588/fn--6591 (main.clj:259)
  clojure.main/repl/read-eval-print--6588 (main.clj:259)
  clojure.main/repl/fn--6597 (main.clj:277)
nil
user=> (System/getProperty "java.runtime.version")
"1.8.0-ea-b94"
@ztellman
Copy link
Owner

Is graphviz installed? When it's not, you get a similar message. If it is, which version?

@trevor
Copy link
Author

trevor commented Jul 12, 2013

Yes, and the other examples generate without error.

% dot -version
dot - graphviz version 2.30.1 (20130712.1559)
libdir = "/usr/local/Cellar/graphviz/2.30.1/lib/graphviz"
Activated plugin library: libgvplugin_quartz.6.dylib
Using textlayout: textlayout:quartz
Activated plugin library: libgvplugin_dot_layout.6.dylib
Using layout: dot:dot_layout
Activated plugin library: libgvplugin_core.6.dylib
Using render: dot:core
Using device: dot:dot:core
The plugin configuration file:
    /usr/local/Cellar/graphviz/2.30.1/lib/graphviz/config6
        was successfully loaded.
    render  :  dot fig gd map pic pov ps quartz svg tk vml vrml xdot
    layout  :  circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi
    textlayout  :  textlayout
    device  :  bmp canon cgimage cmap cmapx cmapx_np dot eps exr fig gd gd2 gif gv imap imap_np ismap jp2 jpe jpeg jpg pct pdf pic pict plain plain-ext png pov ps ps2 psd sgi svg svgz tga tif tiff tk vml vmlz vrml wbmp xdot
    loadimage   :  (lib) bmp eps gd gd2 gif jpe jpeg jpg pdf png ps svg

@ztellman
Copy link
Owner

Okay, apparently whenever there's a syntax error, it just wouldn't return an image. I've made it so there's a much less mysterious exception, and also fixed the syntax error (which apparently only appeared between 2.28 and 2.30, so I wasn't seeing it on my machine until I upgraded).

This is fixed in the new release, 0.1.9.

@trevor
Copy link
Author

trevor commented Jul 12, 2013

looks great, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants