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
SVG Graph Animation
Search
namikuguri
July 11, 2016
Technology
0
190
SVG Graph Animation
グラフアニメーションが作れるライブラリの紹介
namikuguri
July 11, 2016
Tweet
Share
More Decks by namikuguri
See All by namikuguri
実例から学ぶ CSSアニメーション
namikuguri
1
1.3k
かるくCalc()
namikuguri
0
130
SVG Basic
namikuguri
0
190
石
namikuguri
0
78
僕はあの日夕暮れ時に書いたスタイルガイドを忘れない
namikuguri
0
820
誰と作るデザイン?
namikuguri
0
590
CSS の構造化、その目的
namikuguri
0
97
fitme
namikuguri
0
70
About color
namikuguri
0
95
Other Decks in Technology
See All in Technology
SSMRunbook作成の勘所_20241120
koichiotomo
2
130
マルチプロダクトな開発組織で 「開発生産性」に向き合うために試みたこと / Improving Multi-Product Dev Productivity
sugamasao
1
300
Evangelismo técnico: ¿qué, cómo y por qué?
trishagee
0
360
Application Development WG Intro at AppDeveloperCon
salaboy
0
180
フルカイテン株式会社 採用資料
fullkaiten
0
40k
Shopifyアプリ開発における Shopifyの機能活用
sonatard
4
250
Amazon CloudWatch Network Monitor のススメ
yuki_ink
1
200
Lambdaと地方とコミュニティ
miu_crescent
2
370
【Pycon mini 東海 2024】Google Colaboratoryで試すVLM
kazuhitotakahashi
2
500
Adopting Jetpack Compose in Your Existing Project - GDG DevFest Bangkok 2024
akexorcist
0
110
Why App Signing Matters for Your Android Apps - Android Bangkok Conference 2024
akexorcist
0
120
Terraform CI/CD パイプラインにおける AWS CodeCommit の代替手段
hiyanger
1
240
Featured
See All Featured
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Why Our Code Smells
bkeepers
PRO
334
57k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
410
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
What's new in Ruby 2.0
geeforr
343
31k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Statistics for Hackers
jakevdp
796
220k
How GitHub (no longer) Works
holman
310
140k
Transcript
SVGΛͬͨ ԁάϥϑͷͭ͘Γํ ʢಈ͔ͳ͍ʣ Contents D3.js CHARTIST.JS SVG stroke @thleap
ͳ͍ͥ·SVGʁ ANIMATED LETTERS ͷσϞΛݟͯҙ͕ࣝߴ·ͬͨ ͍ํΛͬͯɺΘΕํ͕ؾʹͳΔʢΞΠίϯάϥϑ͕΄ͱΜͲʁʣ ͱΓ͋͑ͣάϥϑ࡞ͬͯΈΑ͏
stroke-dasharrayΛͬͯԁάϥϑΛඳ͘ CHARTIST.JSΛͬͯԁάϥϑΛඳ͘ D3.jsΛͬͯԁάϥϑΛඳ͘
stroke-dasharrayΛͬͯԁάϥϑΛඳ͘ <svg viewBox="0 0 63.6619772368 63.6619772368"> <circle class="pie1" cx="31.8309886184" cy="31.8309886184"
r="15.9154943092"/> … </svg> circle { fill: transparent; stroke-width: 31.8309886184; stroke-dasharray: 0,0,0,100; stroke-dashoffset: 25; } .pie1 { stroke: #082C3D; stroke-dasharray: 33,0,0,0; } … DEMO
stroke-dasharrayΛͬͨԁάϥϑ ΈΛ͓֮͑ͯ͘ͷ͕໘ʢجຊతʹԁप / π / 2 Λ͓͚֮͑ͯྑ͍ͱ͍͑…ʣ HTMLͱCSS͚ͩͰࡁΉͷͰ؆୯ ׂ͞ΕͨύΠʹઢӨΛ͚͍ͭͨͱ͖͕໘ ϥϕϧΛ͚ͭͨΓɺΞχϝʔγϣϯͤ͞Α͏ͱ͢Δͱେม
stroke-dasharrayΛͬͯԁάϥϑΛඳ͘ CHARTIST.JSΛͬͯԁάϥϑΛඳ͘ D3.jsΛͬͯԁάϥϑΛඳ͘
None
None
CHARTIST.JSΛͬͯԁάϥϑΛඳ͘ DEMO <div id="demo"></div> .ct-series-a .ct-area, .ct-series-a .ct-slice-pie { fill:
#082C3D; } var data = { labels: ['SVG', 'CHARTIST.JS', 'D3.js'], series: [1, 1, 1] }; var options = { showLabel: true }; new Chartist.Pie('#demo', data, options);
CHARTIST.JSͷ Ұ௨Γͷάϥϑ͕ἧͬͯΔ ϒϨʔΫϙΠϯτ͕ࢦఆՄೳ SMILΞχϝʔγϣϯ͕Ұ෦ͰΘΕ͍ͯΔ ॻ͘ͷָ͕͍͢͝
stroke-dasharrayΛͬͯԁάϥϑΛඳ͘ CHARTIST.JSΛͬͯԁάϥϑΛඳ͘ D3.jsΛͬͯԁάϥϑΛඳ͘
None
D3.jsΛͬͯԁάϥϑΛඳ͘ DEMO <div id="demo"></div> // SVGの表示領域を生成 var svg = d3.select('#demo').append('svg')
.attr('width', svgWidth).attr('height', svgHeight) // SVGの表示領域を生成 var pie = d3.layout.pie() .value(function(d){ return d; }) // 円グラフのサイズを指定 var pie = d3.svg.arc().innerRadius(0).outerRadius(svgWidth / 2); // 円グラフを描画 svg.selectAll('path') .data(pie(list)) .enter() …
D3.jsͷ ར༻ऀ͕ଟ͘ɺυΩϡϝϯτ๛ ଟ࠼ͳදݱ͕Մೳ
ֶͿͱਂΈʹ·Γͦ͏ͳ D3.js ͕ྑͦ͞͏ ·ͱΊ