views:

109

answers:

2

I'd like to serve up statistical graphs based on Incanter with a framework like Ring or Compojure in a Clojure environment. I haven't seen any examples or links that do this. Could someone steer me toward working examples? Would Enlive help out here as well?

Thanks

+4  A: 

There is a tutorial entry about precisely that on the Data Sorcery blog: Building a Clojure Web application with Incanter, Compojure, and Leiningen.

(Data Sorcery is the official Incanter blog maintained by Incanter's author, David Edgar Liebke.)

Michał Marczyk
See my answer to this SO question for links to materials on Compojure 0.3.x -> 0.4.x transtion: http://stackoverflow.com/questions/3122749/good-current-documentation-and-or-tutorials-for-compojure-ring-development
Michał Marczyk
See also my answer to this question for an up-to-date summary of the present state of one part of the Clojure web stack: http://stackoverflow.com/questions/3180688/what-is-the-good-starting-point-to-developing-restful-web-service-in-clojure
Michał Marczyk
A: 

Hi, I knew about the link you mention but there are a couple issues.
Let me re-phrase my question.

First, what is the best web framework to use, as there are several choices now. Is Compojure still the way to go?

Second, if Compojure is recommended, is there an updated example that runs for the latest build [compojure "0.4.1"] as the current posting doesn't work due to a refactor. If Compojure is no longer recommended, are there runnable examples with other packages?

Thanks

simon-says
For the future: you should post this sort of updates / reactions to answers as comments on those answers, not separate answers. That aside, I have provided a link which might be helpful as a comment on my original answer above; let me know if this is not enough. As for whether Compojure is "still the way to go", it's one of the top Clojure libraries for solving the problem it attempts to solve (writing route definitions); you'll certainly want to investigate other libraries to go with it (again, see my comments on my answer for some (hopefully) useful resources).
Michał Marczyk
For some reason, I couldn't find a way to comment earlier so went with the answer area. Thanks for your postings, I will look into the links you provided. I guess what I'm really looking for is a discussion of the strengths and weaknesses of the various clojure web frameworks, where they fit in best and what they are designed to do that is different from each other, and lastly how they operate with incanter, ideally with more examples and docs. Many thanks.
simon-says
In this case, you might want to post a separate question about Clojure web frameworks and how they compare to each other. I believe Incanter would be simple enough to use as a library regardless of which webby libraries you choose for your app. Also see the "State of Clojure Web development" on the ggroup for potentially interesting bits of information: http://groups.google.com/group/clojure/browse_thread/thread/d9bff18ca4b5e845/5a70a0270ee9baf5
Michał Marczyk