Visualizing MongoDB Objects in Concept and Practice

Similar documents
4/25/2016 C. M. Boyd, Practical Data Visualization with JavaScript Talk Handout

Introduction to D3.js Interactive Data Visualization in the Web Browser

Team Members: Christopher Copper Philip Eittreim Jeremiah Jekich Andrew Reisdorph. Client: Brian Krzys

Sisense. Product Highlights.

JavaScript and jquery for Data Analysis and Visualization

Visualizing the Top 400 Universities

Interactive Data Visualization for the Web Scott Murray

Tutorial: Building a Dojo Application using IBM Rational Application Developer Loan Payment Calculator

Create Cool Lumira Visualization Extensions with SAP Web IDE Dong Pan SAP PM and RIG Analytics Henry Kam Senior Product Manager, Developer Ecosystem

Developer Tutorial Version 1. 0 February 2015

Visualization of Real Time Data Driven Systems using D3 Visualization Technique

Adding 3rd-Party Visualizations to OBIEE Kevin McGinley

NoSQL web apps. w/ MongoDB, Node.js, AngularJS. Dr. Gerd Jungbluth, NoSQL UG Cologne,

Lecture 9 Chrome Extensions

Client Overview. Engagement Situation. Key Requirements

MASTERTAG DEVELOPER GUIDE

TOOLS, TIPS & RESOURCES

Visualizing a Neo4j Graph Database with KeyLines

XML Processing and Web Services. Chapter 17

TIBCO Spotfire Business Author Essentials Quick Reference Guide. Table of contents:

Create interactive web graphics out of your SAS or R datasets

L7_L10. MongoDB. Big Data and Analytics by Seema Acharya and Subhashini Chellappan Copyright 2015, WILEY INDIA PVT. LTD.

Mobile Web Applications. Gary Dubuque IT Research Architect Department of Revenue

Actuate Business Intelligence and Reporting Tools (BIRT)

Lab 2: Visualization with d3.js

Up and Running with LabVIEW Web Services

Visualization of Financial Data

General principles and architecture of Adlib and Adlib API. Petra Otten Manager Customer Support

Dashboard Skin Tutorial. For ETS2 HTML5 Mobile Dashboard v3.0.2

Visualizing an OrientDB Graph Database with KeyLines

Course Information Course Number: IWT 1229 Course Name: Web Development and Design Foundation

MongoDB: document-oriented database

JavaScript Programming

MicroStrategy Desktop

D3.JS: Data-Driven Documents

OpenStreetMap for Web Developers. Serge Wroclawski State of the Map US August 2010

Mobile Web Design with HTML5, CSS3, JavaScript and JQuery Mobile Training BSP-2256 Length: 5 days Price: $ 2,895.00

Web Designing with UI Designing

Facebook Twitter YouTube Google Plus Website . o Zooming and Panning. Panel. 3D commands. o Working with Canvas

Data Visualization in Ext Js 3.4

1. About the Denver LAMP meetup group. 2. The purpose of Denver LAMP meetups. 3. Volunteers needed for several positions

Assignment 5: Visualization

Session D15 Simple Visualization of your TimeSeries Data. Shawn Moe IBM

ArcGIS Web App Builder (AWAB) In BETA. John Bocan MES/DoIT

FCC Management Project

Example. Represent this as XML

An evaluation of JavaFX as 2D game creation tool

Advanced Visualizations Tools for CERN Institutional Data

Programming in HTML5 with JavaScript and CSS3

OpenText Information Hub (ihub) 3.1 and 3.1.1

Custom Visualizations with D3.js

CRM Developer Form

Develop highly interactive web charts with SAS

MongoDB Developer and Administrator Certification Course Agenda

DATA PROCESSING AND VISUALISATION TOOLS. European Public Sector Information Platform. Topic Report No / 07. Author: datos.gob.

Cross Site Scripting (XSS) and PHP Security. Anthony Ferrara NYPHP and OWASP Security Series June 30, 2011

Title: Front-end Web Design, Back-end Development, & Graphic Design Levi Gable Web Design Seattle WA

DIPLOMA IN WEBDEVELOPMENT

d3.js Data-Driven Documents Scott Murray, Jerome Cukier & Jeffrey Heer VisWeek 2012 Tutorial

What's new in gvsig Desktop 2.0

An Introduction to KeyLines and Network Visualization

Safe Harbor Statement

USING GOOGLE MAP API FUNCTIONS TO CREATE APPLICATIONS USING GEOGRAPHIC SPATIAL DATA.

Abstract. Description

Treemap Visualisations

WEB DEVELOPMENT COURSE (PHP/ MYSQL)

There are various ways to find data using the Hennepin County GIS Open Data site:

Visual Statement. NoSQL Data Storage. MongoDB Project. April 10, Bobby Esfandiari Stefan Schielke Nicole Saat

MOBILE APPLICATION FOR EVENT UPDATES SATYA SAGAR VANTEDDU. B.Tech., Jawaharlal Technological University, 2011 A REPORT

