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
Visualization Grammar
Search
Eitan Lees
March 03, 2020
Programming
9
640
Visualization Grammar
A brief tour of the Vega/Vega-Lite visualization grammar used in Altair
Eitan Lees
March 03, 2020
Tweet
Share
More Decks by Eitan Lees
See All by Eitan Lees
Visualization
eitanlees
143
15k
Matplotlib
eitanlees
8
740
Altair Tutorial
eitanlees
4
840
Scientific Visualization
eitanlees
6
530
Other Decks in Programming
See All in Programming
"Swarming" をコンセプトに掲げるアジャイルチームのベストプラクティス
boykush
2
240
2024-10-02 dev2next - Application Observability like you've never heard before
jonatan_ivanov
0
170
Iteratorでページネーションを実現する
sonatard
3
710
ECS向けのドリフト検知機構を実装してみた
tkikuc
0
280
.NET Aspireのクラウド対応検証: Azureと他環境での実践
ymd65536
1
410
文化が生産性を作る
jimpei
3
560
RDBの世界をぬりかえていくモデルグラフDB〜truncus graphによるモデルファースト開発〜
jurabi
0
170
Subclassing, Composition, Python, and You
hynek
3
150
コードレビューと私の過去と未来
jxmtst
0
260
What is TDD?
urakawa_jinsei
1
220
CSC509 Lecture 02
javiergs
PRO
0
160
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
390
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9k
Optimising Largest Contentful Paint
csswizardry
31
2.8k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
7
570
How To Stay Up To Date on Web Technology
chriscoyier
787
250k
In The Pink: A Labor of Love
frogandcode
139
22k
GraphQLの誤解/rethinking-graphql
sonatard
65
9.9k
How to train your dragon (web standard)
notwaldorf
87
5.6k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
92
16k
A better future with KSS
kneath
237
17k
Git: the NoSQL Database
bkeepers
PRO
425
64k
Product Roadmaps are Hard
iamctodd
PRO
48
10k
Transcript
Data Mark Encoding Transform Scale Guide Visualization Grammar
Data Mark Encoding Transform Scale Guide A B C &
Variables Observations Tabular Data A B C
Data Mark Encoding Transform Scale Guide A,B,C,D,E 4,6,4,4,3 4,4,8,4,3 7,5,5,0,1
5,9,3,0,5 0,1,2,4,2 [ { "A":4, "B":6, "C":4, "D":4, "E":3 }, { "A":4, "B":4, "C":8, "D":4, "E":3 }, { "A":7, "B":5, "C":5, "D":0, "E":1 }, { "A":5, "B":9, "C":3, "D":0, "E":5 }, { "A":0, "B":1, "C":2, "D":4, "E":2 } ] https://eitanlees.com/ABC.csv
Data Mark Encoding Transform Scale Guide B A A A
C C C B B and many more ... Text Circle Bar Line
Data Mark Encoding Transform Scale Guide X Position Y Position
Size Color ⠇ Channel A B C D ⠇ Variable
Data Mark Encoding Transform Scale Guide Calculate Fold Filter Aggregate
and many more ...
Data Mark Encoding Transform Scale Guide f(domain) → range
Data Mark Encoding Transform Scale Guide A B C Legend
Data Mark Encoding Transform Scale Guide Let’s make a chart
Data Mark Encoding Transform Scale Guide import altair as alt
from vega_datasets import data iris = data.iris() sepalLength sepalWidth PetalLength PetalWidth species 5.1 3.5 1.4 0.2 setosa 4.9 3.0 1.4 0.2 setosa 4.7 3.2 1.3 0.2 setosa 4.6 3.1 1.5 0.2 setosa ⠇
Data Mark Encoding Transform Scale Guide import altair as alt
from vega_datasets import data iris = data.iris() alt.Chart(iris).mark_circle()
Data Mark Encoding Transform Scale Guide import altair as alt
from vega_datasets import data iris = data.iris() alt.Chart(iris).mark_circle() Without an encoding our chart is not very interesting
Data Mark Encoding Transform Scale Guide import altair as alt
from vega_datasets import data iris = data.iris() alt.Chart(iris).mark_circle().encode( alt.X('petalLength'), alt.Y('petalWidth') )
Data Mark Encoding Transform import altair as alt from vega_datasets
import data iris = data.iris() alt.Chart(iris).mark_circle().encode( alt.X('petalLength'), alt.Y('petalWidth'), alt.Color('species') ) Scale Guide
Data Mark Encoding Transform import altair as alt from vega_datasets
import data iris = data.iris() alt.Chart(iris).mark_circle().encode( alt.X('petalLength'), alt.Y('petalWidth'), alt.Color('species') ) Scale Guide Note that the guides and scales are automatically generated for us
Data Mark Encoding Transform import altair as alt from vega_datasets
import data iris = data.iris() alt.Chart(iris).mark_circle().encode( alt.X('petalLength'), alt.Y('petalWidth'), alt.Color('species') ).transform_filter( alt.datum.sepalWidth < 3 ) Scale Guide