Skip to Content
Interactive Data Visualization for the Web, 2nd Edition
book

Interactive Data Visualization for the Web, 2nd Edition

by Scott Murray
August 2017
Beginner to intermediate
472 pages
10h 17m
English
O'Reilly Media, Inc.
Content preview from Interactive Data Visualization for the Web, 2nd Edition

Appendix D. Sharing Your Code

The D3 community is big on sharing code, whether for showing off new projects and techniques or for asking for help. And let me tell you: people want to help you! But when asking questions, it’s essential to share your code. (Have you ever tried to debug a project without the project itself?)

You are free to publish and share your code however you like, but the most common venues are:

  • bl.ocks.org

  • Bl.ock Builder

  • Gistup

  • Codepen, JS Bin, or similar

  • Normal web server

I’ll walk through each of these options.

bl.ocks.org

Mike Bostock is a big fan of examples. He can’t get enough of them. In 2013, he even gave a great talk making the case for examples titled, yes, “For Example”.

In fact, to encourage us all to create and share our own examples, he built a web service called bl.ocks.org. The blocks service (as I will refer to it, because it is so annoying to type the period in “bl.ocks”) makes it very easy to share your D3 code and projects with others. You can use it to share any kind of code, not just JavaScript and D3, but because Mike built it, it’s sort of optimized for D3 purposes.

Thus, blocks are very popular in the D3 community. Posting a block and sharing the link is a great way to show off your latest project, share a work-in-progress with others, or—most importantly—to get help troubleshooting when you’re at your wit’s end. Before you even begin writing your question on StackOverflow or the D3 Google Group, post a block! Because the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Storytelling with Data: A Data Visualization Guide for Business Professionals

Storytelling with Data: A Data Visualization Guide for Business Professionals

Cole Nussbaumer Knaflic

Publisher Resources

ISBN: 9781491921296Errata Page