JavaScript and jQuery for Data Analysis and Visualization
Published by
John Wiley & Sons, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright 2015 by John Wiley & Sons, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-1-118-84706-0
ISBN: 978-1-118-84721-3 (ebk)
ISBN: 978-1-118-84722-0 (ebk)
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions
.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Web site may provide or recommendations it may make. Further, readers should be aware that Internet Web sites listed in this work may have changed or disappeared between when this work was written and when it is read.
For general information on our other products and services please contact our Customer Care Department within the United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com
. For more information about Wiley products, visit www.wiley.com
.
Library of Congress Control Number: 2014946685
Trademarks: Wiley, Wrox, the Wrox logo, Programmer to Programmer, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. JavaScript is a registered trademark of Oracle America, Inc. jQuery is a registered trademark of jQuery Foundation, Inc. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc., is not associated with any product or vendor mentioned in this book.
To Ally and Kaiya. You brighten all my days.
Graham Murray
For Annie
Vadim Ogievetsky
To Whic, Granger, Charisma, Surley, Two-Gun, FEM, and especially Rafe. See you soon, guys.
Joseph Lowery
Credits
- Executive Editor
Robert Elliott
- Project Editor
Charlotte Kughen
- Technical Editor
Ambrose Little
- Production Editor
Christine Mugnolo
- Copy Editor
Nancy Rapoport
- Production Manager
Kathleen Wisor
- Manager of Content Development and Assembly
Mary Beth Wakefield
- Marketing Director
David Mayhew
- Marketing Manager
Carrie Sherrill
- Professional Technology & Strategy Director
Barry Pruett
- Business Manager
Amy Knies
- Associate Publisher
Jim Minatel
- Project Coordinator, Cover
Patrick Redmond
- Proofreader
Josh Chase, Word One New York
- Indexer
Robert Swanson
- Cover Designer
Wiley
- Cover Image
iStock.com/Henrik5000
About the Authors
Jon J. Raasch is a freelance web developer specializing in web apps for desktop and mobile devices. A user-experience junkie, he builds HTML5 and JavaScript apps that focus on the users at every touch point.
Jon is the author of several John Wiley & Sons books, including JavaScript Programming: Pushing the Limits, Smashing WebKit, and Smashing Mobile Web Development. A perfectionist when it comes to best practices, you can find him building the modern web in his pajamas.
Follow Jon on Twitter @jonraasch
and check out his website http://jonraasch.com
. He's currently based in Portland, OR.
Graham Murray is a software architect specializing in building UI development tools. At present, he works at Infragistics, where he builds data visualization UI controls for desktop, web, and mobile. He is passionate about many programming languages, and he builds source-to-source compilers between them. As a kid, he found some BASIC code in the back of a magazine and hasn't stopped programming since.
Vadim Ogievetsky is a developer at Metamarkets, where he uses D3 on top of AngularJS to build interactive data-driven applications that scale. Prior to working at Metamarkets, Vadim was part of the Stanford Data Visualization group, where he contributed to Protovis and D3. Vadim is an avid promoter of D3 and web-based data visualization; he has guest lectured on D3 at UC Berkeley, Harvard, and Stanford as well as at other universities, meetups, and corporations.
Joseph Lowery currently builds websites, creates online courses for Lynda.com
and other sites, writes fiction, and hangs in Brooklyn. His books about the Web and web-building tools are international bestsellers, having sold more than 400,000 copies worldwide in nine different languages.
Acknowledgments
I would like to thank his co-authors for all their work putting this book together. I'd also like to thank the editors and the rest of the team at Wiley for their support throughout the project. Also, thanks to Martin for the technical proofread.
Jon J. Raasch
I can't thank my wife Allison and daughter Kaiya enough for not getting too fed up with me as I was half present while working on this book. It hasn't been an easy time with all the random adversity that cropped up while I was writing. Thanks for always sticking by me and letting me steal a little time for this book, especially when time has been such a precious commodity. My parents, Chris and Tony, provided some very timely babysitting on many occasions, and ignited my love for computers in the first place by letting me use them so much. My in-laws, Diane and Alan were so gracious and put up with us for so long as we were displaced from our house twice while I was writing this book. Thanks to Ambrose Little for the great edits and suggestions, and for encouraging me to do this in the first place, Thanks also to Jason Beres and Bill Hazard for insisting I take this on when I was feeling trepidation. I'd like to thank Robert Elliott and everyone at Wiley. I'd like to give a special thanks to everyone editing the book, especially Charlotte and Nancy, for being so helpful and patient and for helping me turn my esoteric prose into something people might actually enjoy to read. My co-authors Jon, Vadim, and Joe provided some great advice on additional content to cover. Thanks everyone!
Next page