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
1
2.4k
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
Tweet
Share
More Decks by itszero
See All by itszero
Routing OpenStreetMap
itszero
0
1.4k
EcoSec
itszero
1
200
TaipeiFever
itszero
0
310
Other Decks in Programming
See All in Programming
ポーリング処理廃止によるイベント駆動アーキテクチャへの移行
seitarof
3
1.1k
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
560
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
300
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
270
[SF Ruby Feb'26] The Silicon Heel
palkan
0
110
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
400
野球解説AI Agentを開発してみた - 2026/02/27 LayerX社内LT会資料
shinyorke
PRO
0
330
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
990
メタプログラミングで実現する「コードを仕様にする」仕組み/nikkei-tech-talk43
nikkei_engineer_recruiting
0
190
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
200
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
280
Cyrius ーLinux非依存にコンテナをネイティブ実行する専用OSー
n4mlz
0
170
Featured
See All Featured
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
170
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
270
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
The Cost Of JavaScript in 2023
addyosmani
55
9.8k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
220
The World Runs on Bad Software
bkeepers
PRO
72
12k
Test your architecture with Archunit
thirion
1
2.2k
The Curious Case for Waylosing
cassininazir
0
270
Visualization
eitanlees
150
17k
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/