Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Using D3.js to visualise your analytics data
Search
Edd S
October 21, 2013
Technology
800
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Using D3.js to visualise your analytics data
Learn how to create easy hacks to create graphs of your users behaviour with D3.
Edd S
October 21, 2013
More Decks by Edd S
See All by Edd S
Using React at Deliveroo - LRUG
edds
0
900
Accessibility and how to get the most from your screenreader - EpicFEL
edds
1
640
What even is a table? A quick look at Accessibility APIs
edds
8
2.6k
Accessibility and how to get the most from your screenreader - Pivotal Lunch & Learns
edds
2
450
Accessibility and how to get the most from your screenreader - Front End North
edds
3
1.3k
GOV.UK Case Study - Fronteers 2013
edds
2
1.1k
Using Sass on GOV.UK
edds
8
990
What the flash - Photography Introduction
edds
67
11k
HTML5
edds
11
1.9k
Other Decks in Technology
See All in Technology
Amazon S3 Tablesに全部任せてみた結果——コンパクション/スナップショット管理は本当に手放せるか
shigeruoda
1
460
Oracle Cloud Infrastructure IaaS 新機能アップデート 2026/6 - 2026/8
oracle4engineer
PRO
0
140
Microsoft 365 Copilot chat -tekoälypalvelun tietosuojaongelmat
hponka
0
650
株式会社シーエーシー エンジニア向け会社紹介資料
cac
0
57k
アプリログインとWeb認証基盤をつなぐ ASWebAuthenticationSession 作法
shimastripe
1
190
From Vanilla Kubernetes to a Batteries-Included Platform: Developer Experience at 1,300+ Clusters
yosshi_
0
680
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
3
450
Deploying a Full-Stack Bun-Native Framework on Cloudflare Workers
7nohe
0
130
AIで仕事のやり方を変える
matsu7874
3
1k
TinyGo 開発サイクルを高速化する:Go で作るエミュレータ入門
zozotech
PRO
1
600
幾何アルゴリズムで なめらかなピン操作を / iOSDC Japan 2026 / smoothpin
kazumanagano
0
260
AI活用の現在地、 ちゃんと見えてますか?/XPfest-2026
visional_engineering_and_design
0
180
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
331
22k
Balancing Empowerment & Direction
lara
6
1.3k
Typedesign – Prime Four
hannesfritz
42
3.2k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
500
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
250
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
540
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.3k
Mobile First: as difficult as doing things right
swwweet
225
10k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Transcript
Edd Sowden @edds
D3.js
[ ... ]
Sin Wave
[ 0, 1, 0, -1, 0 ]
var xScale = d3.scale .linear() .domain([0, data.length-1]) .range([0, graphWidth]);
d3.svg.line() .x(function(d, i){ return xScale(i); }) .y(function(d, i){ return yScale(d);
});
demo
[ [ ... ], [ ... ] ]
D3 update pattern
// select all existing elements ... // add new elements
... // update all the elements ... // remove the old elements ...
// select all existing elements lines = graph.selectAll(‘path’) .data(data)
// add new elements lines.enter().append(‘path’)
// update all the elements lines.attr('d', function(d){ return line(d); });
// remove the old elements path.exit().remove();
demo
Updating the lines
demo
Google Analytics
app google window.location (query string) window.location (hash) JSONP (Ajax)
accessToken
https://www.googleapis.com/ analytics/v3/management/accounts
googleUser.apiRequest( endpoint, function(data){ ... } );
Dimensions Metrics Sort order Start and end date
Dimensions Metrics Sort order Start and end date
Dimensions Metrics Sort order Start and end date
Dimensions Metrics Sort order Start and end date
OLAP Cube
date device type operating system
operating system date device type
metrics ga:visitors dimensions ga:deviceCategory ga:nthDay
https://www.googleapis.com/analytics/v3/data/ga? ids={{profileId}}& dimensions=ga:nthDay,ga:deviceCategory& metrics=ga:visitors& start-date=2013-01-01& end-date=2013-09-30& max-results=10000& sort=ga:nthDay& access-token={{accessToken}}
[ [desktop, 0, 7], [mobile, 0, 3], [tablet, 0, 7],
[desktop, 1, 4], ... ]
[ { type: “desktop”, values: [7, 4, 5], }, ...
]
demo
Getting the data in shape
demo
Browser Matrix http://edds.github.io/browser-matrix/
None
Google Analytics Query Explorer 2 http://ga-dev-tools.appspot.com/explorer/
Demos from this talk https://github.com/edds/d3-presentation-examples
Edd Sowden @edds