The best books for learning how to code interactive graphics

Why am I passionate about this?

I’ve been making web pages since the World Wide Web began in the mid-1990s. Back then, the web was visually quite sparse. It wasn’t until the late 2000s that new browser capabilities let the web get visually interesting and an exciting place for interactive graphics. Graphics are great: they can be informational (like charts and maps) or purely aesthetic. My personal journey of learning to code interactive graphics has been so rewarding that I’ve shared the love with others through teaching creative coding workshops and undergraduate courses. If you’re new to coding or computer graphics, I hope you’ll give one of these books a try!


I wrote...

Unstuck: Javascript

By Scott Murray,

Book cover of Unstuck: Javascript

What is my book about?

Everyone who codes on the web has one thing in common: We get stuck! That’s normal; we’re only human, after all! But proficient coders get unstuck more quickly than the rest. Unstuck: JavaScript gets you moving again—quickly—with three simple steps that point you to directly to your best next step.

Shepherd is reader supported. When you buy books, we may earn an affiliate commission.

The books I picked & why

Book cover of Getting Started with p5.js: Making Interactive Graphics in JavaScript and Processing

Scott Murray Why did I love this book?

If I were getting started with coding graphics today, I would start with this book, hands down. Learning p5 is the easiest way to create interactive graphics that run in a web browser, and this book is a very friendly, accessible, and beautifully illustrated introduction to coding graphics with p5.js—no prior experience needed. You might be wondering about the name “p5.js”. It’s a JavaScript library (that’s the “.js” part) based on Processing, the open-source programming language created for artists and designers. (More on Processing in a moment.) I have taught college courses with this book, and students love it. Plus, all the skills you learn here with p5 are applicable to JavaScript—the world’s most popular programming language—more generally.

By Lauren McCarthy, Casey Reas, Ben Fry

Why should I read it?

1 author picked Getting Started with p5.js as one of their favorite books, and they share why you should read it.

What is this book about?

Processing opened up the world of programming to artists, designers, educators, and beginners. The p5.js JavaScript implementation of Processing reinterprets it for today's web. This short book gently introduces the core concepts of computer programming and working with Processing. Written by the co-founders of the Processing project, Reas and Fry, along with Lauren McCarthy, one of the minds behind p5.js, Getting Started with Processing gets you in on the fun!


Book cover of Aesthetic Programming: A Handbook of Software Studies

Scott Murray Why did I love this book?

I love this book so much. It is a bit less “how-to” and a bit more “why in the world are we interested in programming and what does that mean for us as individuals and also for society at large?” That is to say, you can learn to code from this book—in JavaScript with p5.js, specifically—but Aesthetic Programming is not merely about learning to code; it’s also a provocative, critical exploration of code as a medium for thought, communication, and creative expression. When you code, you’re participating in the creation of “computational culture.” With this book by your side, you will be a more self-aware cultural citizen. (Also, this book is visually so, so beautiful. Just leafing through the pages inspires me.)

By Winnie Soon, Geoff Cox,

Why should I read it?

1 author picked Aesthetic Programming as one of their favorite books, and they share why you should read it.

What is this book about?

The book explores the technical as well as cultural imaginaries of programming from its insides. It follows the principle that the growing importance of software requires a new kind of cultural thinking - and curriculum - that can account for, and with which to better understand the politics and aesthetics of algorithmic procedures, data processing and abstraction. It takes a particular interest in power relations that are relatively under-acknowledged in technical subjects, concerning class and capitalism, gender and sexuality, as well as race and the legacies of colonialism. This is not only related to the politics of representation but also…


Book cover of Processing: A Programming Handbook for Visual Designers and Artists

Scott Murray Why did I love this book?

This book changed my life. Known simply as “the blue book” in creative coding circles, I discovered this in a bookstore in Cambridge, Mass., just blocks from where Casey and Ben had created Processing at MIT (and then wrote this book). It opened me up to Processing—their programming language for artists and designers—but also to code as a creative medium. Until then, I saw code as a dry, tedious way to fight with computers. Now I know that code can be just as expressive, engaging, and emotional as prose and poetry.

