Data Visualization Toolkit : Using Javascript, Rails, and Postgres to Present Data and Geospatial Information (Addison-wesley Professional Ruby Series

Data Visualization Toolkit : Using Javascript, Rails, and Postgres to Present Data and Geospatial Information (Addison-wesley Professional Ruby Series

  • ただいまウェブストアではご注文を受け付けておりません。 ⇒古書を探す
  • 製本 Paperback:紙装版/ペーパーバック版/ページ数 224 p.
  • 言語 ENG
  • 商品コード 9780134464435
  • DDC分類 005

Full Description


Create Beautiful Visualizations that Free Your Data to Tell Powerful Truths"The depth of Barrett Clark's knowledge shines through in his writing: clear, concise, and confident. Barrett has been practicing all of this stuff in his day job for many years-Postgres, D3, GIS, all of it. The knowledge in this book is real-world and hard-earned!"-From the Foreword by Obie Fernandez Data Visualization Toolkit is your hands-on, practical, and holistic guide to the art of visualizing data. You'll learn how to use Rails, jQuery, D3, Leaflet, PostgreSQL, and PostGIS together, creating beautiful visualizations and maps that give your data a voice and to make it "dance."Barrett Clark teaches through real-world problems and examples developed specifically to illuminate every technique you need to generate stunningly effective visualizations. You'll move from the absolute basics toward deep dives, mastering diverse visualizations and discovering when to use each. Along the way, you'll build three start-to-finish visualization applications, using actual real estate, weather, and travel datasets.Clark addresses every component of data visualization: your data, database, application server, visualization libraries, and more. He explains data transformations; presents expert techniques in JavaScript, Ruby, and SQL; and illuminates key concepts associated with both descriptive statistics and geospatial data. Throughout, everything is aimed at one goal: to help you cut through the clutter and let your data tell all it can.This guide will help youExplore and understand the data visualization technology stackMaster the thought process and steps involved in importing dataExtract, transform, and load data in usable, reliable formHandle spotty data, or data that doesn't line up with what your chart expectsUse D3 to build pie and bar charts, scatter and box plots, and moreWork effectively with time-series dataTweak Ruby and SQL to optimize performance with large datasetsUse raw SQL in Rails: window functions, subqueries, and common table expressionsBuild chord diagrams and time-series aggregatesUse separate databases or schema for reporting databasesIntegrate geographical data via geospatial SQL queriesConstruct maps with Leaflet and RailsQuery geospatial data the "Rails way" and the "raw SQL way"

Contents

Foreword xvPreface xviiAcknowledgments xxiiiAbout the Author xxvPart I: ActiveRecord and D3 1Chapter 1: D3 and Rails 3Your Toolbox-A Three-Ring Circus 3Maryland Residential Sales App 5Summary 17Chapter 2: Transforming Data with ActiveRecord and D3 19Pie Chart Revisited 19Bar Chart 24Scatter Plot 28Scatter Plot Revisited 33Box Plot 34Summary 40Chapter 3: Working with Time Series Data 41Historic Daily Weather Data 41Weather Rails App 42Simple Line Graph 45Tweak 1: Simple Multiline Graph 50Tweak 2: Add Circle to Highlight the Maximum Temperature 51Tweak 3: Add Circle to Highlight the Minimum Temperature 53Tweak 4: Add Text to Display the Temperature Change 55Tweak 5: Add a Line Between the Focus Circles 56Summary 58Chapter 4: Working with Large Datasets 59Git and Large Files 59The Cloud 60Hotlinking 60Benchmarking 62Querying "Big Data" 65When Benchmarks and Statistics Lie 68Summary 69Part II: Using SQL in Rails 71Chapter 5: Window Functions, Subqueries, and Common Table Expression 73Why Use SQL? 73User-Defined Functions 75How to Use SQL in Rails 78Scatter Plot with Mortgage Payment 79Window Functions 81Using Subqueries 84Common Table Expression 84CTE and the Heatmap 86Summary 90Chapter 6: The Chord Diagram 93The Matrix Is the Truth 93Flight Departures Data 94Departures App 95Transforming the Data 101Create the Views 104Draw the Chord Diagram 106Disjointed City Pairs 108Summary 113Chapter 7: Time Series Aggregates in Postgres 115Finding Flight Segments 115Graphing the Timeline 121Summary 127Chapter 8: Using a Separate Reporting Database 129Transactional versus Reporting Databases 129Working with Multiple Schemas in Rails 131Creating Objects in the Reporting Schema 132Summary 138Part III: Geospatial Rails 139Chapter 9: Working with Geospatial Data in Rails 141GIS Primer 141PostGIS 144ActiveRecord and PostGIS 146Using Geospatial Data in Rails 147Working with Shapefiles 150Summary 154Chapter 10: Making Maps with Leaflet and Rails 155Leaflet 155Incorporating Leaflet into Rails to Visualize Weather Stations 157Visualizing Airports 163Visualizing Zip Codes 168Summary 181Chapter 11: Querying Geospatial Data 183Finding Items within a Bounding Box 183Writing a Bounding Box Query 184Finding Items Near a Point 187Calculating Distance 190Summary 191Afterword 193Appendix A: Ruby and Rails Setup 195Install Ruby 195Finalize the Setup 199Appendix B: Brief Postgres Overview 201Installing Postgres 201SQL Tools 202Bulk Importing Data 202The Query Plan 204Appendix C: SQL Join Overview 207Join Example Database Setup 207Inner Join 207Left Outer Join 208Right Outer Join 208Full Outer Join 209Cross Join 209Self Join 209Index 211

最近チェックした商品