Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Mastering D3.js
  • Table Of Contents Toc
Mastering D3.js

Mastering D3.js

By : Pablo NAVARRO CASTILLO
3.7 (7)
close
close
Mastering D3.js

Mastering D3.js

3.7 (7)
By: Pablo NAVARRO CASTILLO

Overview of this book

If you are a software developer working with data visualizations and want to build complex data visualizations, this book is for you. Basic knowledge of D3 framework is expected. With real-world examples, you will learn how to structure your applications to create enterprise-level charts and interactive dashboards.
Table of Contents (14 chapters)
close
close
13
Index

Highlighting chart elements

We will create a simple chart depicting a series of circles that represent fruits and the number of calories we can get from 100 grams of each fruit. To make things easier, we have created a JSON file with information about the fruits. The file structure is as follows:

{
  "name": "Fruits",
  "data": [
    {
      "name": "Apple",
      "description": "The apple is the pomaceous fruit..."
      "amount_grams": 100,
      "calories": 52,
      "color": "#FF5149"
    },
    ...
  ]
}

We will represent each fruit with a circle and arrange them horizontally. We will map the area of the circle to the calories by serving, coloring them with the color indicated in the data item. As usual, we will use the reusable chart pattern, creating a closure function with the chart attributes and a charting function that contains the rendering logic, as shown in the following...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Mastering D3.js
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon