Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Using D3.js to visualise your analytics data
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Edd S
October 21, 2013
Technology
790
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
890
Accessibility and how to get the most from your screenreader - EpicFEL
edds
1
630
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
980
What the flash - Photography Introduction
edds
67
11k
HTML5
edds
11
1.9k
Other Decks in Technology
See All in Technology
「守りたい体験」を渡すだけで E2E を生成させられるようになった話
hinac0
0
190
Devsumi 2026 Summer 人もAIも使える共通基盤を事業の加速装置にする~デザインシステム運用に学ぶ組織レバレッジ~ 渡辺 凌央
legalontechnologies
PRO
1
230
DatabricksにおけるMCPソリューション
taka_aki
1
270
Empower GenAI with Agile - あなたのアジャイルが生成AIのバフになる仕組み
hageyahhoo
1
210
Data + AI Summit 2026 イベントレポート: 「AIがビジネスで意思決定するデータ基盤」へ
nek0128
0
270
ファミコンでPHPを動かす / PHP on the Famicom
tomzoh
2
400
SoccerMaster: A Vision Foundation Model for Soccer Understanding
kzykmyzw
0
140
世界、断片、モデル。そして理解
ardbeg1958
1
130
生成AI×AWS CDK×AWS FISで"振り返れる"ミニGameDayをつくろう
yoshimi0227
1
390
SREとQA 二人三脚で進めるSLO運用/sre-qa-slo
sugitak
0
880
AIレビューはどこまで任せられるのか?自動化と人が背負うレビューの境界
sansantech
PRO
3
1.1k
美しいコードを書くためにF#を学んでみた話
yud0uhu
1
460
Featured
See All Featured
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
450
How to Think Like a Performance Engineer
csswizardry
28
2.7k
Optimizing for Happiness
mojombo
378
71k
A Soul's Torment
seathinner
6
3.1k
Bash Introduction
62gerente
615
220k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
Google's AI Overviews - The New Search
badams
0
1.1k
Into the Great Unknown - MozCon
thekraken
41
2.6k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
970
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