News for hackers. Stuff that matters.
Re:D3 in Depth by andybak on Sunday April 15, 2018 @07:00PM (#16845516)
This seems so defeatist. Is each graph really that much of a special snowflake that we can't have frameworks that cover the 80% use case but allow you to drop to a lower level when needed?

I am disinclined by temperament to use low level tools for tasks that really should have a sensible generic abstraction. I know some people's brains err in the other direction - each to their own.

(I'm pretty sure tools exist. I used https://bokeh.pydata.org a few years ago when I needed something along these lines. I looked at d3 and had a similar reaction to the grandfather comment)

Re:D3 in Depth by jcranmer on Monday April 16, 2018 @01:12AM (#16846782)
If what you want is a tool that basically does Excel-style static charts for data, then d3 is absolutely the wrong tool. Where d3 shines is when you need to handle smooth, dynamic updates.

In practice, handling dynamic updates requires so many hooks into the data that you can't really define a sensible abstraction layer and have it work well for both simple cases and complex cases. D3 is the successor to Protovis, itself the successor to Flare, itself the successor to Prefuse. And having used all of them save Flare (since I've never had the ability to write Flash code nor the desire to do so), d3 is the only one that I've actually enjoyed using.

Re:D3 in Depth by gumballhead on Sunday April 15, 2018 @09:15PM (#16846045)
I guess I'm one of those people who thinks that d3's api is an amazing level of abstraction. It took a bit for it to click for me, but that was mostly because it was my first exposure to functional programming.

If I ever have to make a chart with another language, I cry because I can't use d3. I have reimplemented portions of d3's api in other environments like native Android before. Digging through the docs to find whatever configuration variable I'm supposed to set reminds me of the days of jquery plugins.

Re:D3 in Depth by gumballhead on Sunday April 15, 2018 @09:27PM (#16846082)
I will say though that it's been a side-project idea of mine for several years now to build a JSX-like templating language that would generate d3 code. Never got around to it.
Re:D3 in Depth by curiousgal on Sunday April 15, 2018 @11:27PM (#16846482)
Can you point me to some resources that can help me with D3?
Re:D3 in Depth by gumballhead on Monday April 16, 2018 @09:03AM (#16848640)
I'd be happy to. Can I ask first what you've tried and what you had trouble with? I think a lot of why d3 is considered low-level is that there are lot of external things you do need to know. For example, for me, it wasn't d3 itself but functional programming that I didn't really understand. For those who don't do web development much, it might be DOM (and in particular, SVG) manipulation.

The d3 specific parts are the idea of mapping data to DOM elements (which is the part I think is beautiful), how it uses the data join to do so, and how you use the scale functions to map from data space to pixel space to set the element positions and other attributes.

Feel free to email me if you like -- it's on my profile.

Re:D3 in Depth by colordrops on Sunday April 15, 2018 @07:06PM (#16845537)
There are higher level visualization tools built on D3.
Re:D3 in Depth by johnsonjo on Monday April 16, 2018 @01:49PM (#16851080)
You can still use d3, but use a d3 charting library on top of it like nvd3 [1]. It gives you a prebuilt chart but you can modify it using d3 commands. It’s pretty useful and high level, but if you need the low level api it is there.

[1]: https://nvd3.org

Re:D3 in Depth by kops on Sunday April 15, 2018 @08:17PM (#16845813)
I agree with he sentiment as an outsider, but let's build 5 bar charts and talk about this stuff again :-)