Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Using D3.js to visualise your analytics data
Search
Edd S
October 21, 2013
Technology
0
750
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
Tweet
Share
More Decks by Edd S
See All by Edd S
Using React at Deliveroo - LRUG
edds
0
830
Accessibility and how to get the most from your screenreader - EpicFEL
edds
1
600
What even is a table? A quick look at Accessibility APIs
edds
8
2.5k
Accessibility and how to get the most from your screenreader - Pivotal Lunch & Learns
edds
2
410
Accessibility and how to get the most from your screenreader - Front End North
edds
3
1.2k
GOV.UK Case Study - Fronteers 2013
edds
2
1.1k
Using Sass on GOV.UK
edds
8
920
What the flash - Photography Introduction
edds
67
11k
HTML5
edds
11
1.8k
Other Decks in Technology
See All in Technology
学術的根拠から読み解くNotebookLMの音声活用法
shukob
1
550
SRE視点で振り返るメルカリのアーキテクチャ変遷と普遍的な考え
foostan
2
3.2k
Pandocでmd→pptx便利すぎワロタwww
meow_noisy
2
1.1k
ページの可視領域を算出する方法について整理する
yamatai1212
0
120
プロダクト負債と歩む持続可能なサービスを育てるための挑戦
sansantech
PRO
1
1.2k
『星の世界の地図の話: Google Sky MapをAI Agentでよみがえらせる』 - Google Developers DevFest Tokyo 2025
taniiicom
0
440
Master Dataグループ紹介資料
sansan33
PRO
1
4k
生成AIシステムとAIエージェントに関する性能や安全性の評価
shibuiwilliam
2
280
レガシーシステム刷新における TypeSpec スキーマ駆動開発のすゝめ
tsukuha
4
880
確実に伝えるHealth通知 〜半自動システムでほどよく漏れなく / JAWS-UG 神戸 #9 神戸へようこそ!LT会
genda
0
160
変わるもの、変わらないもの :OSSアーキテクチャで実現する持続可能なシステム
gree_tech
PRO
0
1.3k
AIで加速する次世代のBill Oneアーキテクチャ〜成長の先にある軌道修正〜
sansantech
PRO
1
150
Featured
See All Featured
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
The Cost Of JavaScript in 2023
addyosmani
55
9.3k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.8k
A Tale of Four Properties
chriscoyier
162
23k
Building an army of robots
kneath
306
46k
Building Adaptive Systems
keathley
44
2.8k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.3k
Designing for Performance
lara
610
69k
Done Done
chrislema
186
16k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
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