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
GitLab Duo Agent Platform × AGENTS.md で実現するSpec-Driven Development / GitLab Duo Agent Platform × AGENTS.md
n11sh1
0
130
Introduction to Bill One Development Engineer
sansan33
PRO
0
360
広告の効果検証を題材にした因果推論の精度検証について
zozotech
PRO
0
150
Bedrock PolicyでAmazon Bedrock Guardrails利用を強制してみた
yuu551
0
200
ZOZOにおけるAI活用の現在 ~開発組織全体での取り組みと試行錯誤~
zozotech
PRO
5
5k
生成AIを活用した音声文字起こしシステムの2つの構築パターンについて
miu_crescent
PRO
2
180
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
13k
usermode linux without MMU - fosdem2026 kernel devroom
thehajime
0
230
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.3k
外部キー制約の知っておいて欲しいこと - RDBMSを正しく使うために必要なこと / FOREIGN KEY Night
soudai
PRO
12
5.3k
データの整合性を保ちたいだけなんだ
shoheimitani
8
3.1k
コスト削減から「セキュリティと利便性」を担うプラットフォームへ
sansantech
PRO
3
1.4k
Featured
See All Featured
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
57
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
120
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
290
GraphQLの誤解/rethinking-graphql
sonatard
74
11k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
110
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
51
WENDY [Excerpt]
tessaabrams
9
36k
Ethics towards AI in product and experience design
skipperchong
2
190
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