Live data from Hacker News

Why is D3 so Verbose?

theheasman.com

71–75 of 75 posts

Re: Why is D3 so Verbose?

#72
post #50

I could not get over the fact that 0,0 in d3 is the top left corner instead of the bottom left. Why?? Everything in real life uses bottom left for 0,0! Probably because the first EGA/VGA accelerators worked this way to save one instruction in the most common use case and things never change....

It's not a d3 thing, it is an SVG thing. It's pretty much the standard for 2d computer graphics. Also same in CSS.

I know that it is a SVG thing[1], but wouldnt that be a point of sth. like d3 - to be a software that gives me the option to choose my coordinate system origin with one line of code and deals with all the bullshit internally?

[1] and before that, a "every screen is a CRT TV with a photon gun that 'draws' lines, starting in the top left"-thing

Re: Why is D3 so Verbose?

#73
post #60
post #50

I could not get over the fact that 0,0 in d3 is the top left corner instead of the bottom left. Why?? Everything in real life uses bottom left for 0,0! Probably because the first EGA/VGA accelerators worked this way to save one instruction in the most common use case and things never change....

It predates EGA. Most/all 8bit BASIC systems were top left, and they got it from somewhere earlier. Spreadsheets are top left, as are lots of other apps graphical or otherwise. The web (CSS, SVG etc). OpenGL etc etc. CRTs scanned downwards, most people read downwards. I would say that nearly everything in the real world (outside math) especially computer related uses top left as an origin.

> I would say that nearly everything in the real world (outside math) especially computer related uses top left as an origin.

I concede that point, its not want to meant, but I did express my point poorly.

  My point is:
  - A lot of things work like books[1]: top-left to bottom-right
  - However, 99+ % of graphs (anything from revenue numbers to health data) in all mediums (books, newspapers, websites) use a bottom-left origin. Never seen a revenue bar growing from top to bottom. In fact, I dont remember the last time i have seen a graph not using the I. Quadrant. Do you?
  - D3.js (imo) is a lib to create graphs from data, but does not abstract this problem away? Why?
[1] "western/latin"-style books ofc

Re: Why is D3 so Verbose?

#74

More granular control, more verbosity. I am still proud of the D3 gadget I made about 8 years back as a green web dev. Couldn't have made it any other way, not sure if I could with any other library today . Wouldn't want to do it again, though, unless I was a dedicated front-end guy.

What was the gadget? I'm also more of a back-end guy that occasionally does front-end. I have a strong design taste, but it takes a lot of effort to improve my skills be able to act on it. I feel like D3 appeals to people with a strong sense of taste.

It was a little gauge to help visualize how much money was left in a given stage of a health insurance plan. Not exactly the coolest thing, but... hey. Still happy about it.

Re: Why is D3 so Verbose?

#75

First of all, shocked people still use d3. Hasn't there been something better? It's pretty ancient by javascript standards. Do people still use jquery too? Haha... been about a decade since I touched this stuff! Second of all, isn't it ungodly slow? I get that it can draw a few boxes nicely, and maybe shuffle them around, but I had to write my own engine using html canvas because d3 couldn't get svg to flow properly…

Vue is about as ancient yet people still use that. Python is even older.
Post reply on HN