r/reactjs • • Nov 03 '21

D3 and React Crash course: Build a responsive line chart

https://www.youtube.com/watch?v=T1RgT0Yh1Lg
16 Upvotes

5 comments sorted by

3

u/IndecisiveSuperman Nov 03 '21

I feel like D3 is overkill for 90% of graphing use cases. I am open to differing opinions but the overhead of learning and time it takes to build a single graph doesn't seem worth it to me unless you are building very complex graphs.

4

u/TaxPlot Nov 03 '21

I spent years using different graphing libraries, and way too often they worked wonderfully until you hit that one use case that isn't quite right and leads to hours of frustration. A few months ago I finally broke down and just learned D3, and now those problems have gone away. Just like anything else, D3 isn't that complex once you take the time to understand it.

But yeah, if you just need a simple graph every now and again, there's no reason not to just use an idiot-proof package.

3

u/ui-dev Nov 03 '21

I agree with you. I have used many chart libraries. I always find that when you want to customize a small detail that is crucial for the chart to make sense, the library just does not have such a feature. You can customize ABC but not D, but another charting library would allow you to customize BCD but not A. .In the past I had been given design by designers and I would immediately build it from the ground up using D3.

3

u/rahulkadukar Nov 03 '21

You cannot build very complex graphs unless you understand the simple ones and it's a good learning exercise to get your head around the whole d3 way of doing things.

But you are right that if someone is planning to use it to build a single basic graph (line, bar, pie etc), then it is overkill.

2

u/ui-dev Nov 03 '21

Thats the point of the video, I hope this video helps someone who does want to build something complex by understanding the basics of how to put a chart together. Most chart libraries do a good job of making it easy to put-together standard charts. But if you are a front-end developer who deals with Designers then learning D3 is valuable.