• Share on Google+

It’s New Year’s again, which means people are thinking about resolutions. This blog post will explore a hot topic in the Tableau world: D3. What is it? Is this something I should learn in 2018? Would D3 be a good fit for me in my current situation?

Although I have only been working in D3 for about a month, I have a unique perspective to offer on this subject from my four years of Tableau experience.

What is D3?

Created by Mike Bostock, D3.js is a JavaScript library that focuses on data visualization. Like Tableau, it was born at Stanford University and became popular after Mr. Bostock joined the New York Times in 2012.

D3.js will be turning seven in February 2018. Although this may sound old in technology time, remember Tableau is already hitting the 15-year mark. So, you shouldn’t feel like you missed out from waiting too long. D3 has experienced many changes since it launched, and it will continue to change in the future.

For example, HTML5, which natively reads XML-based SVG, began only in 2014. It is also worth noting that Mike Bostock’s new project, a new JavaScript-based data science notebook named Observable, hasn’t even been released yet. People in these dataviz and data science communities are still trying to figure everything out.

Similar to Tableau, D3 provides another way to visually encode data in order to provide meaning through visual communication and human perception. The main difference is Tableau translates your requests to represent data in various ways through a drag-and-drop interface using the VizQL language. In contrast, when using D3 you are forced to write code to build to your visualizations.

As light as Tableau’s platform is compared to traditional business intelligence tools, D3 is even lighter. With HTML5, CSS3, core JavaScript, and D3, you can structure, style, and support interactivity in your data visualization ideas without limit. However, this freedom comes with the cost of greater complexity and projects taking longer to complete.

…but what about Tableau?

Isn’t speed important?… especially with Tableau’s mantra about failing fast? Yes! This was my main reason for not trying to learn D3 earlier, because many of my designs and insights required fast iterations. Depending on the situation, a Tableau analyst can run circles around D3 programmers, because in D3 everything is built from scratch or with heavy modifications from other frameworks or libraries.

If you’re already proficient in Tableau, then you might be wondering if learning D3 would be beneficial to you. Like many complicated questions in the data visualization field, the safe answer is “it depends”. So, this next section will go over the many different reasons why learning d3 could either be the right or wrong resolution for you in 2018.

Reasons to learn D3

1. You need a new challenge

In my unique situation, I used Tableau almost exclusively throughout a four-year period. In 2017, I felt like I hit my first bad plateau. As a few people in the community are already aware, I felt a bit stagnant with data visualization after several setbacks that had occurred. Nearly one month ago, I decided to switch things up, and I picked up the D3 book, the Interactive Data Visualizations on the Web.

Without high expectations, I started reading and struggling through the exercises. Once the key points were understood, I became enamored with the challenge of learning something new every day. If you feel like you’re stuck in a rut lately too, then it might be a good time to try D3 and rekindle your passion for dataviz.

2. You want precision when designing a user experience

One major benefit of using D3 is the control it gives you over how to best optimize user experiences across all devices. I had underappreciated this fact when my world consisted of Tableau only, and this is almost certainly the biggest reason that most news organizations use D3 for interactive graphics. When building seamless graphics on the web, you can take full advantage of the latest web technologies to make sure every visitor receives a perfect dataviz experience.

3. You want to create charts that can handle real-time data or animations

D3 is a dichotomy of simplicity and complexity. From a performance standpoint, it’s extremely fast and lightweight. Essentially, D3 is writing instructions on what properties should exist for all of the scalable vector graphics shown. These instructions are dynamic, so the graphics should be drawn based on the data values and rules created throughout the program.

When you update the data, D3 immediately reflects these changes without schedules or extracts. With every D3 view, you are designing and managing different states that change based on new data or user interactivity. This approach greatly improves performance, while also giving you the ability to visualize data in real-time and use animation.

An example of a bar chart reading from live-updating data.

4. You want to benefit from reusable code

When writing code in D3, it’s usually best to force yourself to take on a programmer’s mentality when building new data visualization projects. Creating user stories, developing test cases, building templates, and writing documentation can be unfamiliar steps in your Tableau workflow, but in D3 it quickly becomes important. Even simple D3 visualizations may require thousands of lines of JavaScript.

Building more ambitious projects, like fully-interactive dashboards or web applications, often require help from supporting JavaScript frameworks or libraries. However, if you’re organized, then you can slowly build upon the functionality you had created in previous projects. The more functionality that can be built up over the long run will allow you to continue to tackle more ambitious projects later in the year.

5. You want to see what you can create with complete design freedom

When coding data visualizations yourself, it can be both tedious and exciting. Sometimes you need to design simple charts for simple use cases, and the extra work is not appreciated. Other times, you really need to win over your audience. When fighting for every second of limited attention spans, you need every edge you can get. In D3, you can overlap graphics to create completely unique charts and intricate design effects.

6. You want to be more involved with the #OpenVis Community

If you have been to a Tableau Conference, then you know how big the Tableau Community is. However, it can be easy to miss what’s going on in the related Open Vis Community. The D3 community is a collection of very talented visual journalists, non-profit contributors, data visualization researchers, and independent freelancers. With the choice of Python, R, and D3, you already have access to incredibly powerful technology, which allows you to share new work and collaborate on many exciting projects.

