Live data from Hacker News

D3 7.0

github.com

51–60 of 65 posts

Re: D3 7.0

#51
post #46

Earlier quoted context omitted.

This. It’s literally just a matter of reordering variables, adding or removing a pair of parentheses, and removing the “return svg.node” call. People love to complain about free open-source documentation. Especially for d3 it seems. Shout out to Mike Bostock for all his awesome work.

Knowing what to re-order, remove/add is non-trivial for a newbie. Relevant discussion: [0]. Let's look at the edit distance between [1] and [2]. Previous frustration at [3]. [0] https://news.ycombinator.com/item?id=27415725 [1] https://stackoverflow.com/questions/66966625/converting-obse... [2] https://observablehq.com/@d3/contours [3] https://talk.observablehq.com/t/i-want-to-learn-d3-i-don-t-w...

A newbie could simply use the export functionality in observable, which automatically generates iframe code, or vanilla-js code or react code for you.

Quoting other people that don't want to spend 5 minutes on their problem, doesn't make your not wanting to spend 5 minutes on your problem any more valid.

If you want a no code solution for data viz, use Excel, if finding the export button, or reordering variable declarations in an order, where things come before the things they are used by, is already too difficult, then you're not gonna understand D3 anyways.

Re: D3 7.0

#52
post #36

The one critique I have of D3 is that it is becoming increasingly closely paired with Observable, such that when I'm searching for examples of how to make something in d3, I can only find Observable examples that require the Observable runtime in order to function properly. I think the examples should have a JS native version in addition to the Observable implementation.

Someone should make an open source version of the Observable ecosystem or integrate it into Jupyter tooling better. The notebook format is not encrypted or anything.

I posted this on HN a little while back [1], it's an open source alternative editor/runtime for Observable as a plugin for Starboard.

[1]: https://starboard.gg/nb/nfwK2VA

Re: D3 7.0

#53
post #32
post #30

Earlier quoted context omitted.

I guess it depends on your goal. If your goal is to learn how to code a nice reactive environment like a notebook is great. If your goal is to learn how to take a library and use it in a piece of software to release to the world, the notebook is next to useless.

If you think that the trivial differences between the two environments makes either of them useless to learn the other, franky I'll doubt you'll have the skill to learn D3 properly at all. Taking a dom node and hooking it into the dom is not magic in D3. All that obervable does is hook in any dom node you return for you.

I wasn't sure whether I was going to comment, but this kind of comment is rather unhelpful and poor form. Some may prefer not to have a (mock) notebook runtime in their application for good reason that has nothing to do with their skill.

I see you are passionate about defending Observable, and that's cool - it's a great piece of tech, but please remember that everybody's requirements are different and valid too.

Re: D3 7.0

#54
post #32

Earlier quoted context omitted.

If you think that the trivial differences between the two environments makes either of them useless to learn the other, franky I'll doubt you'll have the skill to learn D3 properly at all. Taking a dom node and hooking it into the dom is not magic in D3. All that obervable does is hook in any dom node you return for you.

I wasn't sure whether I was going to comment, but this kind of comment is rather unhelpful and poor form. Some may prefer not to have a (mock) notebook runtime in their application for good reason that has nothing to do with their skill. I see you are passionate about defending Observable, and that's cool - it's a great piece of tech, but please remember that everybody's requirements are different and valid too.

Then don't use the runtime and rewrite the code to plain js. All you have to do is declare cell contents as variables, and replace the first D3 select, that attaches to a reified dom node, with an #id selector. D3 is a series of tools, where the difficult parts are completely orthogonal to what observable provides.

It's like complaining that you can't learn how to drive in the evening, because there is a different sky color, than during the time you'll take your morning commute. The sky color is not the relevant nor difficult part.

I have my own (different) complaints about observable, but I'm sick and tired of bottom of the barrel programmers complaining about free stuff not being pre-digested enough for them.

Re: D3 7.0

#55
post #47
post #22

So, is d3 tree-shakeable yet? If I import { scaleLinear } from 'd3' in a webpack-built project, will I get only the scaleLinear code? As far as I remember, in v6 this will import a lot of (or perhaps the rest of) d3 as well.

You can also just import it from d3-scale.

Yeah, I know.

I am probably being unreasonable; but it's kind of nice to be able to have a single third-party dependency out of which you can pick what you need at the moment, rather than a host of small third-party dependencies. Kind of like lodash, from which you can at least import individual functions (import merge from 'lodash/merge') rather than installing all those functions as individual packages.

Re: D3 7.0

#56
post #51

Earlier quoted context omitted.

Knowing what to re-order, remove/add is non-trivial for a newbie. Relevant discussion: [0]. Let's look at the edit distance between [1] and [2]. Previous frustration at [3]. [0] https://news.ycombinator.com/item?id=27415725 [1] https://stackoverflow.com/questions/66966625/converting-obse... [2] https://observablehq.com/@d3/contours [3] https://talk.observablehq.com/t/i-want-to-learn-d3-i-don-t-w...

A newbie could simply use the export functionality in observable, which automatically generates iframe code, or vanilla-js code or react code for you. Quoting other people that don't want to spend 5 minutes on their problem, doesn't make your not wanting to spend 5 minutes on your problem any more valid. If you want a no code solution for data viz, use Excel, if finding the export button, or reordering variable decla…

Your post comes off really condescending and shitty. I don’t think it’s necessarily true, either.

I think a lot of newbies might just find the Observable stuff a bit overwhelming. Maybe their background isn’t JavaScript. That does not mean they aren’t gonna understand.

What are you even suggesting. They aren’t capable? We must all look like ants to you, up there.

