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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Edd S
October 21, 2013
Technology
780
0
Share
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
870
Accessibility and how to get the most from your screenreader - EpicFEL
edds
1
610
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
430
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
950
What the flash - Photography Introduction
edds
67
11k
HTML5
edds
11
1.8k
Other Decks in Technology
See All in Technology
QA組織のAI戦略とAIテスト設計システムAITASの実践
sansantech
PRO
1
310
AI時代のシステム開発者の仕事_20260328
sengtor
0
320
JSTQB Expert Levelシラバス「テストマネジメント」日本語版のご紹介
ymty
0
110
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
3
2.1k
Why we keep our community?
kawaguti
PRO
0
370
Databricks Lakehouse Federationで 運用負荷ゼロのデータ連携
nek0128
0
110
スケーリングを封じられたEC2を救いたい
senseofunity129
0
140
MIX AUDIO EN BROADCAST
ralpherick
0
140
Kiro Meetup #7 Kiro アップデート (2025/12/15〜2026/3/20)
katzueno
2
280
Databricks Appsで実現する社内向けAIアプリ開発の効率化
r_miura
0
230
Cortex Code君、今日から内製化支援担当ね。
coco_se
0
190
VSCode中心だった自分がターミナル沼に入門した話
sanogemaru
0
900
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
Optimising Largest Contentful Paint
csswizardry
37
3.6k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
220
Thoughts on Productivity
jonyablonski
76
5.1k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
420
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
500
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
250
Marketing to machines
jonoalderson
1
5.1k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.2k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.6k
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