While the syntax in this book is for Processing (which you can download and run on your computer for free), the concepts are equally applicable to p5.js (which runs in a web browser, also for free).

By Casey Reas, Ben Fry,

Why should I read it?

1 author picked Processing as one of their favorite books, and they share why you should read it.

What is this book about?

The new edition of an introduction to computer programming within the context of the visual arts, using the open-source programming language Processing; thoroughly updated throughout.

The visual arts are rapidly changing as media moves into the web, mobile devices, and architecture. When designers and artists learn the basics of writing software, they develop a new form of literacy that enables them to create new media for the present, and to imagine future media that are beyond the capacities of current software tools. This book introduces this new literacy by teaching computer programming within the context of the visual arts. It…


Book cover of The Nature of Code

Scott Murray Why did I love this book?

If you want your interactive graphics to feel like they are real objects—real things moving around on the screen—then you have to learn how to mimic the natural world. For an object to feel like it has weight, you have to mimic gravity. For a flock of birds to feel real, you have to mimic how real birds swarm in the sky. Yes, this does involve little math. But fortunately, Dan is a superstar teacher, and he will gently walk you through (a) the math and (b) how to translate that math into code.

Speaking of code, this book uses Processing.js, which is an older adaptation of original Processing to JavaScript. That said, the techniques are all equally applicable to modern-day Processing and p5.js.

By Daniel Shiffman,

Why should I read it?

1 author picked The Nature of Code as one of their favorite books, and they share why you should read it.

What is this book about?

How can we capture the unpredictable evolutionary and emergent properties of nature in software?

How can understanding the mathematical principles behind our physical world help us to create digital worlds?

This book focuses on a range of programming strategies and techniques behind computer simulations of natural systems, from elementary concepts in mathematics and physics to more advanced algorithms that enable sophisticated visual results. Readers will progress from building a basic physics engine to creating intelligent moving objects and complex systems, setting the foundation for further experiments in generative design.

Subjects covered include forces, trigonometry, fractals, cellular automata, self-organization, and genetic…


Book cover of Foundation ActionScript 3.0 Animation: Making Things Move!

Scott Murray Why did I love this book?

Okay, hear me out. Yes, this book was published in 2007. Yes, it’s ostensibly about ActionScript, the coding language in Flash, which no one uses anymore. But you won’t use this book to learn ActionScript or Flash: You’ll use it to learn how to make things move with code, in any language. You’ll skip over the ActionScript-specific parts in favor of the lucid explanations and helpful illustrations. Your visual brain will appreciate seeing how sines, cosines, and tangents are relevant—and necessary!—to make digital things move. (Your heart will wish your brain had paid better attention in trigonometry class years earlier, but hey, no regrets!) The chapters “Trigonometry for Animation” and “Velocity and Acceleration” alone are worth the purchase price.

By Keith Peters,

Why should I read it?

1 author picked Foundation ActionScript 3.0 Animation as one of their favorite books, and they share why you should read it.

What is this book about?

This is the first definitive and authoritative book available on ActionScript 3 animation techniques. ActionScript animation is a very popular discipline for Flash developers to learn. The essential skill set has been learned by many Flash developers through the first edition of this book. This has now been updated to ActionScript 3, Adobe's new and improved scripting language. All of the code has been updated, and some new techniques have been added to take advantage of ActionScript 3's new features, including the display list and new event architecture. The code can be used with the Flash 9 IDE, Flex Builder…


5 book lists we think you will like!

Interested in computer programming, computer science, and algorithms?

10,000+ authors have recommended their favorite books and what they love about them. Browse their picks for the best books about computer programming, computer science, and algorithms.

Computer Programming Explore 39 books about computer programming
Computer Science Explore 32 books about computer science
Algorithms Explore 36 books about algorithms