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
Composing data visualizations in Ember
Search
Chris Henn
March 03, 2015
Technology
0
970
Composing data visualizations in Ember
Chris Henn
March 03, 2015
Tweet
Share
Other Decks in Technology
See All in Technology
顧客の言葉を、そのまま信じない勇気
yamatai1212
1
330
Context Engineeringが企業で不可欠になる理由
hirosatogamo
PRO
2
390
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
13k
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.3k
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
6
67k
広告の効果検証を題材にした因果推論の精度検証について
zozotech
PRO
0
100
データ民主化のための LLM 活用状況と課題紹介(IVRy の場合)
wxyzzz
2
660
顧客との商談議事録をみんなで読んで顧客解像度を上げよう
shibayu36
0
150
データの整合性を保ちたいだけなんだ
shoheimitani
8
2.9k
使いにくいの壁を突破する
sansantech
PRO
1
120
Claude_CodeでSEOを最適化する_AI_Ops_Community_Vol.2__マーケティングx_AIはここまで進化した.pdf
riku_423
2
430
FinTech SREのAWSサービス活用/Leveraging AWS Services in FinTech SRE
maaaato
0
120
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
AI: The stuff that nobody shows you
jnunemaker
PRO
2
240
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
580
Agile that works and the tools we love
rasmusluckow
331
21k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.4k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
210
BBQ
matthewcrist
89
10k
Discover your Explorer Soul
emna__ayadi
2
1.1k
Navigating Weather and Climate Data
rabernat
0
100
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.3k
It's Worth the Effort
3n
188
29k
Transcript
Composing Data Visualizations in Ember Chris Henn · chnn/composing-graphics
How should we split a statistical graphic into parts?
• Lets us change one feature of the graphic at
a time • Suggests the aspects of a plot that are possible to change • Encourages custom visualizations for every data situation
mpg cyl disp hp drat wt qsec vs am gear
carb Mazda RX4 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 4 Mazda RX4 Wag 21.0 6 160.0 110 3.90 2.875 17.02 0 1 4 4 Datsun 710 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 1 Hornet 4 Drive 21.4 6 258.0 110 3.08 3.215 19.44 1 0 3 1 Hornet Sportabout 18.7 8 360.0 175 3.15 3.440 17.02 0 0 3 2 Valiant 18.1 6 225.0 105 2.76 3.460 20.22 1 0 3 1 …
[ {name: “Mazda RX4”, mpg: 21.0, wgt: 2.62, cyl: 6,
…}, {name: “Mazda RX4 Wag”, mpg: 21.0, wgt: 2.875, cyl: 6, …}, {name: “Datsun 710”, mpg: 22.8, wgt: 2.32, cyl: 4, …}, … ]
Demo
Hadley Wickham’s Grammar of Graphics
A simple scatterplot
A simple scatterplot • Mappings from variables to aspects of
the plot • In the grammar this is a data to aesthetic mapping • Every visualization has at least one (often more)
A simple scatterplot • Each Data to Aesthetic mapping has
some mapping function • These are called scales
A simple scatterplot • We’ve chosen to represent these as
points • This is called a geom (or geometry)
The Grammar of Graphics • Data to Aesthetic mappings •
Scales: one per Data to Aesthetic mapping • Layers A. Geom B. Stat C. Optional Data to Aesthetic mapping • Coordinate System • Faceting
What does this look like using Ember?
Data to Aesthetic Mappings
{{my-scatterplot data=app.carData y="mpg" x="wt" color="cyl"}} Data to Aesthetic Mappings
Scales
// Some scale constructor var scale = linearScale([0, 10], [0,
300]); scale(5) // => 150 scale.invert(150) // => 5 Scales
var SomeComponent = Ember.Component.extend({ // Computed property that returns a
scale function xScale: linearScaleMacro('data', 'x', ‘screenWidth'), // ... }); Scales
Layers Geometries, Stats, Optional Data to Aesthetic mappings
{{plot-points data=data x=x y=y xScale=xScale yScale=yScale}} Layers
<svg> <path d="{{pathString}}" /> </svg> Layers: Geometries
<svg> {{#each points as |point|}} <circle cx="{{point.x}}" cy=“{{point.y}}" /> {{/each}}
</svg> Layers: Geometries
Further considerations • Interactivity • Animations and transitions • Performance
• When is the grammar appropriate?
When is the Grammar of Graphics appropriate? General Purpose Plotting
Library App with one visualization Your Ember App
Questions? chrishenn.net twitter: @cwhnn github: @chnn