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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
Cursor Subagentsはいいぞ
yug1224
2
130
タスク管理も1on1も、もう「管理」じゃない - KiroとBedrock AgentCoreで変わった“判断の仕事”
yusukeshimizu
0
160
Embeddings : Symfony AI en pratique
lyrixx
0
450
Zephyr(RTOS)でARMとRISC-Vのコア間通信をしてみた
iotengineer22
0
120
SSoT(Single Source of Truth)で「壊して再生」する設計
kawauso
2
420
Network Firewall Proxyで 自前プロキシを消し去ることができるのか
gusandayo
0
170
トイルを超えたCREは何屋になるのか
bengo4com
0
120
OPENLOGI Company Profile for engineer
hr01
1
62k
やさしいとこから始めるGitHubリポジトリのセキュリティ
tsubakimoto_s
3
2.1k
互換性のある(らしい)DBへの移行など考えるにあたってたいへんざっくり
sejima
PRO
0
520
Move Fast and Break Things: 10 in 20
ramimac
0
120
20260326_AIDD事例紹介_ULSC.pdf
findy_eventslides
0
400
Featured
See All Featured
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
210
My Coaching Mixtape
mlcsv
0
92
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
950
Become a Pro
speakerdeck
PRO
31
5.9k
The Spectacular Lies of Maps
axbom
PRO
1
670
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
780
Mobile First: as difficult as doing things right
swwweet
225
10k
Designing for humans not robots
tammielis
254
26k
Thoughts on Productivity
jonyablonski
76
5.1k
Writing Fast Ruby
sferik
630
63k
Crafting Experiences
bethany
1
100
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
110k
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