HTML5 Canvas and CSS3 Graphics Primer

Author: Oswald Campesato
Publisher: Mercury
Pages: 400
ISBN: 978-1936420346
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.

 

html5canv

 

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.

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.

 

Banner

 

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


Make: Technology on Your Time Volume 27

Author: Mark Frauenfelder
Publisher: Make, 2011
Pages: 176
ISBN:978-1449302467
Aimed at: DIY and electronics enthusiasts
Rating: 4.5
Pros: A mix of projects and emphasis on robots
Cons: Ignores software aspects and nothing ambitious this issue
Reviewed by: Harry Fairhead

A special issue on robots. What c [ ... ]



Clojure in Action

Author: Amit Rathore

Publisher: Manning
Pages: 432
ISBN: 978-1935182597
Aimed at: Java and Ruby programmers, in particular those already working with Clojure
Rating: 3.5
Pros: Comprehensive and practical
Cons: Doesn't do a good job of explaining Clojure
Reviewed by: Mike James

Clojure seems to be get [ ... ]


More Reviews

Last Updated ( Sunday, 10 February 2013 )
 
 

   
RSS feed of book reviews only
I Programmer Book Reviews
RSS feed of all content
I Programmer Book Reviews
Copyright © 2014 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.