Quick C2 User Survey

183 views
Skip to first unread message

Mike Stanley

unread,
Mar 4, 2013, 3:12:57 PM3/4/13
to c2-...@googlegroups.com
I'm in the process of determining whether to go with C2 or D3 for an internal reporting tool.  The tool is already written in clojure and would benefit from server side rendering of larger datasets, but not a hard requirement.  I like the general philosophy/approach of C2 but before committing more time to it i'd like to take a pulse check: 

1) is the project still in active development?
2) anyone using it in production?
3) re: the big loud disclaimer/warning about alpha quality.  Granted, it's a nice safety tip, but what's the reality/risk factor?  is it in use in production anywhere?  how stable/unstable has the API really been from day-to-day?  where is the project heading?
4) are there more examples out there? 
5) has anyone built up or working on a higher level abstraction for basic charting, similar to what Rickshaw.js is to D3.
6) anyone using c2 to generate svg that is later converted to png or static image on the server side?
7) I get that animations are not supported by the API, but how about interactions?  Is this something that is out of scope and simply handled with typical JS event handlers and CSS visibility properties?
8) anyone using this in combination with incanter?  any war stories/lessons learned to share?
9) is the google group the best forum for interacting with the community or is there another outlet (irc or the like)
10) Any tips/guides on migrating from D3 to C2?

thanks in advance.

cheers,
... Mike

Bruce Durling

unread,
Mar 5, 2013, 4:24:27 AM3/5/13
to c2-...@googlegroups.com

I'd be interested in knowing too as I'm thinking about moving to c2 from d3. Though perhaps the two of us might be the start of a community. :-)

Cheers,
Bruce

--
You received this message because you are subscribed to the Google Groups "C2-cljs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to c2-cljs+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Taylor Sando

unread,
Mar 6, 2013, 2:25:02 AM3/6/13
to c2-...@googlegroups.com
I was using the library a couple months ago in conjunction with d3.  It worked well enough, but I wasn't really doing anything serious with it.  I really like knockback/knockout and d3 in javascript.  Seems like the ideas could easily be ported to clojurescript.  I'd be interested in helping out.

Kevin Lynagh

unread,
Mar 6, 2013, 12:23:06 PM3/6/13
to c2-...@googlegroups.com
Hi Mike,

It's great to hear your questions about C2.
Growing the open-source community around the project hasn't been a high-priority goal, and it's my fault for not making some of these things more clear.
(Disclaimer: I wrote C2 =)

1) is the project still in active development?
2) anyone using it in production?
3) re: the big loud disclaimer/warning about alpha quality.  Granted, it's a nice safety tip, but what's the reality/risk factor?  is it in use in production anywhere?  how stable/unstable has the API really been from day-to-day?  where is the project heading?

We (Keming Labs) use it regularly with our clients on projects that sound similar to yours (internal analytics tools), though we also used scales and other math pieces from C2 for a consumer-facing iPhone app (http://weathertableapp.com/).
There aren't currently any big changes on the roadmap for C2---the biggest was around June 2012 when

+ "unify!" side-effecting function was replaced with a more general "unify" datatype
+ the internal hiccup compiler was factored out into the Singult library
+ explicit use of watches was replaced with the "bind!" macro that automatically detects atom dependencies

Feature-parity with D3 has never been a goal for C2---we've just added things as we've needed them and as other users have requested them.
The core API has been stable since the move over to Singult, with just extra bits and pieces (scales, statistics, &c.) added since then.

4) are there more examples out there? 

I know several folks are using the project in production on commercial applications, but there's not a ton of open source stuff as far as I know.

5) has anyone built up or working on a higher level abstraction for basic charting, similar to what Rickshaw.js is to D3.

We're working on an implementation of the grammar of graphics that uses C2 as a rendering layer, but it's not open source:


6) anyone using c2 to generate svg that is later converted to png or static image on the server side?

We've done this on several projects via PhantomJS---I've also heard that Apache Batik is usable for that kind of thing (it even includes a CSS engine).

7) I get that animations are not supported by the API, but how about interactions?  Is this something that is out of scope and simply handled with typical JS event handlers and CSS visibility properties?

Yep---the "on" function in the c2.event namespace looks for data on DOM elements attached by the "unify" datatype, but aside from that there isn't any special support.
You can use whatever ClojureScript/JavaScript libraries and idioms your team likes.

10) Any tips/guides on migrating from D3 to C2?

One thing to note is that if you're on a JavaScript runtime this isn't a binary question.
It's perfectly fine to, e.g., use one of D3's categorical scales from to calculate attribute values in some Hiccup markup in C2.

I hope this post clears up some of your questions and helps you make an informed decision.
Feel free to email me off-list if you have project-specific details/questions.

cheers,

Kevin

Kevin Lynagh

unread,
Mar 6, 2013, 12:32:38 PM3/6/13
to c2-...@googlegroups.com
On Wed, Mar 6, 2013 at 3:25 AM, Taylor Sando <taylor...@gmail.com> wrote:
 I really like knockback/knockout and d3 in javascript.  Seems like the ideas could easily be ported to clojurescript.  I'd be interested in helping out.

Taylor, C2 internally uses a library I wrote called "reflex" that was inspired by Knockout's "computed-observables":


I'm not convinced this is the best approach (especially for larger, more complex applications, where it's easy to get yourself into trouble with circular dependencies).
Lately we've been doing a great deal of work with Angular.js, which has a dirty-checking approach for state updates rather than a dependency/callback chain:

    http://stackoverflow.com/questions/9682092/databinding-in-angularjs

and this has been working out very nicely.
 

--
You received this message because you are subscribed to the Google Groups "C2-cljs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to c2-cljs+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Kevin Lynagh
Keming Labs
http://keminglabs.com
888.502.1042

Daniel Woelfel

unread,
Mar 6, 2013, 2:55:53 PM3/6/13
to c2-...@googlegroups.com
6) anyone using c2 to generate svg that is later converted to png or static image on the server side?

I'm converting from svgs generated with the help of c2 to pngs at canhekick.it. If you're not concerned with speed or resource usage, I would go with PhantomJS. It's very easy to set up. 

To generate on-demand images at canhekick.it, I use batik. I didn't record the numbers from my benchmarks, but it's much faster than PhantomJS. It's not too hard to set up, but it took a bit to configure and figure out which css rules it doesn't allow.

My translation code is:

(defn svg-to-png [content]
    (let [out (ByteArrayOutputStream.)]
      (with-in-str (html content)
        (.transcode (PNGTranscoder.)
                    (TranscoderInput. *in*)
                    (TranscoderOutput. out)))
      (.toByteArray out)))

where the html is generated by hiccup. I found it easiest to embed the stylesheet into the svg. That looks like the following, where style-text is a string I slurped from my css file:

       [:defs
        [:style {:type "text/css"}
         (str "<![CDATA[\n"
              style-text
              "\n]]>")]""]

Hope that helps!

-Daniel
Reply all
Reply to author
Forward
0 new messages