In case you’re interested, the Open Vis Conference is in Paris in 2018.

7. You want to diversify your skills

Two important reasons may encourage you to learn other data visualization technologies outside of Tableau. First, the industry might change unexpectedly. In this scenario, only having Tableau experience could be a disadvantage when pursuing new opportunities.

Second, instead of resigning yourself to accept poor use cases for new Tableau projects, give yourself the option to provide alternative solutions to your clients by using your new knowledge and expertise. Instead of forcing a square peg into a round hole with Tableau every single time (which is best used for data discovery and visual analysis) or the potentially worse option, saying ‘no’ to your now disappointed internal/external client, wouldn’t it be better to offer alternatives to visualize data?

8. You want to find another reason to ignore Power BI

Okay, this one is a joke… sort of 🙂

Reasons to avoid learning D3

With every coin there are two sides, and I must now curb your enthusiasm (only a tiny bit, I swear!) with the challenges/frustrations of learning D3.

1. You’ve tried coding before, and you hated it

If you dislike coding, then you’re probably going to have a bad time. There is no way of avoiding the coding experience when working in D3. Furthermore, the less you rely on coding when building data visualizations, then the less power you have when customizing your dataviz work.

2. You cannot deal with distractions right now

You will be spending huge chunks of your precious time and draining your best creative energy every day trying to solve difficult cognitive challenges. These challenges can range from solving obscure error messages to finding out why all of the graphical circles from your scatter plot disappeared after making a small update. You will almost assuredly read through hundreds of stack overflow questions and pray another newbie had asked the exact same trivial question you currently have. Of course, you need this question answered before you can move on to your next frustration.

3. You do not want to invite new kinds of scrutiny

If you find people critiquing your designs intimidating, then the thought of people being critical of your coding style can be downright terrifying. Is my code readable? Is it efficient? On top of this, certain expectations arise when your work is being shared with D3. Some people may associate D3 work with professional journalism, which can be a daunting situation to face when you’re just trying to learn and get feedback on early project ideas.

Sharing work that you are not confident in can certainly be a challenge, and I deal with these same concerns. However, you shouldn’t let the fear of writing poor code keep you from having fun with D3.

Coding will improve with practice; remember that some of the most efficient coders lack the vision, imagination, and creativity needed to make a visually engaging viz. If you have used Tableau for a long time, then you have a great advantage when it comes to dreaming up new data visualization designs and project ideas. If you still find yourself nervous about sharing work in an unfamiliar medium, then it may be tough to get started and stay motivated.

4. You rely on fast on-demand analytics for ad-hoc questions

Like Jimmy Johns, Tableau is freaky-fast. In many business settings, which rely on access to quick data discovery for fast data-driven decision making, waiting hours for you to code something up in D3 to answer a pressing question is a non-starter. You may also gain a new nickname: “the bottleneck”.

Despite reassuring your increasingly anxious customers that slow-and-steady wins the race, remember that you are operating in an environment where seconds count. If you are not providing insights quickly enough, then eventually, they may start ignoring you while they use Tableau themselves without your help.

The less certainty of key metrics or organizational questions, the less appealing D3 becomes for organizational use. This is not to say D3 can’t be used for internal customers, but your teams really need to be selective when allocating resources for these more intensive data projects.

When it comes to larger organizations, D3 can be an appealing option because of its affordability, capacity to scale, and ability to allow organizations to visualize data in real-time. Although D3 may have several strong use cases for your internal customers, finding quick insights is not one of them.

5. You cannot commit to learning something new every day

I’m a big believer in spending at least an hour a day on complex subjects to ensure you don’t immediately forget what you just learned. Associate the commitment needed to learn D3 similar to what is required to learn a foreign language.

Building a routine has been essential for my learning so far: reading books and blogs, studying other people’s code, and working on personal projects. If you cannot establish a learning routine that you can stick to, then making meaningful improvements can be difficult-especially if you are constantly finding yourself relearning important material.

6. You don’t want to work on projects that take longer than a week

Rome wasn’t built in a day, and neither are D3 projects. Almost everything takes longer to build in D3. When projects require longer timelines, it can be tempting to procrastinate, especially if you are just starting to learn D3.

Procrastination and obscure code can be an unfortunate combination. Finding a file with a thousand lines of unfamiliar JavaScript code (because of course you completely forgot about it days afterward) is a situation you want to avoid. Trust me on this one. 🙂

Helpful Hint: start the habit of writing meaningful comments to help yourself out if this situation occurs.

Final Thoughts

If you’re on the fence about learning D3, I would encourage you to at least give it a try. You never know, you could be a hidden D3 genius and find that everything you make is effortless. The best way to find out if D3 is right for you is to take a chance and try it yourself!

Let me know if you are thinking about learning D3 in 2018 and feel free to ask me questions. I am sure I can point you the right direction. If you want me to cover something specific relating to D3 for a blog article in the future, then reach out to me on Twitter: @DavidAKrupp. Thanks for reading!

Additional Material to Explore on D3.js