specviz icon indicating copy to clipboard operation
specviz copied to clipboard

Generates ugly SVG instead of pretty PNG

Open matthiasn opened this issue 8 years ago • 13 comments

Hi, I'd love to use this. But when I do as instructed in the README, I get some ugly SVG file rather than one of those great looking PNG file checked in with the repo. Here's a screenshot: spec

Ideally I'd like a good looking SVG, or dotfile that produces a good result when used with graphviz from the command line. But I tried that as well, and the result (when using the dotfile output without lines numbers) looks fairly similar:

graphviz

Any idea what the issue could be? Thanks

matthiasn avatar Sep 14 '17 03:09 matthiasn

@matthiasn Hmm, if you got the same output when using the dotfile w/ dot command line, then I'm not sure. What is it specifically that you don't like?

jebberjeb avatar Sep 20 '17 21:09 jebberjeb

Well, mostly that it's not the same information. In the PNG there are more than twice as many arrows, showing where something is used. Here, these connections are omitted.

matthiasn avatar Sep 21 '17 21:09 matthiasn

I see the same exact behavior, any updates on how to get the pretty png? I'd love to have something that looks like the example png instead of the screenshots posted above:

the example Instead of actual results

shlomiv avatar Jul 03 '18 18:07 shlomiv

Same for me too, using Clojure 1.9.0. I think specviz doesn't understand s/keys anymore?

oliyh avatar Aug 01 '18 13:08 oliyh

Same for me, if that helps.

marsmining avatar Oct 19 '18 17:10 marsmining

I started playing with some versions, and realized with deps like this:

  :dependencies [
                 [org.clojure/clojure "1.9.0-alpha12"]
                 [specviz "0.2.1"]

and the readme code like below I could generate a png file that looked nice:

(println "writting specviz example...")
(require '[specviz.core :as specviz] )
(specviz/diagram 'specviz.example nil "foo")

Not sure what exactly changed yet.

joefromct avatar Jan 22 '19 02:01 joefromct

Same here, unfortunately. Newest specviz, Clojure 1.10. I tried @joefromct 's version, but I need to be using Clojure 1.10, and with that I get an error trying to require specviz.core from 0.2.1.

Has anyone found a good alternative in the meantime?

eggsyntax avatar Dec 16 '19 16:12 eggsyntax

@eggsyntax can you try pasting your results for the command below, with i minimal reproducible error:

lein deps :tree

(assuming you are using lein)

Maybe there is a suggested exclusion we can use...

joefromct avatar Dec 16 '19 16:12 joefromct

You mean using Clojure 1.10 & specviz 0.2.1, ie the conditions under which I get the error? With 1.10 and 0.2.3 I don't get any errors, I just get the same not-very-useful output that was originally reported in this issue.

eggsyntax avatar Dec 16 '19 16:12 eggsyntax

Oh, yeah, I see I don't get that error on a fresh project with 1.10 and 0.2.1, interesting. The error I'm getting is

core> (require '[specviz.core :as specviz])
Syntax error (FileNotFoundException) compiling at (specviz/core.clj:1:1).
Could not locate clojure/spec__init.class, clojure/spec.clj or clojure/spec.cljc on classpath.

No suggestions from lein deps :tree, though, it just lists my dependencies (there aren't many): [EDIT: cut out many of the dependencies & still the same error, changing the deps tree to match:]

[12:30] dw-domain-specs> lein deps :tree
 [clojure-complete "0.2.5" :exclusions [[org.clojure/clojure]]]
 [nrepl "0.6.0" :exclusions [[org.clojure/clojure]]]
 [org.clojure/clojure "1.10.1"]
   [org.clojure/core.specs.alpha "0.2.44"]
   [org.clojure/spec.alpha "0.2.176"]
 [org.clojure/tools.logging "0.5.0" :scope "test"]
 [specviz "0.2.1"]
   [hiccup "1.0.5"]
   [org.clojure/test.check "0.9.0"]

[EDIT2: I've got to give up on it, at least for now]

eggsyntax avatar Dec 16 '19 17:12 eggsyntax

I don't think this has been fixed in 2021. Please let me know if anyone has got more things to try. Thank you for the project, that .png looks very good!

@eggsyntax have you ever found an alternative?

arichiardi avatar Jan 19 '21 16:01 arichiardi

The problem seems to be that spec->graphviz-elements* dispatches on 'clojure.spec/... keys while in recent years the namespace has moved to clojure.spec.alpha/....

I am attempting a quick fix

arichiardi avatar Jan 19 '21 19:01 arichiardi

I got something working and fixed the defmethods but unfortunately my example has got a lot of s/merge so I think I will park this for now - please let me know if there is any interest in a PR of what I have got

arichiardi avatar Jan 19 '21 22:01 arichiardi