The Mannheim University Library App

HTML5. Turn this page to see Quick Guide of CTTC

Understanding Data: A Comparison of Information Visualization Tools and Techniques

Web Development CSE2WD Final Examination June (a) Which organisation is primarily responsible for HTML, CSS and DOM standards?

Introduction to Web Development with R

Adam Rauch Partner, LabKey Software Extending LabKey Server Part 1: Retrieving and Presenting Data

WEB AND APPLICATION DEVELOPMENT ENGINEER

Advantage of Jquery: T his file is downloaded from

Development Techniques for Native/Hybrid Tizen Apps. Presented by Kirill Kruchinkin

Table of contents. 1. About the platform MetaTrader 4 platform Installation Logging in 5 - Common log in problems 5

JavaScript (HTML5, CSS3) Toolkits for InfoVis (Graphics)

Sitecore Dashboard User Guide

Continue Your Learning with STC Education!

Integration the Web 2.0 way. Florian Daniel April 28, 2009

Friday, February 11, Bruce

How to Deploy Custom Visualizations Using D3 on MSTR 10. Version 1.0. Presented by: Felipe Vilela

Visualizing Information with

e Art of Rapid Prototyping Building Useful Prototypes

Big Data Visualization and Dashboards

AppDev OnDemand Microsoft Development Learning Library

Cleo Communications. CUEScript Training

Embedded Analytics & Big Data Visualization in Any App

Analytics Software for a World of Smart Devices. Find What Matters in the Data from Equipment Systems and Smart Devices

ArcGIS Server mashups

James Singletary IV :: Front End Web Developer located in Tampa, Florida

Developing Native JavaScript Mobile Apps Using Apache Cordova. Hazem Saleh

<Insert Picture Here> Web 2.0 Data Visualization with JSF. Juan Camilo Ruiz Senior Product Manager Oracle Development Tools

Visualizing Data: Scalable Interactivity

Software Development Interactief Centrum voor gerichte Training en Studie Edisonweg 14c, 1821 BN Alkmaar T:

Drupal and ArcGIS Yes, it can be done. Frank McLean Developer

Transcription:

Washington DC 2013 Visualizing MongoDB Objects in Concept and Practice https://github.com/cvitter/ikanow.mongodc2013.presentation

Introduction Do you have a MongoDB database full of BSON documents crying out for visual analysis?

Agenda Visualizing Objects vs. Records Getting Your Data from MongoDB JSON 101 Free & Open Source Visualization Libraries Google Maps JavaScript API D3.js Other Visualization Libraries You Should Know Questions?

Objects vs. Records Document oriented data stores support dynamic and complex schemas vs. the simple, static structures in RDBMs, e.g.:

Is There Really a Difference? Yes and No Yes Obviously, document oriented formats are different from record oriented formats; Few common visualizations tools designed for traditional record based formats support document based formats No The basic visualizations are the same even if the data format feeding them are different

Getting your Data from MongoDB mongoexport Export data from MongoDB as JSON or CSV > mongoexport --db dbname --collection collectionname --out file.json! MongoDB s Simple REST Interface Read only access to data Start your server with the --rest option Simple queries: http://127.0.0.1:28017/databasename/collectionname/! Other options: DrowsyDromedary, MongoDB Rest, etc.

JSON 101 JSON (JavaScript Object Notation) documents are built using two types of common data structures: Name/value pairs (objects) and; { string : value }! Ordered lists of values (arrays). { string : [value, value, value] }! JSON is a subset of the object literal notation of JavaScript so: var jsonobj = {"numbers" : [1, 2, 3] };! var numberone = jsonobj.numbers[0];! var numbertwo = jsonobj.numbers[1];! Converting the string representation of JSON is as easy as: var jsonobj = JSON.parse("{\"numbers\":[1,2,3]}");!

A Word About the Sample Code All of the code used in this presentation is available online via GitHub at: https://github.com/cvitter/ikanow.mongodc2013.presentation " The project includes code from the following Open Source Projects: Bootstrap: http://twitter.github.com/bootstrap/! JQuery: http://jquery.com/! D3.js: http://d3js.org/! The data samples used are simple JSON files read in using JQuery a.ajax method

Google Maps JavaScript API Requirements: Get an API Key (its free*) Have an Internet Connection Build a simple example that: 1. Creates a place holder DIV for the map object 2. Loads the map script 3. Initializes the map 4. Draws markers on the map * Up to 25,000 map loads per day for commercial applications.

Creating the Map Use a DIV to create a placeholder for the map: <div id="map_canvas" style="height:450px; width:870px;"></div>! Load the map script: function loadscript() {! var script = document.createelement("script");! script.type = "text/javascript";! script.src = "http://maps.googleapis.com/maps/api/js?!key=your_api_key&sensor=true_or_false&callback=initialize";! document.body.appendchild(script);! }! Initialize the map: var mapoptions = {!!zoom: 11,!!center: new google.maps.latlng( 38.8964, -77.0262 ),!!maptypeid: google.maps.maptypeid.roadmap! };! map = new google.maps.map(document.getelementbyid('map_canvas'),!!!mapoptions);!

