{"$schema":"https://vega.github.io/schema/vega-lite/v3.json","data":{"url":"https://raw.githubusercontent.com/csmontt/dataVisCourse/master/data/courseworkData.csv"},"config":{"view":{"stroke":""},"title":{"anchor":"start"},"axis":{"ticks":false,"domain":false}},"transform":[{"calculate":"if(datum.occ == 'Professional / Higher managerial', 8,\n if(datum.occ == 'Intermediate managerial', 7,\n if(datum.occ == 'Skilled non manual', 6,\n if(datum.occ == 'Skilled manual', 5,\n if(datum.occ == 'Semi-skilled', 4,\n if(datum.occ == 'Unskilled', 3,\n if(datum.occ == 'Landed farmer', 2,\n if(datum.occ == 'Skilled/semi skilled agriculture', 1, 0))))))))","as":"occOrder"}],"vconcat":[{"hconcat":[{"width":240,"height":315,"selection":{"brush":{"type":"interval"}},"mark":{"type":"circle","size":2,"opacity":0.5},"encoding":{"x":{"field":"lon","type":"quantitative","scale":{"domain":[-8,2]},"axis":{"grid":false,"title":"","values":[],"ticks":false}},"y":{"field":"lat","type":"quantitative","scale":{"domain":[49,61]},"axis":{"grid":false,"title":"","values":[],"ticks":false}},"color":{"condition":{"selection":"brush","field":"occ","type":"nominal","scale":{"domain":["Agricultural labourer","Skilled/semi skilled agriculture","Landed farmer","Unskilled","Semi-skilled","Skilled manual","Skilled non manual","Intermediate managerial","Professional / Higher managerial"],"range":["#A50F15","#DE2D26","#FB6A4A","#9ECAE1","#6BAED6","#4292C6","#2171B5","#08519C","#08306B"]},"legend":null},"value":"lightgrey"}},"title":"UK's occupational map (brush a selection)"},{"vconcat":[{"width":330,"height":110,"mark":"bar","encoding":{"y":{"type":"quantitative","aggregate":"count","stack":"normalize","axis":{"title":"","titlePadding":23}},"x":{"field":"cohort","type":"ordinal","axis":{"title":"","grid":false,"values":[]}},"color":{"field":"occ","type":"nominal","scale":{"domain":["Agricultural labourer","Skilled/semi skilled agriculture","Landed farmer","Unskilled","Semi-skilled","Skilled manual","Skilled non manual","Intermediate managerial","Professional / Higher managerial"],"range":["#A50F15","#DE2D26","#FB6A4A","#9ECAE1","#6BAED6","#4292C6","#2171B5","#08519C","#08306B"]},"legend":null},"order":{"field":"occOrder","type":"quantitative"}},"transform":[{"filter":{"selection":"brush"}}],"title":"Proportion of occupations over cohorts"},{"width":330,"height":115,"mark":"bar","encoding":{"y":{"type":"quantitative","aggregate":"count","axis":{"title":""}},"x":{"field":"cohort","type":"ordinal","axis":{"title":"","grid":false,"labelAngle":300}},"color":{"field":"occ","type":"nominal","scale":{"domain":["Agricultural labourer","Skilled/semi skilled agriculture","Landed farmer","Unskilled","Semi-skilled","Skilled manual","Skilled non manual","Intermediate managerial","Professional / Higher managerial"],"range":["#A50F15","#DE2D26","#FB6A4A","#9ECAE1","#6BAED6","#4292C6","#2171B5","#08519C","#08306B"]},"legend":null},"order":{"field":"occOrder","type":"quantitative"}},"transform":[{"filter":{"selection":"brush"}}],"title":"Occupational measurements over cohorts"}]},{"data":{"url":"https://raw.githubusercontent.com/csmontt/dataVisCourse/master/data/courseworkData.csv"},"transform":[{"calculate":"if(datum.occ == 'Professional / Higher managerial', 8,\n if(datum.occ == 'Intermediate managerial', 7,\n if(datum.occ == 'Skilled non manual', 6,\n if(datum.occ == 'Skilled manual', 5,\n if(datum.occ == 'Semi-skilled', 4,\n if(datum.occ == 'Unskilled', 3,\n if(datum.occ == 'Landed farmer', 2,\n if(datum.occ == 'Skilled/semi skilled agriculture', 1, 0))))))))","as":"occOrder"}],"encoding":{"y":{"field":"occ","type":"nominal","axis":{"title":"","domain":false,"ticks":false},"scale":{"domain":["Professional / Higher managerial","Intermediate managerial","Skilled non manual","Skilled manual","Semi-skilled","Unskilled","Landed farmer","Skilled/semi skilled agriculture","Agricultural labourer"]}},"color":{"field":"occ","type":"nominal","scale":{"domain":["1855-1880","1830-1854","1805-1829","1780-1804"],"range":["#014636","#3690C0","#A6BDDB","#D0D1E6"]},"legend":null}},"mark":{"type":"circle","size":120,"x":-155},"config":{"view":{"stroke":""}}}]},{"hconcat":[{"width":680,"height":100,"mark":{"type":"line","interpolate":"monotone"},"encoding":{"x":{"field":"age_int","type":"ordinal","axis":{"grid":false,"title":"Age","titleFontSize":7,"labelAngle":300}},"y":{"field":"avHcoho","type":"quantitative","scale":{"zero":false},"axis":{"title":""}},"color":{"field":"cohort","type":"nominal","legend":null,"scale":{"domain":["1855-1880","1830-1854","1805-1829","1780-1804"],"range":["#014636","#3690C0","#A6BDDB","#D0D1E6"]}}},"transform":[{"filter":{"selection":"brush"}},{"filter":{"selection":"legendSel"}},{"window":[{"as":"avHcoho","op":"mean","field":"hiscam_age"}],"frame":[null,null],"groupby":["cohort","age_int"]}],"title":"Differences in occupational status (average HISCAM) over the life course between cohorts"},{"selection":{"legendSel":{"type":"multi","encodings":["color"]}},"encoding":{"y":{"field":"cohort","type":"nominal","axis":{"title":"","domain":false,"ticks":false},"scale":{"domain":["1855-1880","1830-1854","1805-1829","1780-1804"]}},"color":{"condition":{"selection":"legendSel","field":"cohort","type":"nominal","scale":{"domain":["Agricultural labourer","Skilled/semi skilled agriculture","Landed farmer","Unskilled","Semi-skilled","Skilled manual","Skilled non manual","Intermediate managerial","Professional / Higher managerial"],"range":["#A50F15","#DE2D26","#FB6A4A","#9ECAE1","#6BAED6","#4292C6","#2171B5","#08519C","#08306B"]},"legend":null},"value":"lightgrey"}},"mark":{"type":"square","size":120,"opacity":1}}]},{"width":60,"height":70,"mark":{"type":"line","interpolate":"monotone"},"encoding":{"x":{"field":"age_int","type":"ordinal","axis":{"grid":false,"title":"","ticks":false,"values":[]}},"y":{"field":"avHcoho","type":"quantitative","scale":{"zero":false},"axis":{"title":""}},"color":{"field":"cohort","type":"nominal","legend":null,"scale":{"domain":["1855-1880","1830-1854","1805-1829","1780-1804"],"range":["#014636","#3690C0","#A6BDDB","#D0D1E6"]}},"column":{"field":"rcodefa","type":"nominal","sort":["Professional / Higher managerial","Intermediate managerial","Skilled non manual","Skilled manual","Semi-skilled","Unskilled","Landed farmer","Skilled/semi skilled agriculture"],"header":{"title":"","labelAngle":352,"labelFontSize":8}}},"transform":[{"filter":{"selection":"brush"}},{"filter":{"selection":"legendSel"}},{"window":[{"as":"avHcoho","op":"mean","field":"hiscam_age"}],"frame":[null,null],"groupby":["cohort","rcodefa","age_int"]}],"title":"The Effect of Father's Occupation on an Individuals Career"}]}