Skip to content
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

Generates ugly SVG instead of pretty PNG #3

Open
matthiasn opened this issue Sep 14, 2017 · 13 comments
Open

Generates ugly SVG instead of pretty PNG #3

matthiasn opened this issue Sep 14, 2017 · 13 comments

Comments

@matthiasn
Copy link

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

@jebberjeb
Copy link
Owner

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

@matthiasn
Copy link
Author

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.

@shlomiv
Copy link

shlomiv commented Jul 3, 2018

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

@oliyh
Copy link

oliyh commented Aug 1, 2018

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

@marsmining
Copy link

Same for me, if that helps.

@joefromct
Copy link

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.

@eggsyntax
Copy link

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?

@joefromct
Copy link

joefromct commented Dec 16, 2019

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

@eggsyntax
Copy link

eggsyntax commented Dec 16, 2019

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
Copy link

eggsyntax commented Dec 16, 2019

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]

@arichiardi
Copy link
Contributor

arichiardi commented Jan 19, 2021

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
Copy link
Contributor

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
Copy link
Contributor

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

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

No branches or pull requests

8 participants