News for hackers. Stuff that matters.
Re:The Trouble with D3 by cowpig on Tuesday June 12, 2018 @07:20PM (#17298956)
I have a background in both web development and data science, and have used several different visualization libraries in python, R (ggplot), and JS.

It still takes me a crazy amount of time to get a simple chart or graph working in D3 if it's anything more than copy/pasting an example. The last thing I did was an area graph that you could click and drag one of the edges and it would update the numbers in the legend as you did it. It took me 20-30 hours to get it working, and I'm sure I re-invented multiple things that D3 provides because it was easier to just write them from scratch than trying to find where Bostock hid it in the library and then decoding whatever crazy abstractions he came up with for it. I think he's bad at naming stuff and also bad at writing docs.

By the time I get something working in D3, I've come close to the point where I could have just written all the abstractions myself. I can use a lightweight virtual DOM library and just write functions that take data and output DOM objects.

D3 does barely more than that, at the cost of learning some really funky abstractions.

I really wish there was a library out there like D3 that tried harder not to surprise me with every abstraction.

But, I think the problem is just a hard one, because I'm not aware of anything that's much better :(

Re:The Trouble with D3 by tcgarvin on Tuesday June 12, 2018 @10:12PM (#17299729)
Longtime D3 (even Protovis) user here. I think you're very correct in that D3 itself is not a good choice for "a simple chart or graph". If that's all I needed, I'd stick with HighCharts, or ggplot, or any of dozens of other libraries that do simple charts well, and often with a lot more batteries included. My unsolicited advice would be to consider staying away from D3 until you need it.

But if you're doing anything remotely bespoke, with any sort of custom interaction or transition, or anything in which you need to multiplex several datasets in a single set of visualizations, this toolkit is hard to beat.

My favorite personal D3 use case so far is modified animated scatter plots/beeswarms using force layouts. Immortalized for me in the "Four Ways to Slice Obama’s 2013 Budget Proposal" ( https://archive.nytimes.com/www.nytimes.com/interactive/2012... ), I've found that set of techniques useful for visualizing business processes in my own work over the years.

I've yet to encounter anything else that comes close to enabling those kinds of data visualizations. It's the "funky abstractions" some folks have trouble with that enable me to swap out X or Y scales with intuitive animations by literally replacing a single object and then re-invoking an idempotent render() function. Working with D3 is the most productive I've ever been in my life from a data visualization standpoint, and I suspect that will continue to be the case for some years.

Re:The Trouble with D3 by anyzen on Wednesday June 13, 2018 @07:19AM (#17302035)
This. I rewrote pure-JS implementation of some topology visualization in D3 and very much regretted it. The abstractions are simply weird, documentation poor and the resulting code difficult to reason about and maintain. Useful for toy projects, but I wouldn't use it in a serious app anymore.

> I really wish there was a library out there like D3 that tried harder not to surprise me with every abstraction.

Interestingly enough, I find that the combination of React + inline SVG fill this space pretty nicely. The engine is well thought out and documented, as is SVG. And animations are easier to do with CSS anyway.

EDIT: note that React is declarative too, which helps with visualizations a lot.

Re:The Trouble with D3 by mbesto on Tuesday June 12, 2018 @10:47PM (#17299857)
> It still takes me a crazy amount of time to get a simple chart or graph working in D3

Wrong tool for the job.

D3 fills the void between "just send my data to a bar chart" and "I need some charts, maybe I'll use raw JS to manipulate SVG's". You're probably in the former camp.

Re:The Trouble with D3 by davidwparker on Wednesday June 13, 2018 @01:41PM (#17305337)
Why would you say that?

`The last thing I did was an area graph that you could click and drag one of the edges and it would update the numbers in the legend as you did it.`

That doesn't sound like "just send my data to a bar chart" to me.

Re:The Trouble with D3 by staticautomatic on Tuesday June 12, 2018 @11:03PM (#17299921)
Out of curiosity, what would you use for "just send my data to a bar chart?"
Re:The Trouble with D3 by db1 on Tuesday June 12, 2018 @11:57PM (#17300121)
Re:The Trouble with D3 by acqq on Wednesday June 13, 2018 @01:45AM (#17300561)
http://www.chartjs.org/samples/latest/

The examples do "cubic" instead of just "connecting the dots" but luckily it can be turned off:

http://www.chartjs.org/samples/latest/charts/line/interpolat...

Re:The Trouble with D3 by bpicolo on Wednesday June 13, 2018 @08:43AM (#17302463)
Google Charts is an option I use a lot - surprised more people don't know about it. Maybe just because it was developed before the hip new land of React? (A bunch of react wrappers exist for it though)

https://developers.google.com/chart/

Re:The Trouble with D3 by thirdsun on Wednesday June 13, 2018 @09:16AM (#17302721)
In addition to the alternatives already mentioned I really like https://frappe.io/charts
Re:The Trouble with D3 by mbesto on Wednesday June 13, 2018 @12:55AM (#17300370)
What the other replies said.
Re:The Trouble with D3 by workinthehead on Tuesday June 12, 2018 @11:59PM (#17300131)
HighCharts for paid, Chart.js for open source.
Re:The Trouble with D3 by mwaitjmp on Wednesday June 13, 2018 @01:42AM (#17300543)
Flot is also a good choice. It's old now and hasn't been updated in a long while but if I'm not mistaken, grafana still makes use of it.
Re:The Trouble with D3 by methyl on Wednesday June 13, 2018 @07:26AM (#17302066)
AmCharts
Re:The Trouble with D3 by esterly on Wednesday June 13, 2018 @12:20AM (#17300218)
try Billboard.js a nice wrapper on top of D3v4 https://naver.github.io/billboard.js/demo/#Chart.Combination...