HTML5 Canvas and CSS3 Graphics Primer

Author: Oswald Campesato
Publisher: Mercury
Pages: 400
ISBN: 978-1936420346
Print: 1936420341 Kindle: B008WOLG72
Audience: JavaScript programmers
Rating: 3.5
Reviewer: David Conrad

There now seem to be too many ways to create graphics within a web page. As well as HTML5 Canvas and CSS3, this book also has quite a lot about SVG.

The book starts off with a look at CSS3 and puts HTML5 into context with some information about browsers and backward compatibility. From here it deals with some basic CSS graphics - shadows and gradient fills. The big problem is that the layout of the book looks messy and the listings are very poorly presented with lots of unnecessary white space and quite a lot of repeated boiler plate code. Given that the book has a companion DVD containing all the source code, you have to wonder why so much of the book is taken up with listings.

Banner

Chapter 2 moves on to 2D/3D animation with a basic introduction and a look at some frameworks you can use - Compass/Sass, Blueprint and LESS. Chapter 3 changes the topic to vector graphics and SVG. This topic is covered from the usual approach of using the SVG tags within HTML but towards the end of the chapter how to use SVG from JavaScript is covered. Most accounts of SVG stop at the basic use of tags but this one also mentions XSLT and CSS3. Unfortunately by this point in the book the length of the program listings is getting out of hand and the book is starting to look more like a cookbook of examples than a tutorial that explains how things work.

 

 

Chapter 4 is where the canvas object enters the picture. It starts with a basic look at the canvas object and then spends far too much time explaining how to draw rectangles and a big example of how to do it. After lots more example the chapter draws to a close with a look at how to get data out of canvas using the toDataURL method. Chapter 5 is a detailed look at gradient fills. Again there are far too many examples which while they look good don't really help you understand how to do things. The end of the chapter does cover a topic which is usually missed - using CSS with the canvas object to create hover over effects and animation.

In Chapter 6 we learn about circles, bezier curves and arcs. There are some nice examples but at the end of the day the chapter is light on explanation. For example, you will learn how to use the arcto method to create rounded rectangles but you wont understand how you did it or how the arcto method works. Chapter 7 applies transforms to 2D shapes and this really is just a selection of examples that might be better in a cookbook.

Chapter 8 explains mouse events on the canvas, Chapter 9 is on animation and Chapter 10 demonstrates how to draw charts and graphs. This part of the book is almost completely a set of long examples rather than explanation.

This is mostly a book of example code. The listings are long and they take up most of the space in the book. This seems a even more pointless when you discover that the programs are all on a DVD bound into the back of the book. However, if you want a book of examples then this one might be what you are looking for. The examples are sometimes trivial but just occasionally they suggest a way of doing something that you might not have thought of. If you are looking for a book that explains how things work, then you probably need a different book - this one has too much example code.

 

Banner


Pearls of Algorithm Engineering

Author: Paolo Ferragina
Publisher: ‎Cambridge University Press
Pages: 326
ISBN: ‎978-1009123280
Print:1009123289
Kindle: B0BZJBGTLN
Audience: Admirers of Knuth
Rating: 5
Reviewer: Mike James

Algorithm engineering - sounds interesting.



Learn Quantum Computing with Python and Q#

Author: Dr. Sarah Kaiser and Dr. Chris Granade
Publisher: Manning
Date: June 2021
Pages: 384
ISBN: 978-1617296130
Print: 1617296139
Kindle: B098BNK1T9
Audience: Developers interested in quantum computing
Rating: 4.5
Reviewer: Mike James
Quantum - it's the future...


More Reviews

Last Updated ( Thursday, 05 January 2017 )