Drawing Markers on the Map Sample documents: {...},! {!!search_field: "adams morgan",!!country: "United States",!!country_code: "US",!!region: "District of Columbia",!!latitude: "38.9213889",!!longitude: "-77.0425000 }! },! {...},! Add markers to the map: for (var i=0; i < locations.length; i++) {!!!!!!var marker = new google.maps.marker({!!!map: map,!!!!position: new google.maps.latlng(!!!!locations[i].latitude, locations[i].longitude ),!!!title: converttotitlecase(locations[i].search_field)!!});! }!

The Finished Product

Creating Heat Maps Requires the Visualization Library: script.src = "http://maps.googleapis.com/maps/api/js?!key=your_api_key&sensor=true_or_false&libraries=visualiza-on &callback=initialize";! Create the Heat Map Data and Layer: var heatmapdata = new Array();! for (var i=0; i < locations.length; i++) {! var newrecord = {location: new!google.maps.latlng( locations[i].geoindex.lat,!!locations[i].geoindex.lon), weight: 1};! heatmapdata.push(newrecord);! }!!!! var heatmap = new google.maps.visualization.heatmaplayer({! data: heatmapdata,! dissipating: true,! radius: 10,! map: map! });!

The Finished Product

D3.js D3.js (d3js.org) is: a JavaScript library for manipulating documents based on data Convert data into visualizations in the following formats: HTML, CSS, SVG Download the library or include it via: <script src="http://d3js.org/d3.v3.min.js"></script>!

The (Very) Basics Select the DIV to write the SVG image to: var chart = d3.select("#d3_canvas").append("svg")!.attr("class", "chart")!!.attr("width", chartwidth)!!.attr("height", chartheight);! Draw the bars (rectangles): chart.selectall("rect")!.data(inputdata)!!.enter().append("rect")!!.attr("y", function(d, i) {return i * (lineheight + 3); })!!.attr("width", function(d, i)!!{ return chartwidth * (d.chance_of_rain * 0.01); })!!.attr("height", function(d) return lineheight; });!

Adding Rules Making things scale on the chart: var x = d3.scale.linear()!!.domain([0, 100])!!.range([0, chartwidth]);! Drawing the rules: chart.selectall("line")!.data(x.ticks(10))!!.enter().append("line")!!.attr("x1", x)!!.attr("x2", x)!!.attr("y1", 0)!!.attr("y2", chartheight)!!.style("stroke", "#ccc");!

Adding Text Labeling the X and Y axes: chart.selectall(".rule")!!.data(x.ticks(10))!!.enter().append("text")!!.attr("class", "rule")!!.attr("x", x)!!.attr("y", 0)!!.attr("dy", -3)!!.attr("text-anchor", "middle")!!.text(string);!! chart.selectall("text")!!.data(inputdata)!!.enter().append("text")!!.attr("x", 0)!!.attr("y", function(d, i) {!!return i * (lineheight + 3) + (lineheight / 2); })!!.attr("dx", -3) // padding-right!!.attr("dy", ".35em") // vertical-align: middle!!.attr("text-anchor", "end") // text-align: right!!.text(function(d) { return d.date; });!

The Finished Product

Treemaps, Bubble Charts, and More D3.js can accept an array of values, objects, or a function that returns an array of values Some of the D3.js visualizations allow you to pass data in a wide variety of formats, others expect a specific format The Treemap and Bubble Chart samples use a really simple JSON tree structure representing multi-level parent child relationships

Treemap

Treemaps Layout D3.js features different layout packs that help you build complex charts including.treemap In this example the layout pack is creating a properly sized div for each node in our JSON file as opposed to creating an SVG image var treemap = d3.layout.treemap()!!.size([width, height])!!.sticky(true)!!.value(function(d) { return d.size; });!! var node = div.datum(data).selectall(".node")!!.data(treemap.nodes)!!.enter().append("div")!!.attr("class", "node")!!.call(position)!!.style("background", function(d) {!!return d.children? color(d.name) : null; })!.text(function(d) { return d.children? null : d.name; });!

Bubble Chart

Other D3js.org Examples

More Cool Visualization Libraries NVD3 (nvd3.org) Re-usable charts and chart components for d3.js Raphael JS (raphaeljs.com) JavaScript library designed to simplify working with vector graphics and build data visualizations TimelineJS (timeline.verite.co) Beautifully crafted timelines that are easy, and intuitive to use.

Reminder: Get the Example Code All of the sample code used in this presentation is available online via GitHub at: https://github.com/cvitter/ ikanow.mongodc2013.presentation

Thank You! Craig Vi4er www.ikanow.com developer.ikanow.com cvi,er@ikanow.com @IkanowDev github.com/ikanow/infinit.e