10 ms·
Try D3 Now - D3 Visualization Tutorial
- swah 15y agoThe website's examples are much more eye catching: http://mbostock.github.com/d3/ex/voronoi.html http://mbostock.github.com/d3/ex/voronoi.html
- polymath21 15y agoWe use d3 extensively here at TwoSides and love it. Here's some examples: http://www.twosides.co/issues/185-should-euthanasia-or-physician-assisted-suicide-be-legal/ http://www.twosides.co/issues/185-should-euthanasia-or-physi... http://www.twosides.co/jono http://www.twosides.co/jono (the venn diagram/bar graph wouldn't be transparent if you had an account)
- icandoitbetter 15y agoThis is the best web UI I've seen in a long time, both in terms of functionality and beauty. Good luck.
- polymath21 15y agoThank you!
- jabr 15y agoJust curious, but do you support IE below 9? If so, how? svgweb?
- Vadoff 15y agoAww, thought this was for Diablo 3...
- yesbabyyes 15y agoI have eyed d3 eagerly for a while and now we enjoy using it for our node knockout entry (http://rapminder.com/ http://rapminder.com/). This tutorial comes in handy - thanks!
- asanwal 15y agoThis is great and quite amusing. I just wish I could compare the # of references to Cristal vs. Dom P over time :)
- yesbabyyes 15y agoThanks asanwal - you will! We have quite a few things we want to finish today before the competition ends, and even more afterwards.
- yesbabyyes 15y agoCheck it out: http://rapminder.com/words/cristal,perignon http://rapminder.com/words/cristal,perignon
- 100k 15y agoD3 is getting a lot of love lately! I like this tutorial as it nicely explains how to use events and animation. If you missed it, I wrote a D3 tutorial two weeks ago that shows how to do basic charting: http://www.recursion.org/d3-for-mere-mortals/ http://www.recursion.org/d3-for-mere-mortals/
- itcmcgrath 15y agoMy first thought upon seeing this was "Why is the D3 database on the top of hacker news???" http://en.wikipedia.org/wiki/Pick_database http://en.wikipedia.org/wiki/Pick_database
- Caged 15y agoI released a visualization I completed yesterday which is written in D3 (source on Github) - http://dealloc.me/demos/crime/2011.html http://dealloc.me/demos/crime/2011.html. Also, I've written an introduction to D3, focusing on what makes it different than your average charting library - http://dealloc.me/2011/06/24/d3-is-not-a-graphing-library.html http://dealloc.me/2011/06/24/d3-is-not-a-graphing-library.ht....
- jmatt 15y agoD3 and ClojureScript: http://keminglabs.com/cljs-d3/ http://keminglabs.com/cljs-d3/ http://groups.google.com/group/clojure/browse_thread/thread/0ec135ec63457e79 http://groups.google.com/group/clojure/browse_thread/thread/...
- ryanmarsh 15y agoI fucking love D3.
- deleted 15y ago[deleted]
- jrmoran 15y agoI might be missing something, since I just started learning it. But instead of drawing a circle like this sampleSVG.append("svg:circle") .style("stroke", "gray") .style("fill", "white") .attr("r", 40) .attr("cx", 50) .attr("cy", 50) .attr("width", 100) .attr("height", 100); I'd prefer to express it like this sampleSVG.append("svg:circle") .style({ "stroke": "gray", "fill": "white"}) .attr({ "r": 40, "cx": 50, "cy": 50, "width": 100, "height": 100}); That way, I can just pass object literals as arguments to functions such as attr.
- oscilloscope 15y agoCheckout this branch of d3: https://github.com/mbostock/d3/commits/map https://github.com/mbostock/d3/commits/map https://github.com/mbostock/d3/pull/179 https://github.com/mbostock/d3/pull/179 We're working on this syntax for: style, classed, property, on, attr, attrTween, style, styleTween. It's a more concise syntax, especially when the attrs are functions. An example from the tutorial: d3.select(this).selectAll("rect") .data(function(d){return d;}) .enter().append("svg:rect") .attr("fill", "aliceblue") .attr("stroke", "steelblue") .attr("stroke-width", "1px") .attr("width", function(d, i){return (histoW/dataset[0].length)+"px"}) .attr("height", function(d, i){return (d/dataMax[rectIdx]*histoH)+"px"}) .attr("x", function(d, i){return i*(histoW/dataset[0].length)+"px"}) Becomes: d3.select(this).selectAll("rect") .data(function(d){return d;}) .enter().append("svg:rect") .attr(function(d,i ) { return { "fill": "aliceblue", "stroke": "steelblue", "stroke-width": "1px", "width": (histoW/dataset[0].length)+"px", "height": (d/dataMax[rectIdx]*histoH)+"px", "x": i*(histoW/dataset[0].length)+"px" }; }); Three anonymous functions become a single function which returns an object.
- rorrr 15y agoSo it's like an incredibly verbose Raphaël? http://raphaeljs.com http://raphaeljs.com
- swah 15y agoFor making a circle, I thought the same thing.
- 100k 15y agoUnlike Raphaël or its predecessor library Protovis (http://mbostock.github.com/protovis/ http://mbostock.github.com/protovis/), D3 uses SVG as the graphical representation. This is more verbose, but is actually really powerful, because there's no translation between what your code is doing and what the browser is using to display your graphics. You can do anything SVG can do in your visualizations, and it is much easier to debug.
- rorrr 15y agoRaphaël uses SVG (and VML for IE browsers). Says so on the main page.
- 100k 15y agoYes, and so does Protovis. But you don't interface with SVG directly. To draw a circle in Raphaël, you use Raphaël.circle. In Protovis, you use pv.Dot. To draw a circle in D3? svg:circle.
- rorrr 15y agoSo both use SVG, you just use the SVG syntax. How is that an advantage? The whole point of libraries like that is not to abstract the presentation layer. Raphaël can be switched to WebGL, for instance, and you won't even need to rewrite any code using that library, while you're stuck with the verbose low level calls to a particular implementation of SVG.
- 15y ago