D3 7.0(github.com) |
I think the examples should have a JS native version in addition to the Observable implementation.
[1] https://datacrayon.com/shop/product/visualisation-with-d3/
D3 is a JS library for data visualisations.
Both are the brainchild of Mike Bostock. That's the connection. :)
I'm super grateful that they provide such good documentation, which is second to none, in a nicely explorable environment.
d3, on the other hand, has converted most of their examples to Observable, which requires extensive research to convert back to JS (in the best case) and in the worst case requires reverse engineering the runtime.
I'm not the only one with this opinion, there are plenty of others who have struggled through similar issues and discussed it.
"The process of converting an Observable notebook to standalone html and/or js is clearly not as simple and copying and pasting. The use of Observable notebooks for all D3 examples has made the introduction to the library much more challenging for this reason." [0]
[0] https://stackoverflow.com/questions/53155957/convert-d3-obse...
[1]: https://talk.observablehq.com/t/i-want-to-learn-d3-i-don-t-w...
Standard JS modules, very nice! D3 now works in all playgrounds and libraries even as dependencies without non-standard tooling!
https://jsbin.com/ducosajehi/edit?html,output
I do wish they didn't even publish UMD, that's a recipe for duplication if some libraries import the module and some import the UMD.
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.
D3 is a low level visualisation library where you write code.
Excel/Tableau are business tools.
D3 is the best way to make visualizations online. Yes, it requires learning the library and building things from scratch, but it's light years better than the dog shit modules Tableau offers.
The claim that one has to "reverse engineer the runtime" is simply absurd.
The people that complain about D3 on observable always turn out to have taken neither the time to understand Observable nor D3 and are looking for a way to just copy paste something into their codebase, without understanding it, and without any willingness to really learn the tools they are using. Which would have never worked in the first place, because D3 is not a plotting library like vega or observables plot, it's a library library, building material from which you can build your own bespoke visualisations.
Observable is in essence reevaluating the entire code with each "requestAnimationFrame", no fancy diffing a la react or other magic, if it runs in observable, it will also run in your code as a static thing. Copy paste the cells out of observable, prepend them with a "const" and you're done, not more work than removing and rewriting the boilerplate that's in every codepen.
That's how many of us learn, by dipping our toes into a new SDK by copying and pasting into our bare HTML/JS page and tweaking things to see what happens. Eventually we will get around to reading the full documentation.
I have made d3 examples and played around with the toolkit since back when it was in its infancy (called protovis or something). It has definitely become more and more difficult over the years for a beginner to jump into.
(Background: I have met Mike since I got my PhD from the hci/graphics lab at Stanford, but we did not overlap.)
I feel like the last point is often overlooked by documentation authors: When evaluating whether to use a library, I'm not just interested in what it can do, but also what it can't do! That's why I really enjoy the "you should use X if you want to do Y"/"you shouldn't use X if you want to do Z" sections present in some manuals.
I am a beginner, and have spent hours in frustration, because I couldn't figure out the examples.
In every other project I would copy and paste some examples and start playing with it to understand.
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.
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...
I find myself wanting to start with a working example I can riff off of more in d3 than with many other tools I've used, so I totally understand the appeal of interactive examples in Observable but find it super frustrating and cumbersome when it comes to actually rolling what I'm working on into an existing application.
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.
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.
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.
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.)
All I am saying is that the d3 team needs a "getting started" page aimed at allowing a dev to include one script tag (or a single npm install) and then copy and paste examples from the example gallery to get it quickly working on their own test website.
I recently tried getting back into d3 and I gave up (opted for another low threshold SVG toolkit). It's fine if d3 is aimed at other people who want to use observable.... It's just not targeted at me anymore.
I'd recommend Plot instead: https://observablehq.com/@observablehq/plot
It also works as a pure JS library, just like D3, but is based on a grammar of graphics idea, like ggplot. It's not infinitely flexible, but flexible enough, and build to get quickly to a chart, with as few lines as possible.
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 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.
Being softlocked into Observable is not a pro.
That's like trying to force every vim user into Jetbrain IDEs (both are great, not trying to start a flamewar here).
Sure an IDE will have more features (like Observable vs simple HTML file), but it's important to understand different people have different ways of doing things.
I know there are some folks who maybe come with sincere laziness, but the hard push with observable complicates an already complex thing. You don’t have to agree.
Keep being mad or whatever and shitting on newcomers to the field. I’ll stick to welcoming folks and trying to hear the merit in their complaints.
Guess who drives out female talent? Mediocre male white nerds who think they know it all and who don't have the open mindedness to learn tools like observable.
ObservableHQ is one of the most impactfull diversity pushing companies I've seen, but you accuse them of some ulterior motives for having the audacity of writing and hosting amazing D3 docs.
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.
Like I said, everyone I've seen complain so far, always turn out to not even want to learn basic stuff.