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
d3.js: the core concepts
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
itszero
July 19, 2015
Programming
2.5k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
d3.js: the core concepts
A very introductory view of d3.js, comes with some code example people can play with.
itszero
July 19, 2015
More Decks by itszero
See All by itszero
Routing OpenStreetMap
itszero
0
1.4k
EcoSec
itszero
1
210
TaipeiFever
itszero
0
320
Other Decks in Programming
See All in Programming
AIとRubyの静的型付け
ukin0k0
0
560
Why Laravel apps break—Mastering the fundamentals to keep them maintainable
kentaroutakeda
1
340
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
380
Copilot CLI の継戦能力を高める コンテキスト管理
nozomutu
1
1.2k
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
1.9k
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
3.5k
Swiftのレキシカルスコープ管理
kntkymt
0
220
OSもどきOS
arkw
0
470
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
210
JavaDoc 再入門
nagise
0
310
さぁV100、メモリをお食べ・・・
nilpe
0
130
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
140
Featured
See All Featured
Technical Leadership for Architectural Decision Making
baasie
3
400
Optimising Largest Contentful Paint
csswizardry
37
3.7k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
610
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
270
Designing for Performance
lara
611
70k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
160
Paper Plane (Part 1)
katiecoart
PRO
0
8.8k
Color Theory Basics | Prateek | Gurzu
gurzu
0
360
Being A Developer After 40
akosma
91
590k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.8k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Transcript
d3.js: the Core Concepts Zero Cho
data visualization…?
None
so what is D3? d3 is an data visualization library
None
None
Data-Driven Documents notice how visualization is NOT in the title?
[ 1, 2, 3, 4 ] data <div/> <svg/> <canvas/>
HTML/SVG/else
geography time scale color geometry layout behavior data
geography time scale color geometry layout behavior data
step 1: SELECT … just like jQuery
d3.select(‘#ex1') .selectAll('.circle') .style('width', '100px') .style('height', '100px'); code
step 2: BINDING … where magic happens
const data = [50, 100, 200, 300]; const funNumToPx =
(num) => `${num}px`; d3.select(‘#ex2') .selectAll('.circle') .data(data) .style('width', funNumToPx) .style('height', funNumToPx); code http://codepen.io/itszero/pen/LVrwPJ
that’s not dynamic but, you say
given a data, you tell d3 to handle… • enter
• update • exit
let data = []; const count = nextInt(20); for(let i=0;i<count;i++)
{ data.push(nextInt(400)); } const funNumToPx = (num) => `${num}px`; const sel = d3.select('#ex3') .selectAll('.circle') .data(data); sel.enter() .append('div') .attr('class', 'circle'); sel.transition() .duration(500) .style('width', funNumToPx) .style('height', funNumToPx); sel.exit() .remove(); code enter: create basic div exit: remove the div update: update style prep: generate an array of random numbers http://codepen.io/itszero/pen/rVKXMp
now let’s checkout a more advanced example http://codepen.io/itszero/pen/RPBKbj
references • paper • 2011 InfoVis • website (examples) •
http://d3js.org/ • tutorials • https://square.github.io/intro-to-d3/