Data Visualization
From choosing a chart and drawing a first line graph in D3 to dashboards, maps, plotting in R and Python and data journalism, data visualization as told through the free samples of the Leanpub books about it.
Created from the free samples of 7 Leanpub books and the descriptions and tables of contents of 17 more, with every source cited.
Data visualization is the representation of numbers as pictures, so that a reader can see in a moment what a table would make them work out. One book in the library shows the point with a year of monthly sales figures: in the table nothing stands out, and as a line chart the upward trend and the peak in one month are visible at once. Its author gives three reasons for the practice, that it is an effective way of understanding and communicating data, that it adds variety that engages a reader, and that a chart can be an appealing piece of work in its own right.[1]
The craft has two halves, deciding what to draw and getting it drawn. The first belongs to statistics and design, and the second, for anything published on the web, to programming. The library is strongest on the second, and above all on one tool: its most widely read book on any visual subject is a beginner's guide to the D3 library, which has sold nearly fifty thousand copies and exists in five editions for five versions of the library.[8] Around it are books on combining D3 with application frameworks, on ready-made charting libraries, dashboards and maps, on plotting in R, Python and MATLAB, on data journalism, and on the computer graphics beneath them all.
This article follows the subject from the choice of a chart through D3, D3 inside application frameworks, charts, maps and dashboards from ready-made libraries, plotting in statistical languages, data journalism, and graphics programming. Its sources are the free samples of the Leanpub books listed at the end, with the descriptions and tables of contents of the books whose samples were not available or not read, and every claim that rests on a source is cited to it.
Where to start
Someone who has never written a web page can begin with D3 Tips and Tricks v7.x (2021), the current edition of a guide written for people unfamiliar with JavaScript and explicitly not for experts,[12] or with Fundamentals of HTML, SVG, CSS and JavaScript for Data Visualisation (2025), which assumes no knowledge of the web's languages and presents the minimum of each that a person working with data needs.[3] Someone who needs a chart for a thesis or a presentation and no code at all has DataViz: How to Choose the Right Chart for Your Data (2021).[15] A complete beginner in programming who wants to work with data generally can start with Elements of Data Science (2026), which teaches a small subset of Python from nothing.[6]
For the reader who already knows the web, Visualising Data with JavaScript (2025) asks for moderate experience of HTML, CSS and JavaScript and introduces three libraries in turn,[1] and D3 Start to Finish (2nd Edition) (2025) lists its prerequisites plainly, the web languages, Node.js and the command line, and sends those without them to its author's primer.[2] Developers who work in React have React+d3.js (2016) and its successor.[5] Journalists have a book of their own in Getting Started with Data Journalism - Second Edition (2022),[18] and researchers who use R have Data Exploration and Visualisation with R: From Data Quality to Credible Evidence (2026).[16]
History
The statistical chart is an invention of the late eighteenth century, when the line graph, the bar chart and the pie chart first appeared in print, and the nineteenth added the statistical map and the diagram drawn to persuade. Computers made charts cheap in the 1980s through the spreadsheet, and the web made them interactive.
One of the books gives the web's part of the story in some detail. Charting libraries for JavaScript are almost as old as the language, which dates from 1995; the earliest still maintained appeared around 2007 and drew standard bar, line and pie charts. In 2009 a library took a different course, offering not finished charts but graphical elements, bars, lines and dots, from which a custom chart could be assembled, and its authors went on to create D3. Through the middle of that decade the dominant platform for rich graphics on the web had been a browser plug-in, which declined as browsers came to support the SVG and canvas standards. D3 was launched in 2011 on the strength of that support and became the dominant library for custom visualisation, and the most popular of the free libraries for standard charts followed in 2014.[1]
The shelf itself records the years since. The beginner's guide to D3 was rewritten for each major version from the third to the seventh,[8][12] and the books on using D3 inside an application framework follow the frameworks' own succession, from one of 2014 to those of 2016 and 2018.[4][13]
Choosing what to draw
The first decision is the form of the chart, and the books agree that it is not a matter of taste. Visualising Data with JavaScript summarises the research on perception: people judge differences of position and of length more accurately than differences of direction, area or shade, which is one reason bar, line and scatter charts are so common, and an unusual chart can still work so long as the quantities that matter are carried by position and length.[1] DataViz: How to Choose the Right Chart for Your Data is a short guide to the chart types met in statistics and to matching one to a set of data, with advice on which variable belongs on which axis and on styling and reviewing the result, and it comes with a flowchart for making the choice.[15]
Data Exploration and Visualisation with R: From Data Quality to Credible Evidence makes the larger argument that a plot is an instrument of reasoning and not a decoration applied at the end. It uses graphics to examine the quality of data, to reveal structure and to challenge assumptions, and its recurring questions are what a pattern shows, what might explain it, what could mislead and what the evidence actually supports.[16] A book on diagrams from a software developer's standpoint gives the vocabulary that all of this shares: the features of a drawn element, its label, shape, size, colour, border and position, can each carry either a quality or a quantity, so that circles and rectangles may stand for kinds of thing while size stands for an amount.[7]
D3, the library of building blocks
D3 is unlike the charting libraries that preceded it. D3 on AngularJS defines it as a library for manipulating documents on the basis of data, whose job is to take data and produce structured HTML or SVG, and says that it is not a ready-made collection of graphs. If all that is wanted is a bar chart of no particular appearance, the book advises, another library is the better choice; D3 is for the case where there are firm requirements about how a visualisation looks and behaves. Its illustration is a thought experiment: with a ready-made bar chart class everything goes well until one wants to change something the library did not make configurable, such as the background of the legend.[4]
D3 Tips and Tricks v3.x is how a very large number of people have learned it. Its author describes it as the notes he kept while learning, written down because that is a good way to remember, and as reading more like a story than a manual. Its opening chapters assume nothing: what HTML, JavaScript and style sheets are, why a web server is needed, which text editor to use, and where to find help, from the library's own site to the question-and-answer forums and galleries of examples. It then starts from a single line graph and takes it apart: the margins and the drawing area, loading the data, formatting dates, scales with their domains and ranges, the axes, and the line itself. It then adds to the graph, with labels, a title, smoothing and grid lines, and goes on to tooltips, tables, bar charts, tree, flow and force diagrams, maps, and reading data from a database.[8] The later editions keep the plan for each new version of the library, with some sixty downloadable examples in the fourth,[9] and the fifth and sixth cover the same ground for theirs.[10][11] The seventh adds what a newcomer now needs first, how to set up a local web server and whether to keep a copy of the library or load the latest from a content network.[12]
D3 Start to Finish (2nd Edition) teaches the library through one finished piece of work, an interactive chart of the energy mix of the world's countries, with chapters of explanation alternating with chapters that build it. What it promises to teach is the library's central mechanism, selections and joins, by which elements on the page are added, removed and updated to stay in step with an array of data; the modules for scales, which turn data values into positions, sizes and colours, for transitions and for loading files; and the general patterns of web development, such as splitting code into modules, that a real visualisation needs. The chapter on selections in the sample shows the style of the whole: a selection is made, and then its styles, attributes, classes and text are set by a chain of method calls. The book is candid that D3 is not everything, using one small library for tooltips and another for sorting and filtering data, and a build tool that supplies the local server earlier editions asked readers to set up.[2]
D3 inside an application
A chart on a real site lives inside an application, and the application's framework also wants to control the page. Three books are about that negotiation. D3 on AngularJS (2014) wraps a chart in a component of the framework of its day, so that it is reusable, configurable and redrawn when its data change, after an introduction to D3's own selections, data binding, scales and axes.[4]
React+d3.js settles the division of labour differently: the framework renders the SVG and D3 is used for what its author calls its best functions and not much else. The sample sets out an architecture in which the whole state of the application is held in one main component, child components report user events upward through callbacks, and changes flow back down, so that a component given the same properties always draws the same thing, which its author compares to a function that depends only on its arguments. He admits that this simplified arrangement would not scale as well as the fuller pattern it is modelled on, and the sample also sets a rectangle drawn in the framework's markup beside the same rectangle drawn with D3. The example built is a chart of salaries.[5] React+D3v4 (2018) extends the approach to a later version of each library, beginning with the simplest method, a D3 drawing wrapped whole as a black box, and building a larger study of salaries with a map and a histogram and controls to filter them; its later chapters are about animation and speed, including drawing to canvas when SVG is too slow.[13]
Charts, maps and dashboards
Most charts do not need D3. Visualising Data with JavaScript gives its reasons for doing the work in JavaScript at all, that it is the only language implemented in every browser, that it is well suited to data and that it has many libraries, and then uses three of them on one real dataset, a government database of renewable energy projects: a library of standard charts, a library for maps, and D3 for a single custom chart, brought together at the end in a published data story. Before any chart it explains the two formats in which such data usually arrives, comma-separated values and JSON, and the parts of a small web application, including the tool that bundles them.[1] Data Dashboards with JavaScript (2025), a companion by the same author on the same data, builds a dashboard from the chart and map libraries and a user-interface framework, covering the styling of charts, including a dark theme, multi-line and stacked bar charts, the processing of the data, an interface for serving it, and deployment.[14]
Beneath every one of these is the web page. Fundamentals of HTML, SVG, CSS and JavaScript for Data Visualisation is written for people who spend their days in a spreadsheet, R or Python and are asked for a chart in a notebook or a dashboard: such charts, it points out, are usually built from HTML, SVG, CSS and JavaScript, and an understanding of the four is what is needed when one has to go deeper than the tool allows. It says of itself that it is by no means comprehensive, and it has its readers experiment in an online editor first, leaving the setting up of tools on their own computer to the last chapter.[3]
Plotting in R, Python and other languages
Analysts mostly draw their charts in the language they analyse in. Elements of Data Science teaches plotting in Python by imitation: its chapter on the subject, which is in the sample, reproduces a published chart of changes in religious affiliation over time and a magazine's chart comparing prices in two cities, and then makes a plot to test a law about the frequencies of words. It prepares the ground with a feature of the language, the keyword argument, because a plotting function is steered almost entirely by named options for limits, labels, titles and legends. The book as a whole is an introduction to data science for people who have never programmed, and each chapter is also a notebook that can be run.[6]
For R there are two books of opposite kinds. Data Exploration and Visualisation with R: From Data Quality to Credible Evidence is a treatise of some twelve hundred pages on exploratory analysis, moving from distributions and relationships to missing data, outliers, geographical and temporal data.[16] Tidyplots: publication-ready plots for scientific papers (e1.1.5) (2026) is a compilation of code and the plots it produces for one package aimed at figures for scientific papers, using throughout a colour scheme chosen to keep its contrast in greyscale print and for colour-blind readers.[17]
Plotting also appears as a chapter in general programming books: one of ten in an introduction to MATLAB that explains the language beside equivalent programs in C,[19] and one in a school text that teaches Python through graphical interfaces.[20] And the author of the D3 guide has a book in which the graph is the last step of a small measurement project, from temperature sensors on a single-board computer through a database to a display of the readings.[21]
Data journalism
Getting Started with Data Journalism - Second Edition sets visualisation inside the work of a newsroom, and argues that the basic skills do not require large resources. Its order is the order of a story: why data matters to journalism and how to plan for it; where data comes from, including official statistics, freedom of information requests, which it treats for the United Kingdom, crowdsourcing and scraping; how to clean it, getting tables out of PDFs and tidying spreadsheets in which different words mean the same thing; how to understand it, with warnings about small numbers and rare events, about the reliability of a source and against cherry-picking; and only then how to show it, in charts, maps and interactive pieces.[18] The second edition notes how much changed between the two, tools for cleaning, analysing and visualising having come and gone.[18]
The graphics underneath
Every chart is finally a drawing, and three books teach drawing in code. Computer graphics in Python (2020) is a guide to one vector graphics library for Python, which it recommends for scripts that produce an image, a chart or a diagram and for images generated on a server; it begins with the difference between pixel images and vector graphics, how the second are rendered into the first, and the benefits and disadvantages of each, which is the same choice a chart-maker faces between SVG and canvas.[22] Canvas Academy (2026) teaches the browser's canvas, the alternative to SVG, through a game, from coordinates and filled rectangles to paths, transformations and the animation loop.[23] Generative Art in Go (2026) uses the same means for art, defining its subject as images made by rules combined with randomness.[24]
Sources
Every source is a Leanpub book. The note after each says which part of it was read; where no sample was available, only the public description and table of contents were used.
- 1.Visualising Data with JavaScript, Peter Cook: Learn how to build charts, maps and data stories using Chart.js, Leaflet and D3. Free sample: the introduction and the chapter on what data visualisation is, with its history of JavaScript charting libraries. 2025. Free sample: PDF
- 2.D3 Start to Finish (2nd Edition), Peter Cook: Learn how to make a custom data visualisation using D3.js. Free sample: the introduction, with prerequisites and what the book teaches, and the opening of the chapter on selections. 2025. Free sample: PDF
- 3.Fundamentals of HTML, SVG, CSS and JavaScript for Data Visualisation, Peter Cook Free sample: the introduction and the chapter on HTML. 2025. Free sample: PDF · EPUB
- 4.D3 on AngularJS, Ari Lerner, Victor Powell: Create Dynamic Visualizations with AngularJS Free sample: the chapter introducing D3 and a first example. 2014. Free sample: PDF · EPUB
- 5.React+d3.js, Swizec Teller: Build data visualizations with React and d3.js Free sample: the opening of the main chapter, with the architecture and the page skeleton. 2016. Free sample: PDF · EPUB
- 6.Elements of Data Science, Allen B. Downey: Getting Started with Data Science and Python Free sample: the preface and the opening of the chapter on plotting. 2026. Free sample: PDF · EPUB
- 7.Beyond diagrams, Pavel Vlasov: Capture your thoughts in diagrams, generate documentation, make them executable Free sample: the introduction and the section on visual features. 2025. Free sample: PDF · EPUB
- 8.D3 Tips and Tricks v3.x, Malcolm Maclean: Interactive Data Visualization in a Web Browser No sample: from the description and table of contents. For version 3 of D3, last published 2019.
- 9.D3 Tips and Tricks v4.x, Malcolm Maclean: Interactive Data Visualization in a Web Browser No sample: from the description and table of contents. For version 4, 2019.
- 10.D3 Tips and Tricks v5.x, Malcolm Maclean: Interactive Data Visualization in a Web Browser No sample: from the description and table of contents. For version 5, 2019.
- 11.D3 Tips and Tricks v6.x, Malcolm Maclean: Interactive Data Visualization in a Web Browser No sample: from the description and table of contents. For version 6, 2021.
- 12.D3 Tips and Tricks v7.x, Malcolm Maclean: Interactive Data Visualization in a Web Browser No sample: from the description and table of contents. For version 7, 2021.
- 13.React+D3v4, Swizec Teller: Reusable dataviz & games using modern JavaScript No sample: from the description and table of contents. 2018.
- 14.Data Dashboards with JavaScript, Peter Cook: Learn how to build data dashboards with Chart.js, Leaflet and React. From the description and table of contents. 2025. Free sample: PDF
- 15.DataViz: How to Choose the Right Chart for Your Data, Lee Baker No sample: from the description alone. 2021.
- 16.Data Exploration and Visualisation with R: From Data Quality to Credible Evidence, Osama Abdelhay No sample: from the description alone. 2026.
- 17.Tidyplots: publication-ready plots for scientific papers (e1.1.5), Kang Wu: a cookbook No sample: from the description alone. 2026.
- 18.Getting Started with Data Journalism - Second Edition, Claire Miller: Writing data stories in any size newsroom No sample: from the description and table of contents. 2022.
- 19.Matlab Programming, Anshuman Mishra: A Comprehensive Guide For Beginners No sample: from the description and table of contents. 2026.
- 20.Python Programming with Tkinter, Nadine Brown: From Fundamentals to Advanced GUI Techniques No sample: from the description and table of contents. 2025.
- 21.Raspberry Pi Computing: Temperature Measurement, Malcolm Maclean: Measure, record and display temperatures with a Raspberry Pi computer No sample: from the description and table of contents. 2021.
- 22.Computer graphics in Python, Martin McBride: Advanced vector graphics using Pycairo and Python From the description and table of contents. 2020. Free sample: PDF · EPUB
- 23.Canvas Academy, Ali Reza Hassan Sagor: Build real 2D games with the HTML5 Canvas — no engine, no framework, no build step From the description and table of contents. 2026. Free sample: PDF · EPUB
- 24.Generative Art in Go, Preslav Rachev: A creative guide From the description and table of contents. 2026. Free sample: PDF · EPUB
Further reading
Other books in the library on neighbouring ground, not cited above.
- Go With Graphics, Tit Petric Image manipulation in Go with the standard library, building a resizing service and colour filters. 2021. Free sample: PDF · EPUB
- Computer Graphics Through Ray Marching: From Equations to Images, Muhammad Ahmad An introduction to making images from equations with ray marching, written as shader programs. 2026. Free sample: PDF · EPUB
- 3D Game and Graphics Programming using UNIGINE, Rohit Gonsalves: C++, C#, and CG Artist perspective An introduction to three-dimensional graphics programming with one engine, in C++ and C#. 2020. Free sample: PDF · EPUB