Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
d3.js: the core concepts
Search
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
330
Other Decks in Programming
See All in Programming
Workers Cache を知る
syumai
0
360
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
180
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
160
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
1.2k
ジョジョの世界をXRで再現する
mofurune
0
160
AI主導のプログラミング学習アプリを作ってみた
econanringo
0
180
パスワード再設定メールのURLについて知っておこう
uyuki234
0
160
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
140
dotNET_vulnclicker_intro.pdf
deka_morita
0
140
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
370
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
150
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
430
Featured
See All Featured
Optimizing for Happiness
mojombo
378
71k
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
550
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
300
Typedesign – Prime Four
hannesfritz
42
3.2k
We Are The Robots
honzajavorek
0
400
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Facilitating Awesome Meetings
lara
57
7.2k
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/