As a dev with over a decade of experience in the front-end and no issues picking up d3 on my own, I still sympathize with overwhelmed newbies. Mike is trying to shove Observable down everyone’s throats in hopes of getting a good valuation and selling it some day, and I don’t blame him wanting to cash in D3 for this purpose. But let us recognize it plainly, and recognize the adverse consequences that has on a subset of the userbase.

And it’s fine if he doesn’t want those people on for the ride. It may also just mean a long-term atrophy of the D3 community.

Re: D3 7.0

#57
post #56
post #51

Earlier quoted context omitted.

A newbie could simply use the export functionality in observable, which automatically generates iframe code, or vanilla-js code or react code for you. Quoting other people that don't want to spend 5 minutes on their problem, doesn't make your not wanting to spend 5 minutes on your problem any more valid. If you want a no code solution for data viz, use Excel, if finding the export button, or reordering variable decla…

Your post comes off really condescending and shitty. I don’t think it’s necessarily true, either. I think a lot of newbies might just find the Observable stuff a bit overwhelming. Maybe their background isn’t JavaScript. That does not mean they aren’t gonna understand. What are you even suggesting. They aren’t capable? We must all look like ants to you, up there. As a dev with over a decade of experience in the front…

> Mike is trying to shove Observable down everyone’s throats in hopes of getting a good valuation and selling it some day

That's an allegation that completely contradicts mikes and observables behaviour to date. They are insanely obsessed with making the barrier of entry of observable as low as possible, give most of the code away as open source, and are more concerned about empowering minorities than having a working business.

But what has it earned them? A bunch of ungrateful brats that couldn't code their way out of a hole if their lives depended on it.

Can you imagine people from any other profession being this whiney and entitled? "Heres a free plan for a bridge! BuT It'S iN MeTrIC SySteM :(!", "CiVIl EnGinEErINg is NoT MAtH!", "I doN'T WanT tO Do A DeStrUCtiVe TeST, CaN'T We JuSt ShIP iT???"

I come off as condescending? Good! I'm tired of catering to the absolute minimum. Observable is f** simple, if you don't have the ability or drive or whatever to learn it, and appreciate the help it provides in learning D3, you won't be able to learn D3. That's not me being mean, that's just realistic. D3 is super f*n hard, I have to look up stuff 24/7, because it's not build to be easy, it's build to be the most generic thing you can imagine to make visualisations.

Let's be real, the people don't complain about observable because they're overwhelmed newbies, but because they don't want to do their job. It's the people that copy paste stuff into their codebase without a glimmer of an attempt to understand it. Spend 10 minutes inside an interactive playground understanding the tool you're gonna use? MoNKeY WAnNt CopY PAsTe NoW!

The living personification of legacy code, the kind of coworker some poor person that actually takes the whole software _engineering_ thing seriously has to clean up after.

Ironically it's do-gooders like Mike and Melody that brought us into this mess in the first place, with their "everybody can be empowered to program" and "always say 'yes, and...'" bull**.

You act as if D3 documentation in observable was some kind of burden, when in reality observable is a bunch of training wheels.

Importing the library is not the difficult part, neither is selecting the DOM node to attach to, the difficult part is the selections, scales, axis, tics, interaction helpers, drawing helpers, simulations, layouts and whatnot.

But sure take the training wheels off! Shaving those 2 pounds of your bike will surely make it go a bit faster. But since you were unwilling to learn how to ride it in the first place, it's just gonna make you fall on your face more quickly.

Re: D3 7.0

#58
post #36

Earlier quoted context omitted.

Someone should make an open source version of the Observable ecosystem or integrate it into Jupyter tooling better. The notebook format is not encrypted or anything.

I posted this on HN a little while back [1], it's an open source alternative editor/runtime for Observable as a plugin for Starboard. [1]: https://starboard.gg/nb/nfwK2VA

Nice!!

Re: D3 7.0

#59
post #46

Earlier quoted context omitted.

This. It’s literally just a matter of reordering variables, adding or removing a pair of parentheses, and removing the “return svg.node” call. People love to complain about free open-source documentation. Especially for d3 it seems. Shout out to Mike Bostock for all his awesome work.

Knowing what to re-order, remove/add is non-trivial for a newbie. Relevant discussion: [0]. Let's look at the edit distance between [1] and [2]. Previous frustration at [3]. [0] https://news.ycombinator.com/item?id=27415725 [1] https://stackoverflow.com/questions/66966625/converting-obse... [2] https://observablehq.com/@d3/contours [3] https://talk.observablehq.com/t/i-want-to-learn-d3-i-don-t-w...

It is trivial. I just told you what to remove, and tracebacks will inform you of the ordering.

I would advise the ‘newbie’ you speak of to learn how to read a basic error message and how to use the backspace key before tackling d3!

(For reference, just this week an intern on my team needed some d3 boilerplate for a fairly complicated plot. I wrote it for her in observable, with some guidelines on where to go next. She finished what was needed and cr’d directly to our codebase - at no point did either of us worry about the supposed difficult translation between observable and a js file.)

Re: D3 7.0

#60
post #55
post #47

Earlier quoted context omitted.

You can also just import it from d3-scale.

Yeah, I know. I am probably being unreasonable; but it's kind of nice to be able to have a single third-party dependency out of which you can pick what you need at the moment, rather than a host of small third-party dependencies. Kind of like lodash, from which you can at least import individual functions (import merge from 'lodash/merge') rather than installing all those functions as individual packages.

I agree with you and wish that were an option, but I do think most build tools will tree shake for you nowadays.
Post reply on HN