Data Visualization with D3.js Cookbook


Data Visualization with D3.js Cookbook
eBook: $26.99
Formats: PDF, PacktLib, ePub and Mobi formats
$22.94
save 15%!
Print + free eBook + free PacktLib access to the book: $71.98    Print cover: $44.99
$44.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Overview
Table of Contents
Author
Support
Sample Chapters

Create stunning data visualization with the power of D3 Bootstrap D3 quickly with the help of ready-to-go code samples Solve real-world visualization problems with the help of practical recipes

Book Details

Language : English
Paperback : 338 pages [ 235mm x 191mm ]
Release Date : October 2013
ISBN : 178216216X
ISBN 13 : 9781782162162
Author(s) : Nick Qi Zhu
Topics and Technologies : All Books, Other, Web Development, Cookbooks, Open Source

Table of Contents

Preface
Chapter 1: Getting Started with D3.js
Chapter 2: Be Selective
Chapter 3: Dealing with Data
Chapter 4: Tipping the Scales
Chapter 5: Playing with Axes
Chapter 6: Transition with Style
Chapter 7: Getting into Shape
Chapter 8: Chart Them Up
Chapter 9: Lay Them Out
Chapter 10: Interacting with your Visualization
Chapter 11: Using Force
Chapter 12: Know your Map
Chapter 13: Test Drive your Visualization
Appendix: Building Interactive Analytics in Minutes
Index
    • Chapter 2: Be Selective
      • Introduction
      • Selecting a single element
      • Selecting multiple elements
      • Iterating through a selection
      • Performing subselection
      • Function chaining
      • Manipulating the raw selection
      • Chapter 3: Dealing with Data
        • Introduction
        • Binding an array as data
        • Binding object literals as data
        • Binding functions as data
        • Working with arrays
        • Filtering with data
        • Sorting with data
        • Loading data from a server
        • Chapter 4: Tipping the Scales
          • Introduction
          • Using quantitative scales
          • Using the time scale
          • Using the ordinal scale
          • Interpolating a string
          • Interpolating colors
          • Interpolating compound objects
          • Implementing a custom interpolator
            • Chapter 6: Transition with Style
              • Introduction
              • Animating a single element
              • Animating multiple elements
              • Using ease
              • Using tweening
              • Using transition chaining
              • Using transition filter
              • Listening to transitional events
              • Implementing a custom interpolator
              • Working with timer
              • Chapter 7: Getting into Shape
                • Introduction
                • Creating simple shapes
                • Using a line generator
                • Using line interpolation
                • Changing line tension
                • Using an area generator
                • Using area interpolation
                • Using an arc generator
                • Implementing arc transition
                • Chapter 8: Chart Them Up
                  • Introduction
                  • Creating a line chart
                  • Creating an area chart
                  • Creating a scatter plot chart
                  • Creating a bubble chart
                  • Creating a bar chart
                  • Chapter 9: Lay Them Out
                    • Introduction
                    • Building a pie chart
                    • Building a stacked area chart
                    • Building a treemap
                    • Building a tree
                    • Building an enclosure diagram
                      • Chapter 11: Using Force
                        • Introduction
                        • Using gravity and charge
                        • Generating momentum
                        • Setting the link constraint
                        • Using force to assist visualization
                        • Manipulating force
                        • Building a force-directed graph
                          • Chapter 13: Test Drive your Visualization
                            • Introduction
                            • Getting Jasmine and setting up the test environment
                            • Test driving your visualization – chart creation
                            • Test driving your visualization – SVG rendering
                            • Test driving your visualization – pixel-perfect bar rendering

                              Nick Qi Zhu

                              Nick Qi Zhu is a professional programmer and visualization enthusiast with more than a decade of experience in software development. He is the author of dc.js—a popular multidimensional charting library built on D3. Currently he is having fun and learning as a lead consultant at ThoughtWorks.
                              Sorry, we don't have any reviews for this title yet.

                              Code Downloads

                              Download the code and support files for this book.


                              Submit Errata

                              Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


                              Errata

                              - 7 submitted: last submission 10 Mar 2014

                              Errata Category: Code Related Page number: 16

                              1. In the code snippet there is the line:

                              if (!arguments.length) h; // <-- G

                              Instead it should be:

                              if (!arguments.length) return headline; // <-- G

                               

                              2. Five lines down there is the line:

                              if (!arguments.length) d;

                              Instead it should be:

                              if (!arguments.length) return descriptio

                              Errata type: code | page number: 20

                              The first code snippet in the page:

                              instance.headline = function (h) {
                              if (!arguments.length) h; // <-- G
                              headline = h;
                              return instance; // <-- H
                              };

                              Should be:

                              instance.headline = function (h) {
                              if (!arguments.length) return headline; // <-- G
                              headline = h;
                              return instance; // <-- H
                              };

                              Errata type: code | page number: 27

                              The first code snippet:

                              // get p element's style for font-size
                              d3.select("p").style("font-size");
                              // set font-size style for p to 10px
                              d3.select("p").style("font-size", "10px");
                              // set font-size style for p to the result of some
                              // calculation. style function also accepts a function as // the
                              value can be produced dynamically
                              d3.select("p"). style("font-size", function(){
                              return normalFontSize + 10;});

                              should be:

                              // get p element's style for font-size
                              d3.select("p").style("font-size");
                              // set font-size style for p to 10px
                              d3.select("p").style("font-size", "10px");
                              // set font-size style for p to the result of some
                              // calculation. style function also accepts a function as
                              // the value can be produced dynamically
                              d3.select("p"). style("font-size", function(){
                              return normalFontSize + 10;});

                              Errata type: code | page number: 42

                               

                              The following sentence:

                              This subset can be discovered by using an inverse of the Update difference, denoted as B\A.

                               

                              should be:

                              This subset can be discovered by using an inverse of the Enter difference, denoted as B\A.

                              Errata type: technical | page number: 19

                               

                              In the quotation at the end of the page -- the name (Crockfort D. 2008) should be (Crockford D. 2008).

                              And...

                              In the quotation: "If we create an object in the functional style, and if all of the methods of the
                              object make no use of this, then the object is durable. A durable object is simply
                              a collection of functions that act as capabilities."

                              The highlighted "this" is a JavaScript keyword.

                              Errata type: technical | page number: 237

                              In the "There's more..." section: The dbclick bullet heading should be dblclick.

                              Errata type: Technical | Errata page: 299

                              In the code snippet right before the heading "Test driving your visualization – SVG rendering":

                              var _parent = p, data;

                              should be:

                              var _parent = p, _data;

                              (Prefix "data" with an underscore.)

                              Sample chapters

                              You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

                              Frequently bought together

                              Data Visualization with D3.js Cookbook +    Building Web and Mobile ArcGIS Server Applications with JavaScript =
                              50% Off
                              the second eBook
                              Price for both: A$36.45

                              Buy both these recommended eBooks together and get 50% off the cheapest eBook.

                              What you will learn from this book

                              Learn how to use functional JavaScript so you can write it the D3 way Select and manipulate HTML and SVG elements efficiently in D3 Drive your visualization using data Master D3 scales and interpolators Animate your visualization with style Use SVG and various D3 path generators Explore D3 layouts and understand and leverage D3 force Build mobile-first interactive visualization with touch support Test-drive your visualization implementation Build multi-dimensional data visualization with crossfilter and dc.js in minutes

                              In Detail

                              D3.js is a JavaScript library designed to display digital data in dynamic graphical form. It helps you bring data to life using HTML, SVG, and CSS. D3 allows great control over the final visual result, and it is the hottest and most powerful web-based data visualization technology on the market today. "Data Visualization with D3.js Cookbook" is packed with practical recipes to help you learn every aspect of data visualization with D3. "Data Visualization with D3.js Cookbook" is designed to provide you with all the guidance you need to get to grips with data visualization with D3. With this book, you will create breathtaking data visualization with professional efficiency and precision with the help of practical recipes, illustrations, and code samples. "Data Visualization with D3.js Cookbook" starts off by touching upon data visualization and D3 basics before gradually taking you through a number of practical recipes covering a wide range of topics you need to know about D3. You will learn the fundamental concepts of data visualization, functional JavaScript, and D3 fundamentals including element selection, data binding, animation, and SVG generation. You will also learn how to leverage more advanced techniques such as custom interpolators, custom tweening, timers, the layout manager, force manipulation, and so on. This book also provides a number of pre-built chart recipes with ready-to-go sample code to help you bootstrap quickly.

                              Approach

                              Packed with practical recipes, this is a step-by-step guide to learning data visualization with D3 with the help of detailed illustrations and code samples.

                              Who this book is for

                              If you are a developer familiar with HTML, CSS, and JavaScript, and you wish to get the most out of D3, then this book is for you. This book can also serve as a desktop quick-reference guide for experienced data visualization developers.

                              Code Download and Errata
                              Packt Anytime, Anywhere
                              Register Books
                              Print Upgrades
                              eBook Downloads
                              Video Support
                              Contact Us
                              Awards Voting Nominations Previous Winners
                              Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
                              Resources
                              Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software