HW 4 Vega-Lite Gallery
Genetics Kits
1. Alayna Smith
2. Daniel Jin
Comparing Twins
Comparing Kits
3. Lily McAboy
Comparing Twins
Comparing Kits
{ "$schema": "https://vega.github.io/schema/vega-lite/v5.json", "data": { "url": "https://calvin-data304.netlify.app/data/twins-genetics-long.json" }, "width": 200, "height": 200, "mark": "bar", "background": "white", "transform": [ { //https://vega.github.io/vega-lite/docs/window.html "window": [{ "op": "lead", "field": "genetic share", "as": "twin_share" }] }, { "calculate": "abs(datum['genetic share'] - datum['twin_share'])", "as": "diff" }, { "aggregate": [ {"op": "mean", "field": "diff", "as": "Average Difference"} ], "groupby": ["kit"] } ], "encoding": { "x": {"field": "", "type": "nominal", "title": ""}, "y": { "field": "Average Difference", "type": "quantitative" }, "opacity": {"value": 0.5}, "column": {"field": "kit", "type": "nominal", "title": "Average Difference By DNA Kit"} } }
4. Priscilla Chen
Comparing Twins
Comparing Kits
5. Luke Monsma
Comparing Twins
Comparing Kits
6. Sucry Bendeck
Comparing Twins
Comparing Kits
7. Felicia Susanto
Comparing Twins
Comparing Kits
8. Ella Addink
Comparing Twins
Comparing Kits
9. Joel Essenburg
Comparing Twins
{ "$schema": "https://vega.github.io/schema/vega-lite/v5.json", "data": { "url": "https://calvin-data304.netlify.app/data/twins-genetics-wide.json" }, "width": 700, "height": 450, "mark": "point", "encoding": { "x": { "field": "Ancestry", "type": "quantitative", }, "y": { "field": "pair", "type": "ordinal", }, "color": { "field": "twin", "type": "nominal", }, "shape": { "field": "id", "type": "nominal", } }, }
Comparing Kits
{ "$schema": "https://vega.github.io/schema/vega-lite/v5.json", "data": { "url": "https://calvin-data304.netlify.app/data/twins-genetics-wide.json" }, "width": 700, "height": 450, "mark": "point", "encoding": { "x": { "field": "23andMe", "type": "quantitative", }, "y": { "field": "MyHeritage", "type": "quantitative", }, "color": { "field": "pair", "type": "nominal", }, "shape": { "field": "id", "type": "nominal", } }, }
Exercise 2.3
1. Alayna Smith
2. Daniel Jin
3. Lily McAboy
4. Priscilla Chen
{ "$schema": "https://vega.github.io/schema/vega-lite/v5.json", "data": { "url": "https://calvin-data304.netlify.app/data/swd-lets-practice-ex-2-3.json" }, "width": 800, "height": 250, "layer":[{ "mark": {"type": "line", "color":"red", "size":3}, "encoding": { "x": {"field": "date", "type": "temporal"}, "y": {"field": "capacity", "type": "quantitative", "title":"value"}, "y2": {"field": "demand", "type": "quantitative"} }}, { "mark": {"type": "point", "size": 50}, "encoding": { "x": {"field": "date", "type": "temporal"}, "y": {"field": "demand", "type": "quantitative"}, "color": { "datum": "Demand", "type": "nominal", "scale": {"domain": ["Demand", "Capacity"], "range": ["red", "blue"]}, "legend": {"title": "Legend"} } }, }, { "mark": {"type": "point","color":"blue", "size":50,"opacity":0.7}, "encoding": { "x": {"field": "date", "type": "temporal"}, "y": {"field": "capacity", "type": "quantitative"} }},] }
5. Luke Monsma
6. Sucry Bendeck
7. Felicia Susanto
8. Ella Addink
9. Joel Essenburg
Next Steps
Alayna Smith: NA
Daniel Jin: For the twin graph, I was wondering if it is possible to make the y axis more specific to 0.01 to 1.00. For the exercise graphic, is there any way that can make the x axis better.
Lily McAboy: I had to use a lot of VegaLite's documentation for aggregate and groupby stuff for the twin data. I really am interested in the "window" code for "transform".
Priscilla Chen: grouped bar. more interactive graphics in general. "3D" graphics
Luke Monsma: layering multiple graphics to make more complex stuff.
Sucry Bendeck: • I am looking forward to doing more intricate graphs such as the ones that I do not know how to do. • Looking forward to how else I could use layering. Is it possible to do 3D graphs in json using layering? • After a long time of doing viz 2 I notice I need to learn more about scales.
Felicia Susanto: animations, more about layering
Ella Addink: NA
Joel Essenburg: I'm mostly looking forward to getting in lots of practice. The more I use Vega-lite, the more familiar I become with all the functions, and the more comfortable I feel using them. I'm especially looking forward to getting to the point where I have the knowledge and practice to be able to quickly whip up a quality graph for any type of dataset.