Skip to content

Instantly share code, notes, and snippets.

@KalebNyquist
Created September 20, 2022 03:41
Show Gist options
  • Save KalebNyquist/40879b0a39f211a3b62eee26a3ab16ae to your computer and use it in GitHub Desktop.
Save KalebNyquist/40879b0a39f211a3b62eee26a3ab16ae to your computer and use it in GitHub Desktop.
Vega-Lite spec from Mon Sep 19 2022
{
"config": {
"view": {
"continuousWidth": 400,
"continuousHeight": 400,
"strokeWidth": 0,
"stroke": "#000000"
}
},
"layer": [
{
"mark": "rect",
"encoding": {
"color": {
"field": "principal component",
"scale": {"scheme": "purplegreen"},
"title": "P.C.",
"type": "quantitative"
},
"x": {
"field": "variable",
"sort": [
"Civic Engagement ⚫",
"Citizen ⚫",
"Democracy ⚫",
"Justice ⚫",
"Liberty ⚫",
"Patriotism ⚫",
"Racial Equity ⚫",
"Belonging ⚫",
"Civic Health ⚫",
"Civil Society ⚫",
"Common Good ⚫",
"Common Ground ⚫",
"Privilege ⚫",
"Social Justice ⚫",
"Activism ⚫",
"Bridge Builder ⚫",
"Civic Infrastructure ⚫",
"Civility ⚫",
"Diversity ⚫",
"Pluralism ⚫",
"Unity ⚫"
],
"title": "",
"type": "ordinal",
"axis": {"domain": false, "grid": false, "ticks": false}
},
"y": {
"field": "variable2",
"sort": [
"Civic Engagement ⚫",
"Citizen ⚫",
"Democracy ⚫",
"Justice ⚫",
"Liberty ⚫",
"Patriotism ⚫",
"Racial Equity ⚫",
"Belonging ⚫",
"Civic Health ⚫",
"Civil Society ⚫",
"Common Good ⚫",
"Common Ground ⚫",
"Privilege ⚫",
"Social Justice ⚫",
"Activism ⚫",
"Bridge Builder ⚫",
"Civic Infrastructure ⚫",
"Civility ⚫",
"Diversity ⚫",
"Pluralism ⚫",
"Unity ⚫"
],
"title": "",
"type": "ordinal",
"axis": {"domain": false, "grid": false, "ticks": false}
}
},
"height": 500,
"width": 500
},
{
"mark": "text",
"encoding": {
"color": {
"condition": {
"value": "white",
"test": "(abs(datum.correlation_label) > 2.5)"
},
"value": "black"
},
"text": {"field": "correlation_label", "type": "nominal"},
"x": {
"field": "variable",
"sort": [
"Civic Engagement ⚫",
"Citizen ⚫",
"Democracy ⚫",
"Justice ⚫",
"Liberty ⚫",
"Patriotism ⚫",
"Racial Equity ⚫",
"Belonging ⚫",
"Civic Health ⚫",
"Civil Society ⚫",
"Common Good ⚫",
"Common Ground ⚫",
"Privilege ⚫",
"Social Justice ⚫",
"Activism ⚫",
"Bridge Builder ⚫",
"Civic Infrastructure ⚫",
"Civility ⚫",
"Diversity ⚫",
"Pluralism ⚫",
"Unity ⚫"
],
"title": "",
"type": "ordinal"
},
"y": {
"field": "variable2",
"sort": [
"Civic Engagement ⚫",
"Citizen ⚫",
"Democracy ⚫",
"Justice ⚫",
"Liberty ⚫",
"Patriotism ⚫",
"Racial Equity ⚫",
"Belonging ⚫",
"Civic Health ⚫",
"Civil Society ⚫",
"Common Good ⚫",
"Common Ground ⚫",
"Privilege ⚫",
"Social Justice ⚫",
"Activism ⚫",
"Bridge Builder ⚫",
"Civic Infrastructure ⚫",
"Civility ⚫",
"Diversity ⚫",
"Pluralism ⚫",
"Unity ⚫"
],
"title": "",
"type": "ordinal"
}
},
"height": 500,
"width": 500
}
],
"data": {"name": "data-a93dc2e2add7cfb7a91ce5aaac4f4a5b"},
"$schema": "https://vega.github.io/schema/vega-lite/v4.17.0.json",
"datasets": {
"data-a93dc2e2add7cfb7a91ce5aaac4f4a5b": [
{
"variable": "Patriotism ⚫",
"variable2": "Racial Equity ⚫",
"principal component": -3.8975150274500665,
"correlation_label": "-3.9"
},
{
"variable": "Common Ground ⚫",
"variable2": "Privilege ⚫",
"principal component": -2.682973605814413,
"correlation_label": "-2.7"
},
{
"variable": "Civic Engagement ⚫",
"variable2": "Patriotism ⚫",
"principal component": -2.3326802892475547,
"correlation_label": "-2.3"
},
{
"variable": "Liberty ⚫",
"variable2": "Racial Equity ⚫",
"principal component": -2.1910618931665224,
"correlation_label": "-2.2"
},
{
"variable": "Civic Engagement ⚫",
"variable2": "Liberty ⚫",
"principal component": -1.9095658190538092,
"correlation_label": "-1.9"
},
{
"variable": "Common Good ⚫",
"variable2": "Privilege ⚫",
"principal component": -1.7983165676250537,
"correlation_label": "-1.8"
},
{
"variable": "Common Ground ⚫",
"variable2": "Social Justice ⚫",
"principal component": -1.5715858162501881,
"correlation_label": "-1.6"
},
{
"variable": "Belonging ⚫",
"variable2": "Privilege ⚫",
"principal component": -1.5581376634656718,
"correlation_label": "-1.6"
},
{
"variable": "Activism ⚫",
"variable2": "Civility ⚫",
"principal component": -1.4142205001646388,
"correlation_label": "-1.4"
},
{
"variable": "Diversity ⚫",
"variable2": "Pluralism ⚫",
"principal component": -1.3654695582581176,
"correlation_label": "-1.4"
},
{
"variable": "Democracy ⚫",
"variable2": "Patriotism ⚫",
"principal component": -1.3513414769328607,
"correlation_label": "-1.4"
},
{
"variable": "Pluralism ⚫",
"variable2": "Unity ⚫",
"principal component": -1.1845758210393318,
"correlation_label": "-1.2"
},
{
"variable": "Activism ⚫",
"variable2": "Bridge Builder ⚫",
"principal component": -1.155951838049616,
"correlation_label": "-1.2"
},
{
"variable": "Civic Infrastructure ⚫",
"variable2": "Unity ⚫",
"principal component": -1.1307269874639252,
"correlation_label": "-1.1"
},
{
"variable": "Civic Engagement ⚫",
"variable2": "Citizen ⚫",
"principal component": -0.916995328715733,
"correlation_label": "-0.9"
},
{
"variable": "Activism ⚫",
"variable2": "Pluralism ⚫",
"principal component": -0.9131023160972269,
"correlation_label": "-0.9"
},
{
"variable": "Citizen ⚫",
"variable2": "Racial Equity ⚫",
"principal component": -0.8985729774427864,
"correlation_label": "-0.9"
},
{
"variable": "Civic Engagement ⚫",
"variable2": "Justice ⚫",
"principal component": -0.8708178014335273,
"correlation_label": "-0.9"
},
{
"variable": "Civil Society ⚫",
"variable2": "Privilege ⚫",
"principal component": -0.866866776657233,
"correlation_label": "-0.9"
},
{
"variable": "Democracy ⚫",
"variable2": "Racial Equity ⚫",
"principal component": -0.7385126771671365,
"correlation_label": "-0.7"
},
{
"variable": "Civility ⚫",
"variable2": "Pluralism ⚫",
"principal component": -0.49437448699498615,
"correlation_label": "-0.5"
},
{
"variable": "Belonging ⚫",
"variable2": "Civil Society ⚫",
"principal component": -0.3575742711721307,
"correlation_label": "-0.4"
},
{
"variable": "Civil Society ⚫",
"variable2": "Social Justice ⚫",
"principal component": -0.34983319781504363,
"correlation_label": "-0.3"
},
{
"variable": "Common Good ⚫",
"variable2": "Social Justice ⚫",
"principal component": -0.3144390383885723,
"correlation_label": "-0.3"
},
{
"variable": "Bridge Builder ⚫",
"variable2": "Diversity ⚫",
"principal component": -0.2765640024791013,
"correlation_label": "-0.3"
},
{
"variable": "Civic Infrastructure ⚫",
"variable2": "Diversity ⚫",
"principal component": -0.2197980915178649,
"correlation_label": "-0.2"
},
{
"variable": "Privilege ⚫",
"variable2": "Social Justice ⚫",
"principal component": -0.2137166421628146,
"correlation_label": "-0.2"
},
{
"variable": "Civic Health ⚫",
"variable2": "Common Ground ⚫",
"principal component": -0.19685929229963883,
"correlation_label": "-0.2"
},
{
"variable": "Activism ⚫",
"variable2": "Civic Infrastructure ⚫",
"principal component": -0.18884898121066757,
"correlation_label": "-0.2"
},
{
"variable": "Belonging ⚫",
"variable2": "Civic Health ⚫",
"principal component": -0.11731855082366587,
"correlation_label": "-0.1"
},
{
"variable": "Democracy ⚫",
"variable2": "Liberty ⚫",
"principal component": -0.010319549371577167,
"correlation_label": "-0.0"
},
{
"variable": "Belonging ⚫",
"variable2": "Social Justice ⚫",
"principal component": 0.018025672224644004,
"correlation_label": "+0.0"
},
{
"variable": "Democracy ⚫",
"variable2": "Justice ⚫",
"principal component": 0.05499253071883655,
"correlation_label": "+0.1"
},
{
"variable": "Civility ⚫",
"variable2": "Diversity ⚫",
"principal component": 0.1184645896158661,
"correlation_label": "+0.1"
},
{
"variable": "Bridge Builder ⚫",
"variable2": "Pluralism ⚫",
"principal component": 0.18784503895660204,
"correlation_label": "+0.2"
},
{
"variable": "Bridge Builder ⚫",
"variable2": "Civic Infrastructure ⚫",
"principal component": 0.23416863764334256,
"correlation_label": "+0.2"
},
{
"variable": "Civic Health ⚫",
"variable2": "Privilege ⚫",
"principal component": 0.2460826779249166,
"correlation_label": "+0.2"
},
{
"variable": "Civic Health ⚫",
"variable2": "Social Justice ⚫",
"principal component": 0.42258630617926923,
"correlation_label": "+0.4"
},
{
"variable": "Activism ⚫",
"variable2": "Unity ⚫",
"principal component": 0.4454068866681529,
"correlation_label": "+0.4"
},
{
"variable": "Civil Society ⚫",
"variable2": "Common Good ⚫",
"principal component": 0.4462674396555023,
"correlation_label": "+0.4"
},
{
"variable": "Justice ⚫",
"variable2": "Racial Equity ⚫",
"principal component": 0.46947334982496297,
"correlation_label": "+0.5"
},
{
"variable": "Citizen ⚫",
"variable2": "Democracy ⚫",
"principal component": 0.640859128910828,
"correlation_label": "+0.6"
},
{
"variable": "Justice ⚫",
"variable2": "Patriotism ⚫",
"principal component": 0.6917583028837044,
"correlation_label": "+0.7"
},
{
"variable": "Civil Society ⚫",
"variable2": "Common Ground ⚫",
"principal component": 0.7040102633996032,
"correlation_label": "+0.7"
},
{
"variable": "Civic Engagement ⚫",
"variable2": "Racial Equity ⚫",
"principal component": 0.7952428743471146,
"correlation_label": "+0.8"
},
{
"variable": "Belonging ⚫",
"variable2": "Common Ground ⚫",
"principal component": 0.9106181836726722,
"correlation_label": "+0.9"
},
{
"variable": "Civic Health ⚫",
"variable2": "Common Good ⚫",
"principal component": 0.9238821941117986,
"correlation_label": "+0.9"
},
{
"variable": "Diversity ⚫",
"variable2": "Unity ⚫",
"principal component": 0.9436631288258235,
"correlation_label": "+0.9"
},
{
"variable": "Bridge Builder ⚫",
"variable2": "Unity ⚫",
"principal component": 0.9809979260381622,
"correlation_label": "+1.0"
},
{
"variable": "Belonging ⚫",
"variable2": "Common Good ⚫",
"principal component": 1.1890995203497328,
"correlation_label": "+1.2"
},
{
"variable": "Civility ⚫",
"variable2": "Unity ⚫",
"principal component": 1.2145759039078434,
"correlation_label": "+1.2"
},
{
"variable": "Citizen ⚫",
"variable2": "Justice ⚫",
"principal component": 1.299232725744063,
"correlation_label": "+1.3"
},
{
"variable": "Civic Infrastructure ⚫",
"variable2": "Civility ⚫",
"principal component": 1.3023565748196628,
"correlation_label": "+1.3"
},
{
"variable": "Civic Infrastructure ⚫",
"variable2": "Pluralism ⚫",
"principal component": 1.5093615854170193,
"correlation_label": "+1.5"
},
{
"variable": "Bridge Builder ⚫",
"variable2": "Civility ⚫",
"principal component": 1.5239673211018254,
"correlation_label": "+1.5"
},
{
"variable": "Civic Engagement ⚫",
"variable2": "Democracy ⚫",
"principal component": 1.530065457636749,
"correlation_label": "+1.5"
},
{
"variable": "Common Good ⚫",
"variable2": "Common Ground ⚫",
"principal component": 1.5751760841307192,
"correlation_label": "+1.6"
},
{
"variable": "Citizen ⚫",
"variable2": "Patriotism ⚫",
"principal component": 1.728044868033142,
"correlation_label": "+1.7"
},
{
"variable": "Justice ⚫",
"variable2": "Liberty ⚫",
"principal component": 1.7738610200755451,
"correlation_label": "+1.8"
},
{
"variable": "Activism ⚫",
"variable2": "Diversity ⚫",
"principal component": 1.7991207256498598,
"correlation_label": "+1.8"
},
{
"variable": "Citizen ⚫",
"variable2": "Liberty ⚫",
"principal component": 1.8455188134670057,
"correlation_label": "+1.8"
},
{
"variable": "Civic Health ⚫",
"variable2": "Civil Society ⚫",
"principal component": 2.532118014701431,
"correlation_label": "+2.5"
},
{
"variable": "Liberty ⚫",
"variable2": "Patriotism ⚫",
"principal component": 3.4317930990950742,
"correlation_label": "+3.4"
},
{
"variable": "Racial Equity ⚫",
"variable2": "Patriotism ⚫",
"principal component": -3.8975150274500665,
"correlation_label": "-3.9"
},
{
"variable": "Privilege ⚫",
"variable2": "Common Ground ⚫",
"principal component": -2.682973605814413,
"correlation_label": "-2.7"
},
{
"variable": "Patriotism ⚫",
"variable2": "Civic Engagement ⚫",
"principal component": -2.3326802892475547,
"correlation_label": "-2.3"
},
{
"variable": "Racial Equity ⚫",
"variable2": "Liberty ⚫",
"principal component": -2.1910618931665224,
"correlation_label": "-2.2"
},
{
"variable": "Liberty ⚫",
"variable2": "Civic Engagement ⚫",
"principal component": -1.9095658190538092,
"correlation_label": "-1.9"
},
{
"variable": "Privilege ⚫",
"variable2": "Common Good ⚫",
"principal component": -1.7983165676250537,
"correlation_label": "-1.8"
},
{
"variable": "Social Justice ⚫",
"variable2": "Common Ground ⚫",
"principal component": -1.5715858162501881,
"correlation_label": "-1.6"
},
{
"variable": "Privilege ⚫",
"variable2": "Belonging ⚫",
"principal component": -1.5581376634656718,
"correlation_label": "-1.6"
},
{
"variable": "Civility ⚫",
"variable2": "Activism ⚫",
"principal component": -1.4142205001646388,
"correlation_label": "-1.4"
},
{
"variable": "Pluralism ⚫",
"variable2": "Diversity ⚫",
"principal component": -1.3654695582581176,
"correlation_label": "-1.4"
},
{
"variable": "Patriotism ⚫",
"variable2": "Democracy ⚫",
"principal component": -1.3513414769328607,
"correlation_label": "-1.4"
},
{
"variable": "Unity ⚫",
"variable2": "Pluralism ⚫",
"principal component": -1.1845758210393318,
"correlation_label": "-1.2"
},
{
"variable": "Bridge Builder ⚫",
"variable2": "Activism ⚫",
"principal component": -1.155951838049616,
"correlation_label": "-1.2"
},
{
"variable": "Unity ⚫",
"variable2": "Civic Infrastructure ⚫",
"principal component": -1.1307269874639252,
"correlation_label": "-1.1"
},
{
"variable": "Citizen ⚫",
"variable2": "Civic Engagement ⚫",
"principal component": -0.916995328715733,
"correlation_label": "-0.9"
},
{
"variable": "Pluralism ⚫",
"variable2": "Activism ⚫",
"principal component": -0.9131023160972269,
"correlation_label": "-0.9"
},
{
"variable": "Racial Equity ⚫",
"variable2": "Citizen ⚫",
"principal component": -0.8985729774427864,
"correlation_label": "-0.9"
},
{
"variable": "Justice ⚫",
"variable2": "Civic Engagement ⚫",
"principal component": -0.8708178014335273,
"correlation_label": "-0.9"
},
{
"variable": "Privilege ⚫",
"variable2": "Civil Society ⚫",
"principal component": -0.866866776657233,
"correlation_label": "-0.9"
},
{
"variable": "Racial Equity ⚫",
"variable2": "Democracy ⚫",
"principal component": -0.7385126771671365,
"correlation_label": "-0.7"
},
{
"variable": "Pluralism ⚫",
"variable2": "Civility ⚫",
"principal component": -0.49437448699498615,
"correlation_label": "-0.5"
},
{
"variable": "Civil Society ⚫",
"variable2": "Belonging ⚫",
"principal component": -0.3575742711721307,
"correlation_label": "-0.4"
},
{
"variable": "Social Justice ⚫",
"variable2": "Civil Society ⚫",
"principal component": -0.34983319781504363,
"correlation_label": "-0.3"
},
{
"variable": "Social Justice ⚫",
"variable2": "Common Good ⚫",
"principal component": -0.3144390383885723,
"correlation_label": "-0.3"
},
{
"variable": "Diversity ⚫",
"variable2": "Bridge Builder ⚫",
"principal component": -0.2765640024791013,
"correlation_label": "-0.3"
},
{
"variable": "Diversity ⚫",
"variable2": "Civic Infrastructure ⚫",
"principal component": -0.2197980915178649,
"correlation_label": "-0.2"
},
{
"variable": "Social Justice ⚫",
"variable2": "Privilege ⚫",
"principal component": -0.2137166421628146,
"correlation_label": "-0.2"
},
{
"variable": "Common Ground ⚫",
"variable2": "Civic Health ⚫",
"principal component": -0.19685929229963883,
"correlation_label": "-0.2"
},
{
"variable": "Civic Infrastructure ⚫",
"variable2": "Activism ⚫",
"principal component": -0.18884898121066757,
"correlation_label": "-0.2"
},
{
"variable": "Civic Health ⚫",
"variable2": "Belonging ⚫",
"principal component": -0.11731855082366587,
"correlation_label": "-0.1"
},
{
"variable": "Liberty ⚫",
"variable2": "Democracy ⚫",
"principal component": -0.010319549371577167,
"correlation_label": "-0.0"
},
{
"variable": "Social Justice ⚫",
"variable2": "Belonging ⚫",
"principal component": 0.018025672224644004,
"correlation_label": "+0.0"
},
{
"variable": "Justice ⚫",
"variable2": "Democracy ⚫",
"principal component": 0.05499253071883655,
"correlation_label": "+0.1"
},
{
"variable": "Diversity ⚫",
"variable2": "Civility ⚫",
"principal component": 0.1184645896158661,
"correlation_label": "+0.1"
},
{
"variable": "Pluralism ⚫",
"variable2": "Bridge Builder ⚫",
"principal component": 0.18784503895660204,
"correlation_label": "+0.2"
},
{
"variable": "Civic Infrastructure ⚫",
"variable2": "Bridge Builder ⚫",
"principal component": 0.23416863764334256,
"correlation_label": "+0.2"
},
{
"variable": "Privilege ⚫",
"variable2": "Civic Health ⚫",
"principal component": 0.2460826779249166,
"correlation_label": "+0.2"
},
{
"variable": "Social Justice ⚫",
"variable2": "Civic Health ⚫",
"principal component": 0.42258630617926923,
"correlation_label": "+0.4"
},
{
"variable": "Unity ⚫",
"variable2": "Activism ⚫",
"principal component": 0.4454068866681529,
"correlation_label": "+0.4"
},
{
"variable": "Common Good ⚫",
"variable2": "Civil Society ⚫",
"principal component": 0.4462674396555023,
"correlation_label": "+0.4"
},
{
"variable": "Racial Equity ⚫",
"variable2": "Justice ⚫",
"principal component": 0.46947334982496297,
"correlation_label": "+0.5"
},
{
"variable": "Democracy ⚫",
"variable2": "Citizen ⚫",
"principal component": 0.640859128910828,
"correlation_label": "+0.6"
},
{
"variable": "Patriotism ⚫",
"variable2": "Justice ⚫",
"principal component": 0.6917583028837044,
"correlation_label": "+0.7"
},
{
"variable": "Common Ground ⚫",
"variable2": "Civil Society ⚫",
"principal component": 0.7040102633996032,
"correlation_label": "+0.7"
},
{
"variable": "Racial Equity ⚫",
"variable2": "Civic Engagement ⚫",
"principal component": 0.7952428743471146,
"correlation_label": "+0.8"
},
{
"variable": "Common Ground ⚫",
"variable2": "Belonging ⚫",
"principal component": 0.9106181836726722,
"correlation_label": "+0.9"
},
{
"variable": "Common Good ⚫",
"variable2": "Civic Health ⚫",
"principal component": 0.9238821941117986,
"correlation_label": "+0.9"
},
{
"variable": "Unity ⚫",
"variable2": "Diversity ⚫",
"principal component": 0.9436631288258235,
"correlation_label": "+0.9"
},
{
"variable": "Unity ⚫",
"variable2": "Bridge Builder ⚫",
"principal component": 0.9809979260381622,
"correlation_label": "+1.0"
},
{
"variable": "Common Good ⚫",
"variable2": "Belonging ⚫",
"principal component": 1.1890995203497328,
"correlation_label": "+1.2"
},
{
"variable": "Unity ⚫",
"variable2": "Civility ⚫",
"principal component": 1.2145759039078434,
"correlation_label": "+1.2"
},
{
"variable": "Justice ⚫",
"variable2": "Citizen ⚫",
"principal component": 1.299232725744063,
"correlation_label": "+1.3"
},
{
"variable": "Civility ⚫",
"variable2": "Civic Infrastructure ⚫",
"principal component": 1.3023565748196628,
"correlation_label": "+1.3"
},
{
"variable": "Pluralism ⚫",
"variable2": "Civic Infrastructure ⚫",
"principal component": 1.5093615854170193,
"correlation_label": "+1.5"
},
{
"variable": "Civility ⚫",
"variable2": "Bridge Builder ⚫",
"principal component": 1.5239673211018254,
"correlation_label": "+1.5"
},
{
"variable": "Democracy ⚫",
"variable2": "Civic Engagement ⚫",
"principal component": 1.530065457636749,
"correlation_label": "+1.5"
},
{
"variable": "Common Ground ⚫",
"variable2": "Common Good ⚫",
"principal component": 1.5751760841307192,
"correlation_label": "+1.6"
},
{
"variable": "Patriotism ⚫",
"variable2": "Citizen ⚫",
"principal component": 1.728044868033142,
"correlation_label": "+1.7"
},
{
"variable": "Liberty ⚫",
"variable2": "Justice ⚫",
"principal component": 1.7738610200755451,
"correlation_label": "+1.8"
},
{
"variable": "Diversity ⚫",
"variable2": "Activism ⚫",
"principal component": 1.7991207256498598,
"correlation_label": "+1.8"
},
{
"variable": "Liberty ⚫",
"variable2": "Citizen ⚫",
"principal component": 1.8455188134670057,
"correlation_label": "+1.8"
},
{
"variable": "Civil Society ⚫",
"variable2": "Civic Health ⚫",
"principal component": 2.532118014701431,
"correlation_label": "+2.5"
},
{
"variable": "Patriotism ⚫",
"variable2": "Liberty ⚫",
"principal component": 3.4317930990950742,
"correlation_label": "+3.